edu.gatech.cs2335.lemmings.gui
Class LToggleButton

java.lang.Object
  extended byedu.gatech.cs2335.lemmings.gui.LComponent
      extended byedu.gatech.cs2335.lemmings.gui.LLeafComponent
          extended byedu.gatech.cs2335.lemmings.gui.LAbstractButton
              extended byedu.gatech.cs2335.lemmings.gui.LToggleButton
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, IClickable

public final class LToggleButton
extends LAbstractButton
implements java.awt.event.ActionListener

Class LToggleButton: this is the ltogglebutton class.

 Revision History:
     v1.0 (Apr. 14, 2004) - Created the LToggleButton class
 

Version:
Version 1.0, Apr. 14, 2004
Author:
Vladimir Urazov

Constructor Summary
LToggleButton()
          Creates a new LToggleButton instance.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Describe actionPerformed method here.
protected  void copy(LComponent component)
          Deep-copies self into the component passed in.
 AnimatedSprite getImage()
          Returns the image displayed on this button.
 java.lang.String getText()
          Returns the text displayed on this button.
 boolean isSelected()
          Returns whether or not the button is currently selected.
protected  boolean paint(java.awt.Graphics g)
          Performs all of the necessary drawing for this control only.
 void setImage(AnimatedSprite newImage)
          Sets up a new value for the image of this button.
 void setSelected(boolean v)
          Describe setSelected method here.
 void setText(java.lang.String v)
          Sets the new value of the text on this button.
 void toggleSelected()
          Toggles the selection on the button.
protected  void updateDimensions()
          Describe updateDimensions method here.
 
Methods inherited from class edu.gatech.cs2335.lemmings.gui.LAbstractButton
addActionListener, fireActionPerformed, getActionCommand, getActionListeners, registerMouseClick, removeActionListener, setActionCommand, setActionListeners
 
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, getBounds, getParent, initialize, isActive, isComponentDirty, isShown, setBounds, setDirty, setParent, setPosition, setShown, setSize, setSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LToggleButton

public LToggleButton()
Creates a new LToggleButton instance.

Method Detail

getText

public java.lang.String getText()
Returns the text displayed on this button.

Returns:
a String value

setText

public void setText(java.lang.String v)
Sets the new value of the text on this button.

Parameters:
v - a String value

getImage

public AnimatedSprite getImage()
Returns the image displayed on this button.

Returns:
an AnimatedSprite value

setImage

public void setImage(AnimatedSprite newImage)
Sets up a new value for the image of this button.

Parameters:
newImage - an AnimatedSprite value

updateDimensions

protected void updateDimensions()
Describe updateDimensions method here.

Overrides:
updateDimensions in class LComponent

isSelected

public boolean isSelected()
Returns whether or not the button is currently selected.

Returns:
a boolean value

setSelected

public void setSelected(boolean v)
Describe setSelected method here.

Parameters:
v - a boolean value

toggleSelected

public void toggleSelected()
Toggles the selection on the button.


copy

protected void copy(LComponent component)
Deep-copies self into the component passed in.

Specified by:
copy in class LComponent
Parameters:
component - a LComponent value

paint

protected boolean paint(java.awt.Graphics g)
Performs all of the necessary drawing for this control only. The children will be taken care of separately. This method need not concern itself with them.

Specified by:
paint in class LComponent
Parameters:
g - a Graphics value
Returns:
a boolean value

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Describe actionPerformed method here.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - an ActionEvent value