public abstract class AbstractContainer<O extends OutputManager<?>> extends AbstractWidget<O> implements Container<O>
| Modifier and Type | Class and Description |
|---|---|
private static class |
AbstractContainer.WorkArea
Stores global data relating to the state of the current context.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<ContainerStateListener<O>> |
containerStateListeners
List of container state listeners
|
private Widget<O> |
current
Current (in focus) widget.
|
private java.util.Set<Widget<?>> |
ignoreFocusSet
The set of widgets that are never selected for focus - they are ignored by
checkWidget(Widget, boolean).
|
private java.util.ArrayList<Widget<O>> |
incomingSystemWidgets
Widgets that were relocated from another container to this container using
BaseEntity.setSystemParent(GenericWidget) |
private Insets |
insets
Container insets.
|
private LayoutManager<O> |
layoutManager
Layout manager.
|
private static CentralLogger |
LOG
logger
|
private java.util.ArrayList<Widget<O>> |
outgoingSystemWidgets
Widgets that were relocated from this container to another container using
BaseEntity.setSystemParent(GenericWidget). |
private java.util.Set<Widget<O>> |
selectedWidgets
Widgets which are stated to be selected in this container
|
private Dimension |
size
Container size.
|
private java.util.List<Widget<O>> |
tabItemList
The tab item list for this container.
|
private WidgetId |
topLevelWidgetId
The widget ID we need to ensure be on the top.
|
private java.util.ArrayList<Widget<O>> |
widgets
Widgets stored in the container.
|
private static ContextLocal<AbstractContainer.WorkArea> |
work
Stores context-local state variables.
|
listeners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
AbstractContainer()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Container<O> |
add(int pos,
Widget<O> widget)
Add the widget on the specified position.
|
Container<O> |
add(Widget<O> widget)
Add widget to container.
|
Container<O> |
add(Widget<O> before,
Widget<O> widget)
Add the widget before the specified widget.
|
void |
addContainerStateListener(ContainerStateListener<O> listener)
Adds container state listener.
|
protected void |
addDirectly(Widget<O> widget)
Add widget directly to the list without triggering repaint or other
operations.
|
(package private) void |
addIncomingSystemWidget(Widget<O> widget)
Adds a widget to the list of incoming system widgets.
|
(package private) void |
addOutgoingSystemWidget(Widget<O> widget)
Adds a widget to the list of outgoing system widgets.
|
protected boolean |
belongsTo(Widget<O> widget)
Check if specified widget belongs to this container.
|
protected boolean |
checkWidget(Widget<O> widget,
boolean direction)
Check potential focus candidate and set focus on it if it matches
criteria.
|
Point |
childrenLocation(Widget<O> child)
Get children location for one child.
|
boolean |
clipping()
This method should be overridden in a container that allows clipping.
|
protected NativeRectangle |
clipRectangle(NativePoint origin,
NativeDimension dimension,
boolean children)
Build clipped rectangle for given coordinates.
|
protected void |
copyState(Widget<?> w)
Copy the widget state from the specified source widget to this instance.
|
Widget<O> |
currentFocus()
Get widget which is in focus.
|
Widget<O> |
currentFocus(boolean recurse)
Get widget which is in focus.
|
protected void |
cycleFocus(boolean direction)
Search for the next or previous focusable widget in this container and
set focus on it.
|
Widget<O> |
defaultFocus()
Get default focusable widget.
|
void |
deregisterSelectedWidget(Widget<O> widget)
Deregister a widget from the list of selected widgets.
|
void |
destroy()
Destroy this widget.
|
void |
detach(Widget<O> widget)
Detach this widget from this container.
|
Dimension |
dimension()
Get widget dimension.
|
void |
doLayout()
Lay out container.
|
void |
draw()
Draw widget.
|
void |
dumpCurrentWidgets()
Outputs the string-formatted chain of current widgets starting from this container level.
|
void |
dumpWidgets()
Dumps to console the tree of widgets.
|
private void |
dumpWidgets(java.lang.String indent)
Dumps to console the tree of widgets.
|
void |
endSizeChange(boolean repaint)
Indicates the ending of the resize process.
|
Widget<O> |
findMouseSource(NativePoint p)
Find the widget positioned just bellow the specified mouse position (in physical units).
|
void |
firstFocus()
Set focus to first focusable widget.
|
Widget<O> |
focus()
Returns the focused direct child Component.
|
boolean |
focusTraversable()
Check if widget is focus traversable.
|
protected void |
focusWorker(boolean direction)
Search for the next or previous focusable widget in the container and
set focus on it.
|
private java.lang.String |
formatCurrentWidgets(java.lang.String indent)
Formats the chain of current widgets starting from this container level.
|
protected java.lang.String |
formatDump()
Formats this widget for a debug dump.
|
Widget<O> |
get(int index)
Get widget for provided index or
null if no such component
exists. |
java.util.Collection<Widget<O>> |
getAllSelectedWidgets()
Retrieve all widgets which are registered as selected in this container.
|
Rectangle |
getClipRect()
Get clipping rectangle.
|
private java.util.List<Widget<O>> |
getDrawableWidgets()
Get the widgets which can be drawn, from this container.
|
Dimension |
getEffectiveScrollableSize()
Calculates the effective size of the scrollable area of this container.
|
Widget<O> |
getFocusInt()
Get focused widget.
|
java.util.Set<Widget<?>> |
getIgnoreFocus()
Returns the set of widgets that are never selected for focus.
|
LayoutManager<O> |
getLayout()
Get active layout manager for the container.
|
Dimension |
getScrollableSize()
Returns the preferred size of the scrollable area of this container.
|
java.util.List<Widget<O>> |
getTabItemList()
Returns the tab item list for this container.
|
boolean |
hasFocusable(Widget<O> exclude)
Reports if there is at least 1 focusable widget that is not the given
widget.
|
double |
height()
Get widget height.
|
Insets |
insets()
Get container insets.
|
void |
lastFocus()
Set focus to last focusable widget.
|
private Widget<O> |
locateFocusTraversable(java.lang.Iterable<Widget<O>> iter)
Helper method for traversing widgets in the container.
|
Dimension |
minimumSize()
Get widget minimum size.
|
void |
moveAfterTabItem(Widget<O> widget,
Widget<O> after)
Move specified widget after the widget "after".
|
void |
moveBeforeTabItem(Widget<O> widget,
Widget<O> before)
Move specified widget before the widget "before".
|
void |
moveToBottom(Widget<O> widget)
Mode specified widget to the bottom of the widget list.
|
boolean |
moveToBottomInClass(Widget<O> widget)
Move the specified widget to the bottom of the widget list considering Z-order class.
|
void |
moveToTop(Widget<O> widget)
Move specified widget to the top of widget list.
|
boolean |
moveToTopInClass(Widget<O> widget)
Move the specified widget to the top of widget list considering Z-order class.
|
void |
moveToZpos(Widget<O> widget,
int pos)
Move widget to specified position in the widget list.
|
void |
nextFocus()
Select next focusable widget.
|
void |
normalizeZOrder()
Reorder widgets according to their ZOrderClass
retaining the order within the class
|
protected void |
onWidgetAdded(Widget<O> w)
The method is called when a widget is added to the container.
|
protected void |
onWidgetRemoved(Widget<O> w)
The method is called when a widget is removed from the container.
|
void |
paintOnTop(WidgetId widgetId)
Mark specified widget ID to be on the top of the painting order.
|
boolean |
parentOf(Widget<O> w)
The method returns
true if this container is parent of the supplied widget. |
protected java.util.List<Widget<O>> |
prepareWidgets(java.util.List<Widget<O>> widgets)
Prepare widgets before drawing
|
void |
prevFocus()
Select previous focusable widget.
|
void |
processKeyEvent(KeyInput event)
Process key event.
|
void |
reflectAncestorChange()
Called when any of the widget's ancestors gets re-assigned.
|
void |
reflectLocationChanged()
Called when the widget's location changes.
|
void |
registerSelectedWidget(Widget<O> widget)
Register a widget to the list of selected widgets.
|
void |
remove(Widget<O> widget)
Remove specified widget from the widget list.
|
void |
removeContainerStateListener(ContainerStateListener<O> listener)
Removes container state listener.
|
(package private) void |
removeIncomingSystemWidget(Widget<O> widget)
Removes a widget from the list of incoming system widgets.
|
(package private) void |
removeOutgoingSystemWidget(Widget<O> widget)
Removes a widget from the list of outgoing system widgets.
|
void |
repaint()
Request widget repainting.
|
void |
replace(Widget<O> oldWidget,
Widget<O> newWidget)
Replace specified widget with another with preserving widget Z-order.
|
void |
requestFocus(boolean force)
Request focus.
|
void |
requestFocus(boolean force,
boolean mouse)
Request focus.
|
void |
setFocus(Widget<O> focus)
Set focus to specified widget.
|
void |
setFocusInt(Widget<O> focus)
Set focus to specified widget.
|
void |
setHeight(double height)
Set container height.
|
void |
setIgnoreFocus(java.util.Collection<Widget<?>> widgets)
Sets the set of widgets that are never selected for focus.
|
void |
setInsets(Insets insets)
Set container insets.
|
void |
setLayout(LayoutManager<O> manager)
Set layout manager for the container.
|
protected void |
setPhysicalDimensionInt(int width,
int height)
Set widget physical dimension.
|
void |
setSize(Dimension size)
Set container size.
|
void |
setSize(double width,
double height)
Set container size.
|
void |
setTabItemList(java.util.List<Widget<O>> tabItemList)
Sets the tab item list for this container.
|
void |
setWidth(double width)
Set container width.
|
void |
startSizeChange(boolean saveOldRect)
Indicates the beginning of the resize process.
|
void |
swap(int first,
int second)
Swap two widgets given by their indices i and j.
|
void |
triggerContainerStateRedrawEnabled()
The method is called when DISABLE-REDRAW is assigned to true on the container or a widget in
the container.
|
void |
unrealize()
Unrealize this container and all its children.
|
protected <C extends WidgetConfig> |
updateSizeWorker(C beforeUpdate)
Instructs the widget that its size may have changed.
|
Widget<O>[] |
widgets()
Get all widgets stored in the container.
|
java.util.List<Widget<O>> |
widgetsAsList(boolean system)
Get all widgets stored in the container.
|
void |
widgetStateChanged()
Notification that this widget's state has changed (visibility, sensitivity, z-order).
|
double |
width()
Get widget width.
|
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, config, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitwidgetsAsListacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, config, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unregisterWidgetListener, validateDisplayValue, windowprivate static final CentralLogger LOG
private static final ContextLocal<AbstractContainer.WorkArea> work
private LayoutManager<O extends OutputManager<?>> layoutManager
private Widget<O extends OutputManager<?>> current
private Insets insets
private Dimension size
private java.util.ArrayList<Widget<O extends OutputManager<?>>> widgets
private java.util.Set<Widget<O extends OutputManager<?>>> selectedWidgets
private java.util.ArrayList<Widget<O extends OutputManager<?>>> incomingSystemWidgets
BaseEntity.setSystemParent(GenericWidget)private java.util.ArrayList<Widget<O extends OutputManager<?>>> outgoingSystemWidgets
BaseEntity.setSystemParent(GenericWidget).private java.util.List<Widget<O extends OutputManager<?>>> tabItemList
private java.util.Set<Widget<?>> ignoreFocusSet
private java.util.List<ContainerStateListener<O extends OutputManager<?>>> containerStateListeners
private WidgetId topLevelWidgetId
public Container<O> add(Widget<O> widget)
add in interface Container<O extends OutputManager<?>>widget - Widget to add.this for fluent syntax support.java.lang.IllegalArgumentException - when the argument is null or instance of TopLevelWindowpublic Container<O> add(int pos, Widget<O> widget)
add in interface Container<O extends OutputManager<?>>pos - The widget's position.widget - The child widget to add.this for fluent syntax support.java.lang.IllegalArgumentException - when the argument is null or instance of TopLevelWindowpublic Container<O> add(Widget<O> before, Widget<O> widget)
add in interface Container<O extends OutputManager<?>>before - The widget before the new widget will be placed.widget - The child widget to add.this for fluent syntax support.java.lang.IllegalArgumentException - when the argument is null or instance of TopLevelWindowpublic void registerSelectedWidget(Widget<O> widget)
widget - The widget to be registered.public void deregisterSelectedWidget(Widget<O> widget)
widget - The widget to be deregistered.public java.util.Collection<Widget<O>> getAllSelectedWidgets()
public boolean clipping()
clipping in interface Container<O extends OutputManager<?>>true if container clips its children.public Widget<O> currentFocus()
currentFocus in interface Container<O extends OutputManager<?>>public Widget<O> currentFocus(boolean recurse)
The method allows to choose whether the focused widget is searched in the nested
containers (recurse == true) or whether only this container is searched
(recurse == false).
currentFocus in interface Container<O extends OutputManager<?>>recurse - The parameter controls whether the method should recurse to the nested
containers when searching for the focused widget.public Widget<O> defaultFocus()
defaultFocus in interface Container<O extends OutputManager<?>>public Dimension dimension()
dimension in interface Widget<O extends OutputManager<?>>dimension in class AbstractWidget<O extends OutputManager<?>>public void doLayout()
doLayout in interface Container<O extends OutputManager<?>>public Widget<O> findMouseSource(NativePoint p)
findMouseSource in interface Widget<O extends OutputManager<?>>findMouseSource in class AbstractWidget<O extends OutputManager<?>>p - The mouse physical location.null if none found.public void draw()
draw in interface Widget<O extends OutputManager<?>>draw in class AbstractWidget<O extends OutputManager<?>>public Point childrenLocation(Widget<O> child)
childrenLocation in interface Container<O extends OutputManager<?>>child - Child component.public void endSizeChange(boolean repaint)
startSizeChange and endSizeChange calls is
suppressed.endSizeChange in interface Container<O extends OutputManager<?>>repaint - If true then the current bounding rectangle and
the rectangle saved during startSizeChange call
are repainted.public Widget<O> focus()
focus in interface Container<O extends OutputManager<?>>public boolean focusTraversable()
focusTraversable in interface Widget<O extends OutputManager<?>>focusTraversable in class AbstractWidget<O extends OutputManager<?>>true if widget is focus traversable.public Widget<O> get(int index)
null if no such component
exists.get in interface Container<O extends OutputManager<?>>index - Widget index.null if index is out
of range.public Rectangle getClipRect()
getClipRect in interface Container<O extends OutputManager<?>>public boolean hasFocusable(Widget<O> exclude)
hasFocusable in interface Container<O extends OutputManager<?>>exclude - A widget to ignore or null if any focusable
widget will do.true if there is at least one other widget that
can be focused.public double height()
height in interface Widget<O extends OutputManager<?>>height in class AbstractWidget<O extends OutputManager<?>>public Insets insets()
insets in interface Container<O extends OutputManager<?>>insets in interface Widget<O extends OutputManager<?>>insets in class AbstractWidget<O extends OutputManager<?>>public Dimension minimumSize()
minimumSize in interface Widget<O extends OutputManager<?>>minimumSize in class AbstractWidget<O extends OutputManager<?>>public void moveBeforeTabItem(Widget<O> widget, Widget<O> before)
moveBeforeTabItem in interface Container<O extends OutputManager<?>>widget - Widget to move.before - The widget before which to insert mover.public void moveAfterTabItem(Widget<O> widget, Widget<O> after)
moveAfterTabItem in interface Container<O extends OutputManager<?>>widget - Widget to move.after - The widget after which to insert mover.public void moveToBottom(Widget<O> widget)
moveToBottom in interface Container<O extends OutputManager<?>>widget - Widget to mover.public void moveToTop(Widget<O> widget)
moveToTop in interface Container<O extends OutputManager<?>>widget - Widget to mover.public void paintOnTop(WidgetId widgetId)
widgetId - Widget ID to be painted on the top.public boolean moveToBottomInClass(Widget<O> widget)
moveToBottomInClass in interface Container<O extends OutputManager<?>>widget - The given widget to move.true if the widget was movedpublic boolean moveToTopInClass(Widget<O> widget)
moveToTopInClass in interface Container<O extends OutputManager<?>>widget - The given widget to move.true if the widget was movedpublic void moveToZpos(Widget<O> widget, int pos)
moveToZpos in interface Container<O extends OutputManager<?>>widget - Widget to mover.pos - Position in Z-order.public void nextFocus()
nextFocus in interface Container<O extends OutputManager<?>>public void prevFocus()
prevFocus in interface Container<O extends OutputManager<?>>public void processKeyEvent(KeyInput event)
processKeyEvent in interface Widget<O extends OutputManager<?>>processKeyEvent in class AbstractWidget<O extends OutputManager<?>>event - Key event to process.public void remove(Widget<O> widget)
The widget will also be destroyed.
remove in interface Container<O extends OutputManager<?>>widget - Widget to remove.public void detach(Widget<O> widget)
detach in interface Container<O extends OutputManager<?>>widget - Widget to detach.java.lang.RuntimeException - when the supplied widget is not attached to this containerpublic void destroy()
destroy in interface Widget<O extends OutputManager<?>>destroy in class AbstractWidget<O extends OutputManager<?>>public void repaint()
repaint in interface Widget<O extends OutputManager<?>>repaint in class AbstractWidget<O extends OutputManager<?>>public void replace(Widget<O> oldWidget, Widget<O> newWidget)
replace in interface Container<O extends OutputManager<?>>oldWidget - Old widget.newWidget - New widget.public void swap(int first,
int second)
first - The first widget indexsecond - The second widget indexpublic void requestFocus(boolean force)
requestFocus in interface Widget<O extends OutputManager<?>>force - When true the method will set focus on this widget unconditionally.public void requestFocus(boolean force,
boolean mouse)
requestFocus in interface Widget<O extends OutputManager<?>>requestFocus in class AbstractWidget<O extends OutputManager<?>>force - When true the method will set focus on this widget unconditionally.mouse - If true then the focus request was caused by a mouse event.public void setFocus(Widget<O> focus)
focus.topLevelWindow(). If the top-level window needs to be
activated, too, call WindowManager.activateWindow(TitledWindow).setFocus in interface Container<O extends OutputManager<?>>focus - Widget to set focus on.public void setHeight(double height)
setHeight in interface Container<O extends OutputManager<?>>height - New container height.public void setInsets(Insets insets)
setInsets in interface Container<O extends OutputManager<?>>insets - Insets to set.public void setLayout(LayoutManager<O> manager)
setLayout in interface Container<O extends OutputManager<?>>manager - New layout manager.public LayoutManager<O> getLayout()
getLayout in interface Container<O extends OutputManager<?>>public void setSize(Dimension size)
setSize in interface Container<O extends OutputManager<?>>size - Size to set.public void setSize(double width,
double height)
setSize in interface Container<O extends OutputManager<?>>width - New width.height - New height.public void setWidth(double width)
setWidth in interface Container<O extends OutputManager<?>>width - Width to set.public void startSizeChange(boolean saveOldRect)
startSizeChange and endSizeChange calls is
suppressed.startSizeChange in interface Container<O extends OutputManager<?>>saveOldRect - If true then the current bounding rectangle is
saved for future repainting.public Widget<O>[] widgets()
widgets in interface Container<O extends OutputManager<?>>public void dumpWidgets()
public void dumpCurrentWidgets()
public void addContainerStateListener(ContainerStateListener<O> listener)
addContainerStateListener in interface Container<O extends OutputManager<?>>listener - A container state listener.public void removeContainerStateListener(ContainerStateListener<O> listener)
removeContainerStateListener in interface Container<O extends OutputManager<?>>listener - A container state listener.protected void onWidgetAdded(Widget<O> w)
w - The added widget.protected void onWidgetRemoved(Widget<O> w)
w - The removed widget.public void triggerContainerStateRedrawEnabled()
public boolean parentOf(Widget<O> w)
true if this container is parent of the supplied widget.parentOf in interface Container<O extends OutputManager<?>>w - Widget to check.private void dumpWidgets(java.lang.String indent)
indent - The indentation (spaces to be printed in formt of the widgets).private java.lang.String formatCurrentWidgets(java.lang.String indent)
indent - The indent for this level.protected java.lang.String formatDump()
public java.util.List<Widget<O>> widgetsAsList(boolean system)
widgetsAsList in interface Container<O extends OutputManager<?>>system - Set to true to return the child widgets as part of the system-level widget hierarchy.public double width()
width in interface Widget<O extends OutputManager<?>>width in class AbstractWidget<O extends OutputManager<?>>public void firstFocus()
firstFocus in interface Container<O extends OutputManager<?>>public void lastFocus()
lastFocus in interface Container<O extends OutputManager<?>>public Dimension getScrollableSize()
This implementation simply delegates the call to dimension().
public Dimension getEffectiveScrollableSize()
This implementation accounts all the visible child widgets into the area and simply determines the furthest x and y from the origin.
public java.util.Set<Widget<?>> getIgnoreFocus()
getIgnoreFocus in interface Container<O extends OutputManager<?>>null.public void setIgnoreFocus(java.util.Collection<Widget<?>> widgets)
null may be used to clear the set.setIgnoreFocus in interface Container<O extends OutputManager<?>>widgets - Set of widgets or null.public void normalizeZOrder()
public void setFocusInt(Widget<O> focus)
focus - Widget to set focus on.public void unrealize()
unrealize in interface Widget<O extends OutputManager<?>>unrealize in class AbstractWidget<O extends OutputManager<?>>public void widgetStateChanged()
widgetStateChanged in interface Widget<O extends OutputManager<?>>widgetStateChanged in class AbstractWidget<O extends OutputManager<?>>void addIncomingSystemWidget(Widget<O> widget)
BaseEntity.setSystemParent(com.goldencode.p2j.ui.GenericWidget) for
more information.widget - A widget to add. Must not be null.void removeIncomingSystemWidget(Widget<O> widget)
BaseEntity.setSystemParent(com.goldencode.p2j.ui.GenericWidget) for more information.widget - A widget to remove.void addOutgoingSystemWidget(Widget<O> widget)
BaseEntity.setSystemParent(com.goldencode.p2j.ui.GenericWidget) for more information.widget - A widget to add.void removeOutgoingSystemWidget(Widget<O> widget)
BaseEntity.setSystemParent(com.goldencode.p2j.ui.GenericWidget) for more information.widget - A widget to remove.protected void copyState(Widget<?> w)
copyState in class AbstractWidget<O extends OutputManager<?>>w - The source widget which state needs to be copied.protected java.util.List<Widget<O>> prepareWidgets(java.util.List<Widget<O>> widgets)
widgets - Container children.protected void addDirectly(Widget<O> widget)
widget - Widget to add.protected boolean belongsTo(Widget<O> widget)
widget - Widget to check.true if widget belongs to container.protected NativeRectangle clipRectangle(NativePoint origin, NativeDimension dimension, boolean children)
origin - Physical location.dimension - Physical dimension.children - Flag to intersect the rectangle with the to-be-drawn chidren.protected <C extends WidgetConfig> void updateSizeWorker(C beforeUpdate)
This implementation ignores the supplied config instance. Instead it relies
on size and AbstractWidget.config() to detect whether size has changed.
updateSizeWorker in class AbstractWidget<O extends OutputManager<?>>C - Widget config type.beforeUpdate - BaseConfig reference or null.public java.util.List<Widget<O>> getTabItemList()
getTabItemList in interface Container<O extends OutputManager<?>>public void setTabItemList(java.util.List<Widget<O>> tabItemList)
tabItemList - The tab item listprotected void focusWorker(boolean direction)
direction - Widget search direction.protected boolean checkWidget(Widget<O> widget, boolean direction)
widget - Candidate widget.direction - Search direction.true if widget was focused and false
otherwise.protected void cycleFocus(boolean direction)
direction - Widget search direction.public void reflectAncestorChange()
AbstractWidget.ancestorCache and AbstractWidget.window) for itself and the entire widget tree starting
from this container.reflectAncestorChange in class AbstractWidget<O extends OutputManager<?>>public void reflectLocationChanged()
reflectLocationChanged in class AbstractWidget<O extends OutputManager<?>>protected void setPhysicalDimensionInt(int width,
int height)
setPhysicalDimensionInt in class AbstractWidget<O extends OutputManager<?>>width - Widget physical width.height - Widget physical height.private Widget<O> locateFocusTraversable(java.lang.Iterable<Widget<O>> iter)
iter - Iterable for the contained widgets.null if no matches found.