|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Component
defines the base level object for the heads up display
and/or graphical user interface elements. The component is intended to be
heirarchical and allow for components to be added to the parent component.
Method Summary | |
void |
add(Component subComponent)
add adds a specified component as a child of this component. |
boolean |
contains(int x,
int y)
contains returns true if the given point is within the
constraints of the component. |
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 subtracts the specified component from the list of
children. |
void |
render()
render takes care of displaying the component to the
screen. |
void |
setColor(float r,
float g,
float b)
setColor sets the 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 transparency of the component
where 0 is completely transparent and 1 is completely opaque. |
Method Detail |
public void add(Component subComponent)
add
adds a specified component as a child of this component.
The child components will always be rendered after the parent. The
children will be rendered on top of the parent.
subComponent
- the child component.public void remove(Component subComponent)
remove
subtracts the specified component from the list of
children. This will call dispose on the child, and subsequently all its
children.
subComponent
- the compoent to delete.public boolean contains(int x, int y)
contains
returns true if the given point is within the
constraints of the component. Useful for things such as mouse placement.
x
- the x coordinate of the tested point.y
- the y coordinate of the tested point.
public void setColor(float r, float g, float b)
setColor
sets the color of the component. The values of
the red, green and blue components are expected to be between 0 and 1.
r
- the red component of the color.g
- the green component of the color.b
- the blue component of the color.public void setTransparency(float a)
setTransparency
sets the transparency of the component
where 0 is completely transparent and 1 is completely opaque.
a
- the alpha value of the component.public void setTexture(java.lang.String texture)
setTexture
sets the texture if any of the component.
texture
- the texture image that defines the texture of the
component.public void setSize(float width, float height)
setSize
sets the size of the component.
width
- the width of the component.height
- the height of the component.public void setLocation(float x, float y)
setLocation
sets the lower left point of the component.
x
- the x coordinate of the lower left point.y
- the y coordinate of the lower left point.public void isVisible(boolean value)
isVisible
determines if the component and it's children are
rendered. If the component is not visible it's children are also not
visible.
value
- if true the component and it's children are rendered,
otherwise not.public int getWidth()
getWidth
returns the current width of the component.
public int getHeight()
getHeight
returns the current height of the component.
public int getX()
getX
returns the current x location of the component.
Where the location is defined by the lower left point.
public int getY()
getY
returns the current y location of the component.
Where the location is defined by the lower left point.
public void dispose()
dispose
destroys the component and all it's children.
public void render()
render
takes care of displaying the component to the
screen.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |