|
||||||||||
| 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.
| Field Summary | |
|---|---|
protected TransformGroup |
transformGroup
|
| Constructor Summary | |
|---|---|
WidgetAssembler(Widget owner,
GroupNode ownerGroup)
|
|
| Method Summary | |
|---|---|
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. |
void |
addWidget(Widget widget,
org.openmali.vecmath2.Tuple2f location)
Adds a Widget to this assembler. |
boolean |
areKeyEventsDispatched()
|
boolean |
contains(Widget widget)
|
Widget |
getCurrentFocussedWidget()
|
org.openmali.vecmath2.Tuple2f |
getPosition(Widget widget)
|
float |
getPositionX(Widget widget)
|
float |
getPositionY(Widget widget)
|
java.util.List<Widget> |
getWidgets()
|
boolean |
isPickingDispatched()
|
void |
onControllerAxisChanged(org.jagatoo.input.devices.components.ControllerAxis axis,
int axisDelta)
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)
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)
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,
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,
long when)
This event is fired, when a key is pressed on a focused Widget. |
void |
onKeyReleased(org.jagatoo.input.devices.components.Key key,
long when)
This event is fired, when a key is released on a focused Widget. |
void |
onKeyTyped(char ch,
long when)
This event is fired when a key is typed on the keyboard. |
Widget |
pick(float relX,
float relY)
Retrieves the SubWidget which is actually picked. |
HUDPickResult |
pick(int canvasX,
int canvasY,
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 |
reposition(Widget widget,
org.openmali.vecmath2.Tuple2f position)
Repositions the Widget relative to the owner Widget |
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. |
void |
update()
|
void |
updateLocation(Widget widget,
float ownerLocX,
float ownerLocY)
Update the assembly Widgets' locations |
void |
updateLocations(float ownerLocX,
float ownerLocY)
Update the assembly Widgets' locations |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TransformGroup transformGroup
| Constructor Detail |
|---|
public WidgetAssembler(Widget owner,
GroupNode ownerGroup)
| Method Detail |
|---|
public final Widget getCurrentFocussedWidget()
public void setTransparency(float transparency,
boolean childrenToo)
transparency - childrenToo - public void setKeyEventsDispatched(boolean b)
b - public boolean areKeyEventsDispatched()
public void onKeyPressed(org.jagatoo.input.devices.components.Key key,
long when)
key - the key that was pressed
public void onKeyReleased(org.jagatoo.input.devices.components.Key key,
long when)
key - the key that was released
public void onKeyTyped(char ch,
long when)
ch - the typed key's characterwhen - the keyevent's timestamppublic void onControllerButtonPressed(org.jagatoo.input.devices.components.ControllerButton button)
button - the pressed buttonpublic void onControllerButtonReleased(org.jagatoo.input.devices.components.ControllerButton button)
button - the released button
public void onControllerAxisChanged(org.jagatoo.input.devices.components.ControllerAxis axis,
int axisDelta)
axis - the changed axisaxisDelta - isTopMost - is this Widget topMost
public void onInputStateChanged(org.jagatoo.input.devices.components.DeviceComponent comp,
int delta,
int state,
boolean isTopMost,
boolean hasFocus)
comp - delta - state - isTopMost - hasFocus - public void setPickDispatched(boolean b)
b - public boolean isPickingDispatched()
public HUDPickResult pick(int canvasX,
int canvasY,
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 pickingpickReason - 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 updateLocation(Widget widget,
float ownerLocX,
float ownerLocY)
widget - the Widget, which's location is to be updatedownerLocX - the owner Widget's x-locationownerLocY - the owner Widget's y-location
public void updateLocations(float ownerLocX,
float ownerLocY)
ownerLocX - the owner Widget's x-locationownerLocY - the owner Widget's y-location
public void reposition(Widget widget,
float posX,
float posY)
widget - the Widget to repositionposX - the new x-positionposY - the new y-position
public void reposition(Widget widget,
org.openmali.vecmath2.Tuple2f position)
widget - the Widget to repositionposition - the new positionpublic float getPositionX(Widget widget)
widget - the Widget in question
public float getPositionY(Widget widget)
widget - the Widget in question
public org.openmali.vecmath2.Tuple2f getPosition(Widget widget)
widget - the Widget in question
public java.util.List<Widget> getWidgets()
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 void addWidget(Widget widget,
org.openmali.vecmath2.Tuple2f location)
widget - the Widget to addlocation - the location to add the Widget at (relative to the owner's position)public void addWidget(Widget widget)
widget - the Widget to addpublic void removeWidget(Widget widget)
widget - the Widget to be removedpublic void update()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||