public abstract class Slider<O extends OutputManager<?>> extends AbstractWidget<O> implements WidgetWithConfig<SliderConfig>, DataContainer, LabeledWidget<O>, MnemonicTrait<O>
Modifier and Type | Field and Description |
---|---|
private MnemonicInfo |
columnMnemonic
Column mnemonic information
|
protected SliderConfig |
config
Slider attributes.
|
protected static int |
INCREMENT
The increment value for slider mouse handler.
|
private Label<O> |
label
Component label.
|
private MnemonicInfo |
mnemonic
Mnemonic information
|
insets, location, LOG, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
Slider(WidgetId id,
Container<O> owner)
This constructor creates a rectangle.
|
Slider(WidgetId id,
SliderConfig cfg)
Special constructor used to restore component using given configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
afterConfigUpdate(SliderConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
protected void |
changeScreenValue(int delta)
Change the current value of the slider.
|
SliderConfig |
config()
Provide access to the attributes stored in the widget.
|
Dimension |
dimension()
Get widget dimension.
|
abstract void |
draw()
Draw the rectangle.
|
boolean |
focusTraversable()
This component will not receive an input focus when Tab or Shift-Tab is pressed.
|
double |
getColon()
Return current value of COLON option.
|
java.lang.String |
getColumnLabelText()
Return text of the column label.
|
MnemonicInfo |
getColumnMnemonic()
Column
MnemonicInfo instance getter. |
Label<O> |
getLabelInstance()
Return the reference to the instance of the
Label attached
to the widget. |
java.lang.String |
getLabelText()
Return text of the label.
|
MnemonicInfo |
getMnemonic()
MnemonicInfo instance getter.
|
int |
getRange()
Get widget range value as int.
|
int |
getScreenValueAsInt()
Get widget screen value as int.
|
java.lang.String |
getScreenValueAsString()
Get widget screen value in String format.
|
java.lang.String |
getText()
Get text representation of the current slider value.
|
double |
getTo()
Return TO column.
|
BaseDataType |
getValue()
Gets the current slider value.
|
double |
height()
Calculate the height of this widget.
|
void |
initialize(WidgetId id,
SliderConfig 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.
|
boolean |
isForceLabel()
Get current state of flag which is forces presence of the label
regardless from the frame NO-LABELS option.
|
boolean |
isModified()
Getting the modification state of the widget.
|
boolean |
isNoLabels()
Get current state of the NO-LABELS flag.
|
boolean |
isRightAligned()
Get widget alignment policy.
|
Dimension |
minimumSize()
Get widget minimum size.
|
void |
processKeyEvent(KeyInput keyEvent)
Process key events that have been generated by this component.
|
void |
setColumnMnemonic(MnemonicInfo mnemonic)
Column
MnemonicInfo instance setter. |
void |
setLabelInstance(Label<O> label)
Assign new instance of
Label to the widget. |
void |
setMnemonic(MnemonicInfo mnemonic)
MnemonicInfo instance setter.
|
void |
setNoLabels(boolean labels)
Force NO-LABELS flag.
|
void |
setValue(BaseDataType value)
Sets the instance representing the current value.
|
void |
setWasVisible()
Remember the widget was made visible at least once.
|
boolean |
wasVisible()
Checking if the widget was made visible at least once.
|
double |
width()
Calculate the width of this widget.
|
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, copyState, createMouseHoverAction, deactivateDirectManipulation, debug, destroy, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, ignoreAction, insets, isCurrent, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChange, refresh, registerWidgetStateListener, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, showPopupMenu, 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, destroy, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, insets, isCurrent, isDirectManipulable, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, repaint, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, topLevelWindow, unrealize, window
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
createMnemonic, getMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, isMnemonicSupported, updateMnemonic
protected static final int INCREMENT
protected SliderConfig config
private Label<O extends OutputManager<?>> label
private MnemonicInfo mnemonic
private MnemonicInfo columnMnemonic
public Slider(WidgetId id, Container<O> owner)
owner
- The parent container, frame which will include this
rectangle.id
- The widget's ID.public Slider(WidgetId id, SliderConfig cfg)
Call initialize(com.goldencode.p2j.ui.WidgetId, com.goldencode.p2j.ui.SliderConfig)
to finish the widget initialization.
id
- The widget's ID.cfg
- Configuration data.public void initialize(WidgetId id, SliderConfig cfg)
This API is called after the widget is created and added to the registry.
initialize
in interface WidgetWithConfig<SliderConfig>
id
- The widget's ID.cfg
- The config used to initialize this widget.public SliderConfig config()
config
in interface Widget<O extends OutputManager<?>>
config
in interface ConfigOwner<SliderConfig>
config
in class AbstractWidget<O extends OutputManager<?>>
public void afterConfigUpdate(SliderConfig beforeUpdate)
afterConfigUpdate
in interface ConfigOwner<SliderConfig>
beforeUpdate
- The configuration before starting updating the widget.public Dimension dimension()
dimension
in interface Widget<O extends OutputManager<?>>
dimension
in class AbstractWidget<O extends OutputManager<?>>
public abstract void draw()
draw
in interface Widget<O extends OutputManager<?>>
draw
in class AbstractWidget<O extends OutputManager<?>>
public double height()
height
in interface Widget<O extends OutputManager<?>>
height
in class AbstractWidget<O extends OutputManager<?>>
public Dimension minimumSize()
minimumSize
in interface Widget<O extends OutputManager<?>>
minimumSize
in class AbstractWidget<O extends OutputManager<?>>
public double width()
width
in interface Widget<O extends OutputManager<?>>
width
in class AbstractWidget<O extends OutputManager<?>>
public boolean focusTraversable()
focusTraversable
in interface Widget<O extends OutputManager<?>>
focusTraversable
in class AbstractWidget<O extends OutputManager<?>>
false
.public double getColon()
getColon
in interface LabeledWidget<O extends OutputManager<?>>
public void setWasVisible()
setWasVisible
in interface LabeledWidget<O extends OutputManager<?>>
public boolean wasVisible()
wasVisible
in interface LabeledWidget<O extends OutputManager<?>>
true
if the widget was visible,
false
otherwise.public boolean isNoLabels()
isNoLabels
in interface LabeledWidget<O extends OutputManager<?>>
public void setNoLabels(boolean labels)
setNoLabels
in interface LabeledWidget<O extends OutputManager<?>>
labels
- The new value of the flag.public java.lang.String getColumnLabelText()
getColumnLabelText
in interface LabeledWidget<O extends OutputManager<?>>
public java.lang.String getLabelText()
getLabelText
in interface LabeledWidget<O extends OutputManager<?>>
public double getTo()
getTo
in interface LabeledWidget<O extends OutputManager<?>>
public boolean isForceLabel()
isForceLabel
in interface LabeledWidget<O extends OutputManager<?>>
public Label<O> getLabelInstance()
Label
attached
to the widget.getLabelInstance
in interface LabeledWidget<O extends OutputManager<?>>
Label
instance.public void setLabelInstance(Label<O> label)
Label
to the widget.setLabelInstance
in interface LabeledWidget<O extends OutputManager<?>>
label
- Reference to new Label
instance.public boolean isRightAligned()
isRightAligned
in interface LabeledWidget<O extends OutputManager<?>>
true
if the widget is formatted for right
alignment.public BaseDataType getValue()
getValue
in interface DataContainer
public void setValue(BaseDataType value)
setValue
in interface DataContainer
value
- The value representing the current widget value.public java.lang.String getText()
getText
in interface DataContainer
""
if no screen value exists.public boolean isModified()
isModified
in interface DataContainer
true
if the widget value was modified,
false
otherwise.public void processKeyEvent(KeyInput keyEvent)
processKeyEvent
in interface Widget<O extends OutputManager<?>>
processKeyEvent
in class AbstractWidget<O extends OutputManager<?>>
keyEvent
- The key event to be handled.public int getScreenValueAsInt()
public int getRange()
public java.lang.String getScreenValueAsString()
public MnemonicInfo getMnemonic()
The implementors should simply return the value of the mnemonic class field. No additional processing logic is advised.
getMnemonic
in interface MnemonicTrait<O extends OutputManager<?>>
public void setMnemonic(MnemonicInfo mnemonic)
The implementors should simply assign the parameter value to the mnemonic class field. No additional processing logic is advised.
setMnemonic
in interface MnemonicTrait<O extends OutputManager<?>>
public MnemonicInfo getColumnMnemonic()
MnemonicInfo
instance getter.
The implementors should simply return the value of the mnemonic class field. No additional processing logic in the implemented method is advised.
The method will return a valid value when the implementing widget supports column label.
getColumnMnemonic
in interface MnemonicTrait<O extends OutputManager<?>>
public void setColumnMnemonic(MnemonicInfo mnemonic)
MnemonicInfo
instance setter.
The implementors should simply assign the parameter value to the mnemonic class field. No additional processing logic in the implemented method is advised.
setColumnMnemonic
in interface MnemonicTrait<O extends OutputManager<?>>
protected void changeScreenValue(int delta)
delta
- The delta value to change the current one.