Search in sources :

Example 6 with ArrowStyle

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

the class TestPencilArrowStyle method testSelectRightArrowStyleLEFTDBLEARROWPencil.

@Test
public void testSelectRightArrowStyleLEFTDBLEARROWPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    selectArrowRightCB.execute(ArrowStyle.LEFT_DBLE_ARROW);
    ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.LEFT_DBLE_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)

Example 7 with ArrowStyle

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

the class TestPencilArrowStyle method testSelectLeftArrowStyleLEFTROUNDBRACKETPencil.

@Test
public void testSelectLeftArrowStyleLEFTROUNDBRACKETPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
    selectArrowLeftCB.execute(ArrowStyle.LEFT_ROUND_BRACKET);
    ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.LEFT_ROUND_BRACKET, newStyle);
    assertEquals(newStyle, ((IArrowableSingleShape) pencil.createShapeInstance()).getArrowAt(0).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertTrue(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 8 with ArrowStyle

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

the class TestPencilArrowStyle method testSelectRightArrowStyleNONEPencil.

@Test
public void testSelectRightArrowStyleNONEPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    selectArrowRightCB.execute(ArrowStyle.NONE);
    ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.NONE, newStyle);
    assertEquals(newStyle, ((IArrowableSingleShape) pencil.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertFalse(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)

Example 9 with ArrowStyle

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

the class TestPencilArrowStyle method testSelectRightArrowStyleRIGHTROUNDBRACKETPencil.

@Test
public void testSelectRightArrowStyleRIGHTROUNDBRACKETPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    selectArrowRightCB.execute(ArrowStyle.RIGHT_ROUND_BRACKET);
    ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.RIGHT_ROUND_BRACKET, newStyle);
    assertEquals(newStyle, ((IArrowableSingleShape) pencil.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertTrue(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 10 with ArrowStyle

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

the class TestPencilArrowStyle method testSelectRightArrowStyleCIRCLEINPencil.

@Test
public void testSelectRightArrowStyleCIRCLEINPencil() {
    new CompositeGUIVoidCommand(activatePencil, pencilCreatesBezier, updateIns).execute();
    ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    selectArrowRightCB.execute(ArrowStyle.CIRCLE_IN);
    ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.CIRCLE_IN, 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)

Aggregations

ArrowStyle (net.sf.latexdraw.models.interfaces.shape.ArrowStyle)40 IArrowableSingleShape (net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape)36 CompositeGUIVoidCommand (net.sf.latexdraw.instruments.CompositeGUIVoidCommand)34 Test (org.junit.Test)34 EnumMap (java.util.EnumMap)1 Image (javafx.scene.image.Image)1 IArrow (net.sf.latexdraw.models.interfaces.shape.IArrow)1