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

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


  }


  @Test
  public void test2CoordinatesFloatSigns2() throws ParseException {
    IEllipse ell = (IEllipse)parser.parsePSTCode("\\"+getCommandName()+"(-+.5,+-5)(+++35.5,--50.5)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(-.5*IShape.PPC-35.5*IShape.PPC, ell.getPosition().getX(), 0.001);
    assertEquals(-5.*-IShape.PPC+50.5*IShape.PPC, ell.getPosition().getY(), 0.001);
    assertEquals(35.5*IShape.PPC*2., ell.getWidth(), 0.001);
    assertEquals(50.5*IShape.PPC*2., ell.getHeight(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here


  }


  @Test
  public void test2CoordinatesFloatSigns() throws ParseException {
    IEllipse ell = (IEllipse)parser.parsePSTCode("\\"+getCommandName()+"(-+-.5,+--.5)(+++35.5,--50.5)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(.5*IShape.PPC-35.5*IShape.PPC, ell.getPosition().getX(), 0.001);
    assertEquals(.5*-IShape.PPC+50.5*IShape.PPC, ell.getPosition().getY(), 0.001);
    assertEquals(35.5*IShape.PPC*2., ell.getWidth(), 0.001);
    assertEquals(50.5*IShape.PPC*2., ell.getHeight(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void test2CoordinatesFloat2() throws ParseException {
    IEllipse ell = (IEllipse)parser.parsePSTCode("\\"+getCommandName()+"(.5,.5)(35.5,50.5)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(.5*IShape.PPC-35.5*IShape.PPC, ell.getPosition().getX(), 0.001);
    assertEquals(.5*-IShape.PPC+50.5*IShape.PPC, ell.getPosition().getY(), 0.001);
    assertEquals(35.5*IShape.PPC*2., ell.getWidth(), 0.001);
    assertEquals(50.5*IShape.PPC*2., ell.getHeight(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void test2CoordinatesFloat() throws ParseException {
    IEllipse ell = (IEllipse)parser.parsePSTCode("\\"+getCommandName()+"(10.5,20.5)(35.5,50.5)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(10.5*IShape.PPC-35.5*IShape.PPC, ell.getPosition().getX(), 0.001);
    assertEquals(20.5*-IShape.PPC+50.5*IShape.PPC, ell.getPosition().getY(), 0.001);
    assertEquals(35.5*IShape.PPC*2., ell.getWidth(), 0.001);
    assertEquals(50.5*IShape.PPC*2., ell.getHeight(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void test2CoordinatesTwoFirstMissing() throws ParseException {
    IEllipse ell = (IEllipse)parser.parsePSTCode("\\"+getCommandName()+"(,)(35,50)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(IShape.PPC-35*IShape.PPC, ell.getPosition().getX(), 0.001);
    assertEquals(-IShape.PPC+50.*IShape.PPC, ell.getPosition().getY(), 0.001);
    assertEquals(35.*IShape.PPC*2., ell.getWidth(), 0.001);
    assertEquals(50.*IShape.PPC*2., ell.getHeight(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void test2CoordinatesTwoLastMissing() throws ParseException {
    IEllipse ell = (IEllipse)parser.parsePSTCode("\\"+getCommandName()+"(0,0)(,)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(-IShape.PPC, ell.getPosition().getX(), 0.001);
    assertEquals(IShape.PPC, ell.getPosition().getY(), 0.001);
    assertEquals(IShape.PPC*2., ell.getWidth(), 0.001);
    assertEquals(IShape.PPC*2., ell.getHeight(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void test2WidthHeight0() throws ParseException {
    IEllipse ell = (IEllipse)parser.parsePSTCode("\\"+getCommandName()+"(0,0)(0,0)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertTrue(ell.getWidth()>0);
    assertTrue(ell.getHeight()>0);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

TOP

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

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.