use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordRotationSText.
@Test
public void testRPutCoordRotationSText() {
parser("\\rput{S}(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(-180d), txt.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRefPointtl.
@Test
public void testRefPointtl() {
parser("\\rput[tl](10,20){coucou}");
final IText txt = getShapeAt(0);
assertEquals(TextPosition.TOP_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 testRPutCoordRotationUText.
@Test
public void testRPutCoordRotationUText() {
parser("\\rput{U}(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(0d, txt.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRefPointB.
@Test
public void testRefPointB() {
parser("\\rput[B](10,20){coucou}");
final IText txt = getShapeAt(0);
assertEquals(TextPosition.BASE, 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 testRefPointBl.
@Test
public void testRefPointBl() {
parser("\\rput[Bl](10,20){coucou}");
final IText txt = getShapeAt(0);
assertEquals(TextPosition.BASE_LEFT, txt.getTextPosition());
assertEquals(10d * IShape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-20d * IShape.PPC, txt.getPosition().getY(), 0.001);
}
Aggregations