Search in sources :

Example 31 with IGrid

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

the class TestParsingPsgrid method testGridDots.

@Theory
public void testGridDots(@TestedOn(ints = { 0, 3 }) final int div) {
    parser("\\psgrid[griddots=" + div + "](0,0)(0,0)(1,1)");
    final IGrid grid = getShapeAt(0);
    assertEquals(div, grid.getGridDots());
}
Also used : IGrid(net.sf.latexdraw.models.interfaces.shape.IGrid) Theory(org.junit.experimental.theories.Theory)

Example 32 with IGrid

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

the class TestParsingPsgrid method testParse1Coord.

@Test
public void testParse1Coord() {
    parser("\\psgrid(1,2)");
    final IGrid 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());
}
Also used : IGrid(net.sf.latexdraw.models.interfaces.shape.IGrid) Test(org.junit.Test)

Example 33 with IGrid

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

Example 34 with IGrid

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

the class TestParsingPsgrid method testParse0Coord.

@Test
public void testParse0Coord() {
    parser("\\begin{pspicture}(2,2)(5,5)\\psgrid\\end{pspicture}");
    final IGrid grid = getShapeAt(0);
    assertEquals(0d, grid.getOriginX(), 0.0001);
    assertEquals(0d, grid.getOriginY(), 0.0001);
    assertEquals(2d, grid.getGridMinX(), 0.0001);
    assertEquals(2d, grid.getGridMinY(), 0.0001);
    assertEquals(5d, grid.getGridMaxX(), 0.0001);
    assertEquals(5d, grid.getGridMaxY(), 0.0001);
    assertTrue(grid.isXLabelSouth());
    assertTrue(grid.isYLabelWest());
}
Also used : IGrid(net.sf.latexdraw.models.interfaces.shape.IGrid) Test(org.junit.Test)

Example 35 with IGrid

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

the class TestParsingPsgrid method testGridLabelsin.

@Test
public void testGridLabelsin() {
    parser("\\psgrid[gridlabels=20in](0,0)(0,0)(1,1)");
    final IGrid grid = getShapeAt(0);
    assertEquals((int) (20d * IShape.PPC / PSTricksConstants.INCH_VAL_CM), grid.getLabelsSize());
}
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