use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestText method testConstructorsOK3.
@Test
public void testConstructorsOK3() {
final Text txt = ShapeFactory.INST.createText(ShapeFactory.INST.createPoint(), "");
assertNotNull(txt.getText());
assertFalse(txt.getText().isEmpty());
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestText method testDuplicate.
@Test
public void testDuplicate() {
shape.setText("foo");
shape.setTextPosition(TextPosition.BOT_RIGHT);
final Text dup = shape.duplicate();
assertEquals(shape.getText(), dup.getText());
assertEquals(shape.getTextPosition(), dup.getTextPosition());
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingPSRotate method testPSRotation0Angle.
@Test
public void testPSRotation0Angle() {
parser("\\psrotate(1,2){0}{coucou}");
assertEquals(1, parsedShapes.size());
final Text text = getShapeAt(0);
assertEquals("coucou", text.getText());
assertEquals(0d, text.getRotationAngle(), 0.001);
assertEquals(0d, text.getPosition().getX(), 0.001);
assertEquals(0d, text.getPosition().getY(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testRPutCoordRotationDText.
@Test
void testRPutCoordRotationDText() {
parser("\\rput{D}(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(-180d), txt.getRotationAngle(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.
the class TestParsingRPut method testRefPointb.
@Test
void testRefPointb() {
parser("\\rput[b](10,20){coucou}");
final Text txt = getShapeAt(0);
assertEquals(TextPosition.BOT, txt.getTextPosition());
assertEquals(10d * Shape.PPC, txt.getPosition().getX(), 0.001);
assertEquals(-20d * Shape.PPC, txt.getPosition().getY(), 0.001);
}
Aggregations