|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.util.SimpleRenderable
com.threerings.opengl.util.SimpleOverlay
com.threerings.opengl.gui.Root
public abstract class Root
Connects the BUI system into the JME scene graph.
| Nested Class Summary | |
|---|---|
protected class |
Root.ButtonRecord
Contains the state of a mouse button. |
protected class |
Root.KeyRecord
Describes a key being held down. |
protected static class |
Root.TickOp
Used to notify the tick participants. |
| Field Summary | |
|---|---|
protected Root.ButtonRecord[] |
_buttons
Mouse button information. |
protected Component |
_ccomponent
|
protected Clipboard |
_clipboard
|
protected Cursor |
_cursor
The cursor being displayed. |
protected int |
_daction
When dragging, the drag action. |
protected Transferable |
_ddata
When dragging, the drag data. |
protected ArrayList<Component> |
_defaults
|
protected TransferHandler |
_dhandler
When dragging, the transfer handler. |
protected Icon |
_dicon
When dragging, the visual representation of the dragged data. |
protected Component |
_dsource
When dragging, the drag source component. |
protected Component |
_focus
|
protected CopyOnWriteArrayList<EventListener> |
_globals
|
protected Component |
_hcomponent
|
protected ArrayList<Component> |
_invalidRoots
|
protected float |
_lastMoveTime
|
protected float |
_lastTipTime
|
protected Color4f |
_modalShade
|
protected int |
_modifiers
|
protected int |
_mouseX
|
protected int |
_mouseY
|
protected HashIntMap<Root.KeyRecord> |
_pressedKeys
Keys currently pressed, mapped by key code. |
protected int |
_px
The location at which the last press occurred, for drag tracking. |
protected int |
_py
The location at which the last press occurred, for drag tracking. |
protected SoundGroup |
_soundGroup
A sound group for feedback effects. |
protected Root.TickOp |
_tickOp
|
protected ObserverList<Tickable> |
_tickParticipants
|
protected long |
_tickStamp
|
protected float |
_tipTime
|
protected int |
_tipWidth
|
protected Window |
_tipwin
|
protected ArrayList<Window> |
_windows
|
protected static long |
CLICK_CHAIN_INTERVAL
Clicks this close to one another are chained together for counting purposes. |
protected static long |
CLICK_INTERVAL
Mouse buttons released within this interval after being pressed are counted as clicks. |
static String |
DEFAULT_CURSOR
The name of the default cursor config. |
protected static int |
DRAG_DISTANCE
The distance from the press location at which we can start a drag operation. |
protected static long |
KEY_REPEAT_DELAY
The delay in milliseconds before auto-repeated key presses will begin. |
protected static int |
KEY_REPEAT_RATE
The key press repeat rate. |
protected static int |
SOUND_SOURCES
The number of sound sources to allocate. |
protected static float |
TIP_MODE_RESET
|
| Fields inherited from class com.threerings.opengl.util.SimpleRenderable |
|---|
_batch, _ctx, _priority, _queue |
| Constructor Summary | |
|---|---|
Root(GlContext ctx)
|
|
| Method Summary | |
|---|---|
void |
addGlobalEventListener(EventListener listener)
Registers a listener that will be notified of all events prior to their being dispatched normally. |
void |
addTickParticipant(Tickable participant)
Adds a tick participant to the list. |
void |
addWindow(Window window)
Registers a top-level window with the input system. |
void |
addWindow(Window window,
boolean topLayer)
Registers a top-level window with the input system. |
protected boolean |
checkMouseMoved(int x,
int y)
Checks for a change to the mouse location, calling mouseDidMove(int, int) and returning
true if the mouse moved. |
void |
clearDrag()
Clears out any drag operation in progress. |
protected void |
clearTipWindow()
|
protected boolean |
dispatchEvent(Component target,
Event event)
Dispatches an event to the specified target (which may be null). |
protected boolean |
dispatchKeyEvent(Component target,
KeyEvent event)
Dispatches a key event, performing extra processing for key repeats. |
protected boolean |
dispatchMouseEvent(Component target,
MouseEvent event)
Dispatches a mouse event, performing extra processing for clicks. |
void |
dispose()
Releases the resources held by this root. |
protected void |
draw()
Draws the geometry in immediate mode. |
Clipboard |
getClipboard()
Returns a reference to the clipboard. |
String |
getClipboardText()
Returns the text in the clipboard, or null for none. |
protected Cursor |
getDefaultCursor()
Returns a reference to the default cursor, or null to use the operating system
default. |
abstract int |
getDisplayHeight()
Returns the height of the display area. |
abstract int |
getDisplayWidth()
Returns the width of the display area. |
Component |
getFocus()
Returns the component that currently has the focus, or null. |
int |
getModifiers()
Returns the current set of event modifiers. |
int |
getMouseX()
Returns the x coordinate of the mouse cursor. |
int |
getMouseY()
Returns the y coordinate of the mouse cursor. |
Sound |
getSound(String path)
Retrieves an instance of the sound at the specified path from the sound group. |
SoundGroup |
getSoundGroup()
Returns the sound group to use for feedback effects. |
protected Component |
getTargetComponent()
|
long |
getTickStamp()
Returns the current timestamp used to stamp event times. |
float |
getTooltipTimeout()
Returns the tool tip timeout. |
Window |
getTopWindow()
Returns a reference to the topmost window, or null if there are no windows. |
Window |
getWindow(int index)
Returns the window at the specified index. |
int |
getWindowCount()
Returns the total number of windows added to this node. |
boolean |
isDragging()
Checks whether a drag operation is in progress. |
boolean |
isOnTop(Window window)
Returns true if the specified window is on top. |
protected void |
keyPressed(long when,
char keyChar,
int keyCode,
boolean consume)
Handles a key press event. |
protected void |
keyReleased(long when,
char keyChar,
int keyCode,
boolean consume)
Handles a key release event. |
protected void |
mouseDidMove(int mouseX,
int mouseY)
|
protected void |
mouseMoved(long when,
int x,
int y,
boolean consume)
Handles a mouse moved/dragged event. |
protected void |
mousePressed(long when,
int button,
int x,
int y,
boolean consume)
Handles a mouse pressed event. |
protected void |
mouseReleased(long when,
int button,
int x,
int y,
boolean consume)
Handles a mouse released event. |
protected void |
mouseWheeled(long when,
int x,
int y,
int delta,
boolean consume)
Handles a mouse wheel event. |
void |
moveToTop(Window window)
Ensures that the specified window is on top. |
void |
playSound(String path)
Plays a sound by path. |
void |
popDefaultEventTarget(Component component)
Pops the default event target off the stack. |
void |
pushDefaultEventTarget(Component component)
Configures a component to receive all events that are not sent to some other component. |
void |
removeAllWindows()
Removes all windows from the root node. |
void |
removeGlobalEventListener(EventListener listener)
Removes a global event listener registration. |
void |
removeTickParticipant(Tickable participant)
Removes a tick participant from the list. |
void |
removeWindow(Window window)
Removes a window from participation in the input system. |
protected void |
renderModalShade(Renderer renderer)
|
void |
requestFocus(Component component)
Requests that the specified component be given the input focus. |
void |
resortWindows()
Called when an added window's layer is changed. |
void |
rootInvalidated(Component root)
This is called by a window or a scroll pane when it has become invalid. |
void |
setClipboardText(String text)
Sets the text in the clipboard. |
void |
setCursor(Cursor cursor)
Sets the cursor to display (or null to use the default cursor). |
protected void |
setFocus(Component focus)
Configures the component that has keyboard focus. |
void |
setModalShade(Color4f color)
Sets the color of the shade behind the first active modal window. |
void |
setMouseDown(int button)
Sets the mouse as being pressed at the current position. |
void |
setMousePosition(int x,
int y)
Sets the mouse position. |
void |
setMouseUp(int button)
Sets the mouse as being released at the current position. |
void |
setTooltipPreferredWidth(int width)
Sets the preferred width of tooltip windows. |
void |
setTooltipTimeout(float seconds)
Configures the number of seconds that the mouse must rest over a component to trigger a tooltip. |
void |
startDrag(TransferHandler handler,
Component source,
int action)
Initiates a drag operation. |
void |
tick(float elapsed)
Updates the state of this object based on the elapsed time in seconds. |
void |
tipTextChanged(Component component)
A large component that changes its tooltip while it is the hover component in the normal course of events can call this method to force an update to the tooltip window. |
String |
toString()
Generates a string representation of this instance. |
protected abstract void |
updateCursor(Cursor cursor)
Updates the cursor. |
protected void |
updateHoverComponent(int mx,
int my)
Recomputes the component over which the mouse is hovering, generating mouse exit and entry events as necessary. |
protected void |
windowDidMove(Window window)
Called by a window when its position changes. |
| Methods inherited from class com.threerings.opengl.util.SimpleOverlay |
|---|
composite, createStates |
| Methods inherited from class com.threerings.opengl.util.SimpleRenderable |
|---|
createBatch, enqueue, getStates |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_CURSOR
protected long _tickStamp
protected int _modifiers
protected int _mouseX
protected int _mouseY
protected Clipboard _clipboard
protected Window _tipwin
protected float _lastMoveTime
protected float _tipTime
protected float _lastTipTime
protected int _tipWidth
protected Color4f _modalShade
protected ArrayList<Window> _windows
protected Component _hcomponent
protected Component _ccomponent
protected Component _focus
protected ArrayList<Component> _defaults
protected ObserverList<Tickable> _tickParticipants
protected Root.TickOp _tickOp
protected CopyOnWriteArrayList<EventListener> _globals
protected ArrayList<Component> _invalidRoots
protected SoundGroup _soundGroup
protected Cursor _cursor
protected Root.ButtonRecord[] _buttons
protected HashIntMap<Root.KeyRecord> _pressedKeys
protected int _px
protected int _py
protected TransferHandler _dhandler
protected Component _dsource
protected Transferable _ddata
protected int _daction
protected Icon _dicon
protected static final float TIP_MODE_RESET
protected static final long CLICK_INTERVAL
protected static final long CLICK_CHAIN_INTERVAL
protected static final int KEY_REPEAT_RATE
protected static final long KEY_REPEAT_DELAY
protected static final int DRAG_DISTANCE
protected static final int SOUND_SOURCES
| Constructor Detail |
|---|
public Root(GlContext ctx)
| Method Detail |
|---|
public void dispose()
public SoundGroup getSoundGroup()
public void playSound(String path)
public Sound getSound(String path)
public long getTickStamp()
public int getModifiers()
public Clipboard getClipboard()
public String getClipboardText()
null for none.
public void setClipboardText(String text)
public void addWindow(Window window)
public void addWindow(Window window,
boolean topLayer)
topLayer - if true, will set the window layer to the top most layer if it's current
layer is less than that.public boolean isOnTop(Window window)
public void moveToTop(Window window)
public Window getTopWindow()
null if there are no windows.
public void resortWindows()
public void removeAllWindows()
public void removeWindow(Window window)
public void addTickParticipant(Tickable participant)
public void removeTickParticipant(Tickable participant)
public void setTooltipTimeout(float seconds)
public float getTooltipTimeout()
setTooltipTimeout(float) for details.
public void setTooltipPreferredWidth(int width)
public void addGlobalEventListener(EventListener listener)
public void removeGlobalEventListener(EventListener listener)
public void rootInvalidated(Component root)
public void pushDefaultEventTarget(Component component)
public void popDefaultEventTarget(Component component)
public void requestFocus(Component component)
public Component getFocus()
public int getWindowCount()
public Window getWindow(int index)
public abstract int getDisplayWidth()
public abstract int getDisplayHeight()
public void setCursor(Cursor cursor)
null to use the default cursor).
public void setMousePosition(int x,
int y)
@Beta public void setMouseDown(int button)
@Beta public void setMouseUp(int button)
public int getMouseX()
public int getMouseY()
public String toString()
toString in class Objectpublic void tipTextChanged(Component component)
public void setModalShade(Color4f color)
public void startDrag(TransferHandler handler,
Component source,
int action)
public void clearDrag()
public boolean isDragging()
public void tick(float elapsed)
Tickable
tick in interface Tickableprotected void draw()
SimpleRenderable
draw in class SimpleRenderableprotected abstract void updateCursor(Cursor cursor)
protected Cursor getDefaultCursor()
null to use the operating system
default.
protected void mousePressed(long when,
int button,
int x,
int y,
boolean consume)
protected void mouseReleased(long when,
int button,
int x,
int y,
boolean consume)
protected void mouseMoved(long when,
int x,
int y,
boolean consume)
protected void mouseWheeled(long when,
int x,
int y,
int delta,
boolean consume)
protected boolean checkMouseMoved(int x,
int y)
mouseDidMove(int, int) and returning
true if the mouse moved.
protected void keyPressed(long when,
char keyChar,
int keyCode,
boolean consume)
protected void keyReleased(long when,
char keyChar,
int keyCode,
boolean consume)
protected boolean dispatchMouseEvent(Component target,
MouseEvent event)
protected boolean dispatchKeyEvent(Component target,
KeyEvent event)
protected boolean dispatchEvent(Component target,
Event event)
protected void setFocus(Component focus)
protected void windowDidMove(Window window)
protected void mouseDidMove(int mouseX,
int mouseY)
protected void updateHoverComponent(int mx,
int my)
protected Component getTargetComponent()
protected void clearTipWindow()
protected void renderModalShade(Renderer renderer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||