/** 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); } }
/** 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; } }
public void dispose() { if (editor != null) { editor.removePropertyChangeListener(this); editor = null; } if (view != null) { view.removePropertyChangeListener(this); view.removeFigureSelectionListener(this); view = null; } }
@Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("enabled")) { updateEnabledState(); } else if (evt.getPropertyName() == DrawingEditor.ACTIVE_VIEW_PROPERTY) { if (activeView != null) { activeView.removePropertyChangeListener(eventHandler); activeView = null; } if (evt.getNewValue() != null) { activeView = ((DrawingView) evt.getNewValue()); activeView.addPropertyChangeListener(eventHandler); updateEnabledState(); } updateViewState(); } }
@Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName() == DrawingEditor.ACTIVE_VIEW_PROPERTY) { if (activeView != null) { activeView.removeFigureSelectionListener(this); activeView.removePropertyChangeListener(this); } if (evt.getNewValue() != null) { activeView = ((DrawingView) evt.getNewValue()); activeView.addFigureSelectionListener(this); activeView.addPropertyChangeListener(this); } updateEnabledState(); } else if (evt.getPropertyName().equals("enabled")) { updateEnabledState(); } }
@Override public void propertyChange(PropertyChangeEvent evt) { String name = evt.getPropertyName(); if (name == DrawingEditor.ACTIVE_VIEW_PROPERTY) { if (view != null) { view.removePropertyChangeListener(this); view.removeFigureSelectionListener(this); } view = (DrawingView) evt.getNewValue(); if (view != null) { view.addPropertyChangeListener(this); view.addFigureSelectionListener(this); } updateVisibility(); } else if (name == DrawingEditor.TOOL_PROPERTY) { updateVisibility(); } }
/** Registers the event handler from the drawing editor and the * active drawing view. */ private void registerEventHandler() { if (specificView != null) { specificView.addPropertyChangeListener(eventHandler); } else { if (editor != null) { editor.addPropertyChangeListener(new WeakPropertyChangeListener(eventHandler)); if (activeView != null) { activeView.removePropertyChangeListener(eventHandler); } activeView = editor.getActiveView(); if (activeView != null) { activeView.addPropertyChangeListener(eventHandler); } } } } }
DrawingView view = (DrawingView) evt.getOldValue(); if (view != null) { view.removePropertyChangeListener(this); if (view.getDrawing() != null) { view.getDrawing().removeFigureListener(this);
/** Registers the event handler from the drawing editor and the * active drawing view. */ private void registerEventHandler() { if (editor != null) { editor.addPropertyChangeListener(new WeakPropertyChangeListener(eventHandler)); if (activeView != null) { activeView.removeFigureSelectionListener(eventHandler); activeView.removePropertyChangeListener(eventHandler); } activeView = editor.getActiveView(); if (activeView != null) { activeView.addFigureSelectionListener(eventHandler); activeView.addPropertyChangeListener(eventHandler); } } } }
@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; } }
DrawingView view = (DrawingView) evt.getOldValue(); if (view != null) { view.removePropertyChangeListener(this); view.removeFigureSelectionListener(this); if (view.getDrawing() != 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; } }
protected void updateActiveView() { DrawingView newValue = (view != null) ? // view : // ((editor != null && editor.getActiveView() != null) ? // editor.getActiveView() : null); DrawingView oldValue = activeView; if (activeView != null) { activeView.removePropertyChangeListener(eventHandler); activeView.removeFigureSelectionListener(eventHandler); if (figuresOfInterest != null) { for (Figure f : figuresOfInterest) { f.removeFigureListener(eventHandler); } } } activeView = newValue; if (activeView != null) { activeView.addPropertyChangeListener(eventHandler); activeView.addFigureSelectionListener(eventHandler); figuresOfInterest = getEditedFigures(); for (Figure f : figuresOfInterest) { f.addFigureListener(eventHandler); } } attributeRestoreData = null; updateAttributeEditor(); }