Package ucar.unidata.util
Class ObjectListener
java.lang.Object
ucar.unidata.util.ObjectListener
- All Implemented Interfaces:
ActionListener
,ItemListener
,KeyListener
,MouseListener
,WindowListener
,EventListener
,ChangeListener
public class ObjectListener
extends Object
implements MouseListener, ActionListener, KeyListener, WindowListener, ItemListener, ChangeListener
Implements ActionListener and MouseListener (and others) interfaces and holds an arbitrary object.
This can be used to pass state into anonymous listener objects without having the
defined as final in the creation scope of the listener.
This also servers like the MouseAdapter - i.e., it implements all of the methods
required in the various interfaces. A derived class does not need to implement all of
the required methods - just the ones they need.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionObjectListener
(Object stateObject) Create the ObjectListener with the given object.ObjectListener
(Object[] objs) A helper constructor that convert the array of objects into an ObjectArray object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
_more_void
actionPerformed
(ActionEvent ev, Object data) This is a special method so we can pass a generic listener instance into another Class's method that can create some ui thing and route events to this guy._more_void
_more_void
_more_void
_more_void
_more_void
_more_void
_more_void
_more_void
_more_void
_more_void
_more_void
_more_void
windowActivated
(WindowEvent event) _more_void
windowClosed
(WindowEvent event) _more_void
windowClosing
(WindowEvent event) _more_void
windowDeactivated
(WindowEvent event) _more_void
windowDeiconified
(WindowEvent event) _more_void
windowIconified
(WindowEvent event) _more_void
windowOpened
(WindowEvent event) _more_
-
Field Details
-
theObject
This is the object that this class is instantiated with.
-
-
Constructor Details
-
ObjectListener
Create the ObjectListener with the given object.- Parameters:
stateObject
- The state object
-
ObjectListener
A helper constructor that convert the array of objects into an ObjectArray object.- Parameters:
objs
-
-
-
Method Details
-
getObject
_more_- Returns:
- _more_
-
setObject
_more_- Parameters:
object
- _more_
-
itemStateChanged
_more_- Specified by:
itemStateChanged
in interfaceItemListener
- Parameters:
e
-
-
mouseClicked
_more_- Specified by:
mouseClicked
in interfaceMouseListener
- Parameters:
e
-
-
mouseEntered
_more_- Specified by:
mouseEntered
in interfaceMouseListener
- Parameters:
e
-
-
mouseExited
_more_- Specified by:
mouseExited
in interfaceMouseListener
- Parameters:
e
-
-
mousePressed
_more_- Specified by:
mousePressed
in interfaceMouseListener
- Parameters:
e
-
-
mouseReleased
_more_- Specified by:
mouseReleased
in interfaceMouseListener
- Parameters:
e
-
-
actionPerformed
_more_- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
ev
-
-
stateChanged
_more_- Specified by:
stateChanged
in interfaceChangeListener
- Parameters:
e
- the event
-
keyPressed
_more_- Specified by:
keyPressed
in interfaceKeyListener
- Parameters:
e
-
-
keyReleased
_more_- Specified by:
keyReleased
in interfaceKeyListener
- Parameters:
e
-
-
keyTyped
_more_- Specified by:
keyTyped
in interfaceKeyListener
- Parameters:
e
-
-
windowActivated
_more_- Specified by:
windowActivated
in interfaceWindowListener
- Parameters:
event
-
-
windowClosed
_more_- Specified by:
windowClosed
in interfaceWindowListener
- Parameters:
event
-
-
windowClosing
_more_- Specified by:
windowClosing
in interfaceWindowListener
- Parameters:
event
-
-
windowDeactivated
_more_- Specified by:
windowDeactivated
in interfaceWindowListener
- Parameters:
event
-
-
windowDeiconified
_more_- Specified by:
windowDeiconified
in interfaceWindowListener
- Parameters:
event
-
-
windowIconified
_more_- Specified by:
windowIconified
in interfaceWindowListener
- Parameters:
event
-
-
windowOpened
_more_- Specified by:
windowOpened
in interfaceWindowListener
- Parameters:
event
-
-
actionPerformed
This is a special method so we can pass a generic listener instance into another Class's method that can create some ui thing and route events to this guy.- Parameters:
ev
-data
-
-