use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestHandGridStyle method testPickcolourLabelsColourHand.
@Test
public void testPickcolourLabelsColourHand() {
new CompositeGUIVoidCommand(activateHand, selectionAddDot, selectionAddGrid, selectionAddGrid, updateIns).execute();
Color col = colourLabels.getValue();
pickcolourLabels.execute();
assertEquals(colourLabels.getValue(), ((IGrid) drawing.getSelection().getShapeAt(1)).getGridLabelsColour().toJFX());
assertEquals(colourLabels.getValue(), ((IGrid) drawing.getSelection().getShapeAt(2)).getGridLabelsColour().toJFX());
assertNotEquals(col, colourLabels.getValue());
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestCanvasCreation method testDrawGrid.
@Test
public void testDrawGrid() {
pencil.setCurrentChoice(EditionChoice.GRID);
final Point2D pos = point(canvas).query();
moveTo(pos).clickOn(MouseButton.PRIMARY).sleep(SLEEP);
assertEquals(1, drawing.size());
assertTrue(drawing.getShapeAt(0) instanceof IGrid);
final IGrid sh = (IGrid) drawing.getShapeAt(0);
assertEquals(-Canvas.getMargins() + canvas.screenToLocal(pos).getX(), sh.getPosition().getX(), 1d);
assertEquals(-Canvas.getMargins() + canvas.screenToLocal(pos).getY(), sh.getPosition().getY(), 1d);
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestPencilGridStyle method testPickcolourLabelsColourPencil.
@Test
public void testPickcolourLabelsColourPencil() {
new CompositeGUIVoidCommand(activatePencil, pencilCreatesGrid, updateIns).execute();
Color col = colourLabels.getValue();
pickcolourLabels.execute();
assertEquals(colourLabels.getValue(), ((IGrid) pencil.createShapeInstance()).getGridLabelsColour().toJFX());
assertNotEquals(col, colourLabels.getValue());
}
use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.
the class TestParsingPsgrid method testParse3Coord.
@Test
public void testParse3Coord() {
parser("\\psgrid(0,-1)(1,2)(3,4)");
final IGrid 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.models.interfaces.shape.IGrid 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 IGrid grid = getShapeAt(0);
assertEquals(0.3 * IShape.PPC, grid.getSubGridWidth(), 0.00001);
}
Aggregations