|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.WidgetAssembler
public class WidgetAssembler
An instance of this class is hold by each Widget. It can be used to add Widgets to to create a new Widget from existing ones.
| Constructor Summary | |
|---|---|
WidgetAssembler(Widget owner)
|
|
| Method Summary | |
|---|---|
void |
addUnmanagedWidget(Widget widget)
Adds an unmanaged Widget to this assembler. |
void |
addWidget(Widget widget)
Adds a Widget to this assembler at location(0, 0). |
void |
addWidget(Widget widget,
float locX,
float locY)
Adds a Widget to this assembler. |
boolean |
areKeyEventsDispatched()
|
boolean |
contains(Widget widget)
|
protected void |
draw(Texture2DCanvas texCanvas,
int offsetX,
int offsetY)
|
int |
getAdditionalContentHeight()
|
int |
getAdditionalContentLeft()
|
int |
getAdditionalContentTop()
|
int |
getAdditionalContentWidth()
|
Widget |
getCurrentFocussedWidget()
|
float |
getPositionX(Widget widget)
|
float |
getPositionY(Widget widget)
|
boolean |
isPickingDispatched()
|
void |
onControllerAxisChanged(org.jagatoo.input.devices.components.ControllerAxis axis,
int axisDelta,
long when)
This event is fired when a ControllerAxis has changed and this Widget is the currently focussed one. |
void |
onControllerButtonPressed(org.jagatoo.input.devices.components.ControllerButton button,
long when)
This event is fired when a ControllerButton has been pressed and this Widget is the currently focussed one. |
void |
onControllerButtonReleased(org.jagatoo.input.devices.components.ControllerButton button,
long when)
This event is fired when a ControllerButton has been released and this Widget is the currently focussed one. |
void |
onInputStateChanged(org.jagatoo.input.devices.components.DeviceComponent comp,
int delta,
int state,
long when,
boolean isTopMost,
boolean hasFocus)
This event is fired when the state of any DeviceComponent has changed. |
void |
onKeyPressed(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
This event is fired, when a key is pressed on a focused Widget. |
void |
onKeyReleased(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
This event is fired, when a key is released on a focused Widget. |
void |
onKeyTyped(char ch,
int modifierMask,
long when)
This event is fired when a key is typed on the keyboard. |
void |
onOwnerMoved(float deltaX,
float deltaY,
boolean needsTextureRefresh)
Called by the owner when its location has changed. |
Widget |
pick(float relX,
float relY)
Retrieves the SubWidget which is actually picked. |
boolean |
pick(int canvasX,
int canvasY,
float widgetX,
float widgetY,
HUDPickResult.HUDPickReason pickReason,
org.jagatoo.input.devices.components.MouseButton button,
long when,
long meta,
int flags)
Dispatches the picking to the assembling Widgets. |
void |
removeWidget(Widget widget)
Removes a Widget from this assembler. |
void |
reposition(Widget widget,
float posX,
float posY)
Repositions the Widget relative to the owner Widget |
void |
setAdditionalContentSize(int additionalContentLeft,
int additionalContentTop,
int additionalContentWidth,
int additionalContentHeight)
|
void |
setKeyEventsDispatched(boolean b)
Enables or disables dispatching of key events to the assemble Widgets. |
void |
setPickDispatched(boolean b)
Enables or disables dispatching of pickings to the assemble Widgets. |
void |
setTransparency(float transparency,
boolean childrenToo)
Sets the whole Widget's Transparency. |
protected void |
setWidgetsDirty()
|
void |
update()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WidgetAssembler(Widget owner)
| Method Detail |
|---|
public void setAdditionalContentSize(int additionalContentLeft,
int additionalContentTop,
int additionalContentWidth,
int additionalContentHeight)
public final int getAdditionalContentLeft()
public final int getAdditionalContentTop()
public final int getAdditionalContentWidth()
public final int getAdditionalContentHeight()
public final Widget getCurrentFocussedWidget()
public void setTransparency(float transparency,
boolean childrenToo)
transparency - childrenToo - public void setKeyEventsDispatched(boolean b)
b - public final boolean areKeyEventsDispatched()
public void onKeyPressed(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
key - the key that was pressedmodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
public void onKeyReleased(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
key - the key that was releasedmodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
public void onKeyTyped(char ch,
int modifierMask,
long when)
ch - the typed key's charactermodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
public void onControllerButtonPressed(org.jagatoo.input.devices.components.ControllerButton button,
long when)
button - the pressed buttonwhen -
public void onControllerButtonReleased(org.jagatoo.input.devices.components.ControllerButton button,
long when)
button - the released buttonwhen -
public void onControllerAxisChanged(org.jagatoo.input.devices.components.ControllerAxis axis,
int axisDelta,
long when)
axis - the changed axisaxisDelta - when -
public void onInputStateChanged(org.jagatoo.input.devices.components.DeviceComponent comp,
int delta,
int state,
long when,
boolean isTopMost,
boolean hasFocus)
comp - delta - state - when - isTopMost - hasFocus - public void setPickDispatched(boolean b)
b - public final boolean isPickingDispatched()
public boolean pick(int canvasX,
int canvasY,
float widgetX,
float widgetY,
HUDPickResult.HUDPickReason pickReason,
org.jagatoo.input.devices.components.MouseButton button,
long when,
long meta,
int flags)
canvasX - the absolute canvas-x-position of the pickingcanvasY - the absolute canvas-y-position of the pickingwidgetX - widgetY - pickReason - the reson of this pickingbutton - the mouse-button, that caused the pickingwhen - meta - flags -
public Widget pick(float relX,
float relY)
relX - the mouse-x-position relative to the owner Widget's positionrelY - the mouse-y-position relative to the owner Widget's position
public void reposition(Widget widget,
float posX,
float posY)
widget - the Widget to repositionposX - the new x-positionposY - the new y-position
public void onOwnerMoved(float deltaX,
float deltaY,
boolean needsTextureRefresh)
deltaX - deltaY - public final float getPositionX(Widget widget)
widget - the Widget in question
public final float getPositionY(Widget widget)
widget - the Widget in question
public boolean contains(Widget widget)
public void addWidget(Widget widget,
float locX,
float locY)
widget - the Widget to addlocX - the x-location to add the Widget at (relative to the owner's position)locY - the y-location to add the Widget at (relative to the owner's position)public final void addWidget(Widget widget)
widget - the Widget to addpublic void addUnmanagedWidget(Widget widget)
widget - the Widget to addpublic void removeWidget(Widget widget)
widget - the Widget to be removedpublic void update()
protected void setWidgetsDirty()
protected void draw(Texture2DCanvas texCanvas,
int offsetX,
int offsetY)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||