Revision 34247 branches/v2_0_0_prep/libraries/libUIComponent/src/org/gvsig/gui/beans/editionpopupmenu/JOptionsEditionByMousePopupMenu.java
JOptionsEditionByMousePopupMenu.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.awt.event.ActionEvent; |
4 | 4 |
import java.awt.event.ActionListener; |
5 |
import java.beans.PropertyChangeListener; |
|
6 |
import java.beans.PropertyChangeSupport; |
|
7 | 5 |
import java.io.Serializable; |
8 | 6 |
import java.util.HashMap; |
9 | 7 |
|
... | ... | |
97 | 95 |
// Action listener for notify (fire) some events that had happened to this component |
98 | 96 |
private ActionListener menuListener = null; |
99 | 97 |
|
100 |
// Listener for property change support |
|
101 |
private PropertyChangeSupport changes = new PropertyChangeSupport(this); |
|
102 |
|
|
103 | 98 |
/** |
104 | 99 |
* Default constructor |
105 | 100 |
*/ |
... | ... | |
253 | 248 |
public void actionPerformed(ActionEvent event) { |
254 | 249 |
// Notifies that the Visibility of this component has changed |
255 | 250 |
if (event.getActionCommand().equals(JOptionsEditionByMousePopupMenu.VISIBILITYCHANGED)) |
256 |
changes.firePropertyChange(JOptionsEditionByMousePopupMenu.VISIBILITYCHANGED, JOptionsEditionByMousePopupMenu.DEFAULT, JOptionsEditionByMousePopupMenu.VISIBILITY); |
|
251 |
firePropertyChange( |
|
252 |
JOptionsEditionByMousePopupMenu.VISIBILITYCHANGED, |
|
253 |
JOptionsEditionByMousePopupMenu.DEFAULT, |
|
254 |
JOptionsEditionByMousePopupMenu.VISIBILITY); |
|
257 | 255 |
else // Notifies that has been clicked on an item |
258 |
changes.firePropertyChange(JOptionsEditionByMousePopupMenu.SELECTEDOPTION, JOptionsEditionByMousePopupMenu.DEFAULT, map.get(event.getActionCommand())); |
|
256 |
firePropertyChange( |
|
257 |
JOptionsEditionByMousePopupMenu.SELECTEDOPTION, |
|
258 |
JOptionsEditionByMousePopupMenu.DEFAULT, |
|
259 |
map.get(event.getActionCommand())); |
|
259 | 260 |
} |
260 | 261 |
}; |
261 | 262 |
} |
... | ... | |
412 | 413 |
super.setVisible(b); |
413 | 414 |
this.getMenuListener().actionPerformed(new ActionEvent(this, JOptionsEditionByMousePopupMenu.VISIBILITY, JOptionsEditionByMousePopupMenu.VISIBILITYCHANGED)); |
414 | 415 |
} |
415 |
|
|
416 |
/** |
|
417 |
* Adds a "Property Change Listener" |
|
418 |
*/ |
|
419 |
public void addPropertyChangeListener(PropertyChangeListener l) { |
|
420 |
changes.addPropertyChangeListener(l); |
|
421 |
} |
|
422 |
|
|
423 |
/** |
|
424 |
* Removes a "Property Change Listener" |
|
425 |
*/ |
|
426 |
public void removePropertyChangeListener(PropertyChangeListener l) { |
|
427 |
changes.removePropertyChangeListener(l); |
|
428 |
} |
|
429 | 416 |
} |
Also available in: Unified diff