ewe.ui
Class Container

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.Container
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, ImageRefresher, TimerProc, UIConstants
Direct Known Subclasses:
Canvas, CardPanel, SingleContainer, TableControl, Window

public class Container
extends Control

Container is a control that contains child controls.


Field Summary
 boolean closedFocus
          If this is true then the keyboard focus cannot be moved outside of this Container using the TAB or cursor keys.
 boolean cycleFocus
          If this is true then the keyboard focus will cycle from the first to the last control in this container when the focus has moved to the very first or very last control.
 boolean dontAutoScroll
          If this is set to true, then when child Controls gain the focus the GUI will not attempt to scroll so that the focused Control is visible.
 boolean dontFocusOnChildren
          If this is true then the keyboard focus cannot be moved to the Container's child controls using the TAB or cursor keys.
 
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.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
Container()
           
 
Method Summary
 void _paintChildren(Graphics g, int x, int y, int width, int height)
          Called by the system to draw the children of the container.
 void add(Control control)
          Adds a child control to this container.
 void addDirectly(Control control)
           
 boolean containerHasFocus()
          Returns true if the Container itself has the focus instead of one of its children.
 void dismantle()
           
 void dismantle(Control stopAt)
           
protected  boolean doHotKey(Control from, KeyEvent ev)
          This method checks to see if a KeyEvent should be considered the Control's hot-key.
 Control findChild(int x, int y)
          Returns the child located at the given x and y coordinates.
 void focusFirst()
           
 void focusFirst(int how)
           
 void focusOnContainer(int how)
          Put the focus on the container itself rather than any of its children.
 void focusOnData(int how)
          Put the focus on the data within the container.
 Iterator getChildren()
          This iterator cycles through the components which are physically added to this Control
 Iterator getChildrenBackwards()
           
protected  Control getFirstFocus()
           
 Control getNextKeyFocus(Control sourceChild, boolean forwards)
          Determine which sub-control should receive the keyboard focus.
 void gotFocus(int how)
          If a container gets the focus via an explicit focusOnContainer() then it will take the focus, otherwise it will call pass focus to the first control within it that wants the focus.
 void lostFocus(int how)
           
 void remove(Control control)
          Removes a child control from the container.
 void removeAll()
           
 void repaintDataNow()
          Repaint the "data" part of the Control now.
 boolean scrollToVisible(int x, int y, int width, int height)
           
 void takeFocus(int how)
           
protected  boolean takePromptControl(Control prompt)
          On a normal Control this will set the promptControl variable to "prompt", but on a Container, the first child non-container will have "prompt" assigned to it.
 
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, 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, onEvent, onKeyEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, removeTimer, repaint, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, resizeTo, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setText, 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

dontAutoScroll

public boolean dontAutoScroll
If this is set to true, then when child Controls gain the focus the GUI will not attempt to scroll so that the focused Control is visible.


dontFocusOnChildren

public boolean dontFocusOnChildren
If this is true then the keyboard focus cannot be moved to the Container's child controls using the TAB or cursor keys. You should also call modifyAll(NoFocus,TakesKeyFocus,false) on the Container after adding the sub-controls.


closedFocus

public boolean closedFocus
If this is true then the keyboard focus cannot be moved outside of this Container using the TAB or cursor keys.


cycleFocus

public boolean cycleFocus
If this is true then the keyboard focus will cycle from the first to the last control in this container when the focus has moved to the very first or very last control.

Constructor Detail

Container

public Container()
Method Detail

addDirectly

public void addDirectly(Control control)

add

public void add(Control control)
Adds a child control to this container.


remove

public void remove(Control control)
Removes a child control from the container.


findChild

public Control findChild(int x,
                         int y)
Returns the child located at the given x and y coordinates.


_paintChildren

public void _paintChildren(Graphics g,
                           int x,
                           int y,
                           int width,
                           int height)
Called by the system to draw the children of the container.


getChildren

public Iterator getChildren()
Description copied from class: Control
This iterator cycles through the components which are physically added to this Control

Overrides:
getChildren in class Control

getChildrenBackwards

public Iterator getChildrenBackwards()
Overrides:
getChildrenBackwards in class Control

repaintDataNow

public void repaintDataNow()
Description copied from class: Control
Repaint the "data" part of the Control now. This is only used for Controls with the HasData modifier. These are controls that distinguish between their data (e.g. contained text) and non-data (e.g. border) on-screen display. If the Control does not have the HasData modifier, then the entire control will be repainted via repaintNow().

Overrides:
repaintDataNow in class Control

removeAll

public void removeAll()

dismantle

public void dismantle(Control stopAt)

dismantle

public final void dismantle()

doHotKey

protected boolean doHotKey(Control from,
                           KeyEvent ev)
Description copied from class: Control
This method checks to see if a KeyEvent should be considered the Control's hot-key. If it is it calls doAction(ByKeyboard).

Overrides:
doHotKey in class Control
Parameters:
from - The Control (parent or sibling) that is passing the event to this Control.
ev - The KeyEvent representing the key press.
Returns:
true if the hot-key was accepted and handled.

getNextKeyFocus

public Control getNextKeyFocus(Control sourceChild,
                               boolean forwards)
Determine which sub-control should receive the keyboard focus. This method is normally called when the user moves the focus off of one control using TAB or the cursor keys. A control which has no children should not look for sub controls.

Overrides:
getNextKeyFocus in class Control
Parameters:
sourceChild - the child control from which the call came from, or null if the call came from the parent of this control, or this control itself.
forwards - true if the user wants to go to the next control, false if the user wants to go to the previous one.
Returns:
the control (which may be this control) that should receive the focus, or null if none should.

getFirstFocus

protected Control getFirstFocus()

takePromptControl

protected boolean takePromptControl(Control prompt)
On a normal Control this will set the promptControl variable to "prompt", but on a Container, the first child non-container will have "prompt" assigned to it.

Overrides:
takePromptControl in class Control
Parameters:
prompt - the Control acting as the prompt (usually an mLabel).

containerHasFocus

public boolean containerHasFocus()
Returns true if the Container itself has the focus instead of one of its children.


focusOnContainer

public void focusOnContainer(int how)
Put the focus on the container itself rather than any of its children.

Parameters:
how - one of the Control.ByXXX values (e.g. ByRequest)

focusOnData

public void focusOnData(int how)
Put the focus on the data within the container. This calls focusFirst().

Parameters:
how - one of the Control.ByXXX values (e.g. ByRequest)

gotFocus

public void gotFocus(int how)
If a container gets the focus via an explicit focusOnContainer() then it will take the focus, otherwise it will call pass focus to the first control within it that wants the focus. If there are none then it will take the focus itself.

Overrides:
gotFocus in class Control

lostFocus

public void lostFocus(int how)
Overrides:
lostFocus in class Control

focusFirst

public void focusFirst()

focusFirst

public void focusFirst(int how)

takeFocus

public void takeFocus(int how)
Overrides:
takeFocus in class Control

scrollToVisible

public boolean scrollToVisible(int x,
                               int y,
                               int width,
                               int height)