Search in sources :

Example 6 with Axes

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

the class TestParsingPsaxes method testParse3Coord2.

@Test
public void testParse3Coord2() {
    parser("\\psaxes(0,0)(1,2)(3,4)");
    final Axes axes = getShapeAt(0);
    assertEquals(0d, axes.getOriginX(), 0.0001);
    assertEquals(0d, axes.getOriginY(), 0.0001);
    assertEquals(1d, axes.getGridStartX(), 0.0001);
    assertEquals(2d, axes.getGridStartY(), 0.0001);
    assertEquals(3d, axes.getGridEndX(), 0.0001);
    assertEquals(4d, axes.getGridEndY(), 0.0001);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 7 with Axes

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

the class TestParsingPsaxes method testLabelsStyle.

@ParameterizedTest
@EnumSource(value = PlottingStyle.class)
public void testLabelsStyle(final PlottingStyle style) {
    parser("\\psaxes[labels=" + style.getPSTToken() + "](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertEquals(style, axes.getLabelsDisplayed());
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 8 with Axes

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

the class TestParsingPsaxes method testParse3Coord.

@Test
public void testParse3Coord() {
    parser("\\psaxes(0,0)(0,0)(3,4)");
    final Axes axes = getShapeAt(0);
    assertEquals(0d, axes.getOriginX(), 0.0001);
    assertEquals(0d, axes.getOriginY(), 0.0001);
    assertEquals(0d, axes.getGridStartX(), 0.0001);
    assertEquals(0d, axes.getGridStartY(), 0.0001);
    assertEquals(3d, axes.getGridEndX(), 0.0001);
    assertEquals(4d, axes.getGridEndY(), 0.0001);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 9 with Axes

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

the class PolymorphArrowableTest method testArrowCircleDiskParamsArr2.

@ParameterizedTest
@MethodSource("arrowsParamsDiv")
default void testArrowCircleDiskParamsArr2(final ArrowableSingleShape sh, final ArrowStyle arr) {
    assumeTrue(arr.isCircleDisk());
    assumeFalse(sh instanceof Axes);
    sh.setArrowStyle(arr, 0);
    final ArrowableSingleShape s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsArrowCircleDisk(sh.getArrowAt(1), s2.getArrowAt(1));
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 10 with Axes

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

the class PolymorphArrowableTest method testArrowBracketParamsArr1.

@ParameterizedTest
@MethodSource("arrowsParamsDiv")
default void testArrowBracketParamsArr1(final ArrowableSingleShape sh, final ArrowStyle arr) {
    assumeTrue(arr.isSquareBracket());
    assumeFalse(sh instanceof Axes);
    sh.setArrowStyle(arr, 0);
    sh.setArrowStyle(ArrowStyle.LEFT_ARROW, 1);
    final ArrowableSingleShape s2 = produceOutputShapeFrom(sh);
    CompareShapeMatcher.INST.assertEqualsArrowBracket(sh.getArrowAt(0), s2.getArrowAt(0));
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ArrowableSingleShape(net.sf.latexdraw.model.api.shape.ArrowableSingleShape) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

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