|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.sprites.Sprite
org.deken.game.component.GComponent
org.deken.game.component.GContainer
org.deken.game.component.GMenuPopout
public class GMenuPopout
Title: GMenuPopout
Description: The GMenuPopout is a button that when clicked will pop out a menu. If the popped out menu looses focus it will close, or when the button is clicked again.
The GMenuPopout can also be set to change based on the menu option selected. This may cause the button to change size. Copyright: Copyright (c) Dec 26, 2013
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.deken.game.component.GComponent |
---|
GComponent.Alignment, GComponent.MouseActions |
Field Summary | |
---|---|
protected GButton |
btnController
|
protected java.util.List<java.lang.String> |
buttons
|
protected java.lang.String |
controllerName
|
protected GMenu |
menuPopOut
|
protected boolean |
menuShown
|
Fields inherited from class org.deken.game.component.GContainer |
---|
backgroundColor, 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 | |
---|---|
GMenuPopout(int screenWidth,
int screenHeight)
|
|
GMenuPopout(int screenWidth,
int screenHeight,
Animation animation)
|
|
GMenuPopout(int screenWidth,
int screenHeight,
Animation animation,
Animation animationHighlight)
|
|
GMenuPopout(int screenWidth,
int screenHeight,
GText controllingButton)
|
Method Summary | |
---|---|
void |
add(GComponent component)
|
boolean |
addControllingButtonListener(ButtonListener listener)
|
void |
addMenu(GMenu gMenu)
Adds a GMenu to this pop out menu. |
GComponent |
copy()
|
void |
draw(java.awt.Graphics2D graphics,
int xOffset,
int yOffset)
Draws the sprite with the current offset. |
java.util.List<? extends GComponent> |
getChildren()
|
GComponent |
getComponentByName(java.lang.String name)
|
java.lang.String |
getControllingButtonName()
|
SpriteSize |
getSize()
|
boolean |
isMenuOpen()
|
void |
notifyButtonListener(java.lang.String name)
|
void |
notifyListener(InputMouseAction inputMouseAction)
notifyListener |
void |
remove(GComponent gameComponent)
|
void |
setBackgroundColor(java.awt.Color backgroundColor)
|
void |
setChangeToSelected(boolean changeToSelected)
|
void |
setCloseOnSelect(boolean closeOnSelect)
|
void |
setControllingButton(GButton button)
Copies the attributes from the button passed in, into the GMenuPopout's controlling button. |
void |
setHighLightColor(java.awt.Color highLightColor)
Sets the color when the mouse is on the button. |
void |
setLocation(GameLocation location)
|
void |
setMenuOffset(int menuOffset)
|
void |
setMonitored(boolean active)
|
void |
setSize(SpriteSize size)
|
protected void |
spriteCollison(Sprite collideSprite)
Handle the collision with another sprite. |
void |
update(long elapseTime)
update |
void |
validate(java.awt.Graphics2D graphics)
|
Methods inherited from class org.deken.game.component.GContainer |
---|
copyBase, isGrabbed, isSizeSet, setGrabbed, setScreenHeightWidth |
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, getWidth, removeFromMap, setBoundingBox, setBoundingBox, setCollisionMap, setName, toString, updateLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.List<java.lang.String> buttons
protected GButton btnController
protected java.lang.String controllerName
protected GMenu menuPopOut
protected boolean menuShown
Constructor Detail |
---|
public GMenuPopout(int screenWidth, int screenHeight)
public GMenuPopout(int screenWidth, int screenHeight, GText controllingButton)
public GMenuPopout(int screenWidth, int screenHeight, Animation animation)
public GMenuPopout(int screenWidth, int screenHeight, Animation animation, Animation animationHighlight)
Method Detail |
---|
public void add(GComponent component)
add
in class GContainer
public boolean addControllingButtonListener(ButtonListener listener)
public void addMenu(GMenu gMenu)
gMenu
- public GComponent copy()
copy
in class GComponent
public void draw(java.awt.Graphics2D graphics, int xOffset, int yOffset)
GComponent
draw
in class GComponent
public java.util.List<? extends GComponent> getChildren()
getChildren
in class GContainer
public GComponent getComponentByName(java.lang.String name)
getComponentByName
in class GContainer
public java.lang.String getControllingButtonName()
public SpriteSize getSize()
getSize
in class Sprite
public boolean isMenuOpen()
public void notifyButtonListener(java.lang.String name)
notifyButtonListener
in interface ButtonListener
public void notifyListener(InputMouseAction inputMouseAction)
InputMouseListener
This method is called when any Mouse Motion event occurs.
notifyListener
in interface InputMouseListener
inputMouseAction
- InputMouseActionpublic void remove(GComponent gameComponent)
remove
in class GContainer
public void setBackgroundColor(java.awt.Color backgroundColor)
setBackgroundColor
in class GContainer
public void setChangeToSelected(boolean changeToSelected)
public void setControllingButton(GButton button)
button
- public void setHighLightColor(java.awt.Color highLightColor)
highLightColor
- public void setCloseOnSelect(boolean closeOnSelect)
public void setLocation(GameLocation location)
setLocation
in class Sprite
location
- GameLocationpublic void setMenuOffset(int menuOffset)
public void setMonitored(boolean active)
setMonitored
in class GComponent
public void setSize(SpriteSize size)
setSize
in class Sprite
size
- SpriteSizepublic void update(long elapseTime)
GComponent
This method takes the elapse time, and calculates the new current frame of the animation.
update
in interface Updateable
update
in class GComponent
elapseTime
- longpublic void validate(java.awt.Graphics2D graphics)
validate
in class GComponent
protected void spriteCollison(Sprite collideSprite)
Sprite
spriteCollison
in class Sprite
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |