waba.ui
Class Window

java.lang.Object
  |
  +--waba.ui.Control
        |
        +--waba.ui.Container
              |
              +--waba.ui.Window
Direct Known Subclasses:
MainWindow

public class Window
extends Container
implements ISurface

Window is a "floating" top-level window. This class is not functional enough to be used for dialogs and other top-level windows, it currently exists only as a base class for the MainWindow class.


Field Summary
protected static ControlEvent _controlEvent
           
protected static KeyEvent _keyEvent
           
protected static PenEvent _penEvent
           
 
Fields inherited from class waba.ui.Container
children, tail
 
Fields inherited from class waba.ui.Control
height, next, parent, prev, width, x, y
 
Constructor Summary
Window()
          Constructs a window.
 
Method Summary
 void _doPaint(int x, int y, int width, int height)
          Called by the VM to repaint an area.
 void _postEvent(int type, int key, int x, int y, int modifiers, int timeStamp)
          Called by the VM to post key and pen events.
protected  void damageRect(int x, int y, int width, int height)
          Adds a damage rectangle to the current list of areas that need repainting.
 Control getFocus()
          Returns the focus control for this window.
 int getWinHandle()
           
 void setFocus(Control c)
          Sets focus to the given control.
 
Methods inherited from class waba.ui.Container
add, findChild, paintChildren, remove
 
Methods inherited from class waba.ui.Control
addTimer, contains, createGraphics, getFontMetrics, getNext, getParent, getRect, onEvent, onPaint, postEvent, removeTimer, repaint, setRect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_keyEvent

protected static KeyEvent _keyEvent

_penEvent

protected static PenEvent _penEvent

_controlEvent

protected static ControlEvent _controlEvent
Constructor Detail

Window

public Window()
Constructs a window.
Method Detail

setFocus

public void setFocus(Control c)
Sets focus to the given control. When a user types a key, the control with focus get the key event. At any given time, only one control in a window can have focus. Calling this method will cause a FOCUS_OUT control event to be posted to the window's current focus control (if one exists) and will cause a FOCUS_IN control event to be posted to the new focus control.

getFocus

public Control getFocus()
Returns the focus control for this window.
See Also:
setFocus(waba.ui.Control)

damageRect

protected void damageRect(int x,
                          int y,
                          int width,
                          int height)
Adds a damage rectangle to the current list of areas that need repainting.

_postEvent

public void _postEvent(int type,
                       int key,
                       int x,
                       int y,
                       int modifiers,
                       int timeStamp)
Called by the VM to post key and pen events.

_doPaint

public void _doPaint(int x,
                     int y,
                     int width,
                     int height)
Called by the VM to repaint an area.

getWinHandle

public int getWinHandle()
Specified by:
getWinHandle in interface ISurface