edu.gatech.cs2335.lemmings.gui
Class LAbstractButton

java.lang.Object
  extended byedu.gatech.cs2335.lemmings.gui.LComponent
      extended byedu.gatech.cs2335.lemmings.gui.LLeafComponent
          extended byedu.gatech.cs2335.lemmings.gui.LAbstractButton
All Implemented Interfaces:
IClickable
Direct Known Subclasses:
JobButton, LButton, LevelButton, LToggleButton

public abstract class LAbstractButton
extends LLeafComponent
implements IClickable

Class LAbstractButton: The abstract button class.

 Revision History:
     v1.0 (Mar. 29, 2004) - Created the LAbstractButton class
 

Version:
Version 1.0, Mar. 29, 2004
Author:
Vladimir Urazov

Constructor Summary
LAbstractButton()
          Creates a new LAbstractButton instance.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Adds an ActionListener to the button.
protected  void fireActionPerformed(java.awt.event.ActionEvent e)
          Notifies all listeners that have registered interest for notification on this event type.
 java.lang.String getActionCommand()
          Returns the action command for this button.
protected  java.util.List getActionListeners()
          Returns the listeners for this button.
 void registerMouseClick(int button, java.awt.Point coords)
          Registers the click of a mouse button at the specified coordinates.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes an ActionListener from the button.
 void setActionCommand(java.lang.String v)
          Sets a new action command for this button.
protected  void setActionListeners(java.util.List ll)
          Sets up the list of action listeners.
 
Methods inherited from class edu.gatech.cs2335.lemmings.gui.LLeafComponent
makeDirty, move, renderAll
 
Methods inherited from class edu.gatech.cs2335.lemmings.gui.LComponent
bringToTop, cleanUp, copy, getBounds, getParent, initialize, isActive, isComponentDirty, isShown, paint, setBounds, setDirty, setParent, setPosition, setShown, setSize, setSize, updateDimensions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LAbstractButton

public LAbstractButton()
Creates a new LAbstractButton instance.

Method Detail

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Adds an ActionListener to the button.

Parameters:
l - the ActionListener to be added.

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes an ActionListener from the button. If the listener is the currently set Action for the button, then the Action is set to null.

Parameters:
l - the listener to be removed.

getActionListeners

protected java.util.List getActionListeners()
Returns the listeners for this button.

Returns:
a List value

setActionListeners

protected void setActionListeners(java.util.List ll)
Sets up the list of action listeners.

Parameters:
ll - a List value

fireActionPerformed

protected void fireActionPerformed(java.awt.event.ActionEvent e)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the event parameter.

Parameters:
e - the ActionEvent object.

getActionCommand

public java.lang.String getActionCommand()
Returns the action command for this button.

Returns:
a String value

setActionCommand

public void setActionCommand(java.lang.String v)
Sets a new action command for this button.

Parameters:
v - a String value

registerMouseClick

public void registerMouseClick(int button,
                               java.awt.Point coords)
Registers the click of a mouse button at the specified coordinates.

Specified by:
registerMouseClick in interface IClickable
Parameters:
button - an int value
coords - a Point value