Search in sources :

Example 6 with IGrid

use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.

the class TestParsingPsgrid method testGridSubGridWidthin.

@Test
public void testGridSubGridWidthin() {
    parser("\\psgrid[subgridwidth=20in](0,0)(0,0)(1,1)");
    final IGrid grid = getShapeAt(0);
    assertEquals(20d * IShape.PPC / PSTricksConstants.INCH_VAL_CM, grid.getSubGridWidth(), 0.00001);
}
Also used : IGrid(net.sf.latexdraw.models.interfaces.shape.IGrid) Test(org.junit.Test)

Example 7 with IGrid

use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.

the class TestParsingPsgrid method testParse3CoordInverted.

@Test
public void testParse3CoordInverted() {
    parser("\\psgrid(0,-1)(3,4)(1,2)");
    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);
    assertFalse(grid.isXLabelSouth());
    assertFalse(grid.isYLabelWest());
}
Also used : IGrid(net.sf.latexdraw.models.interfaces.shape.IGrid) Test(org.junit.Test)

Example 8 with IGrid

use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.

the class TestParsingPsgrid method testGridColor.

@Test
public void testGridColor() {
    parser("\\psgrid[gridcolor=green](0,0)(0,0)(1,1)");
    final IGrid grid = getShapeAt(0);
    assertEquals(DviPsColors.GREEN, grid.getLineColour());
}
Also used : IGrid(net.sf.latexdraw.models.interfaces.shape.IGrid) Test(org.junit.Test)

Example 9 with IGrid

use of net.sf.latexdraw.models.interfaces.shape.IGrid 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 IGrid grid = getShapeAt(0);
    assertEquals(1d, grid.getUnit(), 0.00001);
}
Also used : IGrid(net.sf.latexdraw.models.interfaces.shape.IGrid) Test(org.junit.Test)

Example 10 with IGrid

use of net.sf.latexdraw.models.interfaces.shape.IGrid in project latexdraw by arnobl.

the class TestParsingPsgrid method testGridWidthin.

@Test
public void testGridWidthin() {
    parser("\\psgrid[gridwidth=.3in](0,0)(0,0)(1,1)");
    final IGrid grid = getShapeAt(0);
    assertEquals(.3 * IShape.PPC / PSTricksConstants.INCH_VAL_CM, grid.getGridWidth(), 0.001);
}
Also used : IGrid(net.sf.latexdraw.models.interfaces.shape.IGrid) Test(org.junit.Test)

Aggregations

IGrid (net.sf.latexdraw.models.interfaces.shape.IGrid)43 Test (org.junit.Test)36 IRectangle (net.sf.latexdraw.models.interfaces.shape.IRectangle)5 Color (javafx.scene.paint.Color)4 CompositeGUIVoidCommand (net.sf.latexdraw.instruments.CompositeGUIVoidCommand)4 Theory (org.junit.experimental.theories.Theory)4 HelperTest (net.sf.latexdraw.HelperTest)3 Point2D (javafx.geometry.Point2D)1 IAxes (net.sf.latexdraw.models.interfaces.shape.IAxes)1 IBezierCurve (net.sf.latexdraw.models.interfaces.shape.IBezierCurve)1 ICircle (net.sf.latexdraw.models.interfaces.shape.ICircle)1 ICircleArc (net.sf.latexdraw.models.interfaces.shape.ICircleArc)1 IDot (net.sf.latexdraw.models.interfaces.shape.IDot)1 IEllipse (net.sf.latexdraw.models.interfaces.shape.IEllipse)1 IFreehand (net.sf.latexdraw.models.interfaces.shape.IFreehand)1 IPlot (net.sf.latexdraw.models.interfaces.shape.IPlot)1 IPoint (net.sf.latexdraw.models.interfaces.shape.IPoint)1 IPolygon (net.sf.latexdraw.models.interfaces.shape.IPolygon)1 IPolyline (net.sf.latexdraw.models.interfaces.shape.IPolyline)1 IRhombus (net.sf.latexdraw.models.interfaces.shape.IRhombus)1