use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape in project latexdraw by arnobl.
the class PolymorphArrowableTest method testArrowArrow2.
@ParameterizedTest
@MethodSource("arrowsParamsDiv")
default void testArrowArrow2(final ArrowableSingleShape sh, final ArrowStyle arr) {
assumeTrue(arr.isArrow());
sh.setArrowStyle(ArrowStyle.LEFT_SQUARE_BRACKET, 0);
sh.setArrowStyle(arr, 1);
final ArrowableSingleShape s2 = produceOutputShapeFrom(sh);
CompareShapeMatcher.INST.assertEqualsArrowStyle(sh.getArrowAt(0), s2.getArrowAt(0));
CompareShapeMatcher.INST.assertEqualsArrowStyle(sh.getArrowAt(1), s2.getArrowAt(1));
CompareShapeMatcher.INST.assertEqualsArrowArrow(sh.getArrowAt(1), s2.getArrowAt(1));
}
use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape in project latexdraw by arnobl.
the class TestHandArrowStyle method testSelectLeftArrowStyleHand.
@Test
public void testSelectLeftArrowStyleHand() {
Cmds.of(selectionAddBezier, selectionAddBezier, activateHand, updateIns).execute();
final ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
selectArrowLeftCB.execute(ArrowStyle.BAR_IN);
waitFXEvents.execute();
final ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
assertEquals(ArrowStyle.BAR_IN, newStyle);
assertEquals(newStyle, ((ArrowableSingleShape) drawing.getSelection().getShapeAt(0).orElseThrow()).getArrowAt(0).getArrowStyle());
assertEquals(newStyle, ((ArrowableSingleShape) drawing.getSelection().getShapeAt(1).orElseThrow()).getArrowAt(0).getArrowStyle());
assertNotEquals(style, newStyle);
}
use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape in project latexdraw by arnobl.
the class TestPencilArrowStyle method testSelectLeftArrowStyleRIGHTDBLEARROWPencil.
@Test
public void testSelectLeftArrowStyleRIGHTDBLEARROWPencil() {
Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
final ArrowStyle style = arrowLeftCB.getSelectionModel().getSelectedItem();
Cmds.of(() -> selectArrowLeftCB.execute(ArrowStyle.RIGHT_DBLE_ARROW)).execute();
final ArrowStyle newStyle = arrowLeftCB.getSelectionModel().getSelectedItem();
assertEquals(ArrowStyle.RIGHT_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 testSelectRightArrowStyleLEFTARROWPencil.
@Test
public void testSelectRightArrowStyleLEFTARROWPencil() {
Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
final ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
Cmds.of(() -> selectArrowRightCB.execute(ArrowStyle.LEFT_ARROW)).execute();
final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
assertEquals(ArrowStyle.LEFT_ARROW, newStyle);
assertEquals(newStyle, ((ArrowableSingleShape) editing.createShapeInstance()).getArrowAt(-1).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 testSelectRightArrowStyleRIGHTSQUAREBRACKETPencil.
@Test
public void testSelectRightArrowStyleRIGHTSQUAREBRACKETPencil() {
Cmds.of(activatePencil, pencilCreatesBezier, updateIns).execute();
final ArrowStyle style = arrowRightCB.getSelectionModel().getSelectedItem();
Cmds.of(() -> selectArrowRightCB.execute(ArrowStyle.RIGHT_SQUARE_BRACKET)).execute();
final ArrowStyle newStyle = arrowRightCB.getSelectionModel().getSelectedItem();
assertEquals(ArrowStyle.RIGHT_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());
}
Aggregations