Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Rectangle


     * on the primary selection status of the owner editpart.
     *
     * @param g The graphics used to paint the figure.
     */
    public void paintFigure(Graphics g) {
        Rectangle r = getBounds();
        r.shrink(1, 1);
        try {
            g.setBackgroundColor(getFillColor());
            g.setAlpha(getAlpha());
            g.fillRectangle(r.x, r.y, r.width, r.height);
            g.setForegroundColor(getBorderColor());
            g.drawRectangle(r.x, r.y, r.width, r.height);
        } finally {
            //We don't really own rect 'r', so fix it.
            r.expand(1, 1);
        }
    }
View Full Code Here


       

        //figure.translateToAbsolute(leftTop);
        target.translateToRelative(leftTop);
        Dimension d = target.getPreferredSize();
        Rectangle rect = new Rectangle(leftTop, d);

        // to avoid enlargemeent
        if (_intersectFigure != null)
        {
            rect = rect.intersect(_intersectFigure.getBounds());
        }
       
        target.setBounds(rect);
    }
View Full Code Here

            _referenceFigure = reference;
        }
       
        public void relocate(IFigure target)
        {
            final Rectangle finalBounds = getFinalMenuBounds(target);
            target.setBounds(finalBounds);
        }
View Full Code Here

        }
       
       
        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

        private Rectangle getFinalMenuBounds(final IFigure target)
        {
            final IFigure referenceFigure =  _referenceFigure;
           
            Rectangle targetBounds = getInitialMenuBounds(target);
            Dimension targetSize = target.getPreferredSize();

            // copied from super.relocate because relativeX/Y are private in super
            // changed from super to remove div by 2 that centers target; we want
            // it to be corner-to-corner
            targetBounds.x
                += targetBounds.width+4;
            targetBounds.y
                  -= (targetSize.height / 2) - referenceFigure.getBounds().height/2;
            targetBounds.setSize(targetSize);
            //target.setBounds(targetBounds);

//            final Rectangle viewPortRect =
//                ((IHTMLGraphicalViewer)_owner.getViewer()).getViewport().getBounds();
//            final Rectangle targetRect = targetBounds.getCopy();
View Full Code Here

       
        public void relocate(IFigure target)
        {
            final Point newEndPoint = _endPoint.getCopy();
            target.translateToRelative(_endPoint);
            Rectangle startBounds = target.getBounds().getCopy();
            animateBoundsChange(target, startBounds, newEndPoint);
        }
View Full Code Here

                   }
                   _isAnimating = false;
               }
               else
               {
                   final Rectangle curBounds = target.getBounds().getCopy();
                   curBounds.width += widthIncrement;
                   curBounds.height += heightIncrement;
                   curBounds.x += xIncrement;
                   curBounds.y += yIncrement;
                   target.setBounds(curBounds);
View Full Code Here

    if (rootpart1 == null) {
      return;
    }
       
        point = adjustLocation(rootpart1, point);
    Rectangle bound = EditPartPositionHelper.getAbsoluteBounds(rootpart1);
    // get current according to the point.
    // FlowBoxLine line =
    // getCurrentLine(moveMediator.getEditableContainer(new
    // Target(rootpart)), point, moveMediator);
    while (true) {
View Full Code Here

  /*
   * We should change this, it is too tricky to do in this way.
   */
  private Point adjustLocation(EditPart rootPart, Point point) {
    Point result = point.getCopy();
    Rectangle bounds = EditPartPositionHelper.getAbsoluteBounds(rootPart);
    if (!bounds.contains(point)) {
      if (bounds.getLeft().x > point.x) {
        result.x = bounds.getLeft().x;
      } else if (bounds.getRight().x < point.x) {
        result.x = bounds.getRight().x;
      }
    }
    return result;
  }
View Full Code Here

     * @return the bounding rectangle for the caret at the current
     * position in absolute coords
     */
    protected Rectangle createCaretBounds(DesignPosition position)
    {
        Rectangle rect = EditPartPositionHelper
            .convertToAbsoluteCaretRect(position);

        // to avoid enlarge feedback pane.
        rect = rect.intersect(getFeedbackLayer().getBounds());
       
        return rect;
    }
View Full Code Here

TOP

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

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.