public GraphListener[] getGraphListeners() {
return (GraphListener[]) listenerList.getListeners(GraphListener.class);
}
protected void fireUpdate(Object source,List nodes) {
Object[] listeners = listenerList.getListenerList();
GraphEvent e = null;
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == GraphListener.class) {
if (e == null) {
e = new GraphEvent(source,nodes);
}
((GraphListener) listeners[i + 1]).updateGraph(e);
}
}
}