waba.ui
Class MainWindow

java.lang.Object
  |
  +--waba.ui.Control
        |
        +--waba.ui.Container
              |
              +--waba.ui.Window
                    |
                    +--waba.ui.MainWindow
All Implemented Interfaces:
ISurface
Direct Known Subclasses:
ExtraMainWindow, Welcome

public class MainWindow
extends Window

MainWindow is the main window of a UI based application.

All Waba programs with a user-interface must have a main window.

Here is an example showing a basic application:

 public class MyProgram extends MainWindow
 {
 public void onStart()
  {
  ... initialization code ...
  Label label = new Label("Name:");
  label.setRect(..);
  add(label);
  }
 }
 


Field Summary
static Font defaultFont
           
 
Constructor Summary
MainWindow()
          Constructs a main window.
 
Method Summary
 void _onTimerTick()
          Called by the VM to process timer interrupts.
 void _stopTimer()
           
 void exit(int exitCode)
          Notifies the application that it should stop executing and exit.
 FontMetrics getFontMetrics(Font font)
          Returns the font metrics for a given font.
static MainWindow getMainWindow()
          Returns the MainWindow of the current application.
 void onExit()
          Called just before an application exits.
 void onStart()
          Called when an application starts.
 boolean removeTimer(Timer timer)
          Removes a timer.
 
Methods inherited from class waba.ui.Window
_doPaint, _postEvent, createAWTGraphics, getFocus, setFocus
 
Methods inherited from class waba.ui.Container
add, findChild, paintChildren, remove
 
Methods inherited from class waba.ui.Control
addTimer, contains, createGraphics, getNext, getParent, getRect, onEvent, onPaint, postEvent, repaint, setRect
 
Methods inherited from class java.lang.Object
equals, hashCode, toString
 

Field Detail

defaultFont

public static final Font defaultFont
Constructor Detail

MainWindow

public MainWindow()
Constructs a main window.
Method Detail

exit

public void exit(int exitCode)
Notifies the application that it should stop executing and exit. It will exit after executing any pending events. If the underlying system supports it, the exitCode passed is returned to the program that started the app.

getMainWindow

public static MainWindow getMainWindow()
Returns the MainWindow of the current application.

getFontMetrics

public FontMetrics getFontMetrics(Font font)
Returns the font metrics for a given font.
Overrides:
getFontMetrics in class Control

removeTimer

public boolean removeTimer(Timer timer)
Removes a timer. This method returns true if the timer was found and removed and false if the given timer could not be found.
Overrides:
removeTimer in class Control

onExit

public void onExit()
Called just before an application exits.

onStart

public void onStart()
Called when an application starts. Initialization code is usually either placed in this method or simply in the app's constructor. This method is called just after the app's constructor is called.

_onTimerTick

public void _onTimerTick()
Called by the VM to process timer interrupts. This method is not private to prevent the compiler from removing it during optimization.

_stopTimer

public void _stopTimer()