Search in sources :

Example 1 with Axes

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

the class TestParsingPsaxes method testShowOriginNot.

@Test
public void testShowOriginNot() {
    parser("\\psaxes[showorigin=false](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertFalse(axes.isShowOrigin());
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with Axes

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

the class TestParsingPsaxes method testParse1Coord.

@Test
public void testParse1Coord() {
    parser("\\psaxes(1,2)");
    final Axes axes = getShapeAt(0);
    assertEquals(0d, axes.getOriginX(), 0.0001);
    assertEquals(0d, axes.getOriginY(), 0.0001);
    assertEquals(0d, axes.getGridMinX(), 0.0001);
    assertEquals(0d, axes.getGridMinY(), 0.0001);
    assertEquals(1d, axes.getGridMaxX(), 0.0001);
    assertEquals(2d, axes.getGridMaxY(), 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 3 with Axes

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

the class TestParsingPsaxes method testOx.

@ParameterizedTest
@ValueSource(doubles = { 2d, 3.5 })
public void testOx(final double ox) {
    parser("\\psaxes[Ox=" + ox + "](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertEquals(ox, axes.getOriginX(), 0.00001);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 4 with Axes

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

the class TestParsingPsaxes method testParse2Coord.

@Test
public void testParse2Coord() {
    parser("\\psaxes(1,2)(3,4)");
    final Axes axes = getShapeAt(0);
    assertEquals(0d, axes.getOriginX(), 0.0001);
    assertEquals(0d, axes.getOriginY(), 0.0001);
    assertEquals(0d, axes.getGridMinX(), 0.0001);
    assertEquals(0d, axes.getGridMinY(), 0.0001);
    assertEquals(2d, axes.getGridMaxX(), 0.0001);
    assertEquals(2d, axes.getGridMaxY(), 0.0001);
    assertEquals(Shape.PPC, axes.getPosition().getX(), 0.0001);
    assertEquals(2d * Shape.PPC, axes.getPosition().getY(), 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 5 with Axes

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

the class TestParsingPsaxes method testParamDY.

@ParameterizedTest
@ValueSource(doubles = { 2d, 3.5 })
public void testParamDY(final double dy) {
    parser("\\psaxes[Dy=" + dy + "](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertEquals(dy, axes.getIncrementY(), 0.00001);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ValueSource(org.junit.jupiter.params.provider.ValueSource) 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