use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridLabelColor.
@Test
public void testGridLabelColor() {
parser("\\psgrid[gridlabelcolor=green](0,0)(0,0)(1,1)");
final Grid grid = getShapeAt(0);
assertEquals(DviPsColors.GREEN, grid.getGridLabelsColour());
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testParse3Coord.
@Test
public void testParse3Coord() {
parser("\\psgrid(0,-1)(1,2)(3,4)");
final Grid 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);
assertTrue(grid.isXLabelSouth());
assertTrue(grid.isYLabelWest());
}
use of net.sf.latexdraw.model.api.shape.Grid 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 Grid grid = getShapeAt(0);
assertEquals(20d * Shape.PPC / PSTricksConstants.INCH_VAL_CM, grid.getSubGridWidth(), 0.00001);
}
use of net.sf.latexdraw.model.api.shape.Grid 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 Grid grid = getShapeAt(0);
assertEquals(.3 * Shape.PPC / PSTricksConstants.INCH_VAL_CM, grid.getGridWidth(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridLabelsin.
@Test
public void testGridLabelsin() {
parser("\\psgrid[gridlabels=20in](0,0)(0,0)(1,1)");
final Grid grid = getShapeAt(0);
assertEquals((int) (20d * Shape.PPC / PSTricksConstants.INCH_VAL_CM), grid.getLabelsSize());
}
Aggregations