Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Dimension


  @Override
  public Dimension getSize() {
    try {
      int width = getAttributeInt(SVGConstants.SVG_WIDTH_ATTRIBUTE);
      int height = getAttributeInt(SVGConstants.SVG_HEIGHT_ATTRIBUTE);
      return new Dimension(width, height);
    } catch (Exception e) {
      return null;
    }
  }
View Full Code Here


    if (points.size() == 0)
      points.addAll(getDefaultPoints(layout));

    Rectangle bounds = points.getBounds();
    // calculate difference
    Dimension delta = bounds.getLocation()
        .getDifference(layout.getLocation()).negate();

    // perform translate
    points.translate(delta.width, delta.height);
View Full Code Here

    targetBounds = new PrecisionRectangle(targetBounds);
    reference.translateToAbsolute(targetBounds);
    target.translateToRelative(targetBounds);
    // targetBounds.resize(1, 1);

    Dimension targetSize = target.getPreferredSize();

    targetBounds.x += (int) (targetBounds.width * relativeX - ((targetSize.width + 1) / 2));
    targetBounds.y += (int) (targetBounds.height * relativeY - ((targetSize.height + 1) / 2));
    targetBounds.setSize(targetSize);
    target.setBounds(targetBounds);
View Full Code Here

        return relocateFigure.getPreferredSize();
    }
   
    public void relocate(IFigure target) {
        Rectangle targetBounds = getCurrentTargetBounds(target);
        Dimension targetSize = getNewTargetSize(target);
        relocateBounds(targetBounds, targetSize);

        target.setBounds(targetBounds);       
    }
View Full Code Here

               
        }
    }

    protected void init() {
        setPreferredSize(new Dimension(12, 12));
    }
View Full Code Here

                graphics.drawImage(getImage(), srcRect, getClientArea());
            }
           
        };
       
        figure_.setMinimumSize(new Dimension(0,0));
        return figure_;
    }
View Full Code Here

        Point leftTop = new Point(_referencePoint.x+_xOffset, _referencePoint.y+_yOffset);
       

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

        // to avoid enlargemeent
        if (_intersectFigure != null)
        {
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
View Full Code Here

        addFeedback(dropHintLabel);

        final String hintText = getDropHintText(position);
        dropHintLabel.setText(hintText);
        //TODO: need to handle viewport clipping and adjust label location appropriately
        Dimension hintSize = dropHintLabel.getPreferredSize();
        Point hintLocation = new Point(mousePosition.x, mousePosition.y+DROP_HINT_VERTICAL_OFFSET);
        Rectangle hintRect = new Rectangle(hintLocation, hintSize);

        //Bug 303524 - [WPE] design view flickers on dnd of jsf html column
        //    (translateToRelative BEFORE intersect, so intersection happens on final display bounds)
View Full Code Here

    Point viewLocation = port.getViewLocation();
    Point lastLocation = viewLocation.getCopy();
    new ExposeHelper((IHTMLGraphicalViewer) viewer).exposeArea(rect);
    viewLocation = port.getViewLocation();
    Dimension offset = lastLocation.getDifference(viewLocation);

    p.translate(offset.width, offset.height);
    EditPart part = viewer.findObjectAt(p);
    if (part != null && !(part instanceof ScalableRootEditPart)) {
      while (part != null) {
View Full Code Here

TOP

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

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.