Search in sources :

Example 31 with Dot

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

the class TestParsingPSdot method testDotScale1num.

@ParameterizedTest
@MethodSource(value = "cmds")
public void testDotScale1num(final String cmd) {
    parser(cmd + "(1,1)" + cmd + "[dotscale=2](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)

Example 32 with Dot

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

the class TestParsingPSdot method testNoDotStyle.

@Test
public void testNoDotStyle() {
    parser("\\psdot");
    final Dot dot = getShapeAt(0);
    assertEquals(DotStyle.DOT, dot.getDotStyle());
}
Also used : Dot(net.sf.latexdraw.model.api.shape.Dot) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 33 with Dot

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

the class TestGroup method testGetDotStyleOK.

@Test
public void testGetDotStyleOK() {
    final Dot d1 = ShapeFactory.INST.createDot(ShapeFactory.INST.createPoint());
    final Dot d2 = ShapeFactory.INST.createDot(ShapeFactory.INST.createPoint());
    d1.setDotStyle(DotStyle.BAR);
    shape.getShapes().add(sh1);
    shape.getShapes().add(d1);
    shape.getShapes().add(d2);
    assertEquals(DotStyle.BAR, shape.getDotStyle());
}
Also used : Dot(net.sf.latexdraw.model.api.shape.Dot) HelperTest(net.sf.latexdraw.HelperTest) Test(org.junit.Test)

Example 34 with Dot

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

the class TestGroup method testSetDotStyle.

@Test
public void testSetDotStyle() {
    final Dot d1 = ShapeFactory.INST.createDot(ShapeFactory.INST.createPoint());
    final Dot d2 = ShapeFactory.INST.createDot(ShapeFactory.INST.createPoint());
    shape.getShapes().add(sh1);
    shape.getShapes().add(d1);
    shape.getShapes().add(d2);
    shape.setDotStyle(DotStyle.DIAMOND);
    assertEquals(DotStyle.DIAMOND, d1.getDotStyle());
    assertEquals(DotStyle.DIAMOND, d2.getDotStyle());
}
Also used : Dot(net.sf.latexdraw.model.api.shape.Dot) HelperTest(net.sf.latexdraw.HelperTest) Test(org.junit.Test)

Example 35 with Dot

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

the class TestDot method testConstructor1.

@Test
public void testConstructor1() {
    final Dot dot1 = ShapeFactory.INST.createDot(ShapeFactory.INST.createPoint());
    assertTrue(dot1.getDiametre() > 0);
    assertNotNull(dot1.getDotStyle());
    assertNotNull(dot1.getPosition());
    assertEqualsDouble(0., dot1.getPosition().getX());
    assertEqualsDouble(0., dot1.getPosition().getY());
}
Also used : Dot(net.sf.latexdraw.model.api.shape.Dot) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

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