use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testDoubleRputPosition.
@Test
void testDoubleRputPosition() {
parser("\\rput(1,2){\\rput(2,3){coucou}}");
final Text txt = getShapeAt(0);
assertEquals("coucou", txt.getText());
assertEquals(3d * Shape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-5d * Shape.PPC, txt.getPosition().getY(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testRefPointbr.
@Test
void testRefPointbr() {
parser("\\rput[br](10,20){coucou}");
final Text txt = getShapeAt(0);
assertEquals(TextPosition.BOT_RIGHT, txt.getTextPosition());
assertEquals(10d * Shape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-20d * Shape.PPC, txt.getPosition().getY(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordRotationEText.
@Test
void testRPutCoordRotationEText() {
parser("\\rput{E}(1,2){coucou}");
final Text txt = getShapeAt(0);
assertEquals("coucou", txt.getText());
assertEquals(Shape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-2d * Shape.PPC, txt.getPosition().getY(), 0.001);
assertEquals(Math.toRadians(-270d), txt.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordText.
@Test
void testRPutCoordText() {
parser("\\rput(1,2){coucou}");
final Text txt = getShapeAt(0);
assertEquals("coucou", txt.getText());
assertEquals(Shape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-2d * Shape.PPC, txt.getPosition().getY(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testRefPointt.
@Test
void testRefPointt() {
parser("\\rput[t](10,20){coucou}");
final Text txt = getShapeAt(0);
assertEquals(TextPosition.TOP, txt.getTextPosition());
assertEquals(10d * Shape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-20d * Shape.PPC, txt.getPosition().getY(), 0.001);
}
Aggregations