com.threerings.opengl.gui
Class DisplayRoot

java.lang.Object
  extended by com.threerings.opengl.util.SimpleRenderable
      extended by com.threerings.opengl.util.SimpleOverlay
          extended by com.threerings.opengl.gui.Root
              extended by com.threerings.opengl.gui.DisplayRoot
All Implemented Interfaces:
Compositable, Enqueueable, Tickable

public class DisplayRoot
extends Root

A root for Display-based apps.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.opengl.gui.Root
Root.ButtonRecord, Root.KeyRecord, Root.TickOp
 
Field Summary
protected  boolean _wasActive
          Track whether we were active during the last event poll, so that we can consume the mouse click that may arrive with focus.
 
Fields inherited from class com.threerings.opengl.gui.Root
_buttons, _ccomponent, _clipboard, _cursor, _daction, _ddata, _defaults, _dhandler, _dicon, _dsource, _focus, _globals, _hcomponent, _invalidRoots, _lastMoveTime, _lastTipTime, _modalShade, _modifiers, _mouseX, _mouseY, _pressedKeys, _px, _py, _soundGroup, _tickOp, _tickParticipants, _tickStamp, _tipTime, _tipWidth, _tipwin, _windows, CLICK_CHAIN_INTERVAL, CLICK_INTERVAL, DEFAULT_CURSOR, DRAG_DISTANCE, KEY_REPEAT_DELAY, KEY_REPEAT_RATE, SOUND_SOURCES, TIP_MODE_RESET
 
Fields inherited from class com.threerings.opengl.util.SimpleRenderable
_batch, _ctx, _priority, _queue
 
Constructor Summary
DisplayRoot(GlContext ctx)
           
 
Method Summary
protected  void controllerMoved(Controller controller, long when, int index, boolean xAxis, boolean yAxis, float value)
          Notes that a controller has moved on an axis.
protected  void controllerPovXMoved(Controller controller, long when, float value)
          Notes that a controller has moved on the pov x axis.
protected  void controllerPovYMoved(Controller controller, long when, float value)
          Notes that a controller has moved on the pov y axis.
protected  void controllerPressed(Controller controller, long when, int index)
          Notes that a controller button has been pressed.
protected  void controllerReleased(Controller controller, long when, int index)
          Notes that a controller button has been released.
 int getDisplayHeight()
          Returns the height of the display area.
 int getDisplayWidth()
          Returns the width of the display area.
 void poll()
          Polls the input system for events and dispatches them.
 void setMousePosition(int x, int y)
          Sets the mouse position.
protected  void updateButtonModifier(int button, boolean pressed)
          Updates the modifier for the specified button.
protected  void updateCursor(Cursor cursor)
          Updates the cursor.
protected  void updateKeyModifier(int key, boolean pressed)
          Updates the modifier for the specified key, if any.
 
Methods inherited from class com.threerings.opengl.gui.Root
addGlobalEventListener, addTickParticipant, addWindow, addWindow, checkMouseMoved, clearDrag, clearTipWindow, dispatchEvent, dispatchKeyEvent, dispatchMouseEvent, dispose, draw, getClipboard, getClipboardText, getDefaultCursor, getFocus, getModifiers, getMouseX, getMouseY, getSound, getSoundGroup, getTargetComponent, getTickStamp, getTooltipTimeout, getTopWindow, getWindow, getWindowCount, isDragging, isOnTop, keyPressed, keyReleased, mouseDidMove, mouseMoved, mousePressed, mouseReleased, mouseWheeled, moveToTop, playSound, popDefaultEventTarget, pushDefaultEventTarget, removeAllWindows, removeGlobalEventListener, removeTickParticipant, removeWindow, renderModalShade, requestFocus, resortWindows, rootInvalidated, setClipboardText, setCursor, setFocus, setModalShade, setMouseDown, setMouseUp, setTooltipPreferredWidth, setTooltipTimeout, startDrag, tick, tipTextChanged, toString, updateHoverComponent, windowDidMove
 
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

_wasActive

protected boolean _wasActive
Track whether we were active during the last event poll, so that we can consume the mouse click that may arrive with focus.

Constructor Detail

DisplayRoot

public DisplayRoot(GlContext ctx)
Method Detail

poll

public void poll()
Polls the input system for events and dispatches them.


getDisplayWidth

public int getDisplayWidth()
Description copied from class: Root
Returns the width of the display area.

Specified by:
getDisplayWidth in class Root

getDisplayHeight

public int getDisplayHeight()
Description copied from class: Root
Returns the height of the display area.

Specified by:
getDisplayHeight in class Root

setMousePosition

public void setMousePosition(int x,
                             int y)
Description copied from class: Root
Sets the mouse position.

Overrides:
setMousePosition in class Root

updateCursor

protected void updateCursor(Cursor cursor)
Description copied from class: Root
Updates the cursor.

Specified by:
updateCursor in class Root

updateButtonModifier

protected void updateButtonModifier(int button,
                                    boolean pressed)
Updates the modifier for the specified button.


updateKeyModifier

protected void updateKeyModifier(int key,
                                 boolean pressed)
Updates the modifier for the specified key, if any.


controllerPressed

protected void controllerPressed(Controller controller,
                                 long when,
                                 int index)
Notes that a controller button has been pressed.


controllerReleased

protected void controllerReleased(Controller controller,
                                  long when,
                                  int index)
Notes that a controller button has been released.


controllerMoved

protected void controllerMoved(Controller controller,
                               long when,
                               int index,
                               boolean xAxis,
                               boolean yAxis,
                               float value)
Notes that a controller has moved on an axis.


controllerPovXMoved

protected void controllerPovXMoved(Controller controller,
                                   long when,
                                   float value)
Notes that a controller has moved on the pov x axis.


controllerPovYMoved

protected void controllerPovYMoved(Controller controller,
                                   long when,
                                   float value)
Notes that a controller has moved on the pov y axis.