use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape 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());
}
use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape 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);
}
use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape in project latexdraw by arnobl.
the class PolymorphArrowableTest method testArrowRBracketParamsArr1.
@ParameterizedTest
@MethodSource("arrowsParamsDiv")
default void testArrowRBracketParamsArr1(final ArrowableSingleShape sh, final ArrowStyle arr) {
assumeTrue(arr.isRoundBracket());
assumeFalse(sh instanceof Axes);
sh.setArrowStyle(arr, 0);
final ArrowableSingleShape s2 = produceOutputShapeFrom(sh);
CompareShapeMatcher.INST.assertEqualsArrowRBracket(sh.getArrowAt(0), s2.getArrowAt(0));
}
use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape in project latexdraw by arnobl.
the class PolymorphArrowableTest method testArrowArrow1.
@ParameterizedTest
@MethodSource("arrowsParamsDiv")
default void testArrowArrow1(final ArrowableSingleShape sh, final ArrowStyle arr) {
assumeTrue(arr.isArrow());
sh.setArrowStyle(arr, 0);
sh.setArrowStyle(ArrowStyle.LEFT_ROUND_BRACKET, 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(0), s2.getArrowAt(0));
}
use of net.sf.latexdraw.model.api.shape.ArrowableSingleShape in project latexdraw by arnobl.
the class PolymorphArrowableTest method testArrowCircleDiskParamsArr1.
@ParameterizedTest
@MethodSource("arrowsParamsDiv")
default void testArrowCircleDiskParamsArr1(final ArrowableSingleShape sh, final ArrowStyle arr) {
assumeTrue(arr.isCircleDisk());
assumeFalse(sh instanceof Axes);
sh.setArrowStyle(arr, 0);
final ArrowableSingleShape s2 = produceOutputShapeFrom(sh);
CompareShapeMatcher.INST.assertEqualsArrowCircleDisk(sh.getArrowAt(0), s2.getArrowAt(0));
}
Aggregations