abstract class AbstractScrollBar extends GenericWidget implements ModelChangeListener
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractScrollBar.Part
Enumerate all possible mouse positions in the widget area.
|
| Modifier and Type | Field and Description |
|---|---|
protected AbstractScrollBar.Part |
autoScrollPart
The part the mouse was last time autoscroll started.
|
private boolean |
autoScrollSuspend
Flag used to temporary suspend auto repeat scrolling feature.
|
protected NativeRectangle |
highLightedRect
If not
null, the bounding rectangle of currently highlighted part,
this rectangle must be invalidated when highlighted part or thumb position changes. |
protected AbstractScrollBar.Part |
lastHoverPart
The part the mouse was last time hovered over.
|
protected int |
lastModelPos
Last pressed mouse model position.
|
protected int |
lastMousePos
Last pressed mouse position along the scrolling direction.
|
protected AbstractScrollBar.Part |
lastPressedPart
The part the mouse was last time pressed in.
|
protected ScrollModel |
model
The scroll model
|
private static int[] |
MOUSE_ACTIONS
Mouse actions this widget is interested
|
private boolean |
pressed
Mouse pressed indicator.
|
private ScrollbarExecutor |
scrollbarExecutor
Executor for handling mouse input.
|
private int |
targetWndId
The window ID to send auto scroll mouse messages.
|
private ThinClient |
tcInst
The client instance to use for sending auto scroll mouse messages.
|
private TopLevelWindow<?> |
tlwOwner
The top level owner window.
|
configinsets, listeners, location, LOG, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
AbstractScrollBar(ScrollModel model)
The (only) constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this widget.
|
protected abstract void |
doDraw(GuiDriver<?,?> gd,
GuiColorResolver gc)
Draw widget using the prepared driver and color resolver.
|
void |
draw()
Draw widget.
|
Widget<GuiOutputManager> |
findMouseSource(NativePoint p)
Find the widget positioned just below the specified mouse position (in physical units).
|
protected void |
handleMouseDragExt(java.awt.event.MouseEvent e)
Checks if the mouse left or get back to the scrollbar during grag.
|
protected static int |
minLength()
Get the scrollbar minimum length along the scrolling direction.
|
protected static int |
minWidth()
Get the scrollbar minimum height.
|
void |
modelChanged(Model m)
This method is called by the model after it was changed.
|
protected int[] |
mouseActions()
Determine the mouse actions processed by this widget.
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Notification of a mouse entered event occurred for this widget.
|
void |
mouseExited(java.awt.event.MouseEvent e)
Notification of a mouse exited event occurred for this widget.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Notification of a mouse moved event occurred for this widget.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Notification of a mouse pressed event occurred for this widget.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Notification of a mouse released event occurred for this widget.
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Notification of a mouse wheel moved event occurred for this widget.
|
private void |
stopAutoScroll()
Stops possibly running autoscroll feture in some conditions.
|
protected abstract void |
updateMouseHitInfo(int x,
int y)
Update the
lastHoverPart and highLightedRect field values
when the mouse position changes. |
private void |
updatePart(java.awt.event.MouseEvent e)
Repaint parts according to their highlight and pressed status when mouse position changes.
|
afterConfigUpdate, config, height, initialize, setSize, widthdimension, minimumSize_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, copyState, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, focusTraversable, 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, insets, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseClicked, mouseDragged, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChanged, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalDimensionInt, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unrealize, unregisterWidgetListener, updateSizeWorker, updateSystemParent, widgetRealized, widgetStateChanged, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptsEscAsAnyKey, acceptTrigger, canMovetoTop, completeTrigger, defaultMousePtr, enforceDefaultMousePtr, getIdForTrigger, getLegacyWidget, getTriggerWidget, getTriggerWidget, hasFocus, ignoreEnable, isCurrent, isDirectManipulable, isDroppable, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, maySwitchFocus, parent, refreshWidget, requestFocus, requestFocus, startTrigger, systemFocusGrabbed, validateDisplayValueprotected NativeRectangle highLightedRect
null, the bounding rectangle of currently highlighted part,
this rectangle must be invalidated when highlighted part or thumb position changes.protected AbstractScrollBar.Part lastHoverPart
protected int lastModelPos
protected int lastMousePos
protected AbstractScrollBar.Part lastPressedPart
protected ScrollModel model
private static final int[] MOUSE_ACTIONS
private ScrollbarExecutor scrollbarExecutor
private volatile boolean pressed
private volatile boolean autoScrollSuspend
private TopLevelWindow<?> tlwOwner
private int targetWndId
private ThinClient tcInst
protected AbstractScrollBar.Part autoScrollPart
public AbstractScrollBar(ScrollModel model)
protected static final int minLength()
protected static final int minWidth()
public void destroy()
destroy in interface Widget<GuiOutputManager>destroy in class AbstractWidget<GuiOutputManager>public void draw()
draw in interface Widget<GuiOutputManager>draw in class AbstractWidget<GuiOutputManager>public Widget<GuiOutputManager> findMouseSource(NativePoint p)
this.findMouseSource in interface Widget<GuiOutputManager>findMouseSource in class AbstractWidget<GuiOutputManager>p - The mouse physical location.null if none found.public void modelChanged(Model m)
modelChanged in interface ModelChangeListenerm - the model that was changedpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenermouseEntered in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenermouseExited in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenermousePressed in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved in interface java.awt.event.MouseWheelListenermouseWheelMoved in class AbstractWidget<GuiOutputManager>e - The mouse event.protected abstract void doDraw(GuiDriver<?,?> gd, GuiColorResolver gc)
gd - the drivergc - the color resolver.protected int[] mouseActions()
mouseActions in class AbstractWidget<GuiOutputManager>protected abstract void updateMouseHitInfo(int x,
int y)
lastHoverPart and highLightedRect field values
when the mouse position changes.x - the X coordinatey - the Y coordinateprotected void handleMouseDragExt(java.awt.event.MouseEvent e)
e - The mouse event.private void stopAutoScroll()
private void updatePart(java.awt.event.MouseEvent e)
e - the mouse event with the mouse position.