use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class PolymorphShapeTest method testLoadDbleBorderableParams.
@ParameterizedTest
@MethodSource("net.sf.latexdraw.data.ShapeSupplier#getDiversifiedShapes")
default void testLoadDbleBorderableParams(final Shape sh) {
assumeTrue(sh.isDbleBorderable());
final Shape s2 = produceOutputShapeFrom(sh);
CompareShapeMatcher.INST.assertEqualShapeDbleBorder(sh, s2);
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class PolymorphShapeTest method testLoadFillParams.
@ParameterizedTest
@MethodSource("net.sf.latexdraw.data.ShapeSupplier#getDiversifiedShapes")
default void testLoadFillParams(final Shape sh) {
assumeTrue(sh.isFillable());
final Shape s2 = produceOutputShapeFrom(sh);
CompareShapeMatcher.INST.assertEqualShapeFill(sh, s2);
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class PolymorphShapeTest method testLoadShadowParams.
@ParameterizedTest
@MethodSource("net.sf.latexdraw.data.ShapeSupplier#getDiversifiedShapes")
default void testLoadShadowParams(final Shape sh) {
assumeTrue(sh.isShadowable());
final Shape s2 = produceOutputShapeFrom(sh);
CompareShapeMatcher.INST.assertEqualShapeShadow(sh, s2);
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class PolymorphShapeTest method testLoadSaveShapeParams.
@ParameterizedTest
@MethodSource("net.sf.latexdraw.data.ShapeSupplier#getDiversifiedShapes")
default void testLoadSaveShapeParams(final Shape sh) {
assumeTrue(sh.isBordersMovable());
final Shape s2 = produceOutputShapeFrom(sh);
CompareShapeMatcher.INST.assertEqualShapeBorderMov(sh, s2);
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class TestPSTBase method produceOutputShapeFrom.
@Override
public T produceOutputShapeFrom(final T sh) {
final String view = factory.createView(sh).orElseThrow().getCode(ShapeFactory.INST.createPoint(), Shape.PPC);
final net.sf.latexdraw.parser.pst.PSTLexer lexer = new net.sf.latexdraw.parser.pst.PSTLexer(CharStreams.fromString(view));
final net.sf.latexdraw.parser.pst.PSTParser parser = new net.sf.latexdraw.parser.pst.PSTParser(new CommonTokenStream(lexer));
final TestPSTParser.ErrorPSTLatexdrawListener listener = new TestPSTParser.ErrorPSTLatexdrawListener();
parser.addParseListener(listener);
parser.pstCode(new PSTContext());
parser.getInterpreter().clearDFA();
lexer.getInterpreter().clearDFA();
new ATNDeserializer().deserialize(net.sf.latexdraw.parser.pst.PSTLexer._serializedATN.toCharArray());
final List<Shape> shapes = listener.flatShapes();
assertEquals(1, shapes.size());
return (T) shapes.get(0);
}
Aggregations