Search in sources :

Example 26 with IGrid

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

the class TestParsingPsgrid method testSubGridDots.

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

Example 27 with IGrid

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

the class TestParsingPsgrid method testGridLabelColor.

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

Example 28 with IGrid

use of net.sf.latexdraw.models.interfaces.shape.IGrid 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 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 29 with IGrid

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

the class TestParsingPsgrid method testGridLabels.

@Test
public void testGridLabels() {
    parser("\\psgrid[gridlabels=0.3](0,0)(0,0)(1,1)");
    final IGrid grid = getShapeAt(0);
    assertEquals((int) (0.3 * IShape.PPC), grid.getLabelsSize());
}
Also used : IGrid(net.sf.latexdraw.models.interfaces.shape.IGrid) Test(org.junit.Test)

Example 30 with IGrid

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

the class TestParsingPsgrid method testGridXUnit.

@Test
public void testGridXUnit() {
    parser("\\psgrid[xunit=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)

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