Search in sources :

Example 56 with IArrowableSingleShape

use of net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectLeftArrowStyleLEFTSQUAREBRACKETPencil.

@Test
public void testSelectLeftArrowStyleLEFTSQUAREBRACKETPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
    selectArrowLeftCB.execute(ArrowStyle.LEFT_SQUARE_BRACKET);
    ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.LEFT_SQUARE_BRACKET, newStyle);
    assertEquals(newStyle, ((IArrowableSingleShape) pencil.createShapeInstance()).getArrowAt(0).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertTrue(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) ArrowStyle(net.sf.latexdraw.models.interfaces.shape.ArrowStyle) Test(org.junit.Test)

Example 57 with IArrowableSingleShape

use of net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectLeftArrowStyleRIGHTSQUAREBRACKETPencil.

@Test
public void testSelectLeftArrowStyleRIGHTSQUAREBRACKETPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
    selectArrowLeftCB.execute(ArrowStyle.RIGHT_SQUARE_BRACKET);
    ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.RIGHT_SQUARE_BRACKET, newStyle);
    assertEquals(newStyle, ((IArrowableSingleShape) pencil.createShapeInstance()).getArrowAt(0).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertTrue(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) ArrowStyle(net.sf.latexdraw.models.interfaces.shape.ArrowStyle) Test(org.junit.Test)

Example 58 with IArrowableSingleShape

use of net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectLeftArrowStyleDISKINPencil.

@Test
public void testSelectLeftArrowStyleDISKINPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
    selectArrowLeftCB.execute(ArrowStyle.DISK_IN);
    ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.DISK_IN, newStyle);
    assertEquals(newStyle, ((IArrowableSingleShape) pencil.createShapeInstance()).getArrowAt(0).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertTrue(dotPane.isVisible());
    assertFalse(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) ArrowStyle(net.sf.latexdraw.models.interfaces.shape.ArrowStyle) Test(org.junit.Test)

Example 59 with IArrowableSingleShape

use of net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectRightArrowStyleDISKENDPencil.

@Test
public void testSelectRightArrowStyleDISKENDPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    selectArrowRightCB.execute(ArrowStyle.DISK_END);
    ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.DISK_END, newStyle);
    assertEquals(newStyle, ((IArrowableSingleShape) pencil.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertTrue(dotPane.isVisible());
    assertFalse(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) ArrowStyle(net.sf.latexdraw.models.interfaces.shape.ArrowStyle) Test(org.junit.Test)

Example 60 with IArrowableSingleShape

use of net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectRightArrowStyleRIGHTARROWPencil.

@Test
public void testSelectRightArrowStyleRIGHTARROWPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    selectArrowRightCB.execute(ArrowStyle.RIGHT_ARROW);
    ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.RIGHT_ARROW, newStyle);
    assertEquals(newStyle, ((IArrowableSingleShape) pencil.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertTrue(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertFalse(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : CompositeGUIVoidCommand(net.sf.latexdraw.instruments.CompositeGUIVoidCommand) IArrowableSingleShape(net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape) ArrowStyle(net.sf.latexdraw.models.interfaces.shape.ArrowStyle) Test(org.junit.Test)

Aggregations

IArrowableSingleShape (net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape)93 Theory (org.junit.experimental.theories.Theory)57 ArrowStyle (net.sf.latexdraw.models.interfaces.shape.ArrowStyle)36 CompositeGUIVoidCommand (net.sf.latexdraw.instruments.CompositeGUIVoidCommand)34 Test (org.junit.Test)34 IAxes (net.sf.latexdraw.models.interfaces.shape.IAxes)10