org.deken.game.component
Class MultiMenu
java.lang.Object
org.deken.game.sprites.Sprite
org.deken.game.component.GComponent
org.deken.game.component.GContainer
org.deken.game.component.MultiMenu
- All Implemented Interfaces:
- MenuListener, InputMouseListener, Updateable
public class MultiMenu
- extends GContainer
- implements MenuListener
Title: MultiMenu
Description: TODO
Copyright: Copyright (c) Oct 17, 2013
- 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 |
Constructor Summary |
MultiMenu(int screenWidth,
int screenHeight,
GameMap gameMap)
|
Methods inherited from class org.deken.game.component.GComponent |
addMouseAction, copyBase, getHorizontalAlignment, getMouseActions, getParent, getVerticalAlignment, getXLocation, getYLocation, isEnabled, positionHorizontalAlignment, positionVerticalAlignment, requestKeyPolling, setEnabled, setHorizontalAlignment, setInvalid, setKeyPolling, setParent, setVerticalAlignment |
Methods inherited from class org.deken.game.sprites.Sprite |
getBounds, getDepth, getHeight, getLocation, getName, getSize, getWidth, removeFromMap, setBoundingBox, setBoundingBox, setCollisionMap, setLocation, setName, setSize, toString, updateLocation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MultiMenu
public MultiMenu(int screenWidth,
int screenHeight,
GameMap gameMap)
add
public void add(GComponent component)
- Adds the component to this MultiMenu if it extends GMenu. Otherwise it
will throw a FactoryException.
- Specified by:
add
in class GContainer
- Parameters:
component
-
- Throws:
FactoryException
addGMenu
public int addGMenu(GMenu menu)
addFlipButton
public void addFlipButton(int menuId,
java.lang.String buttonName,
int flipToMenuId)
- Parameters:
menuId
- buttonName
- flipToMenuId
-
copy
public GComponent copy()
- Specified by:
copy
in class GComponent
- Returns:
- GComponent
draw
public void draw(java.awt.Graphics2D graphics,
int xOffset,
int yOffset)
- Description copied from class:
GComponent
- Draws the sprite with the current offset.
- Specified by:
draw
in class GComponent
getChildren
public java.util.List getChildren()
- Specified by:
getChildren
in class GContainer
- Returns:
- List of GComponents that this GContainer holds.
getComponentByName
public GComponent getComponentByName(java.lang.String name)
- Specified by:
getComponentByName
in class GContainer
- Returns:
- GComponent
notifyListener
public void notifyListener(InputMouseAction inputMouseAction)
- Description copied from interface:
InputMouseListener
- notifyListener
This method is called when any Mouse Motion event occurs.
- Specified by:
notifyListener
in interface InputMouseListener
- Parameters:
inputMouseAction
- InputMouseAction
notifyMenuListener
public void notifyMenuListener(java.lang.String name)
- Specified by:
notifyMenuListener
in interface MenuListener
remove
public void remove(GComponent gameComponent)
- Specified by:
remove
in class GContainer
setMonitored
public void setMonitored(boolean active)
- Specified by:
setMonitored
in class GComponent
update
public void update(long elapseTime)
- Description copied from class:
GComponent
- update
This method takes the elapse time, and calculates the new current frame of
the animation.
- Specified by:
update
in interface Updateable
- Specified by:
update
in class GComponent
- Parameters:
elapseTime
- long
validate
public void validate(java.awt.Graphics2D graphics)
- Specified by:
validate
in class GComponent
spriteCollison
protected void spriteCollison(Sprite collideSprite)
- Description copied from class:
Sprite
- Handle the collision with another sprite.
- Specified by:
spriteCollison
in class Sprite