edu.gatech.cs2335.lemmings.gui
Class LevelButton

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

public class LevelButton
extends LAbstractButton

Class LevelButton: This is essentially the button that shows the name of the level, it's thumbnail, and some statistics.

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

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

Constructor Summary
LevelButton(java.lang.String levelName)
          Creates a new LevelButton instance.
 
Method Summary
protected  void copy(LComponent component)
          Deep-copies self into the component passed in.
 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 setLevel(java.lang.String name)
          Sets up to display the level with the specified id.
 void setSelected(boolean v)
          Describe setSelected method here.
 void toggleSelected()
          Toggles the selection on 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, toString, wait, wait, wait
 

Constructor Detail

LevelButton

public LevelButton(java.lang.String levelName)
Creates a new LevelButton instance.

Parameters:
levelName - The id associated with the level we would like to display in this button.
Method Detail

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.


updateDimensions

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

Overrides:
updateDimensions in class LComponent

setLevel

public final void setLevel(java.lang.String name)
Sets up to display the level with the specified id.

Parameters:
name - a String value name cannot be found.

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