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

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


  @Test public void testParseText_footnote() throws ParseException {
    IGroup group = parser.parsePSTCode("\\rput(1,2){\\footnotesize coucou}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text =  (IText)group.getShapeAt(0);
    assertEquals("\\footnotesize coucou", text.getText()); //$NON-NLS-1$
    assertEquals(1.*IShape.PPC, text.getPosition().getX(), 0.001);
    assertEquals(-2.*IShape.PPC, text.getPosition().getY(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here


  @Test public void testParseText_tiny() throws ParseException {
    IGroup group = parser.parsePSTCode("\\rput(1,2){\\tiny coucou}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text =  (IText)group.getShapeAt(0);
    assertEquals("\\tiny coucou", text.getText()); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  @Test public void testParseText_scriptsize() throws ParseException {
    IGroup group = parser.parsePSTCode("\\rput(1,2){\\scriptsize coucou}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text =  (IText)group.getShapeAt(0);
    assertEquals("\\scriptsize coucou", text.getText()); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  @Test public void testParseText_footnotesize() throws ParseException {
    IGroup group = parser.parsePSTCode("\\rput(1,2){\\footnotesize coucou}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text =  (IText)group.getShapeAt(0);
    assertEquals("\\footnotesize coucou", text.getText()); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  @Test public void testParseText_small() throws ParseException {
    IGroup group = parser.parsePSTCode("\\rput(1,2){\\small coucou}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text =  (IText)group.getShapeAt(0);
    assertEquals("\\small coucou", text.getText()); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  @Test public void testParseText_normalsize() throws ParseException {
    IGroup group = parser.parsePSTCode("\\rput(1,2){\\normalsize coucou}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text =  (IText)group.getShapeAt(0);
    assertEquals("\\normalsize coucou", text.getText()); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  @Test public void testParseText_large() throws ParseException {
    IGroup group = parser.parsePSTCode("\\rput(1,2){\\large coucou}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text =  (IText)group.getShapeAt(0);
    assertEquals("\\large coucou", text.getText()); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void testConstructors() {
    IText txt = ShapeFactory.createText();

    assertNotNull(txt.getText());
    assertTrue(txt.getText().length()>0);
    txt = ShapeFactory.createText();

    assertNotNull(txt.getText());
    assertTrue(txt.getText().length()>0);
    txt = ShapeFactory.createText(ShapeFactory.createPoint(), "coucou"); //$NON-NLS-1$

    assertNotNull(txt.getText());
    assertTrue(txt.getText().length()>0);
    txt = ShapeFactory.createText(ShapeFactory.createPoint(), ""); //$NON-NLS-1$

    assertNotNull(txt.getText());
    assertTrue(txt.getText().length()>0);
    txt = ShapeFactory.createText(ShapeFactory.createPoint(), null);

    assertNotNull(txt.getText());
    assertTrue(txt.getText().length()>0);

    txt = ShapeFactory.createText(null, "aa"); //$NON-NLS-1$
    assertEquals(ShapeFactory.createPoint(), txt.getPosition());
    txt = ShapeFactory.createText(ShapeFactory.createPoint(0, Double.NEGATIVE_INFINITY), "aa"); //$NON-NLS-1$
    assertEquals(ShapeFactory.createPoint(), txt.getPosition());
  }
View Full Code Here

  @Test public void testParseText_Large() throws ParseException {
    IGroup group = parser.parsePSTCode("\\rput(1,2){\\Large coucou}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text =  (IText)group.getShapeAt(0);
    assertEquals("\\Large coucou", text.getText()); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  @Test public void testParseText_huge() throws ParseException {
    IGroup group = parser.parsePSTCode("\\rput(1,2){\\huge coucou}").get(); //$NON-NLS-1$
    assertEquals(1, group.size());
    assertTrue(group.getShapeAt(0) instanceof IText);
    IText text =  (IText)group.getShapeAt(0);
    assertEquals("\\huge coucou", 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.