extra.ui
Class ExtraMainWindow

java.lang.Object
  |
  +--waba.ui.Control
        |
        +--waba.ui.Container
              |
              +--waba.ui.Window
                    |
                    +--waba.ui.MainWindow
                          |
                          +--extra.ui.ExtraMainWindow
All Implemented Interfaces:
ISurface

public class ExtraMainWindow
extends MainWindow

A simple extension to MainWindow which adds a title if desired plus the functionality of RelativeContainer. At the moment you need to extend this class for your main app to use the extra.ui.List control but hopefully that won't always be the case.


Field Summary
static int ABOVE
           
static int AUTO
           
static int BELOW
           
static int BOTTOM
           
static int CENTER
           
static int FILL
           
static int JAVA
          Java based platform
static int LEFT
           
static int LEFTOF
           
static int PALMOS
          PalmOS based platform
static int platform
          the platform we are running on (from Vm.getPlatform())
static int REST
           
static int RIGHT
           
static int RIGHTOF
           
static int SAME
           
static int SAME_BOTTOM
           
static int SAME_LEFT
           
static int SAME_RIGHT
           
static int SAME_TOP
           
static int TOP
           
static int WINCE
          WinCE based platform
 
Fields inherited from class waba.ui.MainWindow
defaultFont
 
Constructor Summary
ExtraMainWindow()
          Constructs a new application without a title and no double buffering
ExtraMainWindow(boolean doubleBuffered)
          Constructs a new application without a title and the given double buffering
ExtraMainWindow(String name)
          Constructs a new application with the given title and no double buffering.
ExtraMainWindow(String name, boolean doubleBuffered)
          Constructs a new application with a standard pilot title bar and the given double buffering options.
 
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.
 void add(Control control)
          Adds a component to this application.
 void add(Control control, int x, int y)
          Adds a component to this application.
 void add(Control control, int x, int y, Control relative)
          Adds a component to this application.
 void add(Control control, int x, int y, int width, int height)
          Adds a component to this application.
 void add(Control control, int x, int y, int width, int height, Control relative)
          Adds a component to this application.
 Control findChild(int x, int y)
          Returns the child located at the given x and y coordinates.
 Title getTitle()
          Gets the title for this app, if any.
 void remove(Control control)
          Temporarily removes a component to this application.
 void removePermanently(Control control)
          Permanently removes a component to this application.
 void setFocus(Control c)
          Sets focus to the given control.
 void setGaps(int x, int y)
          Sets the standard gap between components when added with the LEFTOF, RIGHTOF, ABOVE and BELOW settings.
 void setMenuBar(MenuBar menubar)
          Sets the menubar for this application.
 void setRect(int x, int y, int width, int height)
          Sets the rectangle of this application.
 
Methods inherited from class waba.ui.MainWindow
_onTimerTick, _stopTimer, exit, getFontMetrics, getMainWindow, onExit, onStart, removeTimer
 
Methods inherited from class waba.ui.Window
createAWTGraphics, getFocus
 
Methods inherited from class waba.ui.Container
paintChildren
 
Methods inherited from class waba.ui.Control
addTimer, contains, createGraphics, getNext, getParent, getRect, onEvent, onPaint, postEvent, repaint
 
Methods inherited from class java.lang.Object
equals, hashCode, toString
 

Field Detail

PALMOS

public static final int PALMOS
PalmOS based platform

JAVA

public static final int JAVA
Java based platform

WINCE

public static final int WINCE
WinCE based platform

LEFT

public static final int LEFT

LEFTOF

public static final int LEFTOF

CENTER

public static final int CENTER

RIGHTOF

public static final int RIGHTOF

RIGHT

public static final int RIGHT

SAME

public static final int SAME

SAME_LEFT

public static final int SAME_LEFT

SAME_RIGHT

public static final int SAME_RIGHT

TOP

public static final int TOP

ABOVE

public static final int ABOVE

BELOW

public static final int BELOW

BOTTOM

public static final int BOTTOM

SAME_TOP

public static final int SAME_TOP

SAME_BOTTOM

public static final int SAME_BOTTOM

AUTO

public static final int AUTO

FILL

public static final int FILL

REST

public static final int REST

platform

public static int platform
the platform we are running on (from Vm.getPlatform())
Constructor Detail

ExtraMainWindow

public ExtraMainWindow()
Constructs a new application without a title and no double buffering

ExtraMainWindow

public ExtraMainWindow(boolean doubleBuffered)
Constructs a new application without a title and the given double buffering
Parameters:
doubleBuffered - true if an image buffer should be used, false otherwise.

ExtraMainWindow

public ExtraMainWindow(String name)
Constructs a new application with the given title and no double buffering.

ExtraMainWindow

public ExtraMainWindow(String name,
                       boolean doubleBuffered)
Constructs a new application with a standard pilot title bar and the given double buffering options.
Parameters:
title - the name of the app
doubleBuffered - true if an image buffer should be used, false otherwise.
Method Detail

getTitle

public Title getTitle()
Gets the title for this app, if any. Useful for relative placement.

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.
Overrides:
setFocus in class Window

_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. This method is not private to prevent the compiler from removing it during optimization.
Overrides:
_postEvent in class Window

_doPaint

public void _doPaint(int x,
                     int y,
                     int width,
                     int height)
Called by the VM to repaint an area. This method is not private to prevent the compiler from removing it during optimization.
Overrides:
_doPaint in class Window

findChild

public Control findChild(int x,
                         int y)
Returns the child located at the given x and y coordinates.
Overrides:
findChild in class Container

setGaps

public void setGaps(int x,
                    int y)
Sets the standard gap between components when added with the LEFTOF, RIGHTOF, ABOVE and BELOW settings.
Parameters:
x - the x gap in pixels
y - the y gap in pixels

setMenuBar

public void setMenuBar(MenuBar menubar)
Sets the menubar for this application. Will be launched when the menu key is pressed on the Palm.

add

public void add(Control control,
                int x,
                int y)
Adds a component to this application. See RelativeContainer for details
See Also:
RelativeContainer.add(Control,int,int,int,int,Control)

add

public void add(Control control,
                int x,
                int y,
                Control relative)
Adds a component to this application. See RelativeContainer for details
See Also:
RelativeContainer.add(Control,int,int,int,int,Control)

add

public void add(Control control,
                int x,
                int y,
                int width,
                int height)
Adds a component to this application. See RelativeContainer for details
See Also:
RelativeContainer.add(Control,int,int,int,int,Control)

add

public void add(Control control,
                int x,
                int y,
                int width,
                int height,
                Control relative)
Adds a component to this application. See RelativeContainer for details
See Also:
RelativeContainer.add(Control,int,int,int,int,Control)

add

public void add(Control control)
Adds a component to this application. See RelativeContainer for details
Overrides:
add in class Container
See Also:
RelativeContainer.add(Control,int,int,int,int,Control)

remove

public void remove(Control control)
Temporarily removes a component to this application. See RelativeContainer for details
Overrides:
remove in class Container
See Also:
RelativeContainer.add(Control,int,int,int,int,Control)

removePermanently

public void removePermanently(Control control)
Permanently removes a component to this application. See RelativeContainer for details
See Also:
RelativeContainer.add(Control,int,int,int,int,Control)

setRect

public void setRect(int x,
                    int y,
                    int width,
                    int height)
Sets the rectangle of this application.
Overrides:
setRect in class Control