Search in sources :

Example 1 with Dot

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

the class TestParsingPSdot method testCoordinatesMm.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testCoordinatesMm(final String cmd) {
    parser(cmd + "(350mm,200mm)");
    final Dot dot = getShapeAt(0);
    assertEquals(35d * Shape.PPC, dot.getPtAt(0).getX(), 0.0001);
    assertEquals(-20d * Shape.PPC, dot.getPtAt(0).getY(), 0.0001);
}
Also used : Dot(net.sf.latexdraw.model.api.shape.Dot) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 2 with Dot

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

the class TestParsingPSdot method testPssetunitxunit.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testPssetunitxunit(final String cmd) {
    parser("\\psset{unit=2,xunit=3}" + cmd + "(1,1)");
    final Dot dot = getShapeAt(0);
    assertEquals(2d * 3d * Shape.PPC, dot.getX(), 0.000001);
    assertEquals(-2d * Shape.PPC, dot.getY(), 0.000001);
}
Also used : Dot(net.sf.latexdraw.model.api.shape.Dot) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 3 with Dot

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

the class TestParsingPSdot method testParse1Coordinates.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testParse1Coordinates(final String cmd) {
    parser(cmd + "(5,10)");
    final Dot dot = getShapeAt(0);
    assertEquals(5d * Shape.PPC, dot.getPtAt(0).getX(), 0.0001);
    assertEquals(-10d * Shape.PPC, dot.getPtAt(0).getY(), 0.0001);
}
Also used : Dot(net.sf.latexdraw.model.api.shape.Dot) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 4 with Dot

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

the class TestParsingPSdot method testDotsizeNoNum.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testDotsizeNoNum(final String cmd) {
    parser(cmd + "[dotsize=1.5](1,1)");
    final Dot dot = getShapeAt(0);
    assertEquals(1.5 * Shape.PPC, dot.getDiametre(), 0.001);
}
Also used : Dot(net.sf.latexdraw.model.api.shape.Dot) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 5 with Dot

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

the class TestParsingPSdot method testPssetunityunit.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testPssetunityunit(final String cmd) {
    parser("\\psset{unit=2,yunit=3}" + cmd + "(1,1)");
    final Dot dot = getShapeAt(0);
    assertEquals(2d * Shape.PPC, dot.getX(), 0.000001);
    assertEquals(-2d * 3d * Shape.PPC, dot.getY(), 0.000001);
}
Also used : Dot(net.sf.latexdraw.model.api.shape.Dot) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

Dot (net.sf.latexdraw.model.api.shape.Dot)36 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)27 MethodSource (org.junit.jupiter.params.provider.MethodSource)22 Test (org.junit.Test)8 HelperTest (net.sf.latexdraw.HelperTest)5 Test (org.junit.jupiter.api.Test)5 Color (javafx.scene.paint.Color)2 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)2 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 Ellipse (net.sf.latexdraw.model.api.shape.Ellipse)1 Freehand (net.sf.latexdraw.model.api.shape.Freehand)1 Grid (net.sf.latexdraw.model.api.shape.Grid)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 Rhombus (net.sf.latexdraw.model.api.shape.Rhombus)1