public class JBScrollBar extends javax.swing.JScrollBar implements IdeGlassPane.TopComponent, Interpolable
createUI(JComponent)
,
Serialized Formjavax.swing.JScrollBar.AccessibleJScrollBar
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LEADING
This constraint should be used to add a component that will be shown before the scrollbar's track.
|
static Key<RegionPainter<java.lang.Object>> |
TRACK
This key defines a region painter, which is used by the custom ScrollBarUI
to draw additional paintings (i.e.
|
static java.lang.String |
TRAILING
This constraint should be used to add a component that will be shown after the scrollbar's track.
|
blockIncrement, model, orientation, unitIncrement
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
JBScrollBar() |
JBScrollBar(int orientation) |
JBScrollBar(int orientation,
int value,
int extent,
int min,
int max) |
Modifier and Type | Method and Description |
---|---|
protected void |
addImpl(java.awt.Component component,
java.lang.Object name,
int index) |
boolean |
canBePreprocessed(java.awt.event.MouseEvent event)
Notifies glass pane that it should not process mouse event above the scrollbar's thumb.
|
static javax.swing.plaf.ScrollBarUI |
createUI(javax.swing.JComponent c)
Returns a new instance of
ScrollBarUI . |
int |
getBlockIncrement(int direction)
Computes the block increment for scrolling if the viewport's view.
|
protected double |
getDeltaAdjusted(java.awt.event.MouseWheelEvent event) |
int |
getTargetValue()
Gets the target value.
|
int |
getUnitIncrement(int direction)
Computes the unit increment for scrolling if the viewport's view.
|
boolean |
handleMouseWheelEvent(java.awt.event.MouseWheelEvent event)
Handles the mouse wheel events to scroll the scrollbar.
|
void |
setBlockIncrement(int increment) |
void |
setCurrentValue(int value)
Sets the current value (synchronously).
|
void |
setUnitIncrement(int increment) |
void |
setValue(int value)
Sets the target value.
|
void |
updateUI() |
addAdjustmentListener, fireAdjustmentValueChanged, getAccessibleContext, getAdjustmentListeners, getBlockIncrement, getMaximum, getMaximumSize, getMinimum, getMinimumSize, getModel, getOrientation, getUI, getUIClassID, getUnitIncrement, getValue, getValueIsAdjusting, getVisibleAmount, paramString, removeAdjustmentListener, setEnabled, setMaximum, setMinimum, setModel, setOrientation, setUI, setValueIsAdjusting, setValues, setVisibleAmount
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getValue
public static final Key<RegionPainter<java.lang.Object>> TRACK
public static final java.lang.String LEADING
public static final java.lang.String TRAILING
public JBScrollBar()
public JBScrollBar(int orientation)
public JBScrollBar(int orientation, int value, int extent, int min, int max)
protected void addImpl(java.awt.Component component, java.lang.Object name, int index)
addImpl
in class java.awt.Container
public void updateUI()
updateUI
in class javax.swing.JScrollBar
public static javax.swing.plaf.ScrollBarUI createUI(javax.swing.JComponent c)
ScrollBarUI
.
Do not share it between different scroll bars.c
- a target component for this UIScrollBarUI
public int getUnitIncrement(int direction)
super.getUnitIncrement
.getUnitIncrement
in class javax.swing.JScrollBar
direction
- less than zero to scroll up/left, greater than zero for down/rightScrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int)
public void setUnitIncrement(int increment)
setUnitIncrement
in interface java.awt.Adjustable
setUnitIncrement
in class javax.swing.JScrollBar
public int getBlockIncrement(int direction)
super.getBlockIncrement
.getBlockIncrement
in class javax.swing.JScrollBar
direction
- less than zero to scroll up/left, greater than zero for down/rightScrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int)
public void setBlockIncrement(int increment)
setBlockIncrement
in interface java.awt.Adjustable
setBlockIncrement
in class javax.swing.JScrollBar
public boolean canBePreprocessed(java.awt.event.MouseEvent event)
canBePreprocessed
in interface IdeGlassPane.TopComponent
event
- the mouse eventtrue
if glass pane can process the specified event, false
otherwisepublic void setValue(int value)
Interpolable
Technically, it's "setTargetValue", but we need to match the name in Swing classes.
setValue
in interface Interpolable
setValue
in interface java.awt.Adjustable
setValue
in class javax.swing.JScrollBar
value
- the target valuepublic void setCurrentValue(int value)
Interpolable
setCurrentValue
in interface Interpolable
value
- the current valuepublic int getTargetValue()
Interpolable
getTargetValue
in interface Interpolable
public boolean handleMouseWheelEvent(java.awt.event.MouseWheelEvent event)
event
- the mouse wheel eventtrue
if the specified event is handled and consumed, false
otherwiseprotected double getDeltaAdjusted(java.awt.event.MouseWheelEvent event)