@Override
public void removedFromContext(ICanvasContext ctx) {
+ // Ensure hover polling is stopped
+ if (hoverUpdateSchedule != null && !hoverUpdateSchedule.isDone()) {
+ hoverUpdateSchedule.cancel(false);
+ }
+
getHintStack().removeKeyHintListener(getThread(), DistrictDiagramViewer.KEY_MAP_COLORING_OBJECTS, hintListener);
getHintStack().removeKeyHintListener(getThread(), DistrictDiagramViewer.KEY_MAP_COLOR_BAR_OPTIONS, hintListener);
getHintStack().removeKeyHintListener(getThread(), DistrictDiagramViewer.KEY_MAP_SIZING_OBJECTS, hintListener);
}
private ScheduledFuture<?> hoverUpdateSchedule;
+ private static final Object COMPLETE = new Object();
public void hoverNode(Resource runtimeDiagram, Resource mapElement, G2DParentNode hoveredNode) {
IThreadWorkQueue thread = getThread();
public void run(ReadGraph graph) throws DatabaseException {
boolean keyVariablesVertexHover = visualisation.isKeyVariablesVertexHover();
boolean keyVariablesEdgesHover = visualisation.isKeyVariablesEdgesHover();
-
- Resource mapElementInstanceOf = graph.getSingleObject(mapElement, Layer0.getInstance(graph).InstanceOf);
+
+ Resource mapElementInstanceOf = graph.getPossibleObject(mapElement, Layer0.getInstance(graph).InstanceOf);
+ if (mapElementInstanceOf == null) {
+ future.complete(COMPLETE);
+ return;
+ }
+
DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);
boolean doHover = true;
} else {
hoverInfoNode.hover2(null);
}
- future.complete(new Object());
+ future.complete(COMPLETE);
});
} else {
- future.complete(new Object());
+ future.complete(COMPLETE);
}
}
});