Search in sources :

Example 6 with Grid

use of net.sf.latexdraw.model.api.shape.Grid 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 Grid grid = getShapeAt(0);
    assertEquals(DviPsColors.GREEN, grid.getGridLabelsColour());
}
Also used : Grid(net.sf.latexdraw.model.api.shape.Grid) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 7 with Grid

use of net.sf.latexdraw.model.api.shape.Grid in project latexdraw by arnobl.

the class TestParsingPsgrid method testParse3Coord.

@Test
public void testParse3Coord() {
    parser("\\psgrid(0,-1)(1,2)(3,4)");
    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);
    assertTrue(grid.isXLabelSouth());
    assertTrue(grid.isYLabelWest());
}
Also used : Grid(net.sf.latexdraw.model.api.shape.Grid) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 8 with Grid

use of net.sf.latexdraw.model.api.shape.Grid 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 Grid grid = getShapeAt(0);
    assertEquals(20d * Shape.PPC / PSTricksConstants.INCH_VAL_CM, grid.getSubGridWidth(), 0.00001);
}
Also used : Grid(net.sf.latexdraw.model.api.shape.Grid) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 9 with Grid

use of net.sf.latexdraw.model.api.shape.Grid 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 Grid grid = getShapeAt(0);
    assertEquals(.3 * Shape.PPC / PSTricksConstants.INCH_VAL_CM, grid.getGridWidth(), 0.001);
}
Also used : Grid(net.sf.latexdraw.model.api.shape.Grid) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 10 with Grid

use of net.sf.latexdraw.model.api.shape.Grid 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 Grid grid = getShapeAt(0);
    assertEquals((int) (20d * Shape.PPC / PSTricksConstants.INCH_VAL_CM), grid.getLabelsSize());
}
Also used : Grid(net.sf.latexdraw.model.api.shape.Grid) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

Grid (net.sf.latexdraw.model.api.shape.Grid)41 Test (org.junit.jupiter.api.Test)28 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)26 Test (org.junit.Test)8 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)5 Color (javafx.scene.paint.Color)4 HelperTest (net.sf.latexdraw.HelperTest)3 StandardGrid (net.sf.latexdraw.model.api.shape.StandardGrid)3 ValueSource (org.junit.jupiter.params.provider.ValueSource)3 Point2D (javafx.geometry.Point2D)1 Axes (net.sf.latexdraw.model.api.shape.Axes)1 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)1 Circle (net.sf.latexdraw.model.api.shape.Circle)1 CircleArc (net.sf.latexdraw.model.api.shape.CircleArc)1 Dot (net.sf.latexdraw.model.api.shape.Dot)1 Ellipse (net.sf.latexdraw.model.api.shape.Ellipse)1 Freehand (net.sf.latexdraw.model.api.shape.Freehand)1 Plot (net.sf.latexdraw.model.api.shape.Plot)1 Polygon (net.sf.latexdraw.model.api.shape.Polygon)1 Polyline (net.sf.latexdraw.model.api.shape.Polyline)1