/** Unregisters the event handler from the drawing editor and the * active drawing view. */ private void unregisterEventHandler() { if (editor != null) { editor.removePropertyChangeListener(eventHandler); } }
public void dispose() { if (editor != null) { editor.removePropertyChangeListener(this); editor = null; } if (view != null) { view.removePropertyChangeListener(this); view.removeFigureSelectionListener(this); view = null; } }
/** * Sets the target of the proxy. */ public void setTarget(@Nullable DrawingEditor newValue) { if (target != null) { target.removePropertyChangeListener(forwarder); } this.target = newValue; if (target != null) { target.addPropertyChangeListener(forwarder); } } /**
/** Unregisters the event handler from the drawing editor and the * active drawing view. */ private void unregisterEventHandler() { if (editor != null) { editor.removePropertyChangeListener(eventHandler); } if (activeView != null) { activeView.removeFigureSelectionListener(eventHandler); activeView.removePropertyChangeListener(eventHandler); activeView = null; } }
/** Unregisters the event handler from the drawing editor and the * active drawing view. */ private void unregisterEventHandler() { if (editor != null) { editor.removePropertyChangeListener(eventHandler); } if (activeView != null) { activeView.removePropertyChangeListener(eventHandler); activeView = null; } if (specificView != null) { specificView.removePropertyChangeListener(eventHandler); } }
/** * Attaches the FigureAttributeEditorHandler to the specified DrawingEditor. * <p> * The FigureAttributeEditorHandler listens to view changes and selection * changes of the drawing editor and calls setEnabled(boolean) and * updateField(Set<Figure>) on the field accordingly. * * @param newValue a drawing editor. */ public void setEditor(@Nullable DrawingEditor newValue) { DrawingEditor oldValue = editor; if (editor != null) { editor.removePropertyChangeListener(eventHandler); } this.editor = newValue; if (editor != null) { editor.addPropertyChangeListener(new WeakPropertyChangeListener(eventHandler)); } updateActiveView(); }
@Override public void dispose() { if (editor != null) { if (editor.getActiveView() != null) { DrawingView view = editor.getActiveView(); view.removePropertyChangeListener(this); if (view.getDrawing() != null) { view.getDrawing().removeFigureListener(this); } } editor.removePropertyChangeListener(this); editor = null; } component = null; } }
@Override public void dispose() { if (editor != null) { if (editor.getActiveView() != null) { DrawingView view = editor.getActiveView(); view.removePropertyChangeListener(this); view.removeFigureSelectionListener(this); if (view.getDrawing() != null) { view.getDrawing().removeFigureListener(this); } } editor.removePropertyChangeListener(this); editor = null; } component = null; } }