Examples of IEllipse


Examples of ag.ion.bion.officelayer.draw.shapes.IEllipse

    return connector;
  }

  @Override
  public IEllipse createEllipse(int width, int height) {
    IEllipse ellipse = new Ellipse(drawPage.createShape(IShape.ELLIPSE),
        drawPage);
    ellipse.setSize(new Size(width, height));
    return ellipse;
  }
View Full Code Here

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

  }


  @Test
  public void testConstructors2() {
    IEllipse ell = ShapeFactory.createEllipse();

    assertEquals(4, ell.getNbPoints());
  }
View Full Code Here

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

    assertEquals(4, ell.getNbPoints());
  }

  @Test
  public void testConstructors3() {
    IEllipse ell;

    try {
      ell = ShapeFactory.createEllipse(null, ShapeFactory.createPoint());
      fail();
    }catch(IllegalArgumentException ex) { /* */ }

    try {
      ell = ShapeFactory.createEllipse(ShapeFactory.createPoint(), null);
      fail();
    }catch(IllegalArgumentException ex) { /* */ }

    try {
      ell = ShapeFactory.createEllipse(ShapeFactory.createPoint(), ShapeFactory.createPoint());
      fail();
    }catch(IllegalArgumentException ex) { /* */ }

    try {
      ell = ShapeFactory.createEllipse(ShapeFactory.createPoint(1,0), ShapeFactory.createPoint(2,0));
      fail();
    }catch(IllegalArgumentException ex) { /* */ }

    try {
      ell = ShapeFactory.createEllipse(ShapeFactory.createPoint(1,Double.NaN), ShapeFactory.createPoint(2,0));
      fail();
    }catch(IllegalArgumentException ex) { /* */ }

    try {
      ell = ShapeFactory.createEllipse(ShapeFactory.createPoint(1,2), ShapeFactory.createPoint(2,Double.NaN));
      fail();
    }catch(IllegalArgumentException ex) { /* */ }

    ell = ShapeFactory.createEllipse(ShapeFactory.createPoint(20, 26), ShapeFactory.createPoint(30, 35));
    HelperTest.assertEqualsDouble(20., ell.getPosition().getX());
    HelperTest.assertEqualsDouble(35., ell.getPosition().getY());
    HelperTest.assertEqualsDouble(10., ell.getWidth());
    HelperTest.assertEqualsDouble(9., ell.getHeight());
  }
View Full Code Here

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

    Interactor<?,?,?> link = getLink("DnD2AddShape"); //$NON-NLS-1$

    assertTrue(link.getAction() instanceof AddShape);
    assertTrue(((AddShape)link.getAction()).shape().get() instanceof IEllipse);

    IEllipse ell = (IEllipse) ((AddShape)link.getAction()).shape().get();
    checkShape(ell);
    HelperTest.assertEqualsDouble(100., ell.getTopLeftPoint().getX());
    HelperTest.assertEqualsDouble(300., ell.getTopLeftPoint().getY());
    assertTrue(ell.getWidth()>0);
    assertTrue(ell.getHeight()>0);
  }
View Full Code Here

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

    return "(1,2)"; //$NON-NLS-1$
  }


  @Test public void testUnit() throws ParseException {
    IEllipse sh = (IEllipse)parser.parsePSTCode("\\psset{unit=4}\\psellipse(2,3cm)(2cm,5cm)").get().getShapeAt(0); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());
    assertEquals(4.*2.*IShape.PPC-2.*IShape.PPC, sh.getX(), 0.0001);
    assertEquals(-3.*IShape.PPC+5.*IShape.PPC, sh.getY(), 0.0001);
    assertEquals(2.*2.*IShape.PPC, sh.getWidth(), 0.0001);
    assertEquals(2.*5.*IShape.PPC, sh.getHeight(), 0.0001);
  }
View Full Code Here

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

  }


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

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

  }


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

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

  }


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

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

  }


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

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

  }


  @Test
  public void test1Coordinates() throws ParseException {
    IEllipse ell = (IEllipse)parser.parsePSTCode("\\"+getCommandName()+"(35,20)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(-35.*IShape.PPC, ell.getPosition().getX(), 0.001);
    assertEquals(-20.*IShape.PPC*-1., ell.getPosition().getY(), 0.001);
    assertEquals(35.*IShape.PPC*2., ell.getWidth(), 0.001);
    assertEquals(20.*IShape.PPC*2., ell.getHeight(), 0.001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.