Search in sources :

Example 6 with IAxes

use of net.sf.latexdraw.models.interfaces.shape.IAxes in project latexdraw by arnobl.

the class TestParsingPsaxes method testParamdx.

@Theory
public void testParamdx(@DoubleData(vals = { 2d, 3.5 }) final double dx) {
    parser("\\psaxes[dx=" + dx + " cm](0,0)(0,0)(2,2)");
    final IAxes axes = getShapeAt(0);
    assertEquals(dx, axes.getDistLabelsX(), 0.00001);
}
Also used : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Theory(org.junit.experimental.theories.Theory)

Example 7 with IAxes

use of net.sf.latexdraw.models.interfaces.shape.IAxes in project latexdraw by arnobl.

the class TestParsingPsaxes method testShowOrigin.

@Theory
public void testShowOrigin(final boolean origin) {
    parser("\\psaxes[showorigin=" + origin + "](0,0)(0,0)(2,2)");
    final IAxes axes = getShapeAt(0);
    assertEquals(origin, axes.isShowOrigin());
}
Also used : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Theory(org.junit.experimental.theories.Theory)

Example 8 with IAxes

use of net.sf.latexdraw.models.interfaces.shape.IAxes in project latexdraw by arnobl.

the class TestParsingPsaxes method testParse2Coord.

@Test
public void testParse2Coord() {
    parser("\\psaxes(1,2)(3,4)");
    final IAxes 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(IShape.PPC, axes.getPosition().getX(), 0.0001);
    assertEquals(2d * IShape.PPC, axes.getPosition().getY(), 0.0001);
}
Also used : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Test(org.junit.Test)

Example 9 with IAxes

use of net.sf.latexdraw.models.interfaces.shape.IAxes in project latexdraw by arnobl.

the class TestParsingPsaxes method testParse3Coord2.

@Test
public void testParse3Coord2() {
    parser("\\psaxes(0,0)(1,2)(3,4)");
    final IAxes 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 : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Test(org.junit.Test)

Example 10 with IAxes

use of net.sf.latexdraw.models.interfaces.shape.IAxes in project latexdraw by arnobl.

the class TestParsingPsaxes method testParamdy.

@Theory
public void testParamdy(@DoubleData(vals = { 2d, 3.5 }) final double dy) {
    parser("\\psaxes[dy=" + dy + " cm](0,0)(0,0)(2,2)");
    final IAxes axes = getShapeAt(0);
    assertEquals(dy, axes.getDistLabelsY(), 0.00001);
}
Also used : IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) Theory(org.junit.experimental.theories.Theory)

Aggregations

IAxes (net.sf.latexdraw.models.interfaces.shape.IAxes)50 Theory (org.junit.experimental.theories.Theory)28 Test (org.junit.Test)12 IArrowableSingleShape (net.sf.latexdraw.models.interfaces.shape.IArrowableSingleShape)10 HelperTest (net.sf.latexdraw.HelperTest)7 IShape (net.sf.latexdraw.models.interfaces.shape.IShape)5 PlottingStyle (net.sf.latexdraw.models.interfaces.shape.PlottingStyle)4 TicksStyle (net.sf.latexdraw.models.interfaces.shape.TicksStyle)4 IDot (net.sf.latexdraw.models.interfaces.shape.IDot)3 IPoint (net.sf.latexdraw.models.interfaces.shape.IPoint)3 IRectangle (net.sf.latexdraw.models.interfaces.shape.IRectangle)3 Collections (java.util.Collections)2 ShapeData (net.sf.latexdraw.data.ShapeData)2 ShapeFactory (net.sf.latexdraw.models.ShapeFactory)2 ArrowStyle (net.sf.latexdraw.models.interfaces.shape.ArrowStyle)2 AxesStyle (net.sf.latexdraw.models.interfaces.shape.AxesStyle)2 BorderPos (net.sf.latexdraw.models.interfaces.shape.BorderPos)2 DotStyle (net.sf.latexdraw.models.interfaces.shape.DotStyle)2 FillingStyle (net.sf.latexdraw.models.interfaces.shape.FillingStyle)2 IGroup (net.sf.latexdraw.models.interfaces.shape.IGroup)2