Search in sources :

Example 26 with IText

use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.

the class TestParsingRPut method testRPutCoordRotationNText.

@Test
public void testRPutCoordRotationNText() {
    parser("\\rput{N}(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(0d, txt.getRotationAngle(), 0.001);
}
Also used : IText(net.sf.latexdraw.models.interfaces.shape.IText) Test(org.junit.Test)

Example 27 with IText

use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.

the class TestIText method testCopy.

@Test
public void testCopy() {
    final IText s2 = ShapeFactory.INST.createText();
    shape.setText("foo");
    shape.setTextPosition(TextPosition.BOT_RIGHT);
    s2.copy(shape);
    assertEquals(shape.getText(), s2.getText());
    assertEquals(shape.getTextPosition(), s2.getTextPosition());
}
Also used : IText(net.sf.latexdraw.models.interfaces.shape.IText) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 28 with IText

use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.

the class TestIText method testConstructorsOK4.

@Test
public void testConstructorsOK4() {
    IText txt = ShapeFactory.INST.createText(ShapeFactory.INST.createPoint(0, Double.NEGATIVE_INFINITY), "aa");
    assertEquals(ShapeFactory.INST.createPoint(), txt.getPosition());
}
Also used : IText(net.sf.latexdraw.models.interfaces.shape.IText) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 29 with IText

use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.

the class TestIText method testDuplicate.

@Test
public void testDuplicate() {
    shape.setText("foo");
    shape.setTextPosition(TextPosition.BOT_RIGHT);
    final IText dup = shape.duplicate();
    assertEquals(shape.getText(), dup.getText());
    assertEquals(shape.getTextPosition(), dup.getTextPosition());
}
Also used : IText(net.sf.latexdraw.models.interfaces.shape.IText) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Example 30 with IText

use of net.sf.latexdraw.models.interfaces.shape.IText in project latexdraw by arnobl.

the class TestIText method testConstructorsOK2.

@Test
public void testConstructorsOK2() {
    IText txt = ShapeFactory.INST.createText(ShapeFactory.INST.createPoint(), "coucou");
    assertNotNull(txt.getText());
    assertFalse(txt.getText().isEmpty());
}
Also used : IText(net.sf.latexdraw.models.interfaces.shape.IText) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Aggregations

IText (net.sf.latexdraw.models.interfaces.shape.IText)72 Test (org.junit.Test)65 HelperTest (net.sf.latexdraw.HelperTest)6 Platform (javafx.application.Platform)3 URL (java.net.URL)2 Collections (java.util.Collections)2 ResourceBundle (java.util.ResourceBundle)2 Initializable (javafx.fxml.Initializable)2 Point2D (javafx.geometry.Point2D)2 KeyCode (javafx.scene.input.KeyCode)2 ShapeProperties (net.sf.latexdraw.commands.shape.ShapeProperties)2 ShapeFactory (net.sf.latexdraw.models.ShapeFactory)2 IPlot (net.sf.latexdraw.models.interfaces.shape.IPlot)2 TextAreaAutoSize (net.sf.latexdraw.ui.TextAreaAutoSize)2 ViewText (net.sf.latexdraw.view.jfx.ViewText)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Optional (java.util.Optional)1 ExecutionException (java.util.concurrent.ExecutionException)1 Future (java.util.concurrent.Future)1