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

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


    assertEquals(0, shape.getPosition().getY(), 0.0);
  }

  @Test
  public void testConstructor2() {
    IRhombus rho = ShapeFactory.createRhombus(ShapeFactory.createPoint(5, 15), 20, 40);
    HelperTest.assertEqualsDouble(4, rho.getNbPoints());
    assertEquals(20.0, rho.getWidth(), 0.0);
    assertEquals(40.0, rho.getHeight(), 0.0);
    assertEquals(-5.0, rho.getPosition().getX(), 0.0);
    assertEquals(35.0, rho.getPosition().getY(), 0.0);
  }
View Full Code Here


  }


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

  }


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

  }


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

  }


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

  }


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

  }


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

  }


  @Test
  public void test2CoordinatesFloatSigns2() throws ParseException {
    IRhombus rh = (IRhombus)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, rh.getPosition().getX(), 0.001);
    assertEquals(-5.*-IShape.PPC+50.5*IShape.PPC, rh.getPosition().getY(), 0.001);
    assertEquals(35.5*IShape.PPC*2., rh.getWidth(), 0.001);
    assertEquals(50.5*IShape.PPC*2., rh.getHeight(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void test2CoordinatesFloatSigns() throws ParseException {
    IRhombus rh = (IRhombus)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, rh.getPosition().getX(), 0.001);
    assertEquals(.5*-IShape.PPC+50.5*IShape.PPC, rh.getPosition().getY(), 0.001);
    assertEquals(35.5*IShape.PPC*2., rh.getWidth(), 0.001);
    assertEquals(50.5*IShape.PPC*2., rh.getHeight(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

  }


  @Test
  public void test2CoordinatesFloat2() throws ParseException {
    IRhombus rh = (IRhombus)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, rh.getPosition().getX(), 0.001);
    assertEquals(.5*-IShape.PPC+50.5*IShape.PPC, rh.getPosition().getY(), 0.001);
    assertEquals(35.5*IShape.PPC*2., rh.getWidth(), 0.001);
    assertEquals(50.5*IShape.PPC*2., rh.getHeight(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here

TOP

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

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.