protected Dimension getNewTargetSize(IFigure relocateFigure) { return relocateFigure.getPreferredSize(); }
protected Dimension getNewTargetSize(IFigure relocateFigure) { return relocateFigure.getPreferredSize(); }
Dimension childSize = child.getPreferredSize();
/** * Relocates the target using the relative offset locations. * * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure) */ public void relocate(IFigure target) { Rectangle targetBounds = ColumnHelper.getColumnBounds(editPart, target); 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); } }
childSize = child.getPreferredSize(wHint, hHint);// : child.getMinimumSize(wHint, hHint);
public void layout(IFigure figure) { Dimension preferredSize = calculatePreferredClientAreaSize(figure); Rectangle r = figure.getClientArea().getCopy(); List children = figure.getChildren(); int nChildren = children.size(); int extraHorizontalSpace = r.width - preferredSize.width; for (Iterator i = children.iterator(); i.hasNext();) { IFigure child = (IFigure) i.next(); Dimension preferredChildSize = child.getPreferredSize(); if (isHorizontal) { int w = preferredChildSize.width + (extraHorizontalSpace / nChildren); child.setBounds(new Rectangle(r.x, r.y, w, Math.max(preferredSize.height, r.height))); r.x += w + spacing; } else { child.setBounds(new Rectangle(r.x, r.y, Math.max(preferredSize.width, r.width), preferredChildSize.height)); r.y += preferredChildSize.height + spacing; } } } }
Dimension childSize = child.getPreferredSize();
Dimension childSize = child.getPreferredSize();
Dimension targetSize = target.getPreferredSize();
public Dimension getPreferredSize () { final Dimension dimension = VisualInterfaceFactory.eINSTANCE.createDimension (); final org.eclipse.draw2d.geometry.Dimension size = getPropertyFigure ().getPreferredSize (); dimension.setHeight ( size.preciseWidth () ); dimension.setWidth ( size.preciseWidth () ); return dimension; }
public Dimension getPreferredSize () { final Dimension dimension = VisualInterfaceFactory.eINSTANCE.createDimension (); final org.eclipse.draw2d.geometry.Dimension size = getPropertyFigure ().getPreferredSize (); dimension.setHeight ( size.preciseWidth () ); dimension.setWidth ( size.preciseWidth () ); return dimension; }
public void setPreferredHeight ( final double value ) { final PrecisionDimension dim = new PrecisionDimension (); dim.setPreciseWidth ( getPropertyFigure ().getPreferredSize ().preciseWidth () ); dim.setPreciseHeight ( value ); getPropertyFigure ().setPreferredSize ( dim ); }
public void setPreferredWidth ( final double value ) { final PrecisionDimension dim = new PrecisionDimension (); dim.setPreciseWidth ( value ); dim.setPreciseHeight ( getPropertyFigure ().getPreferredSize ().preciseHeight () ); getPropertyFigure ().setPreferredSize ( dim ); }
Dimension childSize = child.getPreferredSize(); if (isHorizontal) Dimension childSize = child.getPreferredSize();
public void setPreferredWidth ( final double value ) { final PrecisionDimension dim = new PrecisionDimension (); dim.setPreciseWidth ( value ); dim.setPreciseHeight ( getPropertyFigure ().getPreferredSize ().preciseHeight () ); getPropertyFigure ().setPreferredSize ( dim ); }
public void setPreferredHeight ( final double value ) { final PrecisionDimension dim = new PrecisionDimension (); dim.setPreciseWidth ( getPropertyFigure ().getPreferredSize ().preciseWidth () ); dim.setPreciseHeight ( value ); getPropertyFigure ().setPreferredSize ( dim ); }
/** * Relocates the target figure to the reference point with possible x and y * offsetting. Uses the target's preferredSize as the new size. */ public void relocate(IFigure target) { 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) { rect = rect.intersect(_intersectFigure.getBounds()); } target.setBounds(rect); }
private Dimension getPreferredSize ( final Rectangle bounds ) { if ( this.symbol != null && this.symbol.getDesignSize () != null ) { return new PrecisionDimension ( this.symbol.getDesignSize ().getWidth (), this.symbol.getDesignSize ().getHeight () ); } else if ( this.figure != null ) { return this.figure.getPreferredSize ( bounds.width, bounds.height ); } else { return new PrecisionDimension ( bounds.width, bounds.height ); } }
private Dimension getPreferredSize ( final Rectangle bounds ) { if ( this.symbol != null && this.symbol.getDesignSize () != null ) { return new PrecisionDimension ( this.symbol.getDesignSize ().getWidth (), this.symbol.getDesignSize ().getHeight () ); } else if ( this.figure != null ) { return this.figure.getPreferredSize ( bounds.width, bounds.height ); } else { return new PrecisionDimension ( bounds.width, bounds.height ); } }
Rectangle rootFigureBounds = new Rectangle(new Point(0,0),rootFigure.getPreferredSize());