use of org.eclipse.gef4.zest.core.widgets.GraphNode in project netxms by netxms.
the class AbstractNetworkMapView method updateObjectPositions.
/**
* Update stored object positions with actual positions read from graph control
*/
protected void updateObjectPositions() {
Graph graph = viewer.getGraphControl();
List<?> nodes = graph.getNodes();
for (Object o : nodes) {
if (o instanceof GraphNode) {
Object data = ((GraphNode) o).getData();
if (data instanceof NetworkMapElement) {
Point loc = ((GraphNode) o).getLocation();
Dimension size = ((GraphNode) o).getSize();
((NetworkMapElement) data).setLocation(loc.x + (size.width + 1) / 2, loc.y + (size.height + 1) / 2);
}
}
}
}
Aggregations