|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjme.geometry.hud.AbstractComponent
AbstractComponent defines a base level of implementation of the
Component interface. The dispose and
render methods must be implmented by the subclass.
| Field Summary | |
protected float |
alpha
|
protected java.util.ArrayList |
children
|
protected Vector |
color
|
protected float |
height
|
protected int |
locationX
|
protected int |
locationY
|
protected float |
width
|
| Constructor Summary | |
AbstractComponent()
|
|
| Method Summary | |
void |
add(Component subComponent)
add places the subcomponent in the array list
of children. |
boolean |
contains(int x,
int y)
contains reports true if the supplied point is within
the constraints of the component. |
abstract void |
dispose()
dispose destroys the component and all it's children. |
int |
getHeight()
getHeight returns the current height of the component. |
int |
getWidth()
getWidth returns the current width of the component. |
int |
getX()
getX returns the current x location of the component. |
int |
getY()
getY returns the current y location of the component. |
void |
isVisible(boolean value)
isVisible determines if the component and it's children are
rendered. |
void |
remove(Component subComponent)
remove removes thes specified subComponent from
this component. |
abstract void |
render()
render takes care of displaying the component to the
screen. |
void |
setColor(float r,
float g,
float b)
setColor sets the overall color of the component. |
void |
setLocation(float x,
float y)
setLocation sets the lower left point of the component. |
void |
setSize(float width,
float height)
setSize sets the size of the component. |
void |
setTexture(java.lang.String texture)
setTexture sets the texture if any of the component. |
void |
setTransparency(float a)
setTransparency sets the alpha channel of the component. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int locationX
protected int locationY
protected float height
protected float width
protected Vector color
protected float alpha
protected java.util.ArrayList children
| Constructor Detail |
public AbstractComponent()
| Method Detail |
public void add(Component subComponent)
add places the subcomponent in the array list
of children. This list is not sorted in anyway.
add in interface ComponentsubComponent - the child to add to this component.Component.add(jme.geometry.hud.Component)public void remove(Component subComponent)
remove removes thes specified subComponent from
this component. This effectively disposes the subcomponent as
well as any children this child may have had.
remove in interface ComponentsubComponent - the child to remove.Component.remove(jme.geometry.hud.Component)
public boolean contains(int x,
int y)
contains reports true if the supplied point is within
the constraints of the component. If the point falls outside
of the component false is returned.
contains in interface Componentx - the x value of the component.y - the y value of the component.
Component.contains(int,int)
public void setColor(float r,
float g,
float b)
setColor sets the overall color of the component.
setColor in interface Componentr - the red value.g - the green value.b - the blue value.Component.setColor(float,float,float)public void setTransparency(float a)
setTransparency sets the alpha channel of the component.
setTransparency in interface Componenta - the alpha value.Component.setTransparency(float)public void setTexture(java.lang.String texture)
ComponentsetTexture sets the texture if any of the component.
setTexture in interface Componenttexture - the texture image that defines the texture of the
component.
public void setSize(float width,
float height)
ComponentsetSize sets the size of the component.
setSize in interface Componentwidth - the width of the component.height - the height of the component.
public void setLocation(float x,
float y)
ComponentsetLocation sets the lower left point of the component.
setLocation in interface Componentx - the x coordinate of the lower left point.y - the y coordinate of the lower left point.public void isVisible(boolean value)
ComponentisVisible determines if the component and it's children are
rendered. If the component is not visible it's children are also not
visible.
isVisible in interface Componentvalue - if true the component and it's children are rendered,
otherwise not.public int getWidth()
ComponentgetWidth returns the current width of the component.
getWidth in interface Componentpublic int getHeight()
ComponentgetHeight returns the current height of the component.
getHeight in interface Componentpublic int getX()
ComponentgetX returns the current x location of the component.
Where the location is defined by the lower left point.
getX in interface Componentpublic int getY()
ComponentgetY returns the current y location of the component.
Where the location is defined by the lower left point.
getY in interface Componentpublic abstract void dispose()
Componentdispose destroys the component and all it's children.
dispose in interface Componentpublic abstract void render()
Componentrender takes care of displaying the component to the
screen.
render in interface Component
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||