use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.
the class TestIPicture method testGetTopRightPoint.
@Test
public void testGetTopRightPoint() {
final IPoint pt = shape.getTopRightPoint();
assertEqualsDouble(shape.getPosition().getX() + shape.getImage().getWidth(), pt.getX());
assertEqualsDouble(shape.getPosition().getY(), pt.getY());
}
use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.
the class TestIPlot method testGetBottomRightPoint.
@Test
public void testGetBottomRightPoint() {
shape.setPlotEquation("x");
shape.setPlotMaxX(20.0);
shape.setPlotMinX(10.0);
shape.setXScale(1.0);
shape.setYScale(1.0);
shape.setNbPlottedPoints(30);
shape.setPosition(10.0, 20.0);
IPoint pt = shape.getBottomRightPoint();
assertTrue(MathUtils.INST.isValidPt(pt));
assertEquals(10.0 + 20.0 * IShape.PPC, pt.getX(), 0.0001);
assertEquals(20.0 - 10.0 * IShape.PPC, pt.getY(), 0.0001);
}
use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.
the class TestIPlot method testGetTopRightPoint.
@Test
public void testGetTopRightPoint() {
shape.setPlotEquation("x");
shape.setPlotMaxX(20.0);
shape.setPlotMinX(10.0);
shape.setXScale(1.0);
shape.setYScale(1.0);
shape.setNbPlottedPoints(30);
shape.setPosition(10.0, 20.0);
IPoint pt = shape.getTopRightPoint();
assertTrue(MathUtils.INST.isValidPt(pt));
assertEquals(10.0 + 20.0 * IShape.PPC, pt.getX(), 0.0001);
assertEquals(20.0 - 20.0 * IShape.PPC, pt.getY(), 0.0001);
}
use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.
the class TestIPlot method testGetBottomLeftPoint.
@Test
public void testGetBottomLeftPoint() {
shape.setPlotEquation("x");
shape.setPlotMaxX(20.0);
shape.setPlotMinX(10.0);
shape.setXScale(1.0);
shape.setYScale(1.0);
shape.setNbPlottedPoints(30);
shape.setPosition(10.0, 20.0);
IPoint pt = shape.getBottomLeftPoint();
assertTrue(MathUtils.INST.isValidPt(pt));
assertEquals(10.0 + 10.0 * IShape.PPC, pt.getX(), 0.0001);
assertEquals(20.0 - 10.0 * IShape.PPC, pt.getY(), 0.0001);
}
use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.
the class TestIPoint method testLPointOK.
@Theory
public void testLPointOK(@DoubleData final double x, @DoubleData final double y) {
final IPoint point = ShapeFactory.INST.createPoint(x, y);
assertEqualsDouble(x, point.getX());
assertEqualsDouble(y, point.getY());
}
Aggregations