edu.gatech.cs2335.lemmings.gui
Class JobButton

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.JobButton
All Implemented Interfaces:
IClickable

public final class JobButton
extends LAbstractButton

Class JobButton: This button will display the animation for the job specified, and the number of that type of job available.

 Revision History:
     v1.0 (Apr. 07, 2004) - Created the JobButton class
 

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

Field Summary
static java.awt.Color SELECTED_COLOR
          The color to use for selected buttons.
static java.awt.Color UNSELECTED_COLOR
          The color to use for unselected buttons.
 
Constructor Summary
JobButton(Level l, java.lang.String id)
          Creates a new JobButton instance.
 
Method Summary
protected  void copy(LComponent component)
          Deep-copies self into the component passed in.
 LemmingJob getLemmingJob()
          Returns the job associated with this button.
 Level getLevel()
          Returns the level associated with 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 setLemmingJob(java.lang.String id)
          Sets up a new job for this button.
 void setLevel(Level l)
          Sets up a new level for this button.
 void setSelected(boolean v)
          Describe setSelected method here.
 void toggleSelected()
          Toggles the selection on the button.
 java.lang.String toString()
          Describe toString method here.
protected  void updateButton()
          Updates the button.
protected  void updateDimensions()
          Updates the bounds of the button.
 
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, wait, wait, wait
 

Field Detail

UNSELECTED_COLOR

public static final java.awt.Color UNSELECTED_COLOR
The color to use for unselected buttons.


SELECTED_COLOR

public static final java.awt.Color SELECTED_COLOR
The color to use for selected buttons.

Constructor Detail

JobButton

public JobButton(Level l,
                 java.lang.String id)
Creates a new JobButton instance.

Parameters:
l - a Level value
id - a String value
Method Detail

getLevel

public Level getLevel()
Returns the level associated with this button.

Returns:
a Level value

setLevel

public void setLevel(Level l)
Sets up a new level for this button.

Parameters:
l - a Level value

getLemmingJob

public LemmingJob getLemmingJob()
Returns the job associated with this button.

Returns:
a LemmingJob value

setLemmingJob

public void setLemmingJob(java.lang.String id)
Sets up a new job for this button.

Parameters:
id - a String value

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.


updateButton

protected void updateButton()
Updates the button.


updateDimensions

protected void updateDimensions()
Updates the bounds of the button.

Overrides:
updateDimensions in class LComponent

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

toString

public java.lang.String toString()
Describe toString method here.

Returns:
a String value