use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridSubGridWidthin.
@Test
public void testGridSubGridWidthin() {
parser("\\psgrid[subgridwidth=20in](0,0)(0,0)(1,1)");
final IGrid grid = getShapeAt(0);
assertEquals(20d * IShape.PPC / PSTricksConstants.INCH_VAL_CM, grid.getSubGridWidth(), 0.00001);
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testParse3CoordInverted.
@Test
public void testParse3CoordInverted() {
parser("\\psgrid(0,-1)(3,4)(1,2)");
final IGrid grid = getShapeAt(0);
assertEquals(0d, grid.getOriginX(), 0.0001);
assertEquals(-1d, grid.getOriginY(), 0.0001);
assertEquals(1d, grid.getGridStartX(), 0.0001);
assertEquals(2d, grid.getGridStartY(), 0.0001);
assertEquals(3d, grid.getGridEndX(), 0.0001);
assertEquals(4d, grid.getGridEndY(), 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 testGridColor.
@Test
public void testGridColor() {
parser("\\psgrid[gridcolor=green](0,0)(0,0)(1,1)");
final IGrid grid = getShapeAt(0);
assertEquals(DviPsColors.GREEN, grid.getLineColour());
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridYUnit.
@Test
public void testGridYUnit() {
parser("\\psgrid[yunit=0.3](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 testGridWidthin.
@Test
public void testGridWidthin() {
parser("\\psgrid[gridwidth=.3in](0,0)(0,0)(1,1)");
final IGrid grid = getShapeAt(0);
assertEquals(.3 * IShape.PPC / PSTricksConstants.INCH_VAL_CM, grid.getGridWidth(), 0.001);
}
Aggregations