use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape in project latexdraw by arnobl.
the class TestParsingArrow method testSquareRightBracketTbarEnd.
@ParameterizedTest
@MethodSource("cmds")
public void testSquareRightBracketTbarEnd(final Tuple<String, String> cmd) {
parser(cmd.a + "{[-}" + cmd.b);
final ArrowableSingleShape line = (ArrowableSingleShape) parsedShapes.get(0);
assertEquals(ArrowStyle.LEFT_SQUARE_BRACKET, line.getArrowStyle(0));
assertEquals(ArrowStyle.NONE, line.getArrowStyle(1));
}
use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape 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());
}
use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape 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());
}
use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape in project latexdraw by arnobl.
the class TestPencilArrowStyle method testSelectLeftArrowStyleROUNDINPencil.
@Test
public void testSelectLeftArrowStyleROUNDINPencil() {
Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
final ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
Cmds.of(() -> selectArrowLeftCB.execute(ArrowStyle.ROUND_IN)).execute();
final ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
assertEquals(ArrowStyle.ROUND_IN, newStyle);
assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(0).getArrowStyle());
assertNotEquals(style, newStyle);
assertFalse(arrowPane.isVisible());
assertFalse(dotPane.isVisible());
assertFalse(barPane.isVisible());
assertFalse(bracketPane.isVisible());
assertFalse(rbracketPane.isVisible());
}
use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape in project latexdraw by arnobl.
the class TestPencilArrowStyle method testSelectRightArrowStyleBARINPencil.
@Test
public void testSelectRightArrowStyleBARINPencil() {
Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
final ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
Cmds.of(() -> selectArrowRightCB.execute(ArrowStyle.BAR_IN)).execute();
final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
assertEquals(ArrowStyle.BAR_IN, 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());
}
Aggregations