|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.ui.Control | +--waba.ui.Container | +--waba.ui.Window | +--waba.ui.MainWindow
MainWindow is the main window of a UI based application.
All SuperWaba programs with a user-interface must have one and only one main window.
Here is an example showing a basic application:
public class MyProgram extends MainWindow { Edit edName; public void onStart() { ... initialization code ... add(new Label("Name:"), LEFT,TOP+2); add(edName = new Edit(""), AFTER,SAME-2); } }
Field Summary | |
static Font |
defaultFont
Default font used in all controls created. |
Fields inherited from class waba.ui.Window |
beepIfOut,
borderStyle,
canDrag,
eraseBackgroundNow,
flicker,
HIDE_STATE,
highResPrepared,
imgCovered,
lastSwappedContainer,
mainSwapContainer,
menubar,
needsPaint,
NO_BORDER,
RECT_BORDER,
ROUND_BORDER,
TAB_BORDER,
TAB_ONLY_BORDER,
title,
titleFont,
topMost,
VK_BOTTOM,
VK_HIDE,
VK_TOP,
zStack |
Fields inherited from class waba.ui.Container |
BORDER_LOWERED,
BORDER_NONE,
BORDER_RAISED,
BORDER_SIMPLE,
children,
lastH,
lastW,
lastX,
lastY,
parentWindow,
tail |
Fields inherited from class waba.ui.Control |
AFTER,
appId,
asContainer,
asWindow,
backColor,
backDis,
BEFORE,
BOTTOM,
CENTER,
enabled,
FILL,
FIT,
fm,
fmH,
focusLess,
font,
foreColor,
foreDis,
height,
LEFT,
parent,
PREFERRED,
RANGE,
RIGHT,
SAME,
TOP,
visible,
width,
x,
x2,
y,
y2 |
Constructor Summary | |
MainWindow()
Constructs a main window with no title and no border. |
|
MainWindow(String title,
byte style)
Constructs a main window with the given title and border style. |
Method Summary | |
void |
_onTimerTick()
Called by the VM to process timer interrupts. |
void |
_runThreads()
Called by the VM to process threads. |
void |
addThread(Thread t,
boolean highPriority)
Add the given thread to the active list of threads. |
protected Timer |
addTimer(Control target,
int millis)
Adds a timer to a control. |
void |
appEnding()
Called by the system so we can finish things correctly. |
void |
appStarting()
Called by the VM when the application is starting. |
void |
exit(int exitCode)
Notifies the application that it should stop executing and exit. |
String |
getCommandLine()
Returns the command line passed by the application that called us in the Vm.exec method |
FontMetrics |
getFontMetrics(Font font)
Returns the font metrics for a given font. |
static MainWindow |
getMainWindow()
Returns the MainWindow of the current application. |
void |
killThreads()
Kill all running threads. |
void |
onExit()
Called just before an application exits. |
void |
onStart()
Called when an application starts. |
void |
removeThread(Thread t)
Remove the given thread from the active list of threads. |
boolean |
removeTimer(Timer timer)
Removes a timer. |
Methods inherited from class waba.ui.Window |
_doPaint,
_doPaint,
_postEvent,
damageRect,
destroyZStack,
dontSaveBehind,
getClientRect,
getFocus,
getOffScreen,
getPreferredHeight,
getPreferredWidth,
getTopMost,
isTopMost,
isVisible,
loadBehind,
makeUnmovable,
onClickedOutside,
onPopup,
onUnpop,
paintTitle,
popupBlockingModal,
popupMenuBar,
popupModal,
postPopup,
postUnpop,
pumpEvents,
saveBehind,
setBorderStyle,
setDoubleBuffer,
setFocus,
setMenuBar,
setStatePosition,
setTitle,
setTitleFont,
swap,
unpop,
validate |
Methods inherited from class waba.ui.Container |
add,
add,
add,
broadcastEvent,
findChild,
getChildren,
onColorsChanged,
onPaint,
paintChildren,
remove,
setEnabled |
Methods inherited from class waba.ui.Control |
addTimer,
contains,
createGraphics,
getAbsoluteRect,
getBackColor,
getFont,
getForeColor,
getNext,
getParent,
getParentWindow,
getPos,
getRect,
getSize,
isDisplayed,
isEnabled,
onBoundsChanged,
onEvent,
onFontChanged,
onWindowPaintFinished,
postEvent,
repaint,
repaintNow,
requestFocus,
setBackColor,
setBackForeColors,
setFocusLess,
setFont,
setForeColor,
setRect,
setRect,
setRect,
setVisible |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
toString,
wait,
wait |
Field Detail |
public static Font defaultFont
Constructor Detail |
public MainWindow()
public MainWindow(String title, byte style)
Method Detail |
public final void exit(int exitCode)
public static MainWindow getMainWindow()
public FontMetrics getFontMetrics(Font font)
protected Timer addTimer(Control target, int millis)
public boolean removeTimer(Timer timer)
public final void appStarting()
public final void appEnding()
public void onExit()
public void onStart()
public void _onTimerTick()
public String getCommandLine()
public void addThread(Thread t, boolean highPriority)
removeThread
.t
- the thread to be enqueuedhighPriority
- High priority threads (when parameter is true) are run
all at once each time the MainWindow._runThreads method is called by the
VM; low priority threads (when parameter is false) are run sequencially one
at a time in each call of _runThreads by the VM. Making too much high
priority threads isnt a good choice because it blocks normal events. After
each call of MainWindow.runThreads, the VM dispatch the normal events.public void removeThread(Thread t)
stopped
method of the thread.public void _runThreads()
public void killThreads()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |