Examples of centralSymmetry()


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


  @Test
  public void testCentralSymmetry() {
    IPoint pt = ShapeFactory.createPoint();
    assertNull(pt.centralSymmetry(null));
    assertEquals(ShapeFactory.createPoint(-1,0),  ShapeFactory.createPoint(1,0).centralSymmetry(pt));
    assertEquals(ShapeFactory.createPoint(0,-1),  ShapeFactory.createPoint(0,1).centralSymmetry(pt));
    assertEquals(ShapeFactory.createPoint(1,0),  ShapeFactory.createPoint(-1,0).centralSymmetry(pt));
    assertEquals(ShapeFactory.createPoint(0,1),  ShapeFactory.createPoint(0,-1).centralSymmetry(pt));
  }
View Full Code Here

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

  public void undo() {
    final IPoint pt = ShapeFactory.createPoint(getPoint());
    pt.translate(-tx, -ty);

    if(isFirstCtrlPt)
      move(pt, pt.centralSymmetry(shape.getPtAt(indexPt)));
    else
      move(pt.centralSymmetry(shape.getPtAt(indexPt)), pt);
  }

View Full Code Here

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

    pt.translate(-tx, -ty);

    if(isFirstCtrlPt)
      move(pt, pt.centralSymmetry(shape.getPtAt(indexPt)));
    else
      move(pt.centralSymmetry(shape.getPtAt(indexPt)), pt);
  }


  @Override
  public void redo() {
View Full Code Here

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

    // Adding the control points.
    if(GLibUtilities.isValidPoint(pt) && position>=-1 && position<points.size()) {
      final IPoint ctrlPt = ShapeFactory.createPoint(pt.getX(), pt.getY()+DEFAULT_POSITION_CTRL);
      if(position==-1) {
        firstCtrlPts.add(ctrlPt);
        secondCtrlPts.add(ctrlPt.centralSymmetry(pt));
      } else {
        firstCtrlPts.add(position, ctrlPt);
        secondCtrlPts.add(position, ctrlPt.centralSymmetry(pt));
      }
    }
View Full Code Here

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

      if(position==-1) {
        firstCtrlPts.add(ctrlPt);
        secondCtrlPts.add(ctrlPt.centralSymmetry(pt));
      } else {
        firstCtrlPts.add(position, ctrlPt);
        secondCtrlPts.add(position, ctrlPt.centralSymmetry(pt));
      }
    }
  }

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.