ucar.unidata.util
Class ObjectListener

java.lang.Object
  extended by ucar.unidata.util.ObjectListener
All Implemented Interfaces:
ActionListener, ItemListener, KeyListener, MouseListener, WindowListener, EventListener

public class ObjectListener
extends Object
implements MouseListener, ActionListener, KeyListener, WindowListener, ItemListener

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
protected  Object theObject
          This is the object that this class is instantiated with.
 
Constructor Summary
ObjectListener(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
 void actionPerformed(ActionEvent ev)
          _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.
 Object getObject()
          _more_
 void itemStateChanged(ItemEvent e)
          _more_
 void keyPressed(KeyEvent e)
          _more_
 void keyReleased(KeyEvent e)
          _more_
 void keyTyped(KeyEvent e)
          _more_
 void mouseClicked(MouseEvent e)
          _more_
 void mouseEntered(MouseEvent e)
          _more_
 void mouseExited(MouseEvent e)
          _more_
 void mousePressed(MouseEvent e)
          _more_
 void mouseReleased(MouseEvent e)
          _more_
 void setObject(Object object)
           
 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_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theObject

protected Object theObject
This is the object that this class is instantiated with.

Constructor Detail

ObjectListener

public ObjectListener(Object stateObject)
Create the ObjectListener with the given object.

Parameters:
stateObject - The state object

ObjectListener

public ObjectListener(Object[] objs)
A helper constructor that convert the array of objects into an ObjectArray object.

Parameters:
objs -
Method Detail

getObject

public Object getObject()
_more_

Returns:
_more_

setObject

public void setObject(Object object)

itemStateChanged

public void itemStateChanged(ItemEvent e)
_more_

Specified by:
itemStateChanged in interface ItemListener
Parameters:
e -

mouseClicked

public void mouseClicked(MouseEvent e)
_more_

Specified by:
mouseClicked in interface MouseListener
Parameters:
e -

mouseEntered

public void mouseEntered(MouseEvent e)
_more_

Specified by:
mouseEntered in interface MouseListener
Parameters:
e -

mouseExited

public void mouseExited(MouseEvent e)
_more_

Specified by:
mouseExited in interface MouseListener
Parameters:
e -

mousePressed

public void mousePressed(MouseEvent e)
_more_

Specified by:
mousePressed in interface MouseListener
Parameters:
e -

mouseReleased

public void mouseReleased(MouseEvent e)
_more_

Specified by:
mouseReleased in interface MouseListener
Parameters:
e -

actionPerformed

public void actionPerformed(ActionEvent ev)
_more_

Specified by:
actionPerformed in interface ActionListener
Parameters:
ev -

keyPressed

public void keyPressed(KeyEvent e)
_more_

Specified by:
keyPressed in interface KeyListener
Parameters:
e -

keyReleased

public void keyReleased(KeyEvent e)
_more_

Specified by:
keyReleased in interface KeyListener
Parameters:
e -

keyTyped

public void keyTyped(KeyEvent e)
_more_

Specified by:
keyTyped in interface KeyListener
Parameters:
e -

windowActivated

public void windowActivated(WindowEvent event)
_more_

Specified by:
windowActivated in interface WindowListener
Parameters:
event -

windowClosed

public void windowClosed(WindowEvent event)
_more_

Specified by:
windowClosed in interface WindowListener
Parameters:
event -

windowClosing

public void windowClosing(WindowEvent event)
_more_

Specified by:
windowClosing in interface WindowListener
Parameters:
event -

windowDeactivated

public void windowDeactivated(WindowEvent event)
_more_

Specified by:
windowDeactivated in interface WindowListener
Parameters:
event -

windowDeiconified

public void windowDeiconified(WindowEvent event)
_more_

Specified by:
windowDeiconified in interface WindowListener
Parameters:
event -

windowIconified

public void windowIconified(WindowEvent event)
_more_

Specified by:
windowIconified in interface WindowListener
Parameters:
event -

windowOpened

public void windowOpened(WindowEvent event)
_more_

Specified by:
windowOpened in interface WindowListener
Parameters:
event -

actionPerformed

public 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.

Parameters:
ev -
data -