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());
}
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);
}
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);
}
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);
}
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);
}
Aggregations