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

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


  }


  @Test
  public void testCoordinatesFloat2() throws ParseException {
    IDot dot =  (IDot)parser.parsePSTCode("\\"+getCommandName()+"(35.5,50.5)").get().getShapeAt(0); //$NON-NLS-1$ //$NON-NLS-2$
    assertEquals(35.5*IShape.PPC, dot.getPtAt(0).getX(), 0.0001);
    assertEquals(-50.5*IShape.PPC, dot.getPtAt(0).getY(), 0.0001);
    assertTrue(PSTParser.errorLogs().isEmpty());
  }
View Full Code Here


  @Test public void testBug756733() throws ParseException {
    // https://bugs.launchpad.net/latexdraw/+bug/756733
    IGroup gp = parser.parsePSTCode("\\psset{unit=5}\\psdot(1,1)\\psdot(1,10pt)").get(); //$NON-NLS-1$
    assertTrue(PSTParser.errorLogs().isEmpty());

    IDot dot = (IDot)gp.getShapeAt(0);
    assertEquals(5.*IShape.PPC, dot.getX(), 0.000001);
    assertEquals(5.*-IShape.PPC, dot.getY(), 0.000001);

    dot = (IDot)gp.getShapeAt(1);
    assertEquals(5.*IShape.PPC, dot.getX(), 0.000001);
    assertEquals(10.*-IShape.PPC/PSTricksConstants.CM_VAL_PT, dot.getY(), 0.000001);
  }
View Full Code Here

    assertEquals(0.5*IShape.PPC, rec.getX(), 0.000001);
    assertEquals(-0.5*IShape.PPC, rec.getY(), 0.000001);
    assertEquals(IShape.PPC, rec.getWidth(), 0.000001);
    assertEquals(IShape.PPC, rec.getHeight(), 0.000001);

    IDot dot = (IDot)gp.getShapeAt(1);
    assertEquals(IShape.PPC, dot.getX(), 0.000001);
    assertEquals(-IShape.PPC, dot.getY(), 0.000001);

    rec = (IRectangle)gp.getShapeAt(2);
    assertEquals(0.5*2.*IShape.PPC, rec.getX(), 0.000001);
    assertEquals(-0.5*2.*IShape.PPC, rec.getY(), 0.000001);
    assertEquals(2.*IShape.PPC, rec.getWidth(), 0.000001);
    assertEquals(2.*IShape.PPC, rec.getHeight(), 0.000001);

    dot = (IDot)gp.getShapeAt(3);
    assertEquals(2.*2.*IShape.PPC, dot.getX(), 0.000001);
    assertEquals(-2.*2.*IShape.PPC, dot.getY(), 0.000001);
  }
View Full Code Here

  private IDot getDotShape() {
    return (IDot) view.getShape();
  }

  private void setDot(final double x, final double y, final DotStyle style, final double size) {
    IDot dot = getDotShape();
    dot.setPosition(x, y);
    dot.setDotStyle(style);
    dot.setDiametre(size);
    view.update();
  }
View Full Code Here

TOP

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

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.