/** * Receives notification of a renderer change event. * * @param event the event. */ public void rendererChanged(RendererChangeEvent event) { Plot parent = getParent(); if (parent != null) { if (parent instanceof RendererChangeListener) { RendererChangeListener rcl = (RendererChangeListener) parent; rcl.rendererChanged(event); } else { // this should never happen with the existing code, but throw an exception in // case future changes make it possible... throw new RuntimeException("The renderer has changed and I don't know what to do!"); } } else { PlotChangeEvent e = new PlotChangeEvent(this); notifyListeners(e); } }
/** * Receives notification of a renderer change event. * * @param event the event. */ public void rendererChanged(RendererChangeEvent event) { Plot parent = getParent(); if (parent != null) { if (parent instanceof RendererChangeListener) { RendererChangeListener rcl = (RendererChangeListener) parent; rcl.rendererChanged(event); } else { // this should never happen with the existing code, but throw // an exception in case future changes make it possible... throw new RuntimeException( "The renderer has changed and I don't know what to do!"); } } else { configureRangeAxes(); PlotChangeEvent e = new PlotChangeEvent(this); notifyListeners(e); } }
/** * Receives notification of a renderer change event. * * @param event the event. */ @Override public void rendererChanged(RendererChangeEvent event) { Plot parent = getParent(); if (parent != null) { if (parent instanceof RendererChangeListener) { RendererChangeListener rcl = (RendererChangeListener) parent; rcl.rendererChanged(event); } else { // this should never happen with the existing code, but throw // an exception in case future changes make it possible... throw new RuntimeException( "The renderer has changed and I don't know what to do!"); } } else { configureRangeAxes(); PlotChangeEvent e = new PlotChangeEvent(this); notifyListeners(e); } }
/** * Registers an object to receive notification of changes to the renderer. * * @param listener the listener (<code>null</code> not permitted). */ public void addChangeListener(RendererChangeListener listener) { if (listener == null) { throw new IllegalArgumentException("Null 'listener' argument."); } this.listenerList.add(RendererChangeListener.class, listener); }
/** * Deregisters an object so that it no longer receives notification of changes to the renderer. * * @param listener the object (<code>null</code> not permitted). */ public void removeChangeListener(RendererChangeListener listener) { if (listener == null) { throw new IllegalArgumentException("Null 'listener' argument."); } this.listenerList.remove(RendererChangeListener.class, listener); }
/** * Notifies all registered listeners that the renderer has been modified. * * @param event information about the change event. */ public void notifyListeners(RendererChangeEvent event) { Object[] ls = this.listenerList.getListenerList(); for (int i = ls.length - 2; i >= 0; i -= 2) { if (ls[i] == RendererChangeListener.class) { ((RendererChangeListener) ls[i + 1]).rendererChanged(event); } } }
/** * Deregisters an object so that it no longer receives * notification of changes to the renderer. * * @param listener the object (<code>null</code> not permitted). */ public void removeChangeListener(RendererChangeListener listener) { if (listener == null) { throw new IllegalArgumentException("Null 'listener' argument."); } this.listenerList.remove(RendererChangeListener.class, listener); }