Search in sources :

Example 16 with Text

use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.

the class TestParsingRPut method testRputPosition.

@Test
void testRputPosition() {
    parser("\\rput(1,2){coucou}");
    assertEquals(1, parsedShapes.size());
    final Text text = getShapeAt(0);
    assertEquals("coucou", text.getText());
    assertEquals(1d * Shape.PPC, text.getPosition().getX(), 0.001);
    assertEquals(-2d * Shape.PPC, text.getPosition().getY(), 0.001);
}
Also used : Text(net.sf.latexdraw.model.api.shape.Text) Test(org.junit.jupiter.api.Test)

Example 17 with Text

use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.

the class TestParsingRPut method testRPutCoordRotationLText.

@Test
void testRPutCoordRotationLText() {
    parser("\\rput{L}(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(-90d), txt.getRotationAngle(), 0.001);
}
Also used : Text(net.sf.latexdraw.model.api.shape.Text) Test(org.junit.jupiter.api.Test)

Example 18 with Text

use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.

the class TestParsingRPut method testRefPointCombotbr.

@Test
void testRefPointCombotbr() {
    parser("\\rput[t](0,0){\\rput[br](2,2){coucou}}");
    final Text txt = getShapeAt(0);
    assertEquals(TextPosition.BOT_RIGHT, txt.getTextPosition());
}
Also used : Text(net.sf.latexdraw.model.api.shape.Text) Test(org.junit.jupiter.api.Test)

Example 19 with Text

use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.

the class TestParsingRPut method testRPutCoordRotationRText.

@Test
void testRPutCoordRotationRText() {
    parser("\\rput{R}(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);
}
Also used : Text(net.sf.latexdraw.model.api.shape.Text) Test(org.junit.jupiter.api.Test)

Example 20 with Text

use of net.sf.latexdraw.model.api.shape.Text in project latexdraw by arnobl.

the class TestParsingPsframebox method testParsepsdblframebox.

@Test
public void testParsepsdblframebox() {
    parser("\\psdblframebox{\\psframe(0,1)}");
    assertEquals(1, parsedShapes.size());
    final Text text = getShapeAt(0);
    assertEquals("\\psdblframebox{\\psframe(0,1)}", text.getText());
}
Also used : Text(net.sf.latexdraw.model.api.shape.Text) Test(org.junit.jupiter.api.Test)

Aggregations

Text (net.sf.latexdraw.model.api.shape.Text)67 Test (org.junit.jupiter.api.Test)53 Test (org.junit.Test)10 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)10 HelperTest (net.sf.latexdraw.HelperTest)6 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)2 ExecutionException (java.util.concurrent.ExecutionException)1 Point2D (javafx.geometry.Point2D)1 Axes (net.sf.latexdraw.model.api.shape.Axes)1 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)1 Circle (net.sf.latexdraw.model.api.shape.Circle)1 CircleArc (net.sf.latexdraw.model.api.shape.CircleArc)1 Dot (net.sf.latexdraw.model.api.shape.Dot)1 Ellipse (net.sf.latexdraw.model.api.shape.Ellipse)1 Freehand (net.sf.latexdraw.model.api.shape.Freehand)1 Grid (net.sf.latexdraw.model.api.shape.Grid)1 Plot (net.sf.latexdraw.model.api.shape.Plot)1 Polygon (net.sf.latexdraw.model.api.shape.Polygon)1 Polyline (net.sf.latexdraw.model.api.shape.Polyline)1 Rhombus (net.sf.latexdraw.model.api.shape.Rhombus)1