|
|||||||||||
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 Component
subComponent
- 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 Component
subComponent
- 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 Component
x
- 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 Component
r
- 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 Component
a
- the alpha value.Component.setTransparency(float)
public void setTexture(java.lang.String texture)
Component
setTexture
sets the texture if any of the component.
setTexture
in interface Component
texture
- the texture image that defines the texture of the
component.public void setSize(float width, float height)
Component
setSize
sets the size of the component.
setSize
in interface Component
width
- the width of the component.height
- the height of the component.public void setLocation(float x, float y)
Component
setLocation
sets the lower left point of the component.
setLocation
in interface Component
x
- the x coordinate of the lower left point.y
- the y coordinate of the lower left point.public void isVisible(boolean value)
Component
isVisible
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 Component
value
- if true the component and it's children are rendered,
otherwise not.public int getWidth()
Component
getWidth
returns the current width of the component.
getWidth
in interface Component
public int getHeight()
Component
getHeight
returns the current height of the component.
getHeight
in interface Component
public int getX()
Component
getX
returns the current x location of the component.
Where the location is defined by the lower left point.
getX
in interface Component
public int getY()
Component
getY
returns the current y location of the component.
Where the location is defined by the lower left point.
getY
in interface Component
public abstract void dispose()
Component
dispose
destroys the component and all it's children.
dispose
in interface Component
public abstract void render()
Component
render
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 |