use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridDots.
@Theory
public void testGridDots(@TestedOn(ints = { 0, 3 }) final int div) {
parser("\\psgrid[griddots=" + div + "](0,0)(0,0)(1,1)");
final IGrid grid = getShapeAt(0);
assertEquals(div, grid.getGridDots());
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testParse1Coord.
@Test
public void testParse1Coord() {
parser("\\psgrid(1,2)");
final IGrid grid = getShapeAt(0);
assertEquals(0d, grid.getOriginX(), 0.0001);
assertEquals(0d, grid.getOriginY(), 0.0001);
assertEquals(0d, grid.getGridMinX(), 0.0001);
assertEquals(0d, grid.getGridMinY(), 0.0001);
assertEquals(1d, grid.getGridMaxX(), 0.0001);
assertEquals(2d, 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 testSubGridLabelColor.
@Test
public void testSubGridLabelColor() {
parser("\\psgrid[subgridcolor=green](0,0)(0,0)(1,1)");
final IGrid grid = getShapeAt(0);
assertEquals(DviPsColors.GREEN, grid.getSubGridColour());
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testParse0Coord.
@Test
public void testParse0Coord() {
parser("\\begin{pspicture}(2,2)(5,5)\\psgrid\\end{pspicture}");
final IGrid grid = getShapeAt(0);
assertEquals(0d, grid.getOriginX(), 0.0001);
assertEquals(0d, grid.getOriginY(), 0.0001);
assertEquals(2d, grid.getGridMinX(), 0.0001);
assertEquals(2d, grid.getGridMinY(), 0.0001);
assertEquals(5d, grid.getGridMaxX(), 0.0001);
assertEquals(5d, 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 testGridLabelsin.
@Test
public void testGridLabelsin() {
parser("\\psgrid[gridlabels=20in](0,0)(0,0)(1,1)");
final IGrid grid = getShapeAt(0);
assertEquals((int) (20d * IShape.PPC / PSTricksConstants.INCH_VAL_CM), grid.getLabelsSize());
}
Aggregations