use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRefPointt.
@Test
public void testRefPointt() {
parser("\\rput[t](10,20){coucou}");
final IText txt = getShapeAt(0);
assertEquals(TextPosition.TOP, 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 testRPutCoordRotationDText.
@Test
public void testRPutCoordRotationDText() {
parser("\\rput{D}(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 testRPutCoordText.
@Test
public void testRPutCoordText() {
parser("\\rput(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);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRefPointbr.
@Test
public void testRefPointbr() {
parser("\\rput[br](10,20){coucou}");
final IText txt = getShapeAt(0);
assertEquals(TextPosition.BOT_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 testRefPointNone.
@Test
public void testRefPointNone() {
parser("\\rput(10,20){coucou}");
final IText txt = getShapeAt(0);
assertEquals(TextPosition.CENTER, txt.getTextPosition());
}
Aggregations