Search in sources :

Example 11 with IEllipse

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

the class TestParsingPsellipse method testCoordinatesMm.

@Test
public void testCoordinatesMm() {
    parser("\\psellipse(0,0)(350mm,200mm)");
    IEllipse ell = getShapeAt(0);
    assertEquals(-35d * IShape.PPC, ell.getPosition().getX(), 0.001);
    assertEquals(-20d * IShape.PPC * -1d, ell.getPosition().getY(), 0.001);
    assertEquals(35d * IShape.PPC * 2d, ell.getWidth(), 0.001);
    assertEquals(20d * IShape.PPC * 2d, ell.getHeight(), 0.001);
}
Also used : IEllipse(net.sf.latexdraw.models.interfaces.shape.IEllipse) Test(org.junit.Test)

Example 12 with IEllipse

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

the class TestParsingPsellipse method testParse2WidthHeight0.

@Test
public void testParse2WidthHeight0() {
    parser("\\psellipse(0,0)(0,0)");
    IEllipse ell = getShapeAt(0);
    assertTrue(ell.getWidth() > 0);
    assertTrue(ell.getHeight() > 0);
}
Also used : IEllipse(net.sf.latexdraw.models.interfaces.shape.IEllipse) Test(org.junit.Test)

Example 13 with IEllipse

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

the class TestParsingPsellipse method testCoordinatesInch.

@Test
public void testCoordinatesInch() {
    parser("\\psellipse(0,0)(35in,20in)");
    IEllipse ell = getShapeAt(0);
    assertEquals(-35d * IShape.PPC / 2.54, ell.getPosition().getX(), 0.001);
    assertEquals(-20d * IShape.PPC / 2.54 * -1d, ell.getPosition().getY(), 0.001);
    assertEquals(35d * IShape.PPC / 2.54 * 2d, ell.getWidth(), 0.001);
    assertEquals(20d * IShape.PPC / 2.54 * 2d, ell.getHeight(), 0.001);
}
Also used : IEllipse(net.sf.latexdraw.models.interfaces.shape.IEllipse) Test(org.junit.Test)

Example 14 with IEllipse

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

the class TestParsingPsellipse method testParse2CoordinatesFloatSigns2.

@Test
public void testParse2CoordinatesFloatSigns2() {
    parser("\\psellipse(-+.5,+-5)(+++35.5,--50.5)");
    IEllipse ell = getShapeAt(0);
    assertEquals(-.5 * IShape.PPC - 35.5 * IShape.PPC, ell.getPosition().getX(), 0.001);
    assertEquals(-5d * -IShape.PPC + 50.5 * IShape.PPC, ell.getPosition().getY(), 0.001);
    assertEquals(35.5 * IShape.PPC * 2d, ell.getWidth(), 0.001);
    assertEquals(50.5 * IShape.PPC * 2d, ell.getHeight(), 0.001);
}
Also used : IEllipse(net.sf.latexdraw.models.interfaces.shape.IEllipse) Test(org.junit.Test)

Example 15 with IEllipse

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

the class TestParsingPsellipse method testParse2CoordinatesFloat2.

@Test
public void testParse2CoordinatesFloat2() {
    parser("\\psellipse(.5,.5)(35.5,50.5)");
    IEllipse ell = getShapeAt(0);
    assertEquals(.5 * IShape.PPC - 35.5 * IShape.PPC, ell.getPosition().getX(), 0.001);
    assertEquals(.5 * -IShape.PPC + 50.5 * IShape.PPC, ell.getPosition().getY(), 0.001);
    assertEquals(35.5 * IShape.PPC * 2d, ell.getWidth(), 0.001);
    assertEquals(50.5 * IShape.PPC * 2d, ell.getHeight(), 0.001);
}
Also used : IEllipse(net.sf.latexdraw.models.interfaces.shape.IEllipse) Test(org.junit.Test)

Aggregations

IEllipse (net.sf.latexdraw.models.interfaces.shape.IEllipse)21 Test (org.junit.Test)18 HelperTest (net.sf.latexdraw.HelperTest)3 ICircle (net.sf.latexdraw.models.interfaces.shape.ICircle)2 IRectangle (net.sf.latexdraw.models.interfaces.shape.IRectangle)2 Point2D (javafx.geometry.Point2D)1 IAxes (net.sf.latexdraw.models.interfaces.shape.IAxes)1 IBezierCurve (net.sf.latexdraw.models.interfaces.shape.IBezierCurve)1 ICircleArc (net.sf.latexdraw.models.interfaces.shape.ICircleArc)1 IDot (net.sf.latexdraw.models.interfaces.shape.IDot)1 IFreehand (net.sf.latexdraw.models.interfaces.shape.IFreehand)1 IGrid (net.sf.latexdraw.models.interfaces.shape.IGrid)1 IPlot (net.sf.latexdraw.models.interfaces.shape.IPlot)1 IPoint (net.sf.latexdraw.models.interfaces.shape.IPoint)1 IPolygon (net.sf.latexdraw.models.interfaces.shape.IPolygon)1 IPolyline (net.sf.latexdraw.models.interfaces.shape.IPolyline)1 IPositionShape (net.sf.latexdraw.models.interfaces.shape.IPositionShape)1 IRectangularShape (net.sf.latexdraw.models.interfaces.shape.IRectangularShape)1 IRhombus (net.sf.latexdraw.models.interfaces.shape.IRhombus)1 IShape (net.sf.latexdraw.models.interfaces.shape.IShape)1