use of net.sf.latexdraw.model.api.shape.Point in project latexdraw by arnobl.
the class TestText method testMirrorVertical.
@Test
public void testMirrorVertical() {
final Point pos = ShapeFactory.INST.createPoint(shape.getPosition());
shape.mirrorVertical(shape.getGravityCentre().getY());
assertEquals(pos, shape.getPosition());
}
use of net.sf.latexdraw.model.api.shape.Point in project latexdraw by arnobl.
the class TestText method testMirrorHorizontal.
@Test
public void testMirrorHorizontal() {
final Point pos = ShapeFactory.INST.createPoint(shape.getPosition());
shape.mirrorHorizontal(shape.getGravityCentre().getX());
assertEquals(pos, shape.getPosition());
}
use of net.sf.latexdraw.model.api.shape.Point in project latexdraw by arnobl.
the class TestPlot 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);
final Point pt = shape.getBottomLeftPoint();
assertTrue(MathUtils.INST.isValidPt(pt));
assertEquals(10.0 + 10.0 * Shape.PPC, pt.getX(), 0.0001);
assertEquals(20.0 - 10.0 * Shape.PPC, pt.getY(), 0.0001);
}
use of net.sf.latexdraw.model.api.shape.Point in project latexdraw by arnobl.
the class TestPlot 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);
final Point pt = shape.getTopRightPoint();
assertTrue(MathUtils.INST.isValidPt(pt));
assertEquals(10.0 + 20.0 * Shape.PPC, pt.getX(), 0.0001);
assertEquals(20.0 - 20.0 * Shape.PPC, pt.getY(), 0.0001);
}
use of net.sf.latexdraw.model.api.shape.Point in project latexdraw by arnobl.
the class TestPlot method testGetTopLeftPoint.
@Test
public void testGetTopLeftPoint() {
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);
final Point pt = shape.getTopLeftPoint();
assertTrue(MathUtils.INST.isValidPt(pt));
assertEquals(10.0 + 10.0 * Shape.PPC, pt.getX(), 0.0001);
assertEquals(20.0 - 20.0 * Shape.PPC, pt.getY(), 0.0001);
}
Aggregations