Search in sources :

Example 21 with Dot

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

the class TestParsingPSdot method testCoordinatesFloat2.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testCoordinatesFloat2(final String cmd) {
    parser(cmd + "(35.5,50.5)");
    final Dot dot = getShapeAt(0);
    assertEquals(35.5 * Shape.PPC, dot.getPtAt(0).getX(), 0.0001);
    assertEquals(-50.5 * 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 22 with Dot

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

the class TestParsingPSdot method testCoordinatesPt.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testCoordinatesPt(final String cmd) {
    parser(cmd + "(35pt,20pt)");
    final Dot dot = getShapeAt(0);
    assertEquals(35d * Shape.PPC / PSTricksConstants.CM_VAL_PT, dot.getPtAt(0).getX(), 0.0001);
    assertEquals(-20d * Shape.PPC / PSTricksConstants.CM_VAL_PT, 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 23 with Dot

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

the class TestParsingPSdot method testPssetdotunitdot.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testPssetdotunitdot(final String cmd) {
    parser("\\psdot(1,1)\\psset{unit=2}" + cmd + "(1,1)");
    Dot dot = getShapeAt(1);
    assertEquals(2d * Shape.PPC, dot.getX(), 0.000001);
    assertEquals(-2d * Shape.PPC, dot.getY(), 0.000001);
    dot = getShapeAt(0);
    assertEquals(Shape.PPC, dot.getX(), 0.000001);
    assertEquals(-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 24 with Dot

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

the class TestParsingPSdot method testDotsize.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testDotsize(final String cmd) {
    parser(cmd + "[dotsize=1.5 cm 4](1,1)");
    final Dot dot = getShapeAt(0);
    assertEquals(1.5 * Shape.PPC + 4d * PSTricksConstants.DEFAULT_LINE_WIDTH * 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 25 with Dot

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

the class TestParsingPSdot method testDotScale2num.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testDotScale2num(final String cmd) {
    parser(cmd + "(1,1)" + cmd + "[dotscale=2 3](1,1)");
    final Dot dot1 = getShapeAt(0);
    final Dot dot2 = getShapeAt(1);
    assertEquals(dot1.getDiametre() * 2d, dot2.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)

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