use of org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure in project elk by eclipse.
the class GmfDiagramLayoutConnector method refreshDiagram.
/**
* Refreshes all ports in the diagram. This is necessary in order correctly move ports, which
* does not work due to GMF bugs. See Eclipse bug #291484.
*
* @param editor
* the diagram editor
* @param rootPart
* the root edit part
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=291484
*/
private static void refreshDiagram(final DiagramEditor editor, final IGraphicalEditPart rootPart) {
EditPart editPart = rootPart;
if (editPart == null) {
editPart = editor.getDiagramEditPart();
}
for (Object obj : editPart.getViewer().getEditPartRegistry().values()) {
if (obj instanceof ShapeNodeEditPart) {
IFigure figure = ((ShapeNodeEditPart) obj).getFigure();
if (figure instanceof BorderedNodeFigure) {
IFigure portContainer = ((BorderedNodeFigure) figure).getBorderItemContainer();
portContainer.invalidate();
portContainer.validate();
}
}
}
}
Aggregations