use of org.eclipse.draw2d.geometry.Insets in project netxms by netxms.
the class ConnectorLabel method getPreferredSize.
/* (non-Javadoc)
* @see org.eclipse.draw2d.Label#getPreferredSize(int, int)
*/
@Override
public Dimension getPreferredSize(int wHint, int hHint) {
Dimension d = calculateLabelSize(getTextSize());
;
Insets insets = getInsets();
d.expand(insets.getWidth(), insets.getHeight());
if (getLayoutManager() != null)
d.union(getLayoutManager().getPreferredSize(this, wHint, hHint));
d.height += 4;
d.width += 6;
return d;
}
use of org.eclipse.draw2d.geometry.Insets in project statecharts by Yakindu.
the class StateEditPart method createNodeFigure.
@Override
protected NodeFigure createNodeFigure() {
NodeFigure figure = new DefaultSizeNodeFigure(getDefaultSize()) {
@Override
public // StateFigure is drawed smaller (Blurshadow size)
Rectangle getHandleBounds() {
Insets insets = new Insets(0, 0, StateFigure.BLUR_SHADOW_WIDTH, StateFigure.BLUR_SHADOW_WIDTH);
return new Rectangle(getBounds().x + insets.left, getBounds().y + insets.top, getBounds().width - (insets.right + insets.left), getBounds().height - (insets.bottom + insets.top));
}
};
figure.setLayoutManager(new StackLayout());
figure.setMinimumSize(getDefaultSize());
figure.add(createPrimaryShape());
return figure;
}
use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.
the class GraphLayoutStrategy method createNode.
protected Node createNode(GraphicalEditPart part, Subgraph subgraph) {
final int NODE_PADDING = 30;
Node node = new Node(part, subgraph);
node.setPadding(new Insets(NODE_PADDING));
setNodeBounds(node, part.getFigure().getBounds());
return node;
}
use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.
the class AbstractEntityLayout method calculateSize.
protected BaselinedDimension calculateSize(IFigure container, int wHint, int hHint, boolean preferred) {
childFigure = getChildren(container);
Insets insets = container.getInsets();
if (wHint > -1)
wHint = Math.max(0, wHint - insets.getWidth() - getMarginLeft() - getMarginRight());
if (hHint > -1)
hHint = Math.max(0, hHint - insets.getHeight() - getMarginTop() - getMarginBottom());
boolean hintsSensitive = calculateChildrenSize(wHint, hHint, preferred);
return new BaselinedDimension(figWidth, figAscent + figDescent, getIndent() + insets.left + getMarginLeft(), figAscent + insets.top + getMarginTop(), hintsSensitive).expand(insets.getWidth(), insets.getHeight()).union(getBorderPreferredSize(container)).expand(getMarginLeft() + getMarginRight(), getMarginTop() + getMarginBottom());
}
use of org.eclipse.draw2d.geometry.Insets in project whole by wholeplatform.
the class MenuActionsPart method createFigure.
protected IFigure createFigure() {
IFigure f = new MenuActionsFigure();
f.setBorder(new MarginBorder(0, 0, 0, DrawUtils.SHADOW_SIZE) {
public void paint(IFigure f, Graphics g, Insets i) {
g.pushState();
Rectangle r = getPaintRectangle(f, i);
DrawUtils.drawShadowBorder(g, r, false);
g.popState();
}
});
return f;
}
Aggregations