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_voidactionPerformed(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_voidwindowActivated(WindowEvent event) _more_voidwindowClosed(WindowEvent event) _more_voidwindowClosing(WindowEvent event) _more_voidwindowDeactivated(WindowEvent event) _more_voidwindowDeiconified(WindowEvent event) _more_voidwindowIconified(WindowEvent event) _more_voidwindowOpened(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:
itemStateChangedin interfaceItemListener- Parameters:
e-
-
mouseClicked
_more_- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
e-
-
mouseEntered
_more_- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
e-
-
mouseExited
_more_- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
e-
-
mousePressed
_more_- Specified by:
mousePressedin interfaceMouseListener- Parameters:
e-
-
mouseReleased
_more_- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
e-
-
actionPerformed
_more_- Specified by:
actionPerformedin interfaceActionListener- Parameters:
ev-
-
stateChanged
_more_- Specified by:
stateChangedin interfaceChangeListener- Parameters:
e- the event
-
keyPressed
_more_- Specified by:
keyPressedin interfaceKeyListener- Parameters:
e-
-
keyReleased
_more_- Specified by:
keyReleasedin interfaceKeyListener- Parameters:
e-
-
keyTyped
_more_- Specified by:
keyTypedin interfaceKeyListener- Parameters:
e-
-
windowActivated
_more_- Specified by:
windowActivatedin interfaceWindowListener- Parameters:
event-
-
windowClosed
_more_- Specified by:
windowClosedin interfaceWindowListener- Parameters:
event-
-
windowClosing
_more_- Specified by:
windowClosingin interfaceWindowListener- Parameters:
event-
-
windowDeactivated
_more_- Specified by:
windowDeactivatedin interfaceWindowListener- Parameters:
event-
-
windowDeiconified
_more_- Specified by:
windowDeiconifiedin interfaceWindowListener- Parameters:
event-
-
windowIconified
_more_- Specified by:
windowIconifiedin interfaceWindowListener- Parameters:
event-
-
windowOpened
_more_- Specified by:
windowOpenedin 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-
-