org.deken.game.component
Class GContainer
java.lang.Object
org.deken.game.sprites.Sprite
org.deken.game.component.GComponent
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
Fields inherited from class org.deken.game.component.GComponent |
horizontalAlignment, id, invalid, keyPolling, mouseActions, parent, requestKeyPolling, screenHeight, screenWidth, verticalAlignment, xOffSet, yOffSet |
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 |
grabbed
protected boolean grabbed
backgroundColor
protected java.awt.Color backgroundColor
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 containerheight
- Height of the container
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)