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

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


  }


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


  }


  @Test
  public void testRPutCoordRotationDoubleText() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput{-10.0}(1,2){coucou}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals("coucou", txt.getText()); //$NON-NLS-1$
    assertEquals(IShape.PPC, txt.getPosition().getX(), 0.001);
    assertEquals(-2.*IShape.PPC, txt.getPosition().getY(), 0.001);
    assertEquals(Math.toRadians(10.), txt.getRotationAngle(), 0.001);
  }
View Full Code Here

  }


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

import org.junit.Test;

public class TestParsingRPut extends TestPSTParser {
  @Test
  public void testRefPointCombo_t_br() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput[t](0,0){\\rput[br](2,2){coucou}}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(IText.TextPosition.BOT_RIGHT, txt.getTextPosition());
  }
View Full Code Here

  }


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

    assertEquals(-20.*IShape.PPC, txt.getPosition().getY(), 0.001);
  }

  @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.BASE, txt.getTextPosition());
    assertEquals(10.*IShape.PPC, txt.getPosition().getX(), 0.001);
    assertEquals(-20.*IShape.PPC, txt.getPosition().getY(), 0.001);
  }
View Full Code Here

    assertEquals(-20.*IShape.PPC, txt.getPosition().getY(), 0.001);
  }

  @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.BASE_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_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.BASE_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_r() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput[r](10,20){coucou}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(IText.TextPosition.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_l() throws ParseException {
    IText txt = (IText)parser.parsePSTCode("\\rput[l](10,20){coucou}").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(IText.TextPosition.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

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.