Examples of rotatePoint()


Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.rotatePoint()

  @Test
  public void testRotatePoint() {
    IPoint pt = ShapeFactory.createPoint();

    assertNull(pt.rotatePoint( null, 0));
    assertNull(pt.rotatePoint(null, 0));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.NaN));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.NEGATIVE_INFINITY));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.POSITIVE_INFINITY));
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.rotatePoint()

  @Test
  public void testRotatePoint() {
    IPoint pt = ShapeFactory.createPoint();

    assertNull(pt.rotatePoint( null, 0));
    assertNull(pt.rotatePoint(null, 0));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.NaN));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.NEGATIVE_INFINITY));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.POSITIVE_INFINITY));

    assertEquals(ShapeFactory.createPoint(0,1),  ShapeFactory.createPoint(1,0).rotatePoint(ShapeFactory.createPoint(), Math.PI/2.));
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.rotatePoint()

  public void testRotatePoint() {
    IPoint pt = ShapeFactory.createPoint();

    assertNull(pt.rotatePoint( null, 0));
    assertNull(pt.rotatePoint(null, 0));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.NaN));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.NEGATIVE_INFINITY));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.POSITIVE_INFINITY));

    assertEquals(ShapeFactory.createPoint(0,1),  ShapeFactory.createPoint(1,0).rotatePoint(ShapeFactory.createPoint(), Math.PI/2.));
    assertEquals(ShapeFactory.createPoint(-1,0), ShapeFactory.createPoint(0,1).rotatePoint(ShapeFactory.createPoint(), Math.PI/2.));
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.rotatePoint()

    IPoint pt = ShapeFactory.createPoint();

    assertNull(pt.rotatePoint( null, 0));
    assertNull(pt.rotatePoint(null, 0));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.NaN));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.NEGATIVE_INFINITY));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.POSITIVE_INFINITY));

    assertEquals(ShapeFactory.createPoint(0,1),  ShapeFactory.createPoint(1,0).rotatePoint(ShapeFactory.createPoint(), Math.PI/2.));
    assertEquals(ShapeFactory.createPoint(-1,0), ShapeFactory.createPoint(0,1).rotatePoint(ShapeFactory.createPoint(), Math.PI/2.));
    assertEquals(ShapeFactory.createPoint(0,-1), ShapeFactory.createPoint(-1,0).rotatePoint(ShapeFactory.createPoint(), Math.PI/2.));
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.rotatePoint()

    assertNull(pt.rotatePoint( null, 0));
    assertNull(pt.rotatePoint(null, 0));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.NaN));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.NEGATIVE_INFINITY));
    assertNull(pt.rotatePoint(ShapeFactory.createPoint(), Double.POSITIVE_INFINITY));

    assertEquals(ShapeFactory.createPoint(0,1),  ShapeFactory.createPoint(1,0).rotatePoint(ShapeFactory.createPoint(), Math.PI/2.));
    assertEquals(ShapeFactory.createPoint(-1,0), ShapeFactory.createPoint(0,1).rotatePoint(ShapeFactory.createPoint(), Math.PI/2.));
    assertEquals(ShapeFactory.createPoint(0,-1), ShapeFactory.createPoint(-1,0).rotatePoint(ShapeFactory.createPoint(), Math.PI/2.));
    assertEquals(ShapeFactory.createPoint(1,0),  ShapeFactory.createPoint(0,-1).rotatePoint(ShapeFactory.createPoint(), Math.PI/2.));
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.rotatePoint()

    final double rotAngle = sh.getRotationAngle();
    IPoint pt = sh.getPtAt(indexPt);

    // If the shape is rotated, the handler's position must fit the rotation angle.
    if(!LNumber.equalsDouble(rotAngle, 0.))
      pt = pt.rotatePoint(zoomedGC, rotAngle);

    point.setPoint(pt.zoom(zoom));
    super.update(sh, zoom);
  }
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.rotatePoint()

    else
      pt = arc.getEndPoint();

    // If the shape is rotated, the handler's position must fit the rotation angle.
    if(!LNumber.equalsDouble(rotAngle, 0.))
      pt = pt.rotatePoint(zoomedGC, rotAngle);

    point.setPoint(pt.zoom(zoom).getMiddlePoint(zoomedGC));
    super.update(arc, zoom);
  }
}
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.rotatePoint()

      final double dx;
      final double dy;
      final IPoint gc     = shape.getGravityCentre();
      final IPoint shadowgc   = ShapeFactory.createPoint(gc.getX()+shape.getShadowSize(), gc.getY());

      shadowgc.setPoint(shadowgc.rotatePoint(gc, shape.getShadowAngle()));
      dx = shadowgc.getX() - gc.getX();
      dy = gc.getY() - shadowgc.getY();

      g.setStroke(new BasicStroke((float) getStrokeThickness(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER));
      g.translate(dx, dy);
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.rotatePoint()

    setPathOLikeDot(shape.getOGap());

    IPoint p1 = ShapeFactory.createPoint((tlx+brx)/2., tly+dec*2);
    IPoint p2 = ShapeFactory.createPoint((tlx+brx)/2., bry-dec*2);
    p1 = p1.rotatePoint(centre, Math.PI/4.);
    p2 = p2.rotatePoint(centre, Math.PI/4.);

    path.moveTo(p1.getX(), p1.getY());
    path.lineTo(p2.getX(), p2.getY());

    p1.setPoint(tlx+dec*2, (tly+bry)/2.);
View Full Code Here

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.rotatePoint()

    path.lineTo(p2.getX(), p2.getY());

    p1.setPoint(tlx+dec*2, (tly+bry)/2.);
    p2.setPoint(brx-dec*2, (tly+bry)/2.);
    p1 = p1.rotatePoint(centre, Math.PI/4.);
    p2 = p2.rotatePoint(centre, Math.PI/4.);

    path.moveTo(p1.getX(), p1.getY());
    path.lineTo(p2.getX(), p2.getY());
  }

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.