Examples of PrecisionRectangle


Examples of org.eclipse.draw2d.geometry.PrecisionRectangle

  private void refresh() {

    // set the bounds of this figure, so it could cover all children.
    bounds = getOwnerFigure().getBounds();
    bounds = new PrecisionRectangle(bounds.getResized(-1, -1));
    getOwnerFigure().translateToAbsolute(bounds);
    this.translateToRelative(bounds);
    this.setBounds(bounds);

    this.removeAll();
View Full Code Here

Examples of org.eclipse.draw2d.geometry.PrecisionRectangle

    // for corner small box.
    Rectangle targetBounds = new Rectangle(referencebox.getX(),
        referencebox.getY(), referencebox.getWidth(), referencebox
            .getHeight());
    targetBounds = new PrecisionRectangle(targetBounds);
    reference.translateToAbsolute(targetBounds);
    target.translateToRelative(targetBounds);
    // targetBounds.resize(1, 1);

    Dimension targetSize = target.getPreferredSize();
View Full Code Here

Examples of org.eclipse.draw2d.geometry.PrecisionRectangle

                    bounds.height = figure.getClientArea().height
                            - tableLayout.getHSpacing() * 2;
                }
            }
        }
        bounds = new PrecisionRectangle(bounds.getResized(-1, -1));
        editPart.getFigure().translateToAbsolute(bounds);
       
        return bounds;
    }
View Full Code Here

Examples of org.eclipse.draw2d.geometry.PrecisionRectangle

     * @return a modifiable Rectangle that represents the bounds of the figure to be relocated
     */
    protected Rectangle getCurrentTargetBounds(IFigure relocateFigure)
    {
        IFigure reference = getReferenceFigure();
        Rectangle targetBounds = new PrecisionRectangle(getReferenceBox().getResized(-1, -1));
        reference.translateToAbsolute(targetBounds);
        relocateFigure.translateToRelative(targetBounds);
        return targetBounds;
    }
View Full Code Here

Examples of org.eclipse.draw2d.geometry.PrecisionRectangle

       
       
        private Rectangle getInitialMenuBounds(final IFigure target)
        {
            Rectangle targetBounds =
                new PrecisionRectangle(_referenceFigure.getBounds().getResized(-1, -1));
            _referenceFigure.translateToAbsolute(targetBounds);
            target.translateToRelative(targetBounds);
            return targetBounds;
        }
View Full Code Here

Examples of org.eclipse.draw2d.geometry.PrecisionRectangle

    Insets referenceInsets = getReference().getInsets();

    Rectangle r = new Rectangle(bounds.x + bounds.width, bounds.y
        + referenceInsets.top, TableEditConst.WIDTH, bounds.height
        - referenceInsets.getHeight());
    bounds = new PrecisionRectangle(r);

    getReference().translateToAbsolute(bounds);
    target.translateToRelative(bounds);

    target.setBounds(bounds);
View Full Code Here

Examples of org.eclipse.draw2d.geometry.PrecisionRectangle

   *            the request
   */
  protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
    IFigure feedback = getDragSourceFeedbackFigure();

    PrecisionRectangle rect = new PrecisionRectangle(
        getInitialFeedbackBounds().getCopy());
    getHostFigure().translateToAbsolute(rect);
    rect.translate(request.getMoveDelta());
    rect.resize(request.getSizeDelta());

    // to avoid enlarge feedback pane.
    // when draging a editpart inside designer to move/copy it, we do not
    // want to
    // enlarge the canvas, since that may resulting in relayout.
    rect = (PrecisionRectangle) rect.intersect(getFeedbackLayer()
        .getBounds());

    feedback.translateToRelative(rect);
    feedback.setBounds(rect);
  }
View Full Code Here

Examples of org.eclipse.draw2d.geometry.PrecisionRectangle

   * This method transforms the input rectangle from the world coordinate
   * system to the device coordinate system.
   */
  public PrecisionRectangle transformRect(PrecisionRectangle inRect)
  {
    PrecisionRectangle outRect = new PrecisionRectangle();
   
    PrecisionDimension inRectDim =
      new PrecisionDimension(inRect.preciseWidth, inRect.preciseHeight);
    PrecisionDimension outRectDim = this.transformDimension(inRectDim);
    outRect.setWidth(outRectDim.preciseWidth);
    outRect.setHeight(outRectDim.preciseHeight);
   
    outRect.setX(this.transformX(inRect.preciseX));
    outRect.setY(this.transformY(inRect.preciseY));
   
    return(outRect);
  }
View Full Code Here

Examples of org.eclipse.draw2d.geometry.PrecisionRectangle

   * system to the world coordinate system. The result is in the passed
   * output rectangle object.
   */
  public PrecisionRectangle inverseTransformRect(PrecisionRectangle inRect)
  {
    PrecisionRectangle outRect = new PrecisionRectangle();
   
    PrecisionDimension inRectDim =
      new PrecisionDimension(inRect.preciseWidth, inRect.preciseHeight);
    PrecisionDimension outRectDim =
      this.inverseTransformDimension(inRectDim);
    outRect.setWidth(outRectDim.preciseWidth);
    outRect.setHeight(outRectDim.preciseHeight);
   
    outRect.setX(this.inverseTransformX(inRect.preciseX));
    outRect.setY(this.inverseTransformY(inRect.preciseY));
   
    return(outRect);
  }
View Full Code Here

Examples of org.eclipse.draw2d.geometry.PrecisionRectangle

    trans.setDeviceOrgX(10.0);
    trans.setDeviceOrgY(20.0);
    trans.setDeviceExtX(50.0);
    trans.setDeviceExtY(-100.0);
   
    PrecisionRectangle rectWorld = new PrecisionRectangle();
   
    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
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.