use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class TestShapePositioner method testSeveralShapesForeground.
@Test
public void testSeveralShapesForeground() {
Cmds.of(selectThreeShapes, selectTwoShapes).execute();
selectShapeAt.execute(Arrays.asList(1, 2));
final Shape s2 = drawing.getShapeAt(1).orElseThrow();
final Shape s3 = drawing.getShapeAt(2).orElseThrow();
Cmds.of(() -> clickOn("#foregroundB")).execute();
assertEquals(s2, drawing.getShapeAt(drawing.size() - 2).orElseThrow());
assertEquals(s3, drawing.getShapeAt(-1).orElseThrow());
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class PolymorphShapeTest method testLoadShapeLineStyleParams.
@ParameterizedTest
@MethodSource("net.sf.latexdraw.data.ShapeSupplier#getDiversifiedShapes")
default void testLoadShapeLineStyleParams(final Shape sh) {
assumeTrue(sh.isLineStylable());
final Shape s2 = produceOutputShapeFrom(sh);
CompareShapeMatcher.INST.assertEqualShapeLineStyle(sh, s2);
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class PolymorphShapeTest method testLoadRotationAngleParams.
@ParameterizedTest
@MethodSource("net.sf.latexdraw.data.ShapeSupplier#getDiversifiedShapes")
default void testLoadRotationAngleParams(final Shape sh) {
final Shape s2 = produceOutputShapeFrom(sh);
CompareShapeMatcher.INST.assertEqualShapeRotationAngle(sh, s2);
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class PolymorphShapeTest method testPointsEquals.
@ParameterizedTest
@MethodSource("net.sf.latexdraw.data.ShapeSupplier#getDiversifiedShapes")
default void testPointsEquals(final Shape sh) {
WaitForAsyncUtils.waitForFxEvents();
final Shape s2 = produceOutputShapeFrom(sh);
assertThat(sh.getPoints()).isEqualTo(s2.getPoints());
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class TestPSTShape method testFreeHandPointsLines.
@Test
public void testFreeHandPointsLines() {
final Freehand fh = ShapeFactory.INST.createFreeHand(Arrays.asList(ShapeFactory.INST.createPoint(50d, 70d), ShapeFactory.INST.createPoint(100d, 90d), ShapeFactory.INST.createPoint(132d, 112d), ShapeFactory.INST.createPoint(150d, 180d)));
fh.setInterval(1);
fh.setType(FreeHandStyle.LINES);
final Shape s2 = produceOutputShapeFrom(fh);
assertThat(s2.getPoints()).isEqualTo(produceOutputShapeFrom(s2).getPoints());
}
Aggregations