com.threerings.opengl.gui
Class CanvasRoot

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.CanvasRoot
All Implemented Interfaces:
Compositable, Enqueueable, Tickable, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, EventListener

public class CanvasRoot
extends Root
implements MouseListener, MouseMotionListener, MouseWheelListener, KeyListener

Bridges between the AWT and the BUI input event system when we are being used in an AWT canvas.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.opengl.gui.Root
Root.ButtonRecord, Root.KeyRecord, Root.TickOp
 
Field Summary
protected  Component _canvas
           
 
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
CanvasRoot(GlContext ctx, Component canvas)
           
 
Method Summary
protected  int convertButton(MouseEvent e)
           
protected  int convertKeyCode(KeyEvent e)
           
protected  int convertModifiers(int modifiers)
           
 int getDisplayHeight()
          Returns the height of the display area.
 int getDisplayWidth()
          Returns the width of the display area.
 void keyPressed(KeyEvent e)
           
 void keyReleased(KeyEvent e)
           
 void keyTyped(KeyEvent e)
           
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void mouseWheelMoved(MouseWheelEvent e)
           
protected  void updateCursor(Cursor cursor)
          Updates the cursor.
 
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, setMousePosition, 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

_canvas

protected Component _canvas
Constructor Detail

CanvasRoot

public CanvasRoot(GlContext ctx,
                  Component canvas)
Method Detail

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

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener

mouseWheelMoved

public void mouseWheelMoved(MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface MouseWheelListener

keyPressed

public void keyPressed(KeyEvent e)
Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent e)
Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent e)
Specified by:
keyTyped in interface KeyListener

updateCursor

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

Specified by:
updateCursor in class Root

convertModifiers

protected int convertModifiers(int modifiers)

convertButton

protected int convertButton(MouseEvent e)

convertKeyCode

protected int convertKeyCode(KeyEvent e)