[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[News.eclipse.technology.gmf] The Layout problem with external labels
|
I noticed that nodes with external labels (labels not inside the node
figure) can not be Layout.
I try the SquareLayout of org.eclipse.gmf.examples.runtime.diagram.layout
which is checked out from CVS, It can Layout any nodes with internal labels,
but if one node has external labels, it fails.
I try the taipan and mindmap examples, they all can be layout if the diagram
contains nodes without external labels, but if there are external labels, it
fails.
As I debug through the project, I found it throws exception by the line
"getExternalLabelsContainer().add(labelFigure)" in the method(listed below)
of NodeEditpart generated by gmf.
/**
* @generated
*/
protected void addChildVisual(EditPart childEditPart, int index) {
if (isExternalLabel(childEditPart)) {
IFigure labelFigure = ((GraphicalEditPart) childEditPart)
.getFigure();
getExternalLabelsContainer().add(labelFigure);
return;
}
super.addChildVisual(childEditPart, -1);
}
Is this a bug?
To solve this problem I was thinking of changing the code generated for the
external labels. Is this the correct way?
By the way, everytime I layout the Diagram, I can not undo it. If I want to
undo it, is there any suggestion?
Thank you.