|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfeud.testgame.gui.GUIComponent
GIOComponent is the abstract base class of a very very simple GUI system. The GUI components can't even paint themselves. They are just click and type sensitive areas of the screen. But it shouldn't be too jard to add functionality that improves the situation if you need that.
Field Summary | |
protected boolean |
visible
|
Constructor Summary | |
GUIComponent()
|
Method Summary | |
void |
add(GUIComponent c)
Adds a child component to this component. |
void |
draw(com.threed.jpct.FrameBuffer buffer)
Draws this component and all of its childs. |
boolean |
evaluateInput(MouseMapper mouse,
com.threed.jpct.util.KeyMapper keyMapper)
Processes key and mouse events in the context of this component. |
GUIComponent |
getParent()
Returns the parent of this component. |
int |
getParentX()
If this component is the child of another one, this will return the parent's x-position. |
int |
getParentY()
If this component is the child of another one, this will return the parent's y-position. |
int |
getX()
Returns the x-position of the component in screen coordinates. |
int |
getY()
Returns the y-position of the component in screen coordinates. |
boolean |
isVisible()
Is this component visible? |
void |
setVisible(boolean visi)
Sets if the component is visible or hidden. |
void |
setX(int x)
Sets the x-position of the component in screen coordinates. |
void |
setY(int y)
Sets the y-position of the component in screen coordinates. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean visible
Constructor Detail |
public GUIComponent()
Method Detail |
public void setX(int x)
x
- the x-positionpublic void setY(int y)
y
- the y-positionpublic void setVisible(boolean visi)
visi
- true if visible, false otherwisepublic boolean isVisible()
public int getX()
public int getY()
public int getParentX()
public int getParentY()
public GUIComponent getParent()
public void add(GUIComponent c)
c
- the child componentpublic boolean evaluateInput(MouseMapper mouse, com.threed.jpct.util.KeyMapper keyMapper)
mouse
- the MouseMapper used to process mouse eventskeyMapper
- the KeyMapper used to process key events
public void draw(com.threed.jpct.FrameBuffer buffer)
buffer
- the FrameBuffer on which to draw to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |