edu.gatech.cs2335.lemmings.gui
Class LContainer

java.lang.Object
  extended byedu.gatech.cs2335.lemmings.gui.LComponent
      extended byedu.gatech.cs2335.lemmings.gui.LContainer
Direct Known Subclasses:
JobContainer, LevelContainer, LRootPane

public abstract class LContainer
extends LComponent

Class LContainer: The parent for all components that can contain other components.

 Revision History:
     v1.0 (Mar. 13, 2004) - Created the LContainer class
 

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

Constructor Summary
LContainer()
          Creates a new LContainer instance.
 
Method Summary
 boolean addChild(LComponent child)
          Attempts to add the component passed in as a child of this component.
 void clear()
          Removes all children.
 LComponent findActiveChild()
          Returns the top-most active child of this component.
 LComponent findChildAtCoordinates(java.awt.Point coords)
          Returns the pointer to the child of this component that the specified coordinates are inside of, if there is one, or NULL if there is no such child.
protected  java.util.List getChildren()
          Returns the list of children.
 void makeDirty()
          Marks the component dirty.
 void move(java.awt.Point offset)
          Moves the component by the offsets specified by the components of the point.
 boolean removeChild(LComponent child)
          Attempts to remove the component passed in from the list of children of the current component.
 boolean renderAll(java.awt.Graphics g)
          Calls paint on self and then all the children in z order.
 
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

LContainer

public LContainer()
Creates a new LContainer instance.

Method Detail

move

public final void move(java.awt.Point offset)
Moves the component by the offsets specified by the components of the point.

Specified by:
move in class LComponent
Parameters:
offset - a Point value

makeDirty

public final void makeDirty()
Marks the component dirty.

Specified by:
makeDirty in class LComponent

renderAll

public final boolean renderAll(java.awt.Graphics g)
Calls paint on self and then all the children in z order.

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

addChild

public final boolean addChild(LComponent child)
Attempts to add the component passed in as a child of this component. Returns true if the addition was successful, and false if it was not.

Parameters:
child - a LComponent value
Returns:
a boolean value

removeChild

public final boolean removeChild(LComponent child)
Attempts to remove the component passed in from the list of children of the current component. Returns true if the removal is successful, or false if the child could not be found in the list. The child is not deleted after removal.

Parameters:
child - a LComponent value
Returns:
a boolean value

getChildren

protected final java.util.List getChildren()
Returns the list of children.

Returns:
a List value

clear

public final void clear()
Removes all children.


findChildAtCoordinates

public final LComponent findChildAtCoordinates(java.awt.Point coords)
Returns the pointer to the child of this component that the specified coordinates are inside of, if there is one, or NULL if there is no such child.

Parameters:
coords - a Point value
Returns:
a LComponent value

findActiveChild

public final LComponent findActiveChild()
Returns the top-most active child of this component.

Returns:
bcomponent