* @param figure
*/
public void refreshLayout() {
ProjectFigure figure = (ProjectFigure) getFigure();
// Computes constraints
Rectangle constraint = null;
Rectangle bounds = figure.getBounds();
if (bounds.height == 0 || bounds.width == 0) {
// By setting the width and height to -1, we ensure that the preferred width and height are calculated automatically.
constraint = new Rectangle(bounds.x, bounds.y, -1, -1);
} else {
constraint = new Rectangle(bounds);
}
((GraphicalEditPart) getParent()).setLayoutConstraint(this, figure, constraint);
// Check for first Layout refresh and set model to preferred size
INode model = (INode) getModel();