Package net.sf.latexdraw.glib.models.interfaces.shape

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IText


  }


  @Test public void testShape3() {
    assertTrue(group.getShapeAt(3) instanceof IText);
    IText txt = (IText) group.getShapeAt(3);
    assertEquals(Color.BLACK, txt.getLineColour());
    assertEquals("\\emph{\\textbf{\\scriptsize{Correspondance de schémas}}}", txt.getText()); //$NON-NLS-1$
    assertEquals(210.585929, txt.getPosition().getX(), 0.00001);
    assertEquals(61.859375, txt.getPosition().getY(), 0.00001);
    assertEquals(TextPosition.BOT_LEFT, txt.getTextPosition());
  }
View Full Code Here


import org.junit.Test;

public class TestTextParsing extends TestPSTParser {
  @Test
  public void testBugParenthesis() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("{( )}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals("( )", txt.getText()); //$NON-NLS-1$
  }
View Full Code Here

    assertTrue(group.getShapeAt(0) instanceof IText);
    assertEquals("\\textit{coucou}", ((IText)group.getShapeAt(0)).getText()); //$NON-NLS-1$
  }

  @Test @Ignore public void testText_withDots() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("0..n").get().getShapeAt(0); //$NON-NLS-1$
    assertEquals("0..n", txt.getText()); //$NON-NLS-1$
  }
View Full Code Here

    IText txt = (IText)parser.parsePSTCode("0..n").get().getShapeAt(0); //$NON-NLS-1$
    assertEquals("0..n", txt.getText()); //$NON-NLS-1$
  }

  @Test @Ignore public void testText_withCommas() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("0,fi,n,,a , b").get().getShapeAt(0); //$NON-NLS-1$
    assertEquals("0,fi,n,,a , b", txt.getText()); //$NON-NLS-1$
  }
View Full Code Here

    assertTrue(((IText)gp.getShapeAt(2)).getText().contains("\\bf")); //$NON-NLS-1$
    assertTrue(((IText)gp.getShapeAt(2)).getText().contains("cc")); //$NON-NLS-1$
  }

  @Test public void testText_when2usefontsTheLatestIsUsed2() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\usefont{T1}{ptm}{m}{n}\n aa"+ //$NON-NLS-1$
            "\\usefont{T1}{ptm}{b}{it}\n bb").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertTrue(txt.getText().contains("usefont{T1}{ptm}{m}{n}")); //$NON-NLS-1$
    assertTrue(txt.getText().contains("usefont{T1}{ptm}{b}{it}")); //$NON-NLS-1$
    assertTrue(txt.getText().contains("aa")); //$NON-NLS-1$
    assertTrue(txt.getText().contains("bb")); //$NON-NLS-1$
  }
View Full Code Here

    assertTrue(txt.getText().contains("bb")); //$NON-NLS-1$
  }


  @Test public void testTextWithSpecialColour() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\definecolor{color0}{rgb}{0.5,0.5,0.5}\\color{color0}couocu").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertNotNull(txt);
    assertEquals(new Color(0.5f,0.5f,0.5f), txt.getLineColour());
  }
View Full Code Here

  @Test public void testBug722075_3() throws ParseException {
    // https://bugs.launchpad.net/latexdraw/+bug/722075
    IGroup group = parser.parsePSTCode("\\textcolor{blue}{xyz} foobar").get(); //$NON-NLS-1$
    assertEquals(2, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text = (IText)group.getShapeAt(0);
    assertEquals("foobar", text.getText()); //$NON-NLS-1$
    assertEquals(Color.BLACK, text.getLineColour());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  @Test public void testBug722075_2() throws ParseException {
    // https://bugs.launchpad.net/latexdraw/+bug/722075
    IGroup group = parser.parsePSTCode("\\textcolor{blue}{xyz}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text = (IText)group.getShapeAt(0);
    assertEquals("xyz", text.getText()); //$NON-NLS-1$
    assertEquals(Color.BLUE, text.getLineColour());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  @Test public void testBug722075_1() throws ParseException {
    // https://bugs.launchpad.net/latexdraw/+bug/722075
    IGroup group = parser.parsePSTCode("\\color{blue} xyz").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text = (IText)group.getShapeAt(0);
    assertEquals("xyz", text.getText()); //$NON-NLS-1$
    assertEquals(Color.BLUE, text.getLineColour());
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  @Test public void testBug911816() throws ParseException {
    // https://bugs.launchpad.net/latexdraw/+bug/911816
    IGroup group = parser.parsePSTCode("\\psframebox{$E=mc^2$}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text = (IText)group.getShapeAt(0);
    assertEquals("\\psframebox{$E=mc^2$}", text.getText()); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

TOP

Related Classes of net.sf.latexdraw.glib.models.interfaces.shape.IText

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.