Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.PrecisionPoint


     * @param windowHeight height of the window in pixel
     * @return the 2d coordinates for the local center/root node
     */
    private Point calculatePositionOfCenterNode(int windowWidth, int windowHeight)
    {
      return (new PrecisionPoint(windowWidth/2, windowHeight/2));
    }
View Full Code Here


          angle = (float)(angle * Math.PI / 180.0f);
                             
          int posX = (int)(Math.cos(angle) * distanceFromCenter);
          int posY = (int)(Math.sin(angle) * distanceFromCenter);
         
          Point position = new PrecisionPoint(posX, posY);
          normalizeNodePositions(centerPosition, position, angle);        
                   
          nodes.get(i).setLocation(position.x,position.y);
        }
       
View Full Code Here

   * This method transforms the input point from the world coordinate system
   * to the device coordinate system.
   */
  public PrecisionPoint transformPoint(PrecisionPoint inPoint)
  {
    PrecisionPoint outPoint =
      new PrecisionPoint(this.transformX(inPoint.preciseX),
        this.transformY(inPoint.preciseY));
   
    return(outPoint);
  }
View Full Code Here

   * This method transforms the input point from the device coordinate system
   * to the world coordinate system.
   */
  public PrecisionPoint inverseTransformPoint(PrecisionPoint inPoint)
  {
    PrecisionPoint outPoint =
      new PrecisionPoint(this.inverseTransformX(inPoint.preciseX),
        this.inverseTransformY(inPoint.preciseY));
   
    return(outPoint);
  }
View Full Code Here

    rectWorld.preciseX = 12.0;
    rectWorld.preciseY = -25.0;
    rectWorld.preciseWidth = 150.0;
    rectWorld.preciseHeight = 150.0;

    PrecisionPoint pointWorld =
      new PrecisionPoint(rectWorld.preciseX, rectWorld.preciseY);
    PrecisionDimension dimWorld =
      new PrecisionDimension(rectWorld.preciseWidth, rectWorld.preciseHeight);
   
    PrecisionPoint pointDevice = trans.transformPoint(pointWorld);
    PrecisionDimension dimDevice = trans.transformDimension(dimWorld);
    PrecisionRectangle rectDevice = trans.transformRect(rectWorld);
   
    // The transformed location & dimension should be (16,70) & (75,-300)
  }
View Full Code Here

  /**
   * This method updates the temporal attributes of this edge.
   */
  public void recalculate()
  {
    PrecisionPoint clipPoint1 =
      ChsGeometry.getIntersection(this.target.getRect(),
        this.source.getCenterX(), this.source.getCenterY());

    PrecisionPoint clipPoint2 =
      ChsGeometry.getIntersection(this.source.getRect(),
        this.target.getCenterX(), this.target.getCenterY());

    // Edge is clipped on both nodes' boundaries
    if (clipPoint1 != null && clipPoint2 != null)
View Full Code Here

    double[] clipPointCoordinates;
   
    clipPointCoordinates = ChsGeometry.getIntersection(this.target.getRect(),
                              this.source.getRect());
   
    PrecisionPoint clipPoint1 = new PrecisionPoint(clipPointCoordinates[0],
                            clipPointCoordinates[1]);
    PrecisionPoint clipPoint2 = new PrecisionPoint(clipPointCoordinates[2],
                            clipPointCoordinates[3]);

    // Edge is clipped on both nodes' boundaries
    if (clipPoint1 != null && clipPoint2 != null)
    {
View Full Code Here

   * coordinates that are not allowed when displaying by shifting the drawing
   * as necessary.
   */
  public void transform()
  {
    this.transform(new PrecisionPoint(0, 0));
  }
View Full Code Here

        for (int i = 0; i < path.size(); i++)
        {
          LNode dummyNode = ((LNode)path.get(i));
          Point p =
            new PrecisionPoint(dummyNode.getCenterX(),
              dummyNode.getCenterY());

          // update bendpoint's location according to dummy node
          EdgeBendpoint ebp =
            (EdgeBendpoint) lEdge.bendpoints.get(i);
          ebp.setRelativeDimensions(
            p.getDifference(sourceLoc),
            p.getDifference(targetLoc));

          // remove created dummy node and dummy edges
          graph.getNodes().remove(dummyNode);
          ((Vector)this.inclusionLevels.get(level)).remove(dummyNode);
View Full Code Here

        if (leftToRight) {
            x = r.x + offsetH;
        } else {
            x = r.right() - 1 - offsetH;
        }
        Point p = new PrecisionPoint(x, y);
        getOwner().translateToAbsolute(p);
        return p;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.geometry.PrecisionPoint

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.