org.deken.game.component
Class GContainer

java.lang.Object
  extended by org.deken.game.sprites.Sprite
      extended by org.deken.game.component.GComponent
          extended by org.deken.game.component.GContainer
All Implemented Interfaces:
InputMouseListener, Updateable
Direct Known Subclasses:
GDecoratedContainer, GMenu, GMenuPopout, GSimpleContainer, GTableContainer, GWindow, MultiMenu

public abstract class GContainer
extends GComponent

Title: GContainer

Description: The object is for storing other GComponents. The extending classes will determine how the GComponents are displayed and stored.

Copyright: Copyright (c) 2006

Version:
1.0
Author:
Gary Deken

Nested Class Summary
 
Nested classes/interfaces inherited from class org.deken.game.component.GComponent
GComponent.Alignment, GComponent.MouseActions
 
Field Summary
protected  java.awt.Color backgroundColor
           
protected  boolean grabbed
           
 
Fields inherited from class org.deken.game.component.GComponent
horizontalAlignment, id, invalid, keyPolling, mouseActions, parent, requestKeyPolling, screenHeight, screenWidth, verticalAlignment, xOffSet, yOffSet
 
Fields inherited from class org.deken.game.sprites.Sprite
boundingBox, collisionMap, location, size
 
Constructor Summary
GContainer(int screenWidth, int screenHeight)
          GContainer
GContainer(int screenWidth, int screenHeight, InputMonitor.Mouse mouseAction)
           
GContainer(int screenWidth, int screenHeight, InputMonitor.Mouse mouseAction, int width, int height)
           
 
Method Summary
abstract  void add(GComponent component)
           
protected  GContainer copyBase(GContainer container)
           
abstract  java.util.List<? extends GComponent> getChildren()
           
abstract  GComponent getComponentByName(java.lang.String name)
           
 boolean isGrabbed()
          Returns whether this container has been grabbed by a mouse or other input.
 boolean isSizeSet()
           
abstract  void remove(GComponent gComponent)
           
 void setBackgroundColor(java.awt.Color backgroundColor)
           
 void setGrabbed(boolean grabbed)
          Sets whether this contain is grabbed by a mouse or other input.
 void setScreenHeightWidth(int screenWidth, int screenHeight)
           
 
Methods inherited from class org.deken.game.component.GComponent
addMouseAction, copy, copyBase, draw, getHorizontalAlignment, getMouseActions, getParent, getVerticalAlignment, getXLocation, getYLocation, isEnabled, positionHorizontalAlignment, positionVerticalAlignment, requestKeyPolling, setEnabled, setHorizontalAlignment, setInvalid, setKeyPolling, setMonitored, setParent, setVerticalAlignment, update, validate
 
Methods inherited from class org.deken.game.sprites.Sprite
getBounds, getDepth, getHeight, getLocation, getName, getSize, getWidth, removeFromMap, setBoundingBox, setBoundingBox, setCollisionMap, setLocation, setName, setSize, spriteCollison, toString, updateLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deken.game.input.InputMouseListener
notifyListener
 

Field Detail

grabbed

protected boolean grabbed

backgroundColor

protected java.awt.Color backgroundColor
Constructor Detail

GContainer

public GContainer(int screenWidth,
                  int screenHeight)
GContainer

Parameters:
screenWidth -
screenHeight -

GContainer

public GContainer(int screenWidth,
                  int screenHeight,
                  InputMonitor.Mouse mouseAction)
Parameters:
screenWidth -
screenHeight -
mouseAction -

GContainer

public GContainer(int screenWidth,
                  int screenHeight,
                  InputMonitor.Mouse mouseAction,
                  int width,
                  int height)
Parameters:
screenWidth -
screenHeight -
mouseAction -
width - Width of the container
height - Height of the container
Method Detail

add

public abstract void add(GComponent component)
Parameters:
component -

getChildren

public abstract java.util.List<? extends GComponent> getChildren()
Returns:
List of GComponents that this GContainer holds.

getComponentByName

public abstract GComponent getComponentByName(java.lang.String name)
Parameters:
name -
Returns:
GComponent

isGrabbed

public boolean isGrabbed()
Returns whether this container has been grabbed by a mouse or other input.

Returns:
boolean

isSizeSet

public boolean isSizeSet()

remove

public abstract void remove(GComponent gComponent)
Parameters:
gComponent -

setBackgroundColor

public void setBackgroundColor(java.awt.Color backgroundColor)

setGrabbed

public void setGrabbed(boolean grabbed)
Sets whether this contain is grabbed by a mouse or other input.

Parameters:
grabbed -

setScreenHeightWidth

public void setScreenHeightWidth(int screenWidth,
                                 int screenHeight)
Parameters:
screenWidth -
screenHeight -

copyBase

protected GContainer copyBase(GContainer container)