Search in sources :

Example 16 with Axes

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

the class PolymorphAxesTest method testAxesStyle.

@ParameterizedTest
@EnumSource(AxesStyle.class)
default void testAxesStyle(final AxesStyle style) {
    final Axes sh = ShapeSupplier.createAxes();
    sh.setAxesStyle(style);
    final Axes s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsAxes(sh, s2);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 17 with Axes

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

the class PolymorphAxesTest method testTicksStyle.

@ParameterizedTest
@EnumSource(TicksStyle.class)
default void testTicksStyle(final TicksStyle style) {
    final Axes sh = ShapeSupplier.createAxes();
    sh.setTicksStyle(style);
    final Axes s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsAxes(sh, s2);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 18 with Axes

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

the class PolymorphAxesTest method testAxesParams.

@ParameterizedTest
@MethodSource("net.sf.latexdraw.data.ShapeSupplier#createDiversifiedAxes")
default void testAxesParams(final Axes sh) {
    final Axes s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsAxes(sh, s2);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 19 with Axes

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

the class TestCanvasCreation method testDrawAxes.

@Test
public void testDrawAxes() {
    final Point2D pos = point(canvas).query();
    Cmds.of(CmdFXVoid.of(() -> editing.setCurrentChoice(EditionChoice.AXES)), () -> moveTo(pos).clickOn(MouseButton.PRIMARY)).execute();
    assertEquals(1, drawing.size());
    assertTrue(drawing.getShapeAt(0).orElseThrow() instanceof Axes);
    final Axes sh = (Axes) drawing.getShapeAt(0).orElseThrow();
    assertEquals(-Canvas.getMargins() + canvas.screenToLocal(pos).getX(), sh.getPosition().getX(), 1d);
    assertEquals(-Canvas.getMargins() + canvas.screenToLocal(pos).getY(), sh.getPosition().getY(), 1d);
}
Also used : Point2D(javafx.geometry.Point2D) Axes(net.sf.latexdraw.model.api.shape.Axes) Test(org.junit.Test)

Example 20 with Axes

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

the class PolymorphAxesTest method testTicksDisplayed.

@ParameterizedTest
@EnumSource(PlottingStyle.class)
default void testTicksDisplayed(final PlottingStyle style) {
    final Axes sh = ShapeSupplier.createAxes();
    sh.setTicksDisplayed(style);
    final Axes s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsAxes(sh, s2);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

Axes (net.sf.latexdraw.model.api.shape.Axes)40 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)28 Test (org.junit.Test)8 EnumSource (org.junit.jupiter.params.provider.EnumSource)8 MethodSource (org.junit.jupiter.params.provider.MethodSource)8 HelperTest (net.sf.latexdraw.HelperTest)7 ArrowableSingleShape (net.sf.latexdraw.model.api.shape.ArrowableSingleShape)7 ValueSource (org.junit.jupiter.params.provider.ValueSource)6 Shape (net.sf.latexdraw.model.api.shape.Shape)5 Test (org.junit.jupiter.api.Test)5 Dot (net.sf.latexdraw.model.api.shape.Dot)3 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)3 Collections (java.util.Collections)2 ShapeData (net.sf.latexdraw.data.ShapeData)2 ShapeFactory (net.sf.latexdraw.model.ShapeFactory)2 ArrowStyle (net.sf.latexdraw.model.api.shape.ArrowStyle)2 AxesStyle (net.sf.latexdraw.model.api.shape.AxesStyle)2 BorderPos (net.sf.latexdraw.model.api.shape.BorderPos)2 DotStyle (net.sf.latexdraw.model.api.shape.DotStyle)2 FillingStyle (net.sf.latexdraw.model.api.shape.FillingStyle)2