Search in sources :

Example 51 with Point

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

the class TestGroup method testGetAxesDistLabelsOk.

@Test
public void testGetAxesDistLabelsOk() {
    final Point pt = ShapeFactory.INST.createPoint(10d, 11d);
    init4getAxes().setDistLabels(pt);
    assertEquals(pt, shape.getDistLabels());
}
Also used : Point(net.sf.latexdraw.model.api.shape.Point) HelperTest(net.sf.latexdraw.HelperTest) Test(org.junit.Test)

Example 52 with Point

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

the class TestLine method testGetIntersectionSegment.

@Test
public void testGetIntersectionSegment() {
    final Line line2 = ShapeFactory.INST.createLine(0, 0, 1, 0);
    line.setLine(1, 1, 0, -1);
    line.updateAandB();
    final Point pt = line.getIntersectionSegment(line2);
    assertNotNull(pt);
    assertEqualsDouble(0.5, pt.getX());
    assertEqualsDouble(0d, pt.getY());
}
Also used : Line(net.sf.latexdraw.model.api.shape.Line) Point(net.sf.latexdraw.model.api.shape.Point) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 53 with Point

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

the class TestLine method testGetIntersectionVert.

@Test
public void testGetIntersectionVert() {
    final Line line2 = ShapeFactory.INST.createLine(0, 0, 1, 0);
    line.setLine(0, -10, 0, 10);
    line.updateAandB();
    final Point pt = line.getIntersection(line2);
    assertNotNull(pt);
    assertEqualsDouble(0d, pt.getX());
    assertEqualsDouble(0d, pt.getY());
}
Also used : Line(net.sf.latexdraw.model.api.shape.Line) Point(net.sf.latexdraw.model.api.shape.Point) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 54 with Point

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

the class TestLine method testGetIntersectionSegmentVert.

@Test
public void testGetIntersectionSegmentVert() {
    line.setLine(0, -10, 0, 10);
    line.updateAandB();
    final Point pt = line.getIntersectionSegment(ShapeFactory.INST.createLine(0, 0, 1, 0));
    assertNotNull(pt);
    assertEqualsDouble(0d, pt.getX());
    assertEqualsDouble(0d, pt.getY());
}
Also used : Point(net.sf.latexdraw.model.api.shape.Point) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 55 with Point

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

the class TestLine method testGetIntersectionHoriz.

@Test
public void testGetIntersectionHoriz() {
    final Line line2 = ShapeFactory.INST.createLine(0, 0, 1, 0);
    line.setLine(0, -10, 0, 10);
    line.updateAandB();
    final Point pt = line2.getIntersection(line);
    assertNotNull(pt);
    assertEqualsDouble(0d, pt.getX());
    assertEqualsDouble(0d, pt.getY());
}
Also used : Line(net.sf.latexdraw.model.api.shape.Line) Point(net.sf.latexdraw.model.api.shape.Point) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Aggregations

Point (net.sf.latexdraw.model.api.shape.Point)139 Test (org.junit.Test)52 HelperTest (net.sf.latexdraw.HelperTest)27 Theory (org.junit.experimental.theories.Theory)23 NotNull (org.jetbrains.annotations.NotNull)19 Line (net.sf.latexdraw.model.api.shape.Line)10 Shape (net.sf.latexdraw.model.api.shape.Shape)9 SVGElement (net.sf.latexdraw.parser.svg.SVGElement)9 SVGGElement (net.sf.latexdraw.parser.svg.SVGGElement)9 Test (org.junit.jupiter.api.Test)8 ArrayList (java.util.ArrayList)7 Polyline (net.sf.latexdraw.model.api.shape.Polyline)5 Color (javafx.scene.paint.Color)4 MathUtils (net.sf.latexdraw.model.MathUtils)4 ShapeFactory (net.sf.latexdraw.model.ShapeFactory)4 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)4 Canvas (net.sf.latexdraw.view.jfx.Canvas)4 Point2D (java.awt.geom.Point2D)3 List (java.util.List)3 ShapeData (net.sf.latexdraw.data.ShapeData)3