use of net.sf.latexdraw.model.api.shape.Grid 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 Grid grid = getShapeAt(0);
assertEquals(1d, grid.getUnit(), 0.00001);
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridDots.
@ParameterizedTest
@ValueSource(ints = { 0, 3 })
public void testGridDots(final int div) {
parser("\\psgrid[griddots=" + div + "](0,0)(0,0)(1,1)");
final Grid grid = getShapeAt(0);
assertEquals(div, grid.getGridDots());
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testParse1Coord.
@Test
public void testParse1Coord() {
parser("\\psgrid(1,2)");
final Grid 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.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testSubGridDots.
@ParameterizedTest
@ValueSource(ints = { 0, 3 })
public void testSubGridDots(final int div) {
parser("\\psgrid[subgriddots=" + div + "](0,0)(0,0)(1,1)");
final Grid grid = getShapeAt(0);
assertEquals(div, grid.getSubGridDots());
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testParse0CoordDoubleValue.
@Test
public void testParse0CoordDoubleValue() {
parser("\\begin{pspicture}(2.1,2.6)(5.6,5.5)\\psgrid\\end{pspicture}");
final Grid grid = getShapeAt(0);
assertEquals(0d, grid.getOriginX(), 0.0001);
assertEquals(0d, grid.getOriginY(), 0.0001);
assertEquals(2d, grid.getGridMinX(), 0.0001);
assertEquals(3d, grid.getGridMinY(), 0.0001);
assertEquals(6d, grid.getGridMaxX(), 0.0001);
assertEquals(6d, grid.getGridMaxY(), 0.0001);
assertTrue(grid.isXLabelSouth());
assertTrue(grid.isYLabelWest());
}
Aggregations