use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordStarIntText.
@Test
public void testRPutCoordStarIntText() {
parser("\\rput{*90}(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);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRputPosition.
@Test
public void testRputPosition() {
parser("\\rput(1,2){coucou}");
assertEquals(1, listener.getShapes().size());
IText text = getShapeAt(0);
assertEquals("coucou", text.getText());
assertEquals(1d * IShape.PPC, text.getPosition().getX(), 0.001);
assertEquals(-2d * IShape.PPC, text.getPosition().getY(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordRotationRText.
@Test
public void testRPutCoordRotationRText() {
parser("\\rput{R}(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(-270d), txt.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordStarFloatText.
@Test
public void testRPutCoordStarFloatText() {
parser("\\rput{*-90.8929}(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(90.8929), txt.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordRotationEText.
@Test
public void testRPutCoordRotationEText() {
parser("\\rput{E}(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(-270d), txt.getRotationAngle(), 0.001);
}
Aggregations