Search in sources :

Example 61 with Shape

use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.

the class TestParsingShape method testParamNoDoubleLine.

@ParameterizedTest
@MethodSource(value = "cmds")
void testParamNoDoubleLine(final Tuple<String, String> cmd) {
    parser(cmd.a + "[doubleline = false]" + cmd.b);
    final Shape sh = getShapeAt(0);
    assumeTrue(sh.isDbleBorderable());
    assertFalse(sh.hasDbleBord());
}
Also used : Shape(net.sf.latexdraw.model.api.shape.Shape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 62 with Shape

use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.

the class TestParsingShape method testParamDoubleLine.

@ParameterizedTest
@MethodSource(value = "cmds")
void testParamDoubleLine(final Tuple<String, String> cmd) {
    parser(cmd.a + "[doubleline = true]" + cmd.b);
    final Shape sh = getShapeAt(0);
    assumeTrue(sh.isDbleBorderable());
    assertTrue(sh.hasDbleBord());
}
Also used : Shape(net.sf.latexdraw.model.api.shape.Shape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 63 with Shape

use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.

the class TestParsingShape method testParamGradmidpoint.

@ParameterizedTest
@MethodSource(value = "cmds")
void testParamGradmidpoint(final Tuple<String, String> cmd) {
    parser(cmd.a + "[fillstyle=gradient, gradmidpoint=0.2]" + cmd.b);
    final Shape sh = getShapeAt(0);
    assumeTrue(sh.isInteriorStylable());
    assertEquals(0.2, sh.getGradMidPt(), 0.00001);
}
Also used : Shape(net.sf.latexdraw.model.api.shape.Shape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 64 with Shape

use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.

the class TestParsingShape method testOpacity.

@ParameterizedTest
@MethodSource(value = "cmds")
void testOpacity(final Tuple<String, String> cmd) {
    parser(cmd.a + "[fillstyle = solid, opacity =0.5]" + cmd.b);
    final Shape sh = getShapeAt(0);
    assumeTrue(sh.isFillable());
    assertEquals(0.5, sh.getFillingCol().getO(), 0.00001);
}
Also used : Shape(net.sf.latexdraw.model.api.shape.Shape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 65 with Shape

use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.

the class TestParsingShape method testParamshadowcolorPredefinedColor.

@ParameterizedTest
@MethodSource(value = "cmds")
void testParamshadowcolorPredefinedColor(final Tuple<String, String> cmd) {
    parser(cmd.a + "[shadow=true, shadowcolor=blue]" + cmd.b);
    final Shape sh = getShapeAt(0);
    assumeTrue(sh.isShadowable());
    assertEquals(DviPsColors.BLUE, sh.getShadowCol());
}
Also used : Shape(net.sf.latexdraw.model.api.shape.Shape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

Shape (net.sf.latexdraw.model.api.shape.Shape)75 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)43 MethodSource (org.junit.jupiter.params.provider.MethodSource)41 Test (org.junit.Test)12 Point (net.sf.latexdraw.model.api.shape.Point)8 PositionShape (net.sf.latexdraw.model.api.shape.PositionShape)7 HelperTest (net.sf.latexdraw.HelperTest)6 ShapeFactory (net.sf.latexdraw.model.ShapeFactory)6 Circle (net.sf.latexdraw.model.api.shape.Circle)6 RectangularShape (net.sf.latexdraw.model.api.shape.RectangularShape)6 NotNull (org.jetbrains.annotations.NotNull)6 Click (io.github.interacto.jfx.interaction.library.Click)5 ArrayList (java.util.ArrayList)5 Objects (java.util.Objects)5 MathUtils (net.sf.latexdraw.model.MathUtils)5 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)5 Inject (net.sf.latexdraw.util.Inject)5 CommandsRegistry (io.github.interacto.command.CommandsRegistry)3 Redo (io.github.interacto.command.library.Redo)3 Undo (io.github.interacto.command.library.Undo)3