public class CaptionButton extends GuiButton
Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
private java.lang.Runnable |
clickHandler
Optional click handler.
|
private GuiDriver |
gd
The graphics driver.
|
private double |
height
The button's height, in character units.
|
private CaptionButtonType |
type
The button type.
|
private double |
width
The button's width, in character units.
|
config, widgetFocused
insets, location, LOG, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
CaptionButton(WidgetId id,
CaptionButtonType type)
Create a new button with the specified type.
|
Modifier and Type | Method and Description |
---|---|
void |
draw()
Draw this caption button, depending on its type.
|
boolean |
focusTraversable()
Caption buttons are not focus traversable.
|
CaptionButtonType |
getType()
Returns the button type.
|
double |
height()
Get the button's
height . |
boolean |
isFocusable()
Checks whether this widget can receive focus generally.
|
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.
|
void |
setClickHandler(java.lang.Runnable handler)
Sets the optional click handler for the button.
|
void |
setDimension(double width,
double height)
Set the button's dimension.
|
double |
width()
Get the button's
width . |
isMouseOver, isPressed, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased
addListener, afterConfigUpdate, checkKey, config, destroy, getColon, getColumnLabelText, getCommand, getLabelInstance, getLabelText, getMnemonic, getTo, handleBasicEvents, initButtonText, initialize, isForceLabel, isMnemonicSupported, isNoLabels, isRightAligned, postprocessConfig, processEvent, processKeyEvent, requestFocus, setCommand, setHidden, setLabelInstance, setMnemonic, setNoLabels, setSupportsMnemonic, setText, setTextLabel, setVisible, setWasVisible, textLabel, wasVisible
dimension, forceCursorOnFocus, getDefaultEvent, handleCursorKeys, ignoreAction, manageSystemActions, minimumSize, onFocusGained, onFocusLost, onKeyPressed, onKeyTyped, processKeyEventCommon, refresh, setActionCode
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, insets, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, prepParentLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, refresh, registerWidgetStateListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, unrealize, updateSizeWorker, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, dimension, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, insets, isDirectManipulable, isDisplayed, isEnabled, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, minimumSize, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, repaint, repaint, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, supportsCustomMousePointer, topLevelWindow, unrealize, window
createMnemonic, getColumnMnemonic, getMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, setColumnMnemonic, updateMnemonic
private CaptionButtonType type
private GuiDriver gd
private double width
private double height
private java.lang.Runnable clickHandler
CaptionButton(WidgetId id, CaptionButtonType type)
id
- The widget's ID.type
- The button type.public CaptionButtonType getType()
public boolean focusTraversable()
focusTraversable
in interface Widget<GuiOutputManager>
focusTraversable
in class AbstractWidget<GuiOutputManager>
public void draw()
draw
in interface Widget<GuiOutputManager>
draw
in class AbstractButton<GuiOutputManager,ButtonConfig>
public void setDimension(double width, double height)
width
- The button's width, in character unitsheight
- The button's height, in character unitspublic double width()
width
.width
in interface Widget<GuiOutputManager>
width
in class Button<GuiOutputManager>
public double height()
height
.height
in interface Widget<GuiOutputManager>
height
in class Button<GuiOutputManager>
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public boolean raiseLegacyMouseEvents()
raiseLegacyMouseEvents
in interface Widget<GuiOutputManager>
raiseLegacyMouseEvents
in class AbstractWidget<GuiOutputManager>
false
.public void setClickHandler(java.lang.Runnable handler)
handler
- Click handler.protected int[] mouseActions()
mouseActions
in class GuiButton
public boolean isFocusable()
isFocusable
in interface Widget<GuiOutputManager>
isFocusable
in class AbstractWidget<GuiOutputManager>
false
.