ewe.ui
Class MainWindow

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.Container
              extended byewe.ui.Window
                  extended byewe.ui.MainWindow
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, HasProperties, ImageRefresher, ISurface, TimerProc, UIConstants, WindowConstants
Direct Known Subclasses:
mApp

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);
  }
 }
 


Nested Class Summary
 
Nested classes inherited from class ewe.ui.Window
Window.TaskBarIconInfo
 
Field Summary
static Font defaultFont
           
 
Fields inherited from class ewe.ui.Window
_controlEvent, _keyEvent, _penEvent, _sipEvent, canDisplay, closeLock, contents, creationData, currentCursor, downPoint, dragAndDropCursor, dragAndDropData, dragAndDropSource, firstDisplay, inEventThread, inFront, lastWindow, wasPainted
 
Fields inherited from class ewe.ui.Container
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren
 
Fields inherited from class ewe.ui.Control
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, parent, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y
 
Fields inherited from class ewe.ui.ControlBase
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput
 
Fields inherited from interface ewe.fx.ISurface
IMAGE_SURFACE, PRINTERJOB_SURFACE, WINDOW_SURFACE
 
Fields inherited from interface ewe.ui.WindowConstants
FLAG_ALWAYS_ON_TOP, FLAG_CAN_MAXIMIZE, FLAG_CAN_MINIMIZE, FLAG_CAN_RESIZE, FLAG_DONT_CLEAR_BACKGROUND, FLAG_FULL_SCREEN, FLAG_HAS_CLOSE_BUTTON, FLAG_HAS_TASKBAR_ENTRY, FLAG_HAS_TITLE, FLAG_IS_DEFAULT_SIZE, FLAG_IS_ICONIZED, FLAG_IS_MODAL, FLAG_IS_VISIBLE, FLAG_MAIN_WINDOW_COUNTER_ROTATED, FLAG_MAIN_WINDOW_ROTATED, FLAG_MAXIMIZE, FLAG_MAXIMIZE_ON_PDA, FLAG_MINIMIZE, FLAG_RESTORE, FLAG_SHOW_SIP_BUTTON, FLAG_STATE_KNOWN, FLAG_VISIBLE_ON_TO_FRONT, GUI_FLAG_HAS_TASKBAR, GUI_FLAG_REVERSE_OK_CANCEL, INFO_ACCEPT_DROPPED_FILES, INFO_CLIENT_RECT, INFO_DROPPED_DATA, INFO_FLAGS_FOR_SIZE, INFO_FONT, INFO_GUI_FLAGS, INFO_NATIVE_WINDOW, INFO_PARENT_RECT, INFO_POSITION_IN_NATIVE_DRAWING_SURFACE, INFO_SCREEN_RECT, INFO_TASKBAR_ICON, INFO_TITLE, INFO_WINDOW_FLAGS, INFO_WINDOW_ICON, INFO_WINDOW_RECT, NATIVE_WINDOW_GET_CONTAINING_WINDOW, NATIVE_WINDOW_GET_DRAWING_SURFACE, OPTION_FLAG_CLEAR, OPTION_FLAG_SET, OPTION_TASKBAR_ICON_MODIFY_ICON, OPTION_TASKBAR_ICON_MODIFY_TIP, SPECIAL_MOUSE_CAPTURE, SPECIAL_MOUSE_MOVE, SPECIAL_MOUSE_RELEASE, SPECIAL_MOUSE_RESIZE, SPECIAL_RESTART_GUI, SPECIAL_ROTATE_SCREEN, STATE_MAXIMIZED, STATE_MINIMIZED, STATE_NORMAL, STATE_UNKNOWN
 
Fields inherited from interface ewe.ui.UIConstants
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
 
Fields inherited from interface ewe.ui.CellConstants
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
 
Fields inherited from interface ewe.ui.ControlConstants
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
 
Fields inherited from interface ewe.fx.ImageRefresher
KEEP_VISIBLE
 
Constructor Summary
MainWindow()
          Constructs a main window.
 
Method Summary
 void _onTimerTick()
          Deprecated.  
protected  void _setTimerInterval(int milliseconds)
          Deprecated.  
protected  Timer addTimer(Control target, int millis)
          Deprecated.  
 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)
          Deprecated.  
 
Methods inherited from class ewe.ui.Window
_doPaint, _postEvent, _textEvent, applicationToFront, appResized, beginDragAndDrop, beginDragAndDrop, captureAppKeys, centerWindow, centerWindow, checkSipCoverage, clearQueuedMoves, clearWindowFlags, close, closeWindow, create, createNativeWindow, damageRect, doPostEvent, doPostEvent, doSpecialOp, enterNativeDialog, exitNativeDialog, getActiveWindow, getContainingWindow, getFocus, getGuiInfo, getInfo, getNativeWindow, getOpenWindows, getProperties, getState, getTitle, getWindowFlags, getWindowRect, handleNativeMessage, handleSipEvent, iconPressed, inNativeInput, isCreated, mobileWindowEvent, nativeGetGuiInfo, nextMouseIsMove, onEvent, releaseMouseCapture, resizeTo, setFocus, setIcon, setInfo, setState, setText, setTitle, setWindowFlags, setWindowRect, shutdown, shutdownAll, supportsMultiple, textInput, toFront, transferPenPress, tryWindow, waitUntilPainted, wantToHandle, windowToFront
 
Methods inherited from class ewe.ui.Container
_paintChildren, add, addDirectly, containerHasFocus, dismantle, dismantle, doHotKey, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getChildrenBackwards, getFirstFocus, getNextKeyFocus, gotFocus, lostFocus, remove, removeAll, repaintDataNow, scrollToVisible, takeFocus, takePromptControl
 
Methods inherited from class ewe.ui.Control
acceptsData, activate, addListener, addTimer, amOnTopFrame, calculateSizes, calculateTextSize, cancelCut, cancelHoldDown, canEdit, chainDataChange, change, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkPenTransparent, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createGraphics, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, doAction, doActionKey, doBackground, doBorder, doMenu, dontAcceptDrop, doPaint, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, exitEntry, fillBackground, formClosing, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFont, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getToolTip, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, make, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onControlEvent, onKeyEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, repaint, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setTextSize, setToolTip, show, shown, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testDim, ticked, toClipboard, toField, toField, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryNext, tryStartMenu, updateData, willAcceptDrop, willShowFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 

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

addTimer

protected Timer addTimer(Control target,
                         int millis)
Deprecated.  

Adds a timer to a control. This method is protected, the public method to add a timer to a control is the addTimer() method in the Control class.


removeTimer

public boolean removeTimer(Timer timer)
Deprecated.  

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()
             throws Exception
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.

Throws:
Exception

_onTimerTick

public void _onTimerTick()
Deprecated.  

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


_setTimerInterval

protected void _setTimerInterval(int milliseconds)
Deprecated.  

Called to set the VM's timer interval. This method is not public, you should use the addTimer() method in the Control class to create a timer.