use of org.gephi.preview.spi.MouseResponsiveRenderer in project gephi by gephi.
the class PreviewModelImpl method prepareManagedListeners.
private void prepareManagedListeners() {
ArrayList<PreviewMouseListener> listeners = new ArrayList<>();
for (PreviewMouseListener listener : Lookup.getDefault().lookupAll(PreviewMouseListener.class)) {
for (Renderer renderer : getManagedEnabledRenderers()) {
if (renderer instanceof MouseResponsiveRenderer) {
if (((MouseResponsiveRenderer) renderer).needsPreviewMouseListener(listener) && !listeners.contains(listener)) {
listeners.add(listener);
}
}
}
}
//First listeners to receive events will be the ones coming from last called renderers.
Collections.reverse(listeners);
enabledMouseListeners = listeners.toArray(new PreviewMouseListener[0]);
}
Aggregations