use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testParse2Coord.
@Test
public void testParse2Coord() {
parser("\\psgrid(1,2)(3,4)");
final IGrid grid = getShapeAt(0);
assertEquals(1d, grid.getOriginX(), 0.0001);
assertEquals(2d, grid.getOriginY(), 0.0001);
assertEquals(1d, grid.getGridMinX(), 0.0001);
assertEquals(2d, grid.getGridMinY(), 0.0001);
assertEquals(3d, grid.getGridMaxX(), 0.0001);
assertEquals(4d, grid.getGridMaxY(), 0.0001);
assertTrue(grid.isXLabelSouth());
assertTrue(grid.isYLabelWest());
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testParse2CoordInverted.
@Test
public void testParse2CoordInverted() {
parser("\\psgrid(3,4)(1,2)");
final IGrid grid = getShapeAt(0);
assertEquals(3d, grid.getOriginX(), 0.0001);
assertEquals(4d, grid.getOriginY(), 0.0001);
assertEquals(1d, grid.getGridMinX(), 0.0001);
assertEquals(2d, grid.getGridMinY(), 0.0001);
assertEquals(3d, grid.getGridMaxX(), 0.0001);
assertEquals(4d, grid.getGridMaxY(), 0.0001);
assertFalse(grid.isXLabelSouth());
assertFalse(grid.isYLabelWest());
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridUnit.
@Test
public void testGridUnit() {
parser("\\psgrid[unit=0.3](0,0)(0,0)(1,1)");
final IGrid grid = getShapeAt(0);
assertEquals(0.3, grid.getUnit(), 0.00001);
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridXUnitCM.
@Test
public void testGridXUnitCM() {
parser("\\psgrid[xunit=20in](0,0)(0,0)(1,1)");
final IGrid grid = getShapeAt(0);
assertEquals(1d, grid.getUnit(), 0.00001);
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridWidthcm.
@Test
public void testGridWidthcm() {
parser("\\psgrid[gridwidth=1.3cm](0,0)(0,0)(1,1)");
final IGrid grid = getShapeAt(0);
assertEquals(1.3 * IShape.PPC, grid.getGridWidth(), 0.001);
}
Aggregations