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

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


  }


  @Test
  public void testRefPoint_tr() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput[tr](10,20){coucou}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(IText.TextPosition.TOP_RIGHT, txt.getTextPosition());
    assertEquals(10.*IShape.PPC, txt.getPosition().getX(), 0.001);
    assertEquals(-20.*IShape.PPC, txt.getPosition().getY(), 0.001);
  }
View Full Code Here


  }


  @Test
  public void testRefPoint_b() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput[b](10,20){coucou}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(IText.TextPosition.BOT, txt.getTextPosition());
    assertEquals(10.*IShape.PPC, txt.getPosition().getX(), 0.001);
    assertEquals(-20.*IShape.PPC, txt.getPosition().getY(), 0.001);
  }
View Full Code Here

  }


  @Test
  public void testRefPoint_t() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput[t](10,20){coucou}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(IText.TextPosition.TOP, txt.getTextPosition());
    assertEquals(10.*IShape.PPC, txt.getPosition().getX(), 0.001);
    assertEquals(-20.*IShape.PPC, txt.getPosition().getY(), 0.001);
  }
View Full Code Here

  }


  @Test
  public void testRefPoint_tl() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput[tl](10,20){coucou}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(IText.TextPosition.TOP_LEFT, txt.getTextPosition());
    assertEquals(10.*IShape.PPC, txt.getPosition().getX(), 0.001);
    assertEquals(-20.*IShape.PPC, txt.getPosition().getY(), 0.001);
  }
View Full Code Here

  }


  @Test
  public void testRefPoint_bl() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput[bl](10,20){coucou}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(IText.TextPosition.BOT_LEFT, txt.getTextPosition());
    assertEquals(10.*IShape.PPC, txt.getPosition().getX(), 0.001);
    assertEquals(-20.*IShape.PPC, txt.getPosition().getY(), 0.001);
  }
View Full Code Here

  }


  @Test
  public void testRefPoint_br() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput[br](10,20){coucou}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(IText.TextPosition.BOT_RIGHT, txt.getTextPosition());
    assertEquals(10.*IShape.PPC, txt.getPosition().getX(), 0.001);
    assertEquals(-20.*IShape.PPC, txt.getPosition().getY(), 0.001);
  }
View Full Code Here


  @Test
  public void testDoubleRputRotationMustNotRotateOtherShapes() throws ParseException {
    IGroup gp = parser.parsePSTCode("\\rput{10}(0,0){\\rput{80}(0,0){coucou}}\\psframe(10,10)").get(); //$NON-NLS-1$
    IText txt = (IText)gp.getShapeAt(0);
    IRectangle rec = (IRectangle)gp.getShapeAt(1);
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(Math.toRadians(-90), txt.getRotationAngle(), 0.001);
    assertEquals(0., rec.getRotationAngle(), 0.001);
  }
View Full Code Here

  }


  @Test
  public void testTripleRputRotationWithStar() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput{10}(0,0){\\rput{*30}(0,0){\\rput{50}(0,0){coucou}}}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(-80., Math.toDegrees(txt.getRotationAngle()), 0.001);
  }
View Full Code Here

  }


  @Test
  public void testDoubleRputRotation() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput{10}(0,0){\\rput{80}(0,0){coucou}}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(Math.toRadians(-90), txt.getRotationAngle(), 0.001);
  }
View Full Code Here



  @Test
  public void testDoubleRputPosition() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput(1,2){\\rput(2,3){coucou}}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals("coucou", txt.getText()); //$NON-NLS-1$
    assertEquals(3.*IShape.PPC, txt.getPosition().getX(), 0.001);
    assertEquals(-5.*IShape.PPC, txt.getPosition().getY(), 0.001);
  }
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.