Search in sources :

Example 16 with ArrowStyle

use of net.sf.latexdraw.model.api.shape.ArrowStyle in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectRightArrowStyleDISKINPencil.

@Test
public void testSelectRightArrowStyleDISKINPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowRightCB.execute(ArrowStyle.DISK_IN)).execute();
    final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.DISK_IN, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertTrue(dotPane.isVisible());
    assertFalse(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

Example 17 with ArrowStyle

use of net.sf.latexdraw.model.api.shape.ArrowStyle in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectRightArrowStyleBARENDPencil.

@Test
public void testSelectRightArrowStyleBARENDPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowRightCB.execute(ArrowStyle.BAR_END)).execute();
    final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.BAR_END, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

Example 18 with ArrowStyle

use of net.sf.latexdraw.model.api.shape.ArrowStyle in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectRightArrowStyleLEFTSQUAREBRACKETPencil.

@Test
public void testSelectRightArrowStyleLEFTSQUAREBRACKETPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowRightCB.execute(ArrowStyle.LEFT_SQUARE_BRACKET)).execute();
    final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.LEFT_SQUARE_BRACKET, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertTrue(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

Example 19 with ArrowStyle

use of net.sf.latexdraw.model.api.shape.ArrowStyle in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectLeftArrowStyleRIGHTARROWPencil.

@Test
public void testSelectLeftArrowStyleRIGHTARROWPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowLeftCB.execute(ArrowStyle.RIGHT_ARROW)).execute();
    final ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.RIGHT_ARROW, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(0).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertTrue(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertFalse(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertFalse(rbracketPane.isVisible());
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

Example 20 with ArrowStyle

use of net.sf.latexdraw.model.api.shape.ArrowStyle in project latexdraw by arnobl.

the class TestPencilArrowStyle method testSelectLeftArrowStyleLEFTROUNDBRACKETPencil.

@Test
public void testSelectLeftArrowStyleLEFTROUNDBRACKETPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowLeftCB.execute(ArrowStyle.LEFT_ROUND_BRACKET)).execute();
    final ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.LEFT_ROUND_BRACKET, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(0).getArrowStyle());
    assertNotEquals(style, newStyle);
    assertFalse(arrowPane.isVisible());
    assertFalse(dotPane.isVisible());
    assertTrue(barPane.isVisible());
    assertFalse(bracketPane.isVisible());
    assertTrue(rbracketPane.isVisible());
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

Aggregations

ArrowStyle (net.sf.latexdraw.model.api.shape.ArrowStyle)36 ArrowableSingleShape (net.sf.latexdraw.model.api.shape.ArrowableSingleShape)34 Test (org.junit.Test)34 EnumMap (java.util.EnumMap)1 Image (javafx.scene.image.Image)1 Arrow (net.sf.latexdraw.model.api.shape.Arrow)1