use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRefPointbl.
@Test
public void testRefPointbl() {
parser("\\rput[bl](10,20){coucou}");
final IText txt = getShapeAt(0);
assertEquals(TextPosition.BOT_LEFT, txt.getTextPosition());
assertEquals(10d * IShape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-20d * IShape.PPC, txt.getPosition().getY(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordRotationDoubleText.
@Test
public void testRPutCoordRotationDoubleText() {
parser("\\rput{-10.0}(1,2){coucou}");
final IText txt = getShapeAt(0);
assertEquals("coucou", txt.getText());
assertEquals(IShape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-2d * IShape.PPC, txt.getPosition().getY(), 0.001);
assertEquals(Math.toRadians(10d), txt.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRefPointtr.
@Test
public void testRefPointtr() {
parser("\\rput[tr](10,20){coucou}");
final IText txt = getShapeAt(0);
assertEquals(TextPosition.TOP_RIGHT, txt.getTextPosition());
assertEquals(10d * IShape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-20d * IShape.PPC, txt.getPosition().getY(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testTripleRputRotationWithStar.
@Test
public void testTripleRputRotationWithStar() {
parser("\\rput{10}(0,0){\\rput{*30}(0,0){\\rput{50}(0,0){coucou}}}");
final IText txt = getShapeAt(0);
assertEquals(-80d, Math.toDegrees(txt.getRotationAngle()), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordRotationWText.
@Test
public void testRPutCoordRotationWText() {
parser("\\rput{W}(1,2){coucou}");
final IText txt = getShapeAt(0);
assertEquals("coucou", txt.getText());
assertEquals(IShape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-2d * IShape.PPC, txt.getPosition().getY(), 0.001);
assertEquals(Math.toRadians(-90d), txt.getRotationAngle(), 0.001);
}
Aggregations