Search in sources :

Example 11 with Shape

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

the class TestParsingShape method testParamGradbegin.

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

Example 12 with Shape

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

the class TestParsingShape method testParamShadow.

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

Example 13 with Shape

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

the class TestStarredCommand method testBorderPos.

@ParameterizedTest
@MethodSource("cmds")
void testBorderPos(final String cmd) {
    parser(cmd);
    final Shape sh = getShapeAt(0);
    assumeTrue(sh.isBordersMovable());
    assertEquals(BorderPos.INTO, sh.getBordersPosition());
}
Also used : Shape(net.sf.latexdraw.model.api.shape.Shape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 14 with Shape

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

the class TestStarredCommand method testLineStyle.

@ParameterizedTest
@MethodSource("cmds")
void testLineStyle(final String cmd) {
    parser(cmd);
    final Shape sh = getShapeAt(0);
    assumeTrue(sh.isLineStylable());
    assertEquals(LineStyle.SOLID, sh.getLineStyle());
}
Also used : Shape(net.sf.latexdraw.model.api.shape.Shape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 15 with Shape

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

the class MoveBackForegroundShapes method moveBackground.

/**
 * Puts the shapes in the background.
 */
private void moveBackground() {
    final int size = shape.size();
    prepareMove();
    for (int i = size - 1; i >= 0; i--) {
        final Shape sh = sortedSh.get(i);
        formerId[i] = drawing.getShapes().indexOf(sh);
        drawing.removeShape(sh);
        drawing.addShape(sh, 0);
    }
    drawing.setModified(true);
}
Also used : Shape(net.sf.latexdraw.model.api.shape.Shape)

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