use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridLabels.
@Test
public void testGridLabels() {
parser("\\psgrid[gridlabels=0.3](0,0)(0,0)(1,1)");
final Grid grid = getShapeAt(0);
assertEquals((int) (0.3 * Shape.PPC), grid.getLabelsSize());
}
use of net.sf.latexdraw.model.api.shape.Grid 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 Grid grid = getShapeAt(0);
assertEquals(DviPsColors.GREEN, grid.getSubGridColour());
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridSubGridWidth.
@Test
public void testGridSubGridWidth() {
parser("\\psgrid[subgridwidth=0.3](0,0)(0,0)(1,1)");
final Grid grid = getShapeAt(0);
assertEquals(0.3 * Shape.PPC, grid.getSubGridWidth(), 0.00001);
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridSubGridDiv.
@ParameterizedTest
@ValueSource(ints = { 0, 3 })
public void testGridSubGridDiv(final int div) {
parser("\\psgrid[subgriddiv=" + div + "](0,0)(0,0)(1,1)");
final Grid grid = getShapeAt(0);
assertEquals(div, grid.getSubGridDiv());
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testParse2CoordInverted.
@Test
public void testParse2CoordInverted() {
parser("\\psgrid(3,4)(1,2)");
final Grid 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());
}
Aggregations