public abstract class Frame<O extends OutputManager<?>> extends AbstractContainer<O> implements ConfigOwner<FrameConfig>, WidgetWithConfig<FrameConfig>, PageBreakListener, CloseListener
Frame
is a top-level window with a title and a border.Modifier and Type | Class and Description |
---|---|
protected class |
Frame.FrameScrollContainer
The implementation of frame's scrollable container.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
active
Active scope flag.
|
private boolean |
allClear
Reflects the initial/all clear state of frame
|
private boolean |
autoLayout
Do automatic layout calculation.
|
private boolean |
autoplacing
Automatic placing is performed for the frame.
|
private boolean |
canHide
true if the frame can be hidden. |
private boolean |
canHideOthers
true if the frame can hide other frames. |
private boolean |
canWipeScreen
true if the frame can wipe screen when hiding other frames. |
private boolean |
changed
Flag indicating this frame's state has been changed or the frame has been destroyed.
|
protected ChooseHandler<O> |
chooseHandler
CHOOSE processing handler.
|
private boolean |
colorChanged
Track color changes.
|
private FrameConfig |
config
Frame attribute container.
|
protected boolean |
configUpdateActive
Track start/end of config update.
|
protected SensitiveScrollContainer<O> |
contentPane
The scrollable container to place inside the ScrollPane.
|
protected UIStatement |
currentStatement
The UI current statement which processes this frame.
|
protected int |
cursor
Down frame cursor position: 0 - top, maxDown - bottom
|
private boolean |
delayedRepaint
Pending repaint.
|
protected boolean |
down
Down frame flag
|
protected Widget<O>[][] |
downBody
Content of the down frame body
|
private double |
dynamicCol
Dynamically calculated column.
|
private boolean |
dynamicDown
Track dynamic down.
|
private double |
dynamicRow
Dynamically calculated row.
|
private boolean |
explicitHide
Flag tracking frame hiding via explicit HIDE calls.
|
static int |
EXTRA_DLG_PIXELS
Extra border pixels for dialog-box.
|
private boolean |
fixedWidth
Set to true if frame has fixed (explicitly specified) width.
|
private boolean |
flushed
Track flushed frame state.
|
private boolean |
focusAttractor
'focus attractor' flag
|
private int |
focusId
Delayed focus activation component ID.
|
private boolean |
focusReset
Mark frame as such that need focus reset on trigger exit.
|
private FrameFocusTransferManager |
focusTransferManager
Helper class which encapsulates all focus transfer logic.
|
private boolean |
forcedRefresh
Forced peer frame refresh on next VIEW call.
|
private boolean |
forcePause
Track forced pause state.
|
private boolean |
forceWipeScreen
true if the frame must wipe screen on next view call. |
protected ScrollPane<O> |
frameScroll
Scroll pane which is actual container.
|
protected double |
headersHeight
Down frame headers height; recalculated dynamically
|
protected java.util.Set<Stream> |
headersOutput
Streams that have had headers output.
|
private boolean |
honorNextConditionalDown
Mark frame as such that need to honor next conditional down and handle
it as unconditional.
|
private boolean |
inScope
Frame in scope flag.
|
private boolean |
isFixedRow
Track frames with fixed (as opposed to dynamically assigned) row.
|
protected int |
lastRow
Last row in the down body.
|
private double |
leadingSkipSize
Size of leading SKIP widgets in iteration.
|
private boolean |
live
Track frame life time.
|
private boolean[] |
needClear
Iteration was enabled and need to be cleared flag.
|
protected boolean |
needPause
Set to true when frame requires pause before hiding.
|
private int |
newRow
Intermediate value for cursor when cursor wrap is pending.
|
protected Widget<O>[] |
nonbody
Components which do not belong to down frame body.
|
private double |
origHeight
Keeps the original frame height.
|
protected double |
originalHeightChars
The HEIGHT-CHARS Progress attribute that was specified upon frame
creation.
|
protected boolean |
paintable
Reflects paintable state of frame
|
private int |
pendingCursorPos
New cursor position.
|
private boolean |
pendingCursorWrap
Mark pending cursor wrap state.
|
private int |
pendingDown
New value for the dynamic down frame.
|
private boolean |
pendingFixedDown
For down and fixed-height frames, this indicated down must be computed
later.
|
private boolean |
pendingNeedClear
Track case when "need clear" is signalled before down body is
initialized.
|
private boolean |
pendingUnderline
Flag to initiate special underline processing for frame that is not on the screen.
|
private boolean |
placedForRedirected
true if placement was done for redirected mode. |
protected boolean |
positionChanged
Flag that indicates the position has changed
|
private boolean |
postponedPlace
Postponed placing frame on screen.
|
private boolean |
postponedVisible
Postponed visibility change flag.
|
private boolean |
protect
Protect frame from removal on hide.
|
protected boolean |
redirected
Set to
true if frame is redirected to some stream. |
private java.util.Map<Widget<O>,java.lang.Double> |
relocY
Maps relocated widgets to their original y-coordinates.
|
private boolean |
resetPending
Pending reset.
|
private java.util.Map<Editor<O>,java.lang.Double> |
resizH
Maps resized editors to their original heights.
|
private Dimension |
savedDim
Saved frame dimension.
|
private int |
savedDown
Saved DOWN attribute.
|
private int |
saveDown
Saved DOWN value.
|
private Dimension |
savedPaneDim
Saved frame pane dimension.
|
private FrameState |
savedState
Saved interactive frame state.
|
protected Widget<O>[] |
savedTabOrder
Saved original tab order.
|
private int |
scopeNesting
Count the scope nesting level.
|
protected boolean |
sizeChanged
Flag that indicates outer size has changed
|
protected boolean |
skipMoveToTop
Flag indicating if the next
moveToTop() call will be ignored. |
private SpareIteration |
spareIteration
Storage for 'spare' iteration values.
|
protected double[] |
startRow
Starting line numbers of every iteration/underline
|
private boolean |
streamed
"frame streamed" flag
|
private int |
streamId
the last used stream ID in redirected mode
|
private java.util.Set<java.lang.Integer> |
streams
Bound streams.
|
protected boolean[] |
touched
Iteration is touched flag.
|
protected boolean |
trailingSkips
Honor trailing skips (only if there are regular widgets too).
|
private double |
trailingSkipSize
Size of trailing SKIP widgets in iteration.
|
protected boolean[][] |
underline
Underline flags of the components in the down frame body
|
protected boolean[] |
underlinedRow
Entire row underline flag.
|
private double |
verticalStep
Down frame vertical step; recalculated dynamically
|
protected double |
verticalStepBoxed
Vertical size of iteration without trailing SKIPs.
|
private boolean |
viewed
Track if frame was viewed inside scope.
|
private boolean |
visibilityChanged
Track frame visibility change, from not-visible to visible.
|
private boolean |
withEditors
Frame contains editors
|
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
Frame(WidgetId id,
FrameConfig cfg)
Special constructor used to restore component using given configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addWidget(Widget<O> widget)
Adding new widget to the container.
|
void |
adjustDown()
Adjust down frame height according to current conditions.
|
void |
adjustDown(int down)
Dynamic DOWN adjustment.
|
private void |
adjustFlagsAndCursor(boolean[][] savedUnderline,
boolean[] savedUnderlinedRow)
Adjust cursor and flags after down frame body filling.
|
private double |
adjustHeight(double height,
double screenHeight,
double regionHeight)
Adjust frame height.
|
protected abstract double |
adjustMinSize(double minWidthOrHeight,
boolean isHeight)
Adjusts the minimum frame width or height value depending on the current min value and
the presense of the box within the frame.
|
protected double |
adjustWidth(double width,
double screenWidth,
double regionWidth)
Adjust frame width.
|
void |
afterConfigUpdate(FrameConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
boolean |
allFramesVisible(boolean checkThis)
Determine if all frames up the hierarchy are visible.
|
private void |
allocate(int ndown)
Allocate down frame body parts.
|
void |
applyConfig(Widget<O> comp,
WidgetConfig cfg)
Apply config to specified widget.
|
void |
arrangeToInteract()
Relocates the current iteration's widgets for use with interactive
terminal after use with streamed output.
|
void |
arrangeToStream()
Relocates the current iteration's widgets for use with streamed output.
|
protected void |
attachToWindow(int wndId)
Attaches this frame to its parent top-level window.
|
protected Widget<?> |
calcDefaultFocus()
Calculate the default focus for this frame after it was moved to top.
|
private void |
calcFixedRect(java.util.ArrayList<Widget<O>> onerow,
java.util.ArrayList<Widget<O>> others)
Calculate height of fixed and repeated parts of frame.
|
private double |
calculateDown(Point location)
Calculate DOWN value.
|
private boolean |
calculateDownAndSetSize(Dimension d,
int titleLen,
double saveWidth)
Calculate frame DOWN value and adjust frame size accordingly.
|
Rectangle |
calculateFrameRect(boolean withBox)
Calculates the frame's rectangle in screen coordinates
|
protected void |
calculateHeight(Dimension d,
double delta)
Calculate frame height.
|
protected double |
calculateHeightDelta()
Calculate frame height delta.
|
private double |
calculateWidth(Dimension d,
int titleLen)
Calculate frame width.
|
protected double |
calculateWidthDelta()
Calculate frame width delta.
|
boolean |
canSetColumn(double column)
Determine if the
COLUMN attribute can be set to the
specified value. |
boolean |
canSetHeightChars(double height,
boolean virtual)
Determine if the
HEIGHT-CHARS attribute can be set to the
specified value. |
boolean |
canSetRow(double row)
Determine if the
ROW attribute can be set to the specified
value. |
boolean |
canSetWidthChars(double width)
Determine if the
WIDTH-CHARS attribute can be set to the
specified value. |
protected double |
captionHeight()
Get the frame's caption height, in character units.
|
private void |
centerFrame(double width,
Dimension screen)
Center frame at the screen, if necessary.
|
private void |
changeVisibility(boolean visible)
Change widget visibility.
|
private boolean |
checkRefreshNecessary(Rectangle rect)
Check if refreshing is actually necessary.
|
void |
clear()
Clears the down frame and resets the cursor to the top of the frame.
|
private void |
clearComponents(Widget<O>[] list)
Clear specified components.
|
void |
clearCurrent()
Clears all fill-ins of the current iteration.
|
void |
clearWorker(boolean clearAll)
Clear all fill-ins in frame and mark all iterations in down frame as
untouched.
|
boolean |
clipping()
This method declares the Frame container valid for clipping of PAINT
events originated within it.
|
private void |
colorChanged()
Notify frame that color of one of its components is changed.
|
protected abstract Colors |
compareColors(BaseConfig config,
Colors colors)
Compare colors.
|
FrameConfig |
config()
Provide access to the attributes stored in the widget.
|
private Widget<O> |
copyComponent(Widget<O> component,
int downIdx)
Create a copy of the given component shifted down at specified amount of
rows.
|
protected void |
copyState(Widget<?> w)
Copy the widget state from the specified source widget to this instance.
|
protected SensitiveScrollContainer<O> |
createScrollContainer()
Creates the frame's scroll container.
|
private TempContainer<O> |
createTempContainer(Dimension minDim)
Create temporary widget container for layout processing.
|
Widget<O> |
currentFocus(boolean recurse)
Get widget which is in focus.
|
void |
destroy()
Destroy this widget.
|
void |
detach(Widget<O> widget)
Detach this widget from this container.
|
private void |
detectSkips(Widget<O>[] c)
Detect leading and trailing SKIP widgets in iteration.
|
(package private) void |
detectTrailingSkips()
Scans the list of widgets and detects the case when there is a mixture
of regular widgets with one or more trailing skips.
|
private void |
displayError(int code,
java.lang.String err)
Display error with specified code and message.
|
void |
doLayout()
The methods calls the LayoutManager service for the widgets which are
not yet positioned explicitly.
|
void |
doLayout(boolean suppressDrawing)
Process frame layout.
|
protected void |
doLayoutWorker(boolean suppressDrawing)
Process frame layout.
|
void |
draw()
Draw this container.
|
abstract void |
draw(Point origin,
Dimension size)
Draw the peer container.
|
protected boolean |
drawDownFrame(Point top,
boolean redir)
Draw the body of a down frame.
|
protected abstract void |
drawUnderline(Widget<O> comp)
Draw underline for specified widget.
|
Widget<O>[] |
enableAllWidgets(Widget<O> focus,
boolean enabled)
Enable/disable all widgets in frame.
|
java.util.Set<java.lang.Integer> |
enabledWidgetsByList(Widget<O>[] affw,
Widget<O> focus,
int[] widgetId,
boolean enabled)
Enable widgets specified in provided list.
|
java.lang.Integer |
enterChoose(Widget<O>[] list,
ChooseData data,
java.lang.Integer focusOn)
Initialize CHOOSE processing mode.
|
(package private) void |
fillDownBody()
Fill down frame body.
|
private void |
fillDownBodyParts(java.util.ArrayList<Widget<O>> onerow,
int ndown)
Fill down body and relevant flags.
|
private void |
finishCursorWrap(boolean normalExit,
boolean doView)
Finish pending cursor wrap.
|
void |
fixNonBody(Widget<O> oldc,
Widget<O> newc)
Fixes the list of non-body components of this down frame in case there
is a replacement.
|
protected void |
forceBox(double start,
double lines)
Forces drawing of a box character for a number of consecutive lines
in redirected mode.
|
private void |
forcePlaceFrame(boolean visible)
Force placement of frame at the screen.
|
protected abstract Rectangle |
frameContentBounds()
Get the bounds of the frame's content.
|
private java.util.List<Widget<O>> |
getAllTabOrderedWidgets()
Get all widgets (in the entire frame tree), using their tab order.
|
double |
getBorderBottomChars()
Getting the thickness in the units of char for the peer frame border
at the bottom of the peer frame.
|
double |
getBorderLeftChars()
Getting the thickness in the units of char for the peer frame border
at the left of the peer frame.
|
double |
getBorderRightChars()
Getting the thickness in the units of char for the peer frame border
at the right of the peer frame.
|
double |
getBorderTopChars()
Getting the thickness in the units of char for the peer frame border
at the top of the peer frame.
|
ChooseData |
getChooseData()
Obtain current CHOOSE mode data.
|
java.lang.String |
getChooseHelp()
Return the help text for the selected component using the CHOOSE index.
|
AbstractContainer<O> |
getContentPane()
Getting the content pane for scrollable container
|
int |
getCursor()
Returns the current cursor position in this down frame.
|
Dimension |
getDialogDecorationCharSize()
Returns the size of the decoration elements for dialog-box.
|
int |
getDown()
Get frame DOWN attribute value.
|
WidgetConfig[] |
getDownConfigs()
Get the widget configs for the current iteration in the frame's down body.
|
private FrameData |
getDownFrameValue(Widget<O> widget)
Get frame value for DOWN frames.
|
Widget<O> |
getField(int index,
Widget<O> comp)
Get field from specified iteration.
|
Widget<O> |
getField(Widget<O> comp)
Get field from current iteration.
|
private int |
getFieldIndex(Widget<O> comp)
Get index of the component in the row.
|
private java.lang.String |
getFieldText(Widget<O> field)
Get text of field.
|
Widget<O> |
getFirstEnabledWidget()
Looks up the very first enabled widget in specified frames.
|
static int |
getFirstFocusableId(Frame<?> frame)
Looks up the first focusable widget of the frame.
|
static int |
getFirstFocusableId(Frame<?> frame,
java.util.List<java.lang.Integer> fgWidgetsIds)
Looks up the first focusable widget of the entire frame or field-group in frame.
|
double |
getFixedHeight()
Get vertical size of fixed portion of pane (like headers and such).
|
int |
getFocusId()
ID of component which will receive focus next time.
|
protected Dimension |
getFrameRegion()
The method returns the lower right point of the frame screen region.
|
java.lang.String |
getFrameValue(int index,
Widget<O> comp)
Retrieve the value of the component at the specified row.
|
FrameData |
getFrameValue(Widget<O> widget)
Get the text value of the currently focused widget taking into account
the last CHOOSE operation.
|
Dimension |
getInnerSize()
Getting the inner size of the container.
|
double |
getIterationHeight()
Get vertical size of one iteration.
|
java.util.Set<java.lang.Integer> |
getIterationIds()
Get IDs of widgets which belong to single iteration.
|
abstract double |
getLabelHeight(java.lang.String labelText,
LabeledWidget<O> widget,
boolean topLabel)
Compute the label height in character units.
|
abstract double |
getLabelWidth(java.lang.String label,
LabeledWidget<O> widget)
Compute the label width in character units.
|
double |
getLeadingSkipSize()
Get size of the leading skip in iteration.
|
protected Dimension |
getMaxFrameSize()
The method returns the maximum frame size according to the workspace size
of its parent window.
|
double |
getMinHeight()
Return minimal frame height.
|
(package private) Dimension |
getMinimumSize()
Compute and return the minimum size need to display the widgets within
this frame.
|
Widget<O> |
getNextEnabledWidget(Widget<O> widget,
boolean wrap)
Looks up the next enabled and visible widget in the tab order of the
specified frame.
|
double |
getOriginalHeightChars()
Return the HEIGHT-CHARS Progress attribute that was specified upon frame
creation.
|
private FrameData |
getRegularFrameValue(Widget<O> widget)
Get frame value for regular (1-DOWN) frames.
|
Frame |
getRootFrame()
Get the root frame (the frame which has no other frame as parent).
|
abstract double |
getRowDelta()
Get a delta which is added between frames, when their Y coordinate is automatically
computed.
|
Dimension |
getSavedDimension()
Get original frame dimension provided by application.
|
int |
getScopeNesting()
Get the scope nesting level.
|
Widget<O> |
getSelectedField(Widget<O> base)
Return the selected component (using the CHOOSE index) in a down frame
that corresponds with the given base component.
|
Widget<O> |
getSelectedWidget(int number)
Returns the handle of the widget with number inside the frame.
|
int |
getStreamId()
Gets the last used stream ID.
|
double |
getTrailingSkipSize()
Get size of the trailing skip in iteration.
|
private java.lang.Iterable<Rectangle> |
getUnoccupied(Rectangle rect)
Calculates contiguous rectangles of the given rectangle that have lines
not covered with any frame.
|
java.lang.String[] |
getValues(Widget<O> focusedCol)
Retrieve text values for entire column.
|
ZOrderClass |
getZOrderClass()
Get the Z-Order class
|
private void |
handleDynamicDown()
Handle dynamic DOWN changes.
|
private void |
handleDynamicLocation()
Handle dynamic frame location changes.
|
private void |
handleFlags()
Handle various frame flags.
|
boolean |
hasAnyEnabled()
Check if at least one component of any type (including labels) is
enabled.
|
boolean |
hasBox()
The method returns
true when the frame should have a box around. |
boolean |
hasDefaultButton()
Check if the frame has a default button
|
boolean |
hasEditors()
Checks whether frame has editors.
|
boolean |
hasEnabled()
Check if at least one component able to accept input is enabled.
|
boolean |
hasHeaders()
Check if the frame has any header widgets.
|
boolean |
hasSavedState()
Check if frame has saved state.
|
protected boolean |
hasTitle()
Check if frame has title.
|
void |
initialize(WidgetId id,
FrameConfig cfg)
Replacement API for the logic which should exist in the widget's c'tor, but the logic
can't be executed as it depends on the widget being registered into the official registry.
|
void |
initializeWidget(Widget<O> comp)
Initialize widget when its state is UNINITIALIZED.
|
private void |
insertEmptyRow(int insertAt)
Insert empty row at specified index.
|
private boolean |
intersectsTopFrame()
Check if frame intersects top frame.
|
boolean |
isActive()
Check status of active frame scope.
|
boolean |
isAlive()
Returns
true if frame is in active use on the server and
false if the frame is not in use by the server and can
be destroyed. |
boolean |
isAllClear()
Returns the state of the ALL CLEAR flag.
|
boolean |
isAttrSpace()
Get current state of the ATTR-SPACE attribute.
|
boolean |
isAutoplacing()
Get current state of the automatic frame placing flag.
|
boolean |
isCanHide()
Get state of canHide flag.
|
boolean |
isCanHideOthers()
Get current state of canHideOthers flag.
|
boolean |
isCanWipeScreen()
Get state of canWipeScreen flag.
|
boolean |
isChanged()
Get the root frame's changed state.
|
boolean |
isChooseActive()
Get current state of the choose activation flag.
|
boolean |
isConfigUpdateActive()
Get current state of config update.
|
boolean |
isCurrentTouched()
Checks the touched state of the current iteration of the down frame.
|
boolean |
isDelayedRepaint()
Return state of the
delayedRepaint flag. |
boolean |
isDialog()
Check if frame is a
Dialog . |
boolean |
isDown()
Return
true if frame is down frame. |
boolean |
isDownCalculated()
Check if down frame elements size calculation is performed at least
once.
|
boolean |
isDynamic()
Returns
true if size of the DOWN frame should be
dynamically recalculated. |
boolean |
isExplicitHide()
Get current status of 'explicitHide' flag.
|
boolean |
isFixedWidth()
Get current state of fixed width flag.
|
(package private) boolean |
isFlushed()
Get frame flushed state.
|
boolean |
isFocusAttractor()
Get current status of 'focus attractor' flag.
|
boolean |
isFocusReset()
Check if frame needs focus reset.
|
boolean |
isForcedRefresh()
Get current state of the forced refresh flag.
|
boolean |
isForcePause()
Get current state of forced pause flag.
|
boolean |
isForceWipeScreen()
Return current state of 'force wipe screen' flag.
|
boolean |
isHonorNextConditionalDown()
Check if frame requires special handling for conditional down.
|
boolean |
isInChoose(Widget<O> widget)
Check to see if a widget is part of an ongoing CHOOSE.
|
boolean |
isInScope()
Returns
true if frame is in frame scope. |
boolean |
isInternalGo()
Return
true if last CHOOSe operation was finished by
internal GO event. |
boolean |
isLabels()
Get current state of labels flag.
|
boolean |
isLastWidget(Widget<O> wdgt)
Check if the specified widget is the last component in this frame.
|
boolean |
isLastWidget(Widget<O> wdgt,
boolean recursive)
Check if the specified widget is the last component in this frame.
|
boolean |
isLeftMostWidget(Widget<O> widget)
Check if the specified widget is the left-most component in the current
screen row (not the same as the current record which may wrap).
|
boolean |
isNeedPause()
Returns state of the
needPause flag. |
boolean |
isNeedReset()
Return state of the
resetPending flag. |
boolean |
isNoHide()
Return state of NO-HIDE flag or
false if the frame was deleted. |
boolean |
isPendingFixedDown()
Return
true if frame is pending fixed down. |
boolean |
isPendingUnderline()
Check if down frame elements was underlined when frame was not on the screen.
|
boolean |
isPlacedForRedirected()
Return true if frame is placement was done for redirected mode.
|
boolean |
isRedirected()
Gets redirection flag.
|
boolean |
isRightMostWidget(Widget<O> widget)
Check if the specified widget is the right-most component in the current
screen row (not the same as the current record which may wrap).
|
boolean |
isRootFrame()
Check if this frame is the root frame (is parented directly to a window).
|
boolean |
isSideLabels()
Get current state of labels placement flag.
|
boolean |
isStreamed()
Check the streamed flag.
|
boolean |
isThreeD()
If the method returns
true the widget should be represented with 3D visuals. |
boolean |
isTopFrame()
Check if frame is a top frame in the parent's Z-order.
|
boolean |
isViewed()
Get the state of the
viewed flag |
boolean |
isVisibilityChanged()
Get current status of 'visibility changed' flag.
|
boolean |
isWithHeaders(Stream stream)
Detects whether the frame was displayed with headers on the current
output page (of a paged stream) or ever (of a non-paged stream).
|
ChooseData |
leaveChoose()
Stop CHOOSE mode.
|
private Widget<O> |
locateDownBodyComponent(Widget<O> comp)
Locate actual component for DOWN frames.
|
private Widget<O> |
locateRegularBodyComponent(Widget<O> comp)
Locate actual component for regular (1-DOWN) frames.
|
Point |
location()
Get frame location relative to container.
|
private void |
maintainTabOrder(int[] widgetIds)
Updates frame tab order based on the supplied array of widget ids.
|
void |
markAsStreamed()
Mark this frame as streamed.
|
void |
markChanged(boolean changed)
Mark this frame as changed; if this is not a root frame, mark the root frame.
|
void |
moveAboveWidget(Widget<O> widget,
int validCursorPos)
Move the cursor to the component in the nearest row above this widget.
|
void |
moveBelowWidget(Widget<O> widget,
int validCursorPos)
Move the cursor to the component in the nearest row below this widget.
|
boolean |
moveCursor(int by,
boolean noPause)
Moves the down frame cursor up or down by a specified number of
iterations.
|
boolean |
moveToBottom()
Moves this frame to the bottom of other widgets in the Tab ordering.
|
boolean |
moveToTop()
Moves this frame to the top of other widgets in the Tab ordering.
|
boolean |
moveToTop(boolean ignoreKeepZorder)
Move the frame to the top in z-order.
|
void |
moveWidgetBeforeTabItem(Widget<O> widget,
Widget<O> before)
Move specified widget before the widget "before".
|
void |
needClearRow()
Mark current iteration as such that need to be cleared.
|
void |
notifyClose(Stream out)
Notify the registered object that the given stream is being closed.
|
void |
notifyPageBreak(Stream out)
Notify the registered object that the given stream has just written
a page break (and thus a new page of output has just begun).
|
void |
notifyUnbind(Stream out)
Notify registered object that given stream reached end of life cycle and
all references to it can be safely discarded.
|
private void |
onFromHiddenToVisible()
Process transition from hidden to visible state.
|
protected void |
onFromVisibleToHidden()
Process transition from visible to hidden state.
|
NativePoint |
physicalLocation()
Get frame physical location relative to container, expressed in units native to UI type.
|
void |
placeAtTop()
Place frame at top in Z-order, taking into account dialogs.
|
void |
placed()
Notify frame that it is placed.
|
int |
placeToWindow(int windowId,
UIStatement stmt)
Resolve the window to which this frame needs to be attached.
|
int |
placeToWindow(int windowId,
UIStatement stmt,
boolean force)
Resolve the window to which this frame needs to be attached.
|
private boolean |
posErrorCondition()
Check prerequisite conditions for potential position change errors.
|
void |
postponePlace(boolean place)
Enable/disable frame placing after
applyConfig(Widget, WidgetConfig) . |
void |
postponeSetVisible(boolean visible)
Enable/disable changing frame visibility after
applyConfig(Widget, WidgetConfig) . |
void |
postprocess(boolean newFrame,
boolean suppressRedraw)
This method is invoked when frame is constructed and configuration of
all widgets is set, but no other actions are performed.
|
void |
postprocessConfig()
Additional processing required when widget configuration is updated AFTER the frame layout
has been performed.
|
void |
prepareIteration(Widget<O> widget,
ScreenBuffer frameBuf,
int[] widgetIds,
boolean isView)
Finish previous iteration and save frame buffer data into 'spare'
iteration.
|
void |
preprocess(FrameConfig deltaConfig)
This method is invoked when frame definition is about to be updated but after its active config was
set with changes coming from server.
|
boolean |
preventFocusWhenMouseDownEventDefined()
Test if this widget must prevent receiving focus on mouse-down event.
|
void |
previousFocus()
Moving the input focus to the last widget which can receive a focus in
the peer container.
|
boolean |
processCancelButton()
Processing for cancel button in a frame.
|
boolean |
processDefaultButton(KeyInput event)
Processing for default button in a frame, based on an event.
|
boolean |
processDefaultButton(KeyInput event,
boolean recursive)
Processing for default button in a frame, based on an event source.
|
Widget<O> |
processFrameMnemonic(int key,
Widget<O> start)
Process the specific key as a mnemonic, in this frame's widgets (include nested frames).
|
void |
processKeyEvent(KeyInput event)
Override key processing.
|
private void |
readjustDownBody()
Recalculate coordinates of the down frame body components.
|
void |
realizeFrame(boolean realize)
Realize the frame, only if it's not yet realized.
|
void |
rearrangeEditors()
Rearranges widgets in the frame in preparation for the next drawing
of the frame in redirected mode.
|
private void |
refreshBoxedFrame(ThinClient client,
Rectangle rect) |
private void |
refreshFrameArea(ThinClient client,
Rectangle rect)
Refresh area which belongs to frame.
|
private void |
refreshOnTopFrameHide(ThinClient client)
Process screen refreshing when frame is top frame in Z-order.
|
private void |
refreshOnVisibilityChange(boolean visible)
Handle refreshing of parts of frame on visibility changes.
|
void |
relayout()
Recalculate frame layout.
|
protected boolean |
relocateComponent(Widget<O> source,
double step,
Widget<O> dest)
Relocate component to the given position using source component as a
reference.
|
void |
repaint()
Controllable object repainting.
|
void |
repaintCurrent()
Repaints the current iteration.
|
void |
repaintUninitialized()
Repaint all uninitialized widgets of the current iteration.
|
void |
requestFocus()
Requesting the focus to the
Frame . |
void |
reset()
Reset frame to its initial state.
|
void |
resetAll()
Reset widgets in regular frame.
|
void |
resetAutoplacing()
Reset automatic frame placing flag.
|
void |
resetChanged()
Reset CHANGED flag in fill-in widgets.
|
private void |
resetChangedFlag(Widget<O> widget)
Reset
ScreenBuffer.CHANGED flag for specified widget. |
protected abstract void |
resetColors(BaseConfig config)
Reset colors.
|
(package private) void |
resetCursor()
Reset cursor to initial state.
|
private void |
resetDownBody(int from,
int to,
boolean clearAll)
Reset widgets which belong to DOWN body.
|
private void |
resetDownBodyWorker(int idx)
Worker routine for
resetDownBody(int, int, boolean) . |
void |
resetForcedRefresh()
Reset forced refresh flag.
|
void |
resetNeedPause()
Reset
needPause flag for all frames which are visible. |
void |
resetPlacementQuirk(boolean force)
Reset placement quirk if necessary.
|
void |
resetWidget(Widget<O> comp)
Reset widget when switching from UNINITIALIZED state.
|
static WidgetId |
resolveWidgetId(Frame<?> frame,
int widgetId)
Resolve the widget id, depending if this frame is a down frame or not.
|
void |
restore()
Restore frame state.
|
void |
restoreEditors()
Restores the dimensions and locations of all widgets as they were before
the call to
rearrangeEditors() . |
private Dimension |
restoreFrameDetails()
Restore frame details.
|
void |
restoreInitialTabOrder()
Restores tab order that corresponds initial components layout.
|
private void |
saveFrameDetails()
Save frame details.
|
void |
scroll(boolean fromCurrent,
boolean upDown)
Scrolls the down frame up or down by one line.
|
private void |
scrollDownBody(int from,
int to,
int moveTo,
int incr)
Scroll down body.
|
private void |
scrollWorker(int from,
int to,
int moveTo,
int incr,
int insertAt)
Down frame body scrolling worker routine.
|
void |
setAlive(boolean alive)
Mark start and end of frame lifetime at client.
|
void |
setAllClear(boolean allClear)
Sets or resets the ALL CLEAR flag for the frame.
|
void |
setAttrSpace(boolean attr_space)
Set new state of the ATTR-SPACE attribute.
|
void |
setBodyVisible(boolean visible)
Set visibility of the down frame.
|
void |
setBox(boolean box)
Mark frame as boxed or non-boxed depending on NO-BOX flag.
|
void |
setCanHide(boolean canHide)
Set current state of canHide flag.
|
void |
setCanHideOthers(boolean canHideOthers)
Set current state of canHideOthers flag.
|
void |
setCanWipeScreen(boolean canWipeScreen)
Set state of canWipeScreen flag.
|
boolean |
setChooseAt(Widget<O> widget)
Positions the CHOOSE at the specified widget if possible and returns
the indication of success or failure.
|
void |
setColumns(int columns)
Sets the number of columns (n COLUMNS) option.
|
UIStatement |
setCurrentStatement(UIStatement stmt)
Set the current UI statement.
|
void |
setCursor(int cursor)
Assigns the current cursor position in a down frame.
|
void |
setDelayedRepaint(boolean delayedRepaint)
Mark frames that requires a repaint when will be displayed.
|
void |
setDown(boolean down)
Set the down state of this frame.
|
void |
setDynCol(int column)
Set dynamic column.
|
void |
setDynRow(int row)
Set dynamic frame row.
|
void |
setExplicitHide(boolean explicit)
Set new value for the 'explicitHide' flag.
|
(package private) void |
setFlushed(boolean flushed)
Set state of
flushed flag. |
void |
setFocusAttractor(boolean attractor)
Set new value for the 'focus attractor' flag.
|
void |
setFocusId(int focusId)
Set ID of component which will receive focus next time.
|
void |
setFocusReset(boolean focusReset)
Mark/unmark frame as such that need focus reset on trigger exit.
|
void |
setForcePause(boolean forcePause)
Set forced pause flag state.
|
void |
setForceWipeScreen(boolean forceWipeScreen)
Set state of forceWipeScreen flag.
|
void |
setFormatCheck(boolean formatCheck)
Set hard format check state.
|
void |
setHeight(double height)
Set the new height of the frame.
|
void |
setHonorNextConditionalDown(boolean mark)
Mark frame for special conditional down processing.
|
private void |
setInnerAndOuterSize(Dimension outerSize,
int titleLen)
Set size of frame components.
|
void |
setInnerSize(double innerWidth,
double innerHeight)
Setting the inner size of the container.
|
void |
setInScope(boolean inScope)
Mark start and end of frame scope.
|
void |
setLabels(boolean labels)
Set new state of the labels placement flag.
|
void |
setLayout(LayoutManager<O> customLayout)
Sets the custom layout to meet the Progress needs.
|
void |
setNeedPause(boolean needPause)
Sets
needPause flag to specified state. |
void |
setNeedPauseDirect(boolean needPause)
Directly set
needPause flag. |
void |
setNeedReset(boolean needReset)
Mark frame as such that requires resetting frame widgets when frame will
be displayed.
|
void |
setNonBodyVisible(boolean visible)
Set visibility of the non-body widgets inside a down frame.
|
void |
setOuterSize(double width,
double height)
Sets the size of the peer container.
|
void |
setPaintable(boolean paintable)
Controls object repainting.
|
void |
setPendingFixedDown(boolean state)
Set the pendingFixedDown flag.
|
void |
setPendingUnderline(boolean flag)
Sets the underline pending flag meaning the draw() method shout perform element relocation
when the flag is
true . |
void |
setProtected(boolean protect)
Protect frame from removal on hide.
|
void |
setRedirected(boolean redirected,
int streamId)
Set redirection flag and the associated stream ID.
|
void |
setSavedDimension(double width,
double height)
Change the original frame dimension, which was initially
provided by application.
|
void |
setScopeNesting(int scopeNesting)
Set the scope nesting level.
|
void |
setSensitive(boolean sensitive)
Change only sensitivity related flag for current frame.
|
void |
setSize(double width,
double height)
Set the new size of the frame.
|
void |
setSkipMoveToTop(boolean skipMoveToTop)
Set the
skipMoveToTop flag. |
void |
setState(Widget<O> comp,
byte state)
Set field state.
|
void |
setTabItemList(int[] nextTabItemList)
Set the next tab item list.
|
void |
setTabItemList(java.util.List<Widget<O>> tabItemList)
Sets the tab item list for this container.
|
void |
setValue(Widget<O> comp,
BaseDataType value)
Set frame value.
|
void |
setValue(Widget<O> comp,
BaseDataType value,
java.lang.String fmt)
Set frame value.
|
void |
setViewed(boolean viewed)
Set the state of the
viewed flag |
void |
setVisibilityChanged(boolean changed)
Set new value for the 'visibility changed' flag.
|
void |
setVisible(boolean visible)
Handle change of frame visibility.
|
void |
setWidth(double width)
Set the new width of the frame.
|
java.lang.String |
shortName()
Get short name of the frame.
|
private boolean |
sizeErrorCondition()
Check prerequisite conditions for potential size change errors.
|
void |
switchLabelsEmptyMode(Rectangle rect)
Switch empty mode for labels which fit into specified rectangle.
|
protected boolean |
thisAndAncestryVisible()
Test if this frame and all its ancestor frames are visible.
|
java.lang.String |
toString()
Frame-specific version of the
toString() . |
void |
touchBody()
Make sure that clipping rectangle of redirected frame with trailing
SKIPs is set correctly.
|
void |
touchRow()
Marks the current iteration as touched to allow all uninitialized
widgets to display.
|
void |
unbind(int id)
Unbind stream with given ID.
|
void |
underline(Widget<O>[] list)
Underlines a set of widgets.
|
void |
updateInnerSize()
Updates the inner size (aka scrollable size) of the frame according
to the current state of the associated config instance.
|
java.lang.String[] |
view()
Debugging Aid.
|
(package private) void |
viewed()
Clears the pending "moved cursor" condition and puts the iterations
widgets into their visible cursor position.
|
add, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipRectangle, currentFocus, cycleFocus, defaultFocus, deregisterSelectedWidget, dimension, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusTraversable, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, height, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, reflectAncestorChange, reflectLocationChange, registerSelectedWidget, remove, removeContainerStateListener, replace, requestFocus, requestFocus, setFocus, setFocusInt, setIgnoreFocus, setInsets, setSize, startSizeChange, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged, width
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, 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, hasFocus, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isTotallyObscured, isVisible, isVisible, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, translate, unregisterWidgetStateListener, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
widgetsAsList
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, hasFocus, hasFocus, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, isCurrent, isDirectManipulable, isDirectManipulationActive, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isTotallyObscured, isVisible, isVisible, maySwitchFocus, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetStateListener, repaint, repaint, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unregisterWidgetStateListener, validateDisplayValue, window
public static final int EXTRA_DLG_PIXELS
private boolean viewed
private boolean live
private boolean canHide
true
if the frame can be hidden.private boolean canHideOthers
true
if the frame can hide other frames.private boolean canWipeScreen
true
if the frame can wipe screen when hiding other frames.private boolean forceWipeScreen
true
if the frame must wipe screen on next view call.private boolean autoplacing
private int savedDown
private boolean autoLayout
protected boolean needPause
protected Widget<O extends OutputManager<?>>[] savedTabOrder
private Dimension savedDim
private Dimension savedPaneDim
private boolean dynamicDown
private int pendingDown
private boolean streamed
private boolean resetPending
true
, frame widgets need to be reset
when frame is about to be displayed.private int scopeNesting
private boolean delayedRepaint
true
, frames will be repainted on
the next display/view statement.private boolean allClear
private double dynamicCol
private double dynamicRow
private boolean active
private int focusId
private boolean inScope
protected boolean redirected
true
if frame is redirected to some stream.private int streamId
private boolean isFixedRow
protected boolean paintable
protected boolean configUpdateActive
private boolean colorChanged
private boolean postponedVisible
private boolean postponedPlace
private boolean protect
private boolean forcePause
private boolean withEditors
private boolean flushed
private boolean placedForRedirected
true
if placement was done for redirected mode.private boolean focusAttractor
private boolean visibilityChanged
private boolean explicitHide
private java.util.Set<java.lang.Integer> streams
private FrameState savedState
private boolean focusReset
private boolean honorNextConditionalDown
protected SensitiveScrollContainer<O extends OutputManager<?>> contentPane
protected ScrollPane<O extends OutputManager<?>> frameScroll
private FrameConfig config
protected boolean down
protected int cursor
protected double headersHeight
private double verticalStep
protected double verticalStepBoxed
protected Widget<O extends OutputManager<?>>[][] downBody
protected boolean[][] underline
protected boolean[] underlinedRow
protected boolean[] touched
private boolean[] needClear
protected double[] startRow
protected Widget<O extends OutputManager<?>>[] nonbody
private int saveDown
protected int lastRow
protected boolean trailingSkips
protected java.util.Set<Stream> headersOutput
protected UIStatement currentStatement
private boolean fixedWidth
private boolean pendingNeedClear
private boolean forcedRefresh
private java.util.Map<Editor<O extends OutputManager<?>>,java.lang.Double> resizH
private java.util.Map<Widget<O extends OutputManager<?>>,java.lang.Double> relocY
private double origHeight
private SpareIteration spareIteration
private boolean pendingCursorWrap
private int pendingCursorPos
private int newRow
private boolean pendingFixedDown
protected double originalHeightChars
private double leadingSkipSize
private double trailingSkipSize
private FrameFocusTransferManager focusTransferManager
protected ChooseHandler<O extends OutputManager<?>> chooseHandler
private boolean pendingUnderline
private boolean changed
protected boolean positionChanged
protected boolean sizeChanged
protected boolean skipMoveToTop
moveToTop()
call will be ignored.public Frame(WidgetId id, FrameConfig cfg)
Call initialize(com.goldencode.p2j.ui.WidgetId, com.goldencode.p2j.ui.FrameConfig)
to finish the widget initialization.
id
- The widget's ID.cfg
- Configuration data.public static WidgetId resolveWidgetId(Frame<?> frame, int widgetId)
frame
- The frame.widgetId
- The widget ID.public abstract double getLabelWidth(java.lang.String label, LabeledWidget<O> widget)
label
- The label text.widget
- The widgeth to which the label belongs.public abstract double getLabelHeight(java.lang.String labelText, LabeledWidget<O> widget, boolean topLabel)
labelText
- The label text.widget
- The widget to which the label belongs.topLabel
- Flag identifying that the label is shown above the widget.public abstract double getRowDelta()
protected abstract void resetColors(BaseConfig config)
config
- Widget configuration.protected abstract Colors compareColors(BaseConfig config, Colors colors)
ChUI implementation must compare dcolor and pfcolor.
GUI implementation must compare bgcolor and fgcolor.
config
- Widget configuration.colors
- Colors to be compared.protected abstract void drawUnderline(Widget<O> comp)
comp
- The base component to draw underline for.protected abstract Rectangle frameContentBounds()
public void initialize(WidgetId id, FrameConfig cfg)
This API is called after the widget is created and added to the registry.
initialize
in interface WidgetWithConfig<FrameConfig>
id
- The widget's ID.cfg
- The config used to initialize this widget.public void setSkipMoveToTop(boolean skipMoveToTop)
skipMoveToTop
flag.skipMoveToTop
- The new value.public void setColumns(int columns)
columns
- number of columns in the framepublic boolean hasEnabled()
true
if frame has enabled components and
false
otherwise.public boolean hasAnyEnabled()
true
if frame has enabled components and
false
otherwise.public void setFormatCheck(boolean formatCheck)
formatCheck
- New state of format check.public boolean clipping()
clipping
in interface Container<O extends OutputManager<?>>
clipping
in class AbstractContainer<O extends OutputManager<?>>
true
because Frame allows clipping.public void requestFocus()
Frame
.requestFocus
in interface Widget<O extends OutputManager<?>>
public FrameConfig config()
config
in interface Widget<O extends OutputManager<?>>
config
in interface ConfigOwner<FrameConfig>
config
in class AbstractWidget<O extends OutputManager<?>>
public Point location()
location
in interface Widget<O extends OutputManager<?>>
location
in class AbstractWidget<O extends OutputManager<?>>
public NativePoint physicalLocation()
physicalLocation
in interface Widget<O extends OutputManager<?>>
physicalLocation
in class AbstractWidget<O extends OutputManager<?>>
public void relayout()
public void postprocessConfig()
postprocessConfig
in interface Widget<O extends OutputManager<?>>
postprocessConfig
in class AbstractWidget<O extends OutputManager<?>>
public void doLayout()
doLayout
in interface Container<O extends OutputManager<?>>
doLayout
in class AbstractContainer<O extends OutputManager<?>>
public int placeToWindow(int windowId, UIStatement stmt)
windowId
- The target window ID.stmt
- The UI statement which places this frame.public int placeToWindow(int windowId, UIStatement stmt, boolean force)
windowId
- The target window ID.stmt
- The UI statement which places this frame.force
- Flag indicating if the placement needs to be forced to the specified window.protected void attachToWindow(int wndId)
wndId
- Window to attach to.public void doLayout(boolean suppressDrawing)
suppressDrawing
- If true
then drawing is suppressed even if frame
is visible.public Dimension getDialogDecorationCharSize()
protected void copyState(Widget<?> w)
copyState
in class AbstractContainer<O extends OutputManager<?>>
w
- The source widget which state needs to be copied.protected void doLayoutWorker(boolean suppressDrawing)
suppressDrawing
- If true
then drawing is suppressed even if frame
is visible.protected SensitiveScrollContainer<O> createScrollContainer()
private TempContainer<O> createTempContainer(Dimension minDim)
minDim
- The minimum dimension for the temp container.TempContainer
.private Dimension restoreFrameDetails()
private void saveFrameDetails()
protected double calculateHeightDelta()
protected double calculateWidthDelta()
private double calculateWidth(Dimension d, int titleLen)
d
- Initial frame dimensions.titleLen
- Length of frame title.private boolean calculateDownAndSetSize(Dimension d, int titleLen, double saveWidth)
d
- Initial frame dimensions.titleLen
- Title length.saveWidth
- Saved frame width.true
if frame needs readjustment.private void setInnerAndOuterSize(Dimension outerSize, int titleLen)
outerSize
- Frame outer size.titleLen
- Title length.public Dimension getSavedDimension()
public void setSavedDimension(double width, double height)
width
- The width of the frame.height
- The height of the frame.public void setSize(double width, double height)
setSize
in interface Container<O extends OutputManager<?>>
setSize
in class AbstractContainer<O extends OutputManager<?>>
width
- The new value for the frame width.height
- The new value for the frame height.public void setWidth(double width)
setWidth
in interface Container<O extends OutputManager<?>>
setWidth
in class AbstractContainer<O extends OutputManager<?>>
width
- The new value for the frame width.public void setHeight(double height)
setHeight
in interface Container<O extends OutputManager<?>>
setHeight
in class AbstractContainer<O extends OutputManager<?>>
height
- The new value for the frame height.public void addWidget(Widget<O> widget)
widget
- The new widget to be added to the container.public void detach(Widget<O> widget)
detach
in interface Container<O extends OutputManager<?>>
detach
in class AbstractContainer<O extends OutputManager<?>>
widget
- Widget to detach.java.lang.RuntimeException
- when the supplied widget is not attached to this containerpublic void setTabItemList(int[] nextTabItemList)
nextTabItemList
- The next tab item listprotected boolean drawDownFrame(Point top, boolean redir)
top
- The location from where to start drawing.redir
- Flag indicating if redirected mode is active.true
if the screen needs to be synchronized.public void draw()
draw
in interface Widget<O extends OutputManager<?>>
draw
in class AbstractContainer<O extends OutputManager<?>>
public Widget<O> getSelectedWidget(int number)
number
- The widget number whose handle should be returned.public boolean moveToBottom()
moveToBottom
in interface Widget<O extends OutputManager<?>>
moveToBottom
in class AbstractWidget<O extends OutputManager<?>>
true
if operation was successful and
false
otherwise.public boolean moveToTop()
moveToTop
in interface Widget<O extends OutputManager<?>>
moveToTop
in class AbstractWidget<O extends OutputManager<?>>
true
if operation was successful and
false
otherwise.public boolean moveToTop(boolean ignoreKeepZorder)
ignoreKeepZorder
- The flag indicating ignore Z-order keep value for frames.true
if operation was successfulpublic void moveWidgetBeforeTabItem(Widget<O> widget, Widget<O> before)
widget
- Widget to move.before
- The widget before to insert mover.public void markAsStreamed()
public void markChanged(boolean changed)
changed
- The new state.public boolean isChanged()
public boolean isAlive()
true
if frame is in active use on the server and
false
if the frame is not in use by the server and can
be destroyed.true
if frame is in scope.public void setAlive(boolean alive)
alive
- New value for the flag.public boolean isInScope()
true
if frame is in frame scope.true
if frame is in scope.public void setInScope(boolean inScope)
inScope
- New value for the flag.public void setVisible(boolean visible)
setVisible
in interface Widget<O extends OutputManager<?>>
setVisible
in class AbstractWidget<O extends OutputManager<?>>
visible
- New visibility state. true
- show frame,
false
- hide frame.public UIStatement setCurrentStatement(UIStatement stmt)
stmt
- The statement. It may be null if not one of UI statements or if the UI statement
has finished.public void realizeFrame(boolean realize)
realize
- Flag indicating if the frame should be realized.protected void forceBox(double start, double lines)
start
- line number in screen coordinates where the output startslines
- number of lines to output toprotected final boolean thisAndAncestryVisible()
protected final Widget<?> calcDefaultFocus()
null
.protected void onFromVisibleToHidden()
private void onFromHiddenToVisible()
private void changeVisibility(boolean visible)
visible
- New visibility state.private void forcePlaceFrame(boolean visible)
visible
- New visibility state.private void handleDynamicDown()
private void handleFlags()
private void handleDynamicLocation()
private void refreshOnVisibilityChange(boolean visible)
visible
- New visibility state.private void refreshOnTopFrameHide(ThinClient client)
client
- ThinClient
reference.private void refreshBoxedFrame(ThinClient client, Rectangle rect)
client
- ThinClient
reference.rect
- Initial frame rectangle.private boolean checkRefreshNecessary(Rectangle rect)
rect
- Frame rectangle.true
if refreshing is necessary.private void refreshFrameArea(ThinClient client, Rectangle rect)
client
- Reference to ThinClient
.rect
- Frame rectangle.protected boolean hasTitle()
true
if frame has valid non-empty title.public void resetAutoplacing()
public void resetNeedPause()
needPause
flag for all frames which are visible.public boolean isAutoplacing()
true
if automatic placing is active for the
frame.public boolean isActive()
public boolean isStreamed()
public boolean isDialog()
Dialog
.true
if frame is a Dialog
.public boolean isViewed()
viewed
flagpublic void setViewed(boolean viewed)
viewed
flagviewed
- The new state of the viewed
flag.public boolean isTopFrame()
true
if frame is top frame.public int getDown()
public FrameData getFrameValue(Widget<O> widget)
widget
- widget to query the value for or null
which
indicates the currently focused widget, if anyprivate FrameData getRegularFrameValue(Widget<O> widget)
widget
- Thw subjected widget.private FrameData getDownFrameValue(Widget<O> widget)
widget
- The subjected widget.private Widget<O> locateRegularBodyComponent(Widget<O> comp)
comp
- Component to locate.private Widget<O> locateDownBodyComponent(Widget<O> comp)
comp
- Component to locate.public Widget<O> getSelectedField(Widget<O> base)
base
- The base component of the frame.public boolean isCanHideOthers()
public void setCanHideOthers(boolean canHideOthers)
canHideOthers
- New value of the flag.public boolean isCanWipeScreen()
public void setCanWipeScreen(boolean canWipeScreen)
canWipeScreen
- New value of the flag.public void setForceWipeScreen(boolean forceWipeScreen)
forceWipeScreen
- New value of the flag.public boolean isForceWipeScreen()
true
if frame must wipe screen on next VIEW call.public boolean isCanHide()
public void setCanHide(boolean canHide)
canHide
- New value of the flag.public void adjustDown()
Note. In redirected mode, down frame possibly needs just one iteration of data ever. The current implementation doesn't detect this case and adjusts the frame based on the screen dimensions, which is incorrect. The UI would benefit from adjusting the down frame to one iteration as it minimizes the consumed resources. TO-DO.
protected void calculateHeight(Dimension d, double delta)
d
- Frame dimensions.delta
- Height delta.private double calculateDown(Point location)
location
- Frame location.public boolean isDynamic()
true
if size of the DOWN frame should be
dynamically recalculated.true
if size should be recalculated.public double getMinHeight()
public boolean isNeedPause()
needPause
flag.public void setNeedPauseDirect(boolean needPause)
needPause
flag.needPause
- New flag value.public void setNeedPause(boolean needPause)
needPause
flag to specified state.needPause
- New value for the flag.public java.lang.String toString()
toString()
.toString
in class AbstractWidget<O extends OutputManager<?>>
Object.toString()
public java.lang.String[] view()
public boolean processDefaultButton(KeyInput event)
event
- The event which c determine an action for the default button.TRUE
if event be re-routed to default button,
FALSE
otherwise.public boolean processDefaultButton(KeyInput event, boolean recursive)
event
- The event which c determine an action for the default button.recursive
- true
to search in the family frame tree for a frame with default button.
false
to try only the current frame.TRUE
if event be re-routed to default button (not necessarily to this
frame default button if recursive was set), FALSE
otherwise.public boolean processCancelButton()
TRUE
if event be re-routed to cancel button,
FALSE
otherwise.public Widget<O> processFrameMnemonic(int key, Widget<O> start)
key
- The mnemonic key.start
- The widget from which mnemonic search starts.null
if no widget can
accept it.public void processKeyEvent(KeyInput event)
processKeyEvent
in interface Widget<O extends OutputManager<?>>
processKeyEvent
in class AbstractContainer<O extends OutputManager<?>>
event
- Key event to process.public void adjustDown(int down)
down
- New value of the DOWN attribute.public void setDynRow(int row)
row
- Dynamically calculated row.public void setDynCol(int column)
column
- Dynamically calculated column.public boolean isInternalGo()
true
if last CHOOSe operation was finished by
internal GO event.internalGo
flag.public void setNeedReset(boolean needReset)
needReset
- true
- clear frame on next displaying.public boolean isNeedReset()
resetPending
flag.public void setDelayedRepaint(boolean delayedRepaint)
delayedRepaint
- true
- repaint the frame on the next display.public boolean isDelayedRepaint()
delayedRepaint
flag.public int getScopeNesting()
public void setScopeNesting(int scopeNesting)
scopeNesting
- The new scope nesting levelpublic void setAllClear(boolean allClear)
allClear
- true
- new value for the ALL CLEAR flagpublic boolean isAllClear()
public boolean isNoHide()
false
if the frame was deleted.public boolean hasEditors()
true
if frame has at least one editorpublic void reset()
public void repaint()
repaint
in interface Widget<O extends OutputManager<?>>
repaint
in class AbstractContainer<O extends OutputManager<?>>
public void setFocusId(int focusId)
focusId
- Component ID.public int getFocusId()
public boolean isRedirected()
true
if frame is redirected.public int getStreamId()
public void restoreInitialTabOrder()
public void preprocess(FrameConfig deltaConfig)
deltaConfig
- Depending on the context this is either the config before server side changes applied or
after the server side changes. In the former case the active config will have the server side
changes applied, in the latter not.public void postprocess(boolean newFrame, boolean suppressRedraw)
newFrame
- TODOsuppressRedraw
- true
means suppress redrawing of frame.public boolean isConfigUpdateActive()
true
if config is being applied to the widgetpublic void postponeSetVisible(boolean visible)
applyConfig(Widget, WidgetConfig)
.visible
- New state of the flag.public void postponePlace(boolean place)
applyConfig(Widget, WidgetConfig)
.place
- New state of the flag.public void setForcePause(boolean forcePause)
forcePause
- New value for the flag.public boolean isForcePause()
public void placed()
public boolean isPlacedForRedirected()
true
for redirected mode.public boolean isFocusAttractor()
public void setFocusAttractor(boolean attractor)
attractor
- New value for the flag.public boolean isVisibilityChanged()
public void setVisibilityChanged(boolean changed)
changed
- New value for the flag.public boolean isExplicitHide()
public void setExplicitHide(boolean explicit)
explicit
- New value for the flag.private void colorChanged()
public void setFocusReset(boolean focusReset)
focusReset
- true
mark frame, false
- unmark.public boolean isFocusReset()
public boolean hasDefaultButton()
true
if the frame has a default buttonDimension getMinimumSize()
Call this method only after frame has been laid out.
public java.lang.String shortName()
public void placeAtTop()
public void setPaintable(boolean paintable)
paintable
- true
if repaint() calls are to be honored.public void setProtected(boolean protect)
protect
- New state of the flag;public void touchBody()
public void setRedirected(boolean redirected, int streamId)
redirected
- state of redirectionstreamId
- associated stream ID, if redirected is true.public boolean hasSavedState()
true
if frame has saved state.public void restore()
public void unbind(int id)
id
- boolean isFlushed()
void setFlushed(boolean flushed)
flushed
flag.flushed
- New state of the flag.public void resetPlacementQuirk(boolean force)
force
- Force resetting of the placement quirk.public Rectangle calculateFrameRect(boolean withBox)
withBox
- when true
, instructs the method to include
the room the frame's box takes, into the rectangleprivate boolean intersectsTopFrame()
true
if frame intersects top frame in Z-order.private java.lang.Iterable<Rectangle> getUnoccupied(Rectangle rect)
rect
- original rectangle to inspectpublic void setHonorNextConditionalDown(boolean mark)
mark
- true
enables special down processing.public boolean isHonorNextConditionalDown()
true
if such a processing is required.public boolean isFixedWidth()
true
if frame width is specified explicitly.public boolean isWithHeaders(Stream stream)
This determination makes sense for the down frames only.
It is based on a list of paged streams on which this frame has been viewed for the current page. Each stream has its own paging state and will change pages at a different/arbitrary point than any other stream.
This same list will also contain all non-paged streams which have ever gotten output from this frame.
stream
- The stream to lookup in the list.true
if the frame has been viewed for the current
page on the given paged stream OR if the frame has been viewed
at least once for a non-paged stream. false
if
the frame is not a down frame or if it hasn't been viewed as
noted above for the given stream.public boolean isCurrentTouched()
true
if the current iteration has received some
output since the last cursor movement.public void setBox(boolean box)
box
- true
if frame is boxed and false
otherwise.public AbstractContainer<O> getContentPane()
public void setOuterSize(double width, double height)
width
- The new width of the container in character units. The width includes
the total size of vertical borders.height
- The new height of the container in character units. The height includes
the total size of horizontal borders.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<?>>
currentFocus
in class AbstractContainer<O extends OutputManager<?>>
recurse
- The parameter controls whether the method should recurse to the nested
containers when searching for the focused widget.private void centerFrame(double width, Dimension screen)
width
- Frame width.screen
- Screen dimensions.private double adjustHeight(double height, double screenHeight, double regionHeight)
height
- Input height.screenHeight
- Screen height.regionHeight
- Parent frame region height.protected double adjustWidth(double width, double screenWidth, double regionWidth)
width
- Input width.screenWidth
- Screen height.regionWidth
- Parent frame region width.public void setInnerSize(double innerWidth, double innerHeight)
innerWidth
- The new inner width of the container in character units.innerHeight
- The new inner height of the container in character units.public Dimension getInnerSize()
public void previousFocus()
public abstract void draw(Point origin, Dimension size)
Drawing for the redirected terminal differs. Labels/headers are drawn only once per page, instead of the usual once per frame.
origin
- The coordinate of the upper-left corner for peer container in
character units.size
- The size of the peer container in character units.public void repaintUninitialized()
public void notifyPageBreak(Stream out)
This notification will only be provided for the second and subsequent pages since it is based on notifying for page breaks (and there is no page break for the first page).
This particular listener uses the page break notification as a signal that the next time the frame outputs something, the frame headers should be redrawn, since it will be the first occurrence of the frame on the new page. Two conditions should be met for redrawing the frame headers:
notifyPageBreak
in interface PageBreakListener
out
- The stream that just wrote a page break.public void notifyClose(Stream out)
Not used here.
notifyClose
in interface CloseListener
out
- The stream being closed.public void notifyUnbind(Stream out)
This is used to remove non-paged streams from the list of streams for which we have output headers already. Paged streams always get a page break notification (even on the last page so long as at least 1 byte has already been output, which it must have in our case since it is in the list). But non-paged streams don't get any other notification that we can use for removal.
notifyUnbind
in interface CloseListener
out
- The stream being closed.public boolean isSideLabels()
public boolean isLabels()
public void setLabels(boolean labels)
labels
- New state of the flag.public boolean isAttrSpace()
public void setAttrSpace(boolean attr_space)
attr_space
- New state of the flag.public java.lang.String getFrameValue(int index, Widget<O> comp)
index
- The row from which to retrieve data.comp
- The component which forms a column of values.private java.lang.String getFieldText(Widget<O> field)
field
- Field to get text from.public double getFixedHeight()
public double getIterationHeight()
public double getLeadingSkipSize()
public double getTrailingSkipSize()
public Widget<O> getField(int index, Widget<O> comp)
index
- Row to retrieve.comp
- Reference component.public void clearWorker(boolean clearAll)
clearAll
- Force clearing all widgets in down frame.private void resetDownBody(int from, int to, boolean clearAll)
from
- Start row.to
- End row.clearAll
- if true
then all widgets will be cleared regardless
from the row clear flag.private void resetDownBodyWorker(int idx)
resetDownBody(int, int, boolean)
.idx
- Row index.public void resetAll()
public void clearCurrent()
public void repaintCurrent()
public java.util.Set<java.lang.Integer> getIterationIds()
Set
of widget IDs.public void touchRow()
public void needClearRow()
public void resetChanged()
private void resetChangedFlag(Widget<O> widget)
ScreenBuffer.CHANGED
flag for specified widget.widget
- Input widget.public void setValue(Widget<O> comp, BaseDataType value)
comp
- Component which is used as a reference.value
- Value to set.public void setValue(Widget<O> comp, BaseDataType value, java.lang.String fmt)
comp
- Component which is used as a reference.value
- Value to set.fmt
- An optional format string to use with this value. This will
temporarily override the current format string if and only if
component
is a FillIn
. May be
null
.public void setState(Widget<O> comp, byte state)
comp
- Reference component.state
- New state for the field.public void initializeWidget(Widget<O> comp)
comp
- Reference component.public void resetWidget(Widget<O> comp)
comp
- Reference component.public void applyConfig(Widget<O> comp, WidgetConfig cfg)
comp
- Reference component.cfg
- Config to apply.public java.lang.String[] getValues(Widget<O> focusedCol)
focusedCol
- Reference widget.public void setBodyVisible(boolean visible)
visible
- New visibility state.public void setNonBodyVisible(boolean visible)
visible
- New visibility state.public boolean allFramesVisible(boolean checkThis)
checkThis
- Flag indicating if this frame's visibility needs to be included in the check.true
if all frame's ancestors are visible.public boolean isRootFrame()
public Frame getRootFrame()
public boolean isPendingFixedDown()
true
if frame is pending fixed down.true
if frame is pending fixed down.public double getOriginalHeightChars()
public void setPendingFixedDown(boolean state)
state
- New state for this flag.public boolean isDown()
true
if frame is down frame.true
if frame is down frame.public void setDown(boolean down)
down
- The down-state of this frame.public void underline(Widget<O>[] list)
list
- array of field level widgets to be underlined.public void setPendingUnderline(boolean flag)
true
.flag
- true
if down frame elements underline needs special processing,
false
if already not.public boolean isPendingUnderline()
true
if down frame elements underline was postponed,
false
otherwise.public boolean isDownCalculated()
true
if down frame elements are calculated.public void fixNonBody(Widget<O> oldc, Widget<O> newc)
oldc
- existing component to be replaced in the non-body listnewc
- replacement componentpublic void prepareIteration(Widget<O> widget, ScreenBuffer frameBuf, int[] widgetIds, boolean isView)
widget
- The frame or widget.frameBuf
- The current values of widgets.widgetIds
- Array of field level widget IDs.isView
- true
if parameters are for VIEW,
false
for DISPLAY.public Widget<O> getField(Widget<O> comp)
comp
- Reference component.void detectTrailingSkips()
public boolean isLastWidget(Widget<O> wdgt)
Note that last widget is determined as last traversable widget in Tab
order, regardless from its position in the frame. Since
ThinClient.enable(int, int[], ScreenBuffer[], boolean, int, int[])
changes Tab order, it also changes which widget is last by the means
of this method.
wdgt
- widget to checktrue
if this component is the last component in
the frame.public boolean isLastWidget(Widget<O> wdgt, boolean recursive)
Note that last widget is determined as last traversable widget in Tab
order, regardless from its position in the frame. Since
ThinClient.enable(int, int[], ScreenBuffer[], boolean, int, int[])
changes Tab order, it also changes which widget is last by the means
of this method.
wdgt
- widget to checkrecursive
- If true
the method will also consider widgets of all the inner frames.true
if this component is the last component in
the frame.void viewed()
public boolean moveCursor(int by, boolean noPause)
Moving up beyond the top iteration means wrapping to the bottom. Moving down beyond the last iteration means wrapping back to the top. In both cases the down frame gets cleared.
by
- number of lines; positive numbers mean moving cursor downnoPause
- if true
then no pause will be generated on cursor
wrap.true
if cursor wrap has occurredpublic void scroll(boolean fromCurrent, boolean upDown)
fromCurrent
- true
if FROM-CURRENT option was usedupDown
- true
if scrolling upprivate void scrollWorker(int from, int to, int moveTo, int incr, int insertAt)
from
- Source start row.to
- Source end row.moveTo
- Destination start row.incr
- Increment.insertAt
- Row where empty row should be inserted.private void insertEmptyRow(int insertAt)
insertAt
- Index at which empty row should be inserted.private void scrollDownBody(int from, int to, int moveTo, int incr)
from
- Source start row.to
- Source end row.moveTo
- Destination start row.incr
- Increment.public void clear()
void resetCursor()
public int getCursor()
public void setCursor(int cursor)
cursor
- New cursor position.void fillDownBody()
private void adjustFlagsAndCursor(boolean[][] savedUnderline, boolean[] savedUnderlinedRow)
savedUnderline
- Saved underline flag array.savedUnderlinedRow
- Saved underlined row array.private void fillDownBodyParts(java.util.ArrayList<Widget<O>> onerow, int ndown)
onerow
- List of widgets consisting one row.ndown
- Number of iterations.private void allocate(int ndown)
ndown
- Number of iterations.private void detectSkips(Widget<O>[] c)
c
- Array of iteration widgets.public boolean canSetWidthChars(double width)
WIDTH-CHARS
attribute can be set to the
specified value.width
- The width value to be tested.true
if the specified width is valid.private void displayError(int code, java.lang.String err)
code
- Error code.err
- Error message.public boolean canSetHeightChars(double height, boolean virtual)
HEIGHT-CHARS
attribute can be set to the
specified value.height
- The height value to be tested.virtual
- Flag for virtual height.true
if the specified height is valid.protected abstract double adjustMinSize(double minWidthOrHeight, boolean isHeight)
minWidthOrHeight
- The size value to be adjusted.isHeight
- TRUE
if the size value is height, FALSE
if width.private boolean sizeErrorCondition()
true
if conditions are met.public boolean canSetRow(double row)
ROW
attribute can be set to the specified
value.row
- The row value to be tested.true
if the specified row is valid.public boolean canSetColumn(double column)
COLUMN
attribute can be set to the
specified value.column
- The column value to be tested.true
if the specified column is valid.private boolean posErrorCondition()
true
if conditions are met.private void clearComponents(Widget<O>[] list)
list
- Components to clear.private void calcFixedRect(java.util.ArrayList<Widget<O>> onerow, java.util.ArrayList<Widget<O>> others)
onerow
- List where widgets from repeated part of frame will be saved.others
- List where widgets from fixed part of frame will be saved.public void arrangeToStream()
public void arrangeToInteract()
public void rearrangeEditors()
Editors can hold variable number of lines. If the widget's height does not allow accommodation of all lines, the widget should be resized to get the extra room. This leads to a cascade of relocations for all widgets placed below the editor's rectangle. As the final step, the containers holding the widgets, up to the frame, have to be resized accordingly.
During this rearranging process, the original dimensions and locations
of all affected widgets are saved for the subsequent restoration, which
is implemented in restoreEditors()
and is fast.
public void restoreEditors()
rearrangeEditors()
.public void resetForcedRefresh()
public boolean isForcedRefresh()
private void finishCursorWrap(boolean normalExit, boolean doView)
normalExit
- Type of the exit, true
means normal exit,
false
means exit with condition.doView
- Display saved iteration if any.private Widget<O> copyComponent(Widget<O> component, int downIdx)
component
- Component to make a copy of.private void readjustDownBody()
private int getFieldIndex(Widget<O> comp)
comp
- Component which is used as a reference.protected boolean relocateComponent(Widget<O> source, double step, Widget<O> dest)
source
- Reference component.step
- Vertical step relative to source component.dest
- Destination component.true
if component does not fit of the scroll pane
and false
otherwise.public void moveAboveWidget(Widget<O> widget, int validCursorPos)
See FrameFocusTransferManager.moveAboveWidget(Widget, int)
for
more details.
widget
- widget to checkvalidCursorPos
- cursor offset within the widgetpublic boolean isLeftMostWidget(Widget<O> widget)
See FrameFocusTransferManager.isLeftMostWidget(Widget)
for
more details.
widget
- widget to checktrue
if this component is the left-most component
in the row.public void moveBelowWidget(Widget<O> widget, int validCursorPos)
See FrameFocusTransferManager.moveBelowWidget(Widget, int)
for
more details.
widget
- widget to checkvalidCursorPos
- cursor offset within the widgetpublic boolean isRightMostWidget(Widget<O> widget)
See FrameFocusTransferManager.isRightMostWidget(Widget)
for
more details.
widget
- widget to checktrue
if this component is the right-most component
in the row.public java.lang.Integer enterChoose(Widget<O>[] list, ChooseData data, java.lang.Integer focusOn)
list
- List of components.data
- Choose data.focusOn
- ID of the widget to start from.public ChooseData getChooseData()
public ChooseData leaveChoose()
public java.lang.String getChooseHelp()
null
if not in CHOOSEpublic boolean isInChoose(Widget<O> widget)
widget
- Widget to check.true
if the widget is part of a CHOOSEpublic boolean isChooseActive()
public boolean setChooseAt(Widget<O> widget)
widget
- Widget to set current CHOOSE position at.true
if the widget is part of an active CHOOSEpublic Widget<O> getFirstEnabledWidget()
null
public java.util.Set<java.lang.Integer> enabledWidgetsByList(Widget<O>[] affw, Widget<O> focus, int[] widgetId, boolean enabled)
affw
- Storage for affected widgets.focus
- Focused widget.widgetId
- List of widget IDs to enable.enabled
- New enabled state for the affected widgets.public static int getFirstFocusableId(Frame<?> frame)
frame
- frame to query-1
if no focusable widget is foundpublic static int getFirstFocusableId(Frame<?> frame, java.util.List<java.lang.Integer> fgWidgetsIds)
frame
- frame to queryfgWidgetsIds
- The list widgets IDs of some field-group in this frame.-1
if no focusable widget is foundpublic Widget<O> getNextEnabledWidget(Widget<O> widget, boolean wrap)
widget
- widget to start search after, when null
search starts from the beginningwrap
- if true
the search wraps to the first widget
of the frame when the last widget failsnull
public Widget<O>[] enableAllWidgets(Widget<O> focus, boolean enabled)
focus
- Focused widget.enabled
- New enabled state.public void setSensitive(boolean sensitive)
sensitive
- New sensitive state.public void switchLabelsEmptyMode(Rectangle rect)
rect
- Input rectangle.public double getBorderBottomChars()
public double getBorderLeftChars()
public double getBorderRightChars()
public double getBorderTopChars()
public void destroy()
destroy
in interface Widget<O extends OutputManager<?>>
destroy
in class AbstractContainer<O extends OutputManager<?>>
public void setLayout(LayoutManager<O> customLayout)
setLayout
in interface Container<O extends OutputManager<?>>
setLayout
in class AbstractContainer<O extends OutputManager<?>>
customLayout
- The new layout to be used for widget whose coordinate is not
explicitly defined upon adding to the peer frame.public void afterConfigUpdate(FrameConfig beforeUpdate)
afterConfigUpdate
in interface ConfigOwner<FrameConfig>
beforeUpdate
- Config reference capturing the config state before
the owner's config was modified.public boolean hasHeaders()
true
if any widget is a header widget.public WidgetConfig[] getDownConfigs()
public ZOrderClass getZOrderClass()
getZOrderClass
in interface Widget<O extends OutputManager<?>>
getZOrderClass
in class AbstractWidget<O extends OutputManager<?>>
public boolean isThreeD()
true
the widget should be represented with 3D visuals.isThreeD
in interface Widget<O extends OutputManager<?>>
isThreeD
in class AbstractWidget<O extends OutputManager<?>>
public boolean hasBox()
true
when the frame should have a box around.
Note that the returned value may differ from FrameConfig.box
as
for example dialog boxes do not draw a box even when BOX set to true.public void updateInnerSize()
protected double captionHeight()
protected Dimension getMaxFrameSize()
protected Dimension getFrameRegion()
private void maintainTabOrder(int[] widgetIds)
The algorithm of determining tab order based on the order of frame items
in the set/update/enable statementa is as follows:
(1) Focus is placed to the first item in the set/update list.
(2) Iterate the list from right to left and keep only the first occurrences
of selected items. The resulting unique sequence will determine the focus order
starting with the already focused item.
Example:
set k j l i k k l j with frame f1.
Initial focus is placed to item k. The unique sequence will be i k l j.
The focus order is thus k l j i.
When KEEP-TAB-ORDER is specified the focus order is determined by the order
the items are placed on the frame. Also, SET/UPDATE is exited after the last
item in the unique sequence is RETURNed. That is, the example above is exited
after j is RETURNed.
widgetIds
- The array of widget ids to enable and to maintain tab order for.private java.util.List<Widget<O>> getAllTabOrderedWidgets()
public boolean preventFocusWhenMouseDownEventDefined()
true
.preventFocusWhenMouseDownEventDefined
in interface Widget<O extends OutputManager<?>>
preventFocusWhenMouseDownEventDefined
in class AbstractWidget<O extends OutputManager<?>>
public void setTabItemList(java.util.List<Widget<O>> tabItemList)
setTabItemList
in class AbstractContainer<O extends OutputManager<?>>
tabItemList
- The tab item list