Search in sources :

Example 66 with IText

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

the class TestTextParsing method testBug7220751.

@Test
public void testBug7220751() {
    // https://bugs.launchpad.net/latexdraw/+bug/722075
    parser("\\color{blue} xyz");
    assertEquals(1, listener.getShapes().size());
    IText text = getShapeAt(0);
    assertEquals("xyz", text.getText());
    assertEquals(DviPsColors.BLUE, text.getLineColour());
}
Also used : IText(net.sf.latexdraw.models.interfaces.shape.IText) Test(org.junit.Test)

Example 67 with IText

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

the class TestTextParsing method testBug7220752.

@Test
public void testBug7220752() {
    // https://bugs.launchpad.net/latexdraw/+bug/722075
    parser("\\textcolor{blue}{xyz}");
    assertEquals(1, listener.getShapes().size());
    IText text = getShapeAt(0);
    assertEquals("xyz", text.getText());
    assertEquals(DviPsColors.BLUE, text.getLineColour());
}
Also used : IText(net.sf.latexdraw.models.interfaces.shape.IText) Test(org.junit.Test)

Example 68 with IText

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

the class TestTextParsing method testParseTexttiny.

@Test
public void testParseTexttiny() {
    parser("\\rput(1,2){\\tiny coucou}");
    assertEquals(1, listener.getShapes().size());
    IText text = getShapeAt(0);
    assertEquals("\\tiny coucou", text.getText());
}
Also used : IText(net.sf.latexdraw.models.interfaces.shape.IText) Test(org.junit.Test)

Example 69 with IText

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

the class TestTextParsing method testTextWithSpecialColour.

@Test
public void testTextWithSpecialColour() {
    parser("\\definecolor{color0}{rgb}{0.5,0.5,0.5}\\color{color0}foo");
    final IText txt = getShapeAt(0);
    assertNotNull(txt);
    assertEquals(ShapeFactory.INST.createColor(0.5, 0.5, 0.5), txt.getLineColour());
}
Also used : IText(net.sf.latexdraw.models.interfaces.shape.IText) Test(org.junit.Test)

Example 70 with IText

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

the class TestTextParsing method testBug911816.

@Test
public void testBug911816() {
    // https://bugs.launchpad.net/latexdraw/+bug/911816
    parser("\\psframebox{$E=mc^2$}");
    assertEquals(1, listener.getShapes().size());
    IText text = getShapeAt(0);
    assertEquals("\\psframebox{$E=mc^2$}", text.getText());
}
Also used : IText(net.sf.latexdraw.models.interfaces.shape.IText) Test(org.junit.Test)

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