/** Registers the event handler from the drawing editor and the * active drawing view. */ private void registerEventHandler() { if (editor != null) { editor.addPropertyChangeListener(new WeakPropertyChangeListener(eventHandler)); } } }
/** * 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); } } /**
public SelectionComponentDisplayer(DrawingEditor editor, JComponent component) { this.editor = editor; this.weakRef = new WeakReference<JComponent>(component); if (editor.getActiveView() != null) { view = editor.getActiveView(); view.addPropertyChangeListener(this); view.addFigureSelectionListener(this); } editor.addPropertyChangeListener(this); updateVisibility(); }
/** * 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(); }
public DrawingComponentRepainter(DrawingEditor editor, JComponent component) { this.editor = editor; this.component = component; if (editor != null) { if (editor.getActiveView() != null) { DrawingView view = editor.getActiveView(); view.addPropertyChangeListener(this); if (view.getDrawing() != null) { view.getDrawing().addFigureListener(this); } } editor.addPropertyChangeListener(this); } }
/** 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); } } } } }
/** 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); } } } }
public SelectionComponentRepainter(DrawingEditor editor, JComponent component) { this.editor = editor; this.component = component; if (editor != null) { if (editor.getActiveView() != null) { DrawingView view = editor.getActiveView(); view.addPropertyChangeListener(this); view.addFigureSelectionListener(this); if (view.getDrawing() != null) { view.getDrawing().addFigureListener(this); } } editor.addPropertyChangeListener(this); } }
zoomPopupButton.setText((int) (editor.getDrawingViews().iterator().next().getScaleFactor() * 100) + " %"); editor.addPropertyChangeListener(new PropertyChangeListener() {
public DefaultAttributeAction(DrawingEditor editor, AttributeKey[] keys, @Nullable String name, @Nullable Icon icon, @Nullable Map<AttributeKey, Object> fixedAttributes) { super(editor); this.keys = keys.clone(); putValue(AbstractAction.NAME, name); putValue(AbstractAction.SMALL_ICON, icon); setEnabled(true); editor.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(DefaultAttributeAction.this.keys[0].getKey())) { putValue("attribute_" + DefaultAttributeAction.this.keys[0].getKey(), evt.getNewValue()); } } }); this.fixedAttributes = fixedAttributes; updateEnabledState(); }
popupButton.setFocusable(false); editor.addPropertyChangeListener(new PropertyChangeListener() {