Search in sources :

Example 6 with IPoint

use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.

the class TestIGroup method testSetAxesdistLabels.

@Test
public void testSetAxesdistLabels() {
    init4setAxes();
    IPoint pt = ShapeFactory.INST.createPoint(13d, 14d);
    shape.setDistLabels(pt);
    shape.getShapes().stream().filter(sh -> sh instanceof IAxes).map(sh -> (IAxes) sh).forEach(sh -> assertEquals(pt, sh.getDistLabels()));
}
Also used : ShapeData(net.sf.latexdraw.data.ShapeData) ShapeFactory(net.sf.latexdraw.models.ShapeFactory) RunWith(org.junit.runner.RunWith) BorderPos(net.sf.latexdraw.models.interfaces.shape.BorderPos) HelperTest(net.sf.latexdraw.HelperTest) IShape(net.sf.latexdraw.models.interfaces.shape.IShape) Matchers.closeTo(org.hamcrest.Matchers.closeTo) LineStyle(net.sf.latexdraw.models.interfaces.shape.LineStyle) DviPsColors(net.sf.latexdraw.view.latex.DviPsColors) Theories(org.junit.experimental.theories.Theories) TicksStyle(net.sf.latexdraw.models.interfaces.shape.TicksStyle) AxesStyle(net.sf.latexdraw.models.interfaces.shape.AxesStyle) IPoint(net.sf.latexdraw.models.interfaces.shape.IPoint) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Before(org.junit.Before) Theory(org.junit.experimental.theories.Theory) PSTricksConstants(net.sf.latexdraw.view.pst.PSTricksConstants) Matchers.empty(org.hamcrest.Matchers.empty) PlottingStyle(net.sf.latexdraw.models.interfaces.shape.PlottingStyle) Assert.assertNotNull(org.junit.Assert.assertNotNull) Assert.assertTrue(org.junit.Assert.assertTrue) IGroup(net.sf.latexdraw.models.interfaces.shape.IGroup) Test(org.junit.Test) DotStyle(net.sf.latexdraw.models.interfaces.shape.DotStyle) ArrowStyle(net.sf.latexdraw.models.interfaces.shape.ArrowStyle) Assert.assertNull(org.junit.Assert.assertNull) FillingStyle(net.sf.latexdraw.models.interfaces.shape.FillingStyle) Assert.assertFalse(org.junit.Assert.assertFalse) IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) IRectangle(net.sf.latexdraw.models.interfaces.shape.IRectangle) IDot(net.sf.latexdraw.models.interfaces.shape.IDot) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) IPoint(net.sf.latexdraw.models.interfaces.shape.IPoint) IAxes(net.sf.latexdraw.models.interfaces.shape.IAxes) HelperTest(net.sf.latexdraw.HelperTest) Test(org.junit.Test)

Example 7 with IPoint

use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.

the class TestIGroup method testGetAxesIncrementOk.

@Test
public void testGetAxesIncrementOk() {
    IPoint pt = ShapeFactory.INST.createPoint(10d, 11d);
    init4getAxes().setIncrement(pt);
    assertEquals(pt, shape.getIncrement());
}
Also used : IPoint(net.sf.latexdraw.models.interfaces.shape.IPoint) HelperTest(net.sf.latexdraw.HelperTest) Test(org.junit.Test)

Example 8 with IPoint

use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.

the class TestILine method testGetIntersectionSegmentVert.

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

Example 9 with IPoint

use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.

the class TestILine method testGetIntersectionSegmentHoriz.

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

Example 10 with IPoint

use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.

the class TestIPicture method testGetBottomLeftPoint.

@Test
public void testGetBottomLeftPoint() {
    final IPoint pt = shape.getBottomLeftPoint();
    assertEqualsDouble(shape.getPosition().getX(), pt.getX());
    assertEqualsDouble(shape.getPosition().getY() + shape.getImage().getHeight(), pt.getY());
}
Also used : IPoint(net.sf.latexdraw.models.interfaces.shape.IPoint) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Aggregations

IPoint (net.sf.latexdraw.models.interfaces.shape.IPoint)191 Test (org.junit.Test)45 HelperTest (net.sf.latexdraw.HelperTest)25 Theory (org.junit.experimental.theories.Theory)21 IShape (net.sf.latexdraw.models.interfaces.shape.IShape)15 SVGElement (net.sf.latexdraw.parsers.svg.SVGElement)11 SVGGElement (net.sf.latexdraw.parsers.svg.SVGGElement)11 ShapeFactory (net.sf.latexdraw.models.ShapeFactory)10 ILine (net.sf.latexdraw.models.interfaces.shape.ILine)10 IBezierCurve (net.sf.latexdraw.models.interfaces.shape.IBezierCurve)9 IGroup (net.sf.latexdraw.models.interfaces.shape.IGroup)9 ArrayList (java.util.ArrayList)8 MathUtils (net.sf.latexdraw.models.MathUtils)8 Collections (java.util.Collections)7 IPolygon (net.sf.latexdraw.models.interfaces.shape.IPolygon)7 Arrays (java.util.Arrays)6 Cursor (javafx.scene.Cursor)6 BorderPos (net.sf.latexdraw.models.interfaces.shape.BorderPos)6 IModifiablePointsShape (net.sf.latexdraw.models.interfaces.shape.IModifiablePointsShape)6 Inject (net.sf.latexdraw.util.Inject)6