public class WindowTitleBar extends AbstractContainer<GuiOutputManager> implements WidgetWithConfig<BaseConfig>
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
WindowTitleBar.WindowIcon
The window's icon.
|
private class |
WindowTitleBar.WindowTitle
The window's title.
|
| Modifier and Type | Field and Description |
|---|---|
private CaptionButton[] |
allButtons
The full set of window caption buttons
|
private CaptionButton[] |
buttons
The displayed caption buttons.
|
private BaseConfig |
config
This widget configuration instance.
|
private boolean |
disableSystemMenu
When true, the window system menu activated by title right-click is disabled
|
private GuiDriver |
gd
The graphics driver.
|
private GuiFontResolver |
gf
Font resolver.
|
(package private) WindowTitleBar.WindowIcon |
icon
The window's icon.
|
(package private) WindowTitleBar.WindowTitle |
title
The window title.
|
private TitledWindow<?> |
wndParent
The ancestor window widget.
|
listeners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
WindowTitleBar(WidgetId id,
boolean showWindowIcon,
CaptionButtonType[] buttonTypes,
java.lang.Boolean[] buttonEnabledStates,
java.lang.String windowTitle,
boolean disableSystemMenu)
Custom c'tor.
|
WindowTitleBar(WidgetId id,
java.lang.String windowTitle)
Basic c'tor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateTooltips()
Activates tooltips for caption buttons.
|
void |
afterConfigUpdate(BaseConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
BaseConfig |
config()
Get the widget config.
|
void |
destroy()
Destroy this widget.
|
void |
displayButtons(CaptionButtonType[] buttonTypes)
Makes the specified buttons visible on the title bar.
|
void |
doLayout()
Layout the elements of this title.
|
void |
draw()
Draw the title's background.
|
Widget<GuiOutputManager> |
findMouseSource(NativePoint p)
Find the widget positioned just bellow the specified mouse position (in physical units).
|
boolean |
focusTraversable()
This component will not receive focus when Tab or Shift-Tab is pressed.
|
void |
initialize(WidgetId id,
BaseConfig 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.
|
private boolean |
isActiveWindow()
Determine if the window associated with this bar is the active window.
|
protected int[] |
mouseActions()
Determine the mouse actions processed by this widget.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Notification of a mouse clicked event occurred for this widget.
|
boolean |
raiseLegacyMouseEvents()
Check if the widget implementation can raise legacy, 4GL-style, mouse events.
|
(package private) void |
registerWindowTitlePopup()
Register widgets regions for a right mouse click action and a left mouse click action
to open a window title popup widget.
|
void |
setCaptionButtonEnabled(CaptionButtonType button,
boolean enabled)
Enabled or disables a caption button.
|
void |
setClickHandler(CaptionButtonType button,
java.lang.Runnable handler)
Sets a click handler for any of the title bar buttons.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
void |
update(boolean showWindowIcon,
CaptionButtonType[] buttons,
java.lang.Boolean[] buttonStates,
java.lang.String windowTitle,
boolean disableSystemMenu)
Modifies the title bar according to the parameters.
|
add, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, currentFocus, cycleFocus, defaultFocus, deregisterSelectedWidget, detach, dimension, dumpCurrentWidgets, dumpWidgets, endSizeChange, firstFocus, focus, 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, processKeyEvent, reflectAncestorChange, reflectLocationChanged, registerSelectedWidget, remove, removeContainerStateListener, repaint, replace, requestFocus, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setPhysicalDimensionInt, setSize, setSize, setTabItemList, setWidth, startSizeChange, swap, 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, 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, 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, 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, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitwidgetsAsListacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, 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, 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, windowWindowTitleBar.WindowIcon icon
WindowTitleBar.WindowTitle title
private final GuiDriver gd
private GuiFontResolver gf
private CaptionButton[] allButtons
private CaptionButton[] buttons
private BaseConfig config
private boolean disableSystemMenu
private TitledWindow<?> wndParent
public WindowTitleBar(WidgetId id, java.lang.String windowTitle)
id - The widget's ID.windowTitle - The window title.public WindowTitleBar(WidgetId id, boolean showWindowIcon, CaptionButtonType[] buttonTypes, java.lang.Boolean[] buttonEnabledStates, java.lang.String windowTitle, boolean disableSystemMenu)
id - The widget's ID.showWindowIcon - If true the window's window icon will be shown.buttonTypes - Array of button types to show on the bar.buttonEnabledStates - The enabled state of each individual button. The order corresponds to the
buttonTypes argument.windowTitle - The window title.disableSystemMenu - The system menu disable flag.public void initialize(WidgetId id, BaseConfig cfg)
This API is called after the widget is created and added to the registry.
initialize in interface WidgetWithConfig<BaseConfig>id - The widget's ID.cfg - The config used to initialize this widget.public BaseConfig config()
config in interface Widget<GuiOutputManager>config in interface ConfigOwner<BaseConfig>config in class AbstractWidget<GuiOutputManager>public void afterConfigUpdate(BaseConfig beforeUpdate)
afterConfigUpdate in interface ConfigOwner<BaseConfig>beforeUpdate - Config reference capturing the config state before
the owner's config was modified.public void doLayout()
doLayout in interface Container<GuiOutputManager>doLayout in class AbstractContainer<GuiOutputManager>public void displayButtons(CaptionButtonType[] buttonTypes)
buttonTypes - The buttons to make visible.void registerWindowTitlePopup()
public void mouseClicked(java.awt.event.MouseEvent e)
If the widget is not already focused, it forces the focus to it. After the focus was received, it computes the caret location, based on the mouse position over the widget's content.
mouseClicked in interface java.awt.event.MouseListenermouseClicked in class AbstractWidget<GuiOutputManager>e - The mouse event.public Widget<GuiOutputManager> findMouseSource(NativePoint p)
findMouseSource in interface Widget<GuiOutputManager>findMouseSource in class AbstractContainer<GuiOutputManager>p - The mouse physical location.null if none found.protected int[] mouseActions()
mouseActions in class AbstractWidget<GuiOutputManager>public void draw()
draw in interface Widget<GuiOutputManager>draw in class AbstractContainer<GuiOutputManager>public boolean raiseLegacyMouseEvents()
raiseLegacyMouseEvents in interface Widget<GuiOutputManager>raiseLegacyMouseEvents in class AbstractWidget<GuiOutputManager>false.public void destroy()
destroy in interface Widget<GuiOutputManager>destroy in class AbstractContainer<GuiOutputManager>public void activateTooltips()
public void setCaptionButtonEnabled(CaptionButtonType button, boolean enabled)
button - The button to enable/disable.enabled - The new enabled state.public void setClickHandler(CaptionButtonType button, java.lang.Runnable handler)
button - Button type.handler - Click handler.public boolean focusTraversable()
focusTraversable in interface Widget<GuiOutputManager>focusTraversable in class AbstractContainer<GuiOutputManager>falsepublic void update(boolean showWindowIcon,
CaptionButtonType[] buttons,
java.lang.Boolean[] buttonStates,
java.lang.String windowTitle,
boolean disableSystemMenu)
showWindowIcon - If true the window's window icon will be shown.buttons - Array of button types to show on the bar.buttonStates - The enabled state of each individual button. The order corresponds to the
buttons argument.windowTitle - The window title.disableSystemMenu - The system menu disable flag.public java.lang.String toString()
toString in class AbstractWidget<GuiOutputManager>private boolean isActiveWindow()