public class WindowTitleBar extends AbstractContainer<GuiOutputManager> implements WidgetWithConfig<BaseConfig>, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
Modifier and Type | Class and Description |
---|---|
(package private) class |
WindowTitleBar.WindowIcon
The window's icon.
|
private class |
WindowTitleBar.WindowTitle
The window's title.
|
Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
private CaptionButton[] |
buttons
The caption buttons.
|
private BaseConfig |
config
This widget configuration instance.
|
private GuiDriver |
gd
The graphics driver.
|
(package private) WindowTitleBar.WindowIcon |
icon
The window's icon.
|
(package private) WindowTitleBar.WindowTitle |
title
The window title.
|
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
WindowTitleBar(WidgetId id,
boolean showWindowIcon,
CaptionButtonType[] buttonTypes,
java.lang.String windowTitle)
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 |
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.
|
private void |
triggerTitlePopup(AbstractWidget holder,
java.awt.event.MouseEvent e)
Trigger an action to open a window title popup.
|
add, add, add, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, currentFocus, currentFocus, cycleFocus, defaultFocus, destroy, detach, dimension, endSizeChange, firstFocus, focus, focusWorker, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getWidgetsList, hasFocusable, height, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, prepareWidgets, prevFocus, processKeyEvent, remove, repaint, replace, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setWidth, startSizeChange, unrealize, updateSizeWorker, widgets, width
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, ignoreAction, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, manageSystemActions, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, refresh, registerWidgetStateListener, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
mouseEntered, mouseExited, mousePressed, mouseReleased
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, isDirectManipulable, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, repaint, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, topLevelWindow, window
WindowTitleBar.WindowIcon icon
WindowTitleBar.WindowTitle title
private GuiDriver gd
private CaptionButton[] buttons
private BaseConfig config
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.String windowTitle)
id
- The widget's ID.showWindowIcon
- If true
the window's window icon will be shown.buttonTypes
- Array of button types to create on the bar.windowTitle
- The window title.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
- public void doLayout()
doLayout
in interface Container<GuiOutputManager>
doLayout
in class AbstractContainer<GuiOutputManager>
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.MouseListener
mouseClicked
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.private void triggerTitlePopup(AbstractWidget holder, java.awt.event.MouseEvent e)
holder
- A widget that handles a mouse click evente
- 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 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>
false
private boolean isActiveWindow()