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

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


  @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


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

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

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

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

  }


  @Test public void testShape10() {
    assertTrue(group.getShapeAt(10) instanceof IText);
    final IText txt = (IText) group.getShapeAt(10);
    assertEquals("\\normalsize{Dragging}", txt.getText()); //$NON-NLS-1$
    assertEquals(579., txt.getPosition().getX(),0.0001);
    assertEquals(258., txt.getPosition().getY(),0.0001);
    assertEquals(TextPosition.BOT_LEFT, txt.getTextPosition());
    assertEquals(Color.BLACK, txt.getLineColour());
  }
View Full Code Here

    final IGroup gp = (IGroup) group.getShapeAt(0);
    assertEquals(2, gp.size());
    final ICircle circle = (ICircle) gp.getShapeAt(0);
    final IGroup gp2 = (IGroup) gp.getShapeAt(1);
    assertEquals(2, gp2.size());
    final IText txt1 = (IText) gp2.getShapeAt(0);
    final IText txt2 = (IText) gp2.getShapeAt(1);

    assertEquals(Color.BLACK, circle.getLineColour());
    assertTrue(circle.isFilled());
    assertEquals(Color.WHITE, circle.getFillingCol());
    assertEquals(60., circle.getWidth(),0.0001);
    assertEquals(580., circle.getPosition().getX(),0.0001);
    assertEquals(180., circle.getPosition().getY(),0.0001);
    assertEquals(2., circle.getThickness(),0.0001);
    assertEquals(LineStyle.SOLID, circle.getLineStyle());
    assertEquals(BorderPos.INTO, circle.getBordersPosition());
    assertEquals(0., circle.getRotationAngle(),0.0001);
    assertFalse(circle.hasShadow());
    assertFalse(circle.hasDbleBord());
    assertEquals("\\normalsize{State}", txt1.getText()); //$NON-NLS-1$
    assertEquals("\\normalsize{2}", txt2.getText()); //$NON-NLS-1$
    assertEquals(Color.BLACK, txt1.getLineColour());
    assertEquals(Color.BLACK, txt2.getLineColour());
    assertEquals(591.7, txt1.getPosition().getX(), 0.1);
    assertEquals(146.1, txt1.getPosition().getY(), 0.1);
    assertEquals(605.7, txt2.getPosition().getX(), 0.1);
    assertEquals(166.1, txt2.getPosition().getY(), 0.1);
    assertEquals(TextPosition.BOT_LEFT, txt1.getTextPosition());
    assertEquals(TextPosition.BOT_LEFT, txt2.getTextPosition());
    assertEquals(0., txt1.getRotationAngle(),0.0001);
    assertEquals(0., txt2.getRotationAngle(),0.0001);
  }
View Full Code Here

  }


  @Test public void testShape3() {
    assertTrue(group.getShapeAt(3) instanceof IText);
    IText txt = (IText) group.getShapeAt(3);
    assertEquals("\\normalsize{$t$}", txt.getText()); //$NON-NLS-1$
    assertEquals(Color.BLACK, txt.getLineColour());
    assertEquals(405., txt.getPosition().getX(), 0.000001);
    assertEquals(160., txt.getPosition().getY(), 0.000001);
  }
View Full Code Here

  }


  @Test public void testShape6() {
    assertTrue(group.getShapeAt(6) instanceof IText);
    IText txt = (IText) group.getShapeAt(6);
    assertEquals("\\normalsize{$t_7$}", txt.getText()); //$NON-NLS-1$
    assertEquals(Color.BLACK, txt.getLineColour());
    assertEquals(365., txt.getPosition().getX(), 0.000001);
    assertEquals(160., txt.getPosition().getY(), 0.000001);
  }
View Full Code Here

  }


  @Test public void testShape7() {
    assertTrue(group.getShapeAt(7) instanceof IText);
    IText txt = (IText) group.getShapeAt(7);
    assertEquals("\\normalsize{$\\cdots\\cdots$}", txt.getText()); //$NON-NLS-1$
    assertEquals(Color.BLACK, txt.getLineColour());
    assertEquals(365., txt.getPosition().getX(), 0.000001);
    assertEquals(125., txt.getPosition().getY(), 0.000001);
  }
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.