use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestGrid method testDuplicate.
@Test
public void testDuplicate() {
shape.setGridDots(45);
shape.setSubGridDots(55);
shape.setGridLabelsColour(DviPsColors.CYAN);
shape.setSubGridColour(DviPsColors.GREEN);
shape.setUnit(0.6);
shape.setGridWidth(12);
shape.setSubGridWidth(24);
shape.setSubGridDiv(32);
shape.setXLabelSouth(false);
shape.setYLabelWest(false);
final Grid dup = shape.duplicate();
assertEquals(dup.getGridDots(), shape.getGridDots());
assertEquals(dup.getSubGridDiv(), shape.getSubGridDiv());
assertEquals(dup.getGridLabelsColour(), shape.getGridLabelsColour());
assertEquals(dup.getSubGridColour(), shape.getSubGridColour());
assertEqualsDouble(dup.getUnit(), shape.getUnit());
assertEqualsDouble(dup.getGridWidth(), shape.getGridWidth());
assertEqualsDouble(dup.getSubGridWidth(), shape.getSubGridWidth());
assertEquals(dup.getSubGridDiv(), shape.getSubGridDiv());
assertFalse(dup.isXLabelSouth());
assertFalse(dup.isYLabelWest());
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestGrid method testConstructors.
@Test
public void testConstructors() {
final Grid grid = ShapeFactory.INST.createGrid(ShapeFactory.INST.createPoint());
assertThat(grid.getGridEndX()).isGreaterThanOrEqualTo(grid.getGridStartX());
assertThat(grid.getGridEndY()).isGreaterThanOrEqualTo(grid.getGridStartY());
assertEqualsDouble(0d, grid.getPosition().getX());
assertEqualsDouble(0d, grid.getPosition().getY());
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestPencilGridStyle method testPickLineColourPencil.
@Test
public void testPickLineColourPencil() {
Cmds.of(activatePencil, pencilCreatesGrid, updateIns).execute();
final Color col = colourSubGrid.getValue();
Cmds.of(pickcolourSubGrid).execute();
assertEquals(colourSubGrid.getValue(), ((Grid) editing.createShapeInstance()).getSubGridColour().toJFX());
assertNotEquals(col, colourSubGrid.getValue());
}
use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.
the class TestParsingPsgrid method testGridYUnitin.
@Test
public void testGridYUnitin() {
parser("\\psgrid[yunit=20in](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 testParse3CoordInverted.
@Test
public void testParse3CoordInverted() {
parser("\\psgrid(0,-1)(3,4)(1,2)");
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);
assertFalse(grid.isXLabelSouth());
assertFalse(grid.isYLabelWest());
}
Aggregations