Search in sources :

Example 21 with ArrowStyle

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

the class TestPencilArrowStyle method testSelectRightArrowStyleNONEPencil.

@Test
public void testSelectRightArrowStyleNONEPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns, () -> selectArrowRightCB.execute(ArrowStyle.NONE)).execute();
    final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.NONE, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(-1).getArrowStyle());
    assertFalse(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 22 with ArrowStyle

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

the class TestPencilArrowStyle method testSelectRightArrowStyleCIRCLEINPencil.

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

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

the class TestHandArrowStyle method testSelectRightArrowStyleHand.

@Test
public void testSelectRightArrowStyleHand() {
    Cmds.of(selectionAddBezier, selectionAddBezier, activateHand, updateIns).execute();
    final ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
    selectArrowRightCB.execute(ArrowStyle.ROUND_IN);
    waitFXEvents.execute();
    final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.ROUND_IN, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) drawing.getSelection().getShapeAt(0).orElseThrow()).getArrowAt(-1).getArrowStyle());
    assertEquals(newStyle, ((ArrowableSingleShape) drawing.getSelection().getShapeAt(1).orElseThrow()).getArrowAt(-1).getArrowStyle());
    assertNotEquals(style, newStyle);
}
Also used : ArrowStyle(net.sf.latexdraw.model.api.shape.ArrowStyle) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) Test(org.junit.Test)

Example 24 with ArrowStyle

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

the class TestPencilArrowStyle method testSelectLeftArrowStyleNONEPencil.

@Test
public void testSelectLeftArrowStyleNONEPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns, () -> selectArrowLeftCB.execute(ArrowStyle.NONE)).execute();
    final ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.NONE, newStyle);
    assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(0).getArrowStyle());
    assertFalse(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 25 with ArrowStyle

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

the class TestPencilArrowStyle method testSelectLeftArrowStyleLEFTDBLEARROWPencil.

@Test
public void testSelectLeftArrowStyleLEFTDBLEARROWPencil() {
    Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
    final ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
    Cmds.of(() -> selectArrowLeftCB.execute(ArrowStyle.LEFT_DBLE_ARROW)).execute();
    final ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
    assertEquals(ArrowStyle.LEFT_DBLE_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)

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