Class SubstanceScrollBarUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ScrollBarUI
javax.swing.plaf.basic.BasicScrollBarUI
org.pushingpixels.substance.internal.ui.SubstanceScrollBarUI
- All Implemented Interfaces:
LayoutManager
,SwingConstants
,TransitionAwareUI
UI for scroll bars in Substance look and feel.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Listener on arrow buttons.protected class
Track mouse drags.Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicScrollBarUI
BasicScrollBarUI.ArrowButtonListener, BasicScrollBarUI.ModelListener, BasicScrollBarUI.PropertyChangeHandler, BasicScrollBarUI.ScrollListener, BasicScrollBarUI.TrackListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.pushingpixels.substance.internal.ui.SubstanceScrollBarUI.CompositeButtonModel
Surrogate model to sync between rollover effects of scroll buttons and scroll track / scroll thumb.protected StateTransitionTracker
protected JButton
The second decrease button.protected JButton
The second increase button.protected int
Scroll bar width.protected AdjustmentListener
Listener on adjustments made to the scrollbar model - this is for repaiting both scrollbars with the viewport.Fields inherited from class javax.swing.plaf.basic.BasicScrollBarUI
buttonListener, decrButton, DECREASE_HIGHLIGHT, decrGap, incrButton, INCREASE_HIGHLIGHT, incrGap, isDragging, maximumThumbSize, minimumThumbSize, modelListener, NO_HIGHLIGHT, propertyChangeListener, scrollbar, scrollListener, scrollTimer, thumbColor, thumbDarkShadowColor, thumbHighlightColor, thumbLightShadowColor, thumbRect, trackColor, trackHighlight, trackHighlightColor, trackListener, trackRect
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BasicScrollBarUI.ArrowButtonListener
protected JButton
createDecreaseButton
(int orientation) protected JButton
createGeneralDecreaseButton
(int orientation, boolean isRegular) Creates a decrease button.protected JButton
createGeneralIncreaseButton
(int orientation, boolean isRegular) Creates a increase button.protected JButton
createIncreaseButton
(int orientation) protected BasicScrollBarUI.TrackListener
static ComponentUI
createUI
(JComponent comp) static String
Returns the memory usage string.protected ComponentState
Returns the scroll button state.Returns the model for tracking the transitions.protected void
protected void
protected void
boolean
isInside
(MouseEvent me) Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.protected void
protected void
Lays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT
.protected void
Lays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE
.protected void
Lays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE
.protected void
Lays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.NONE
.protected void
protected void
Lays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT
.protected void
Lays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE
.protected void
Lays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE_BOTH
.protected void
Lays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT
.void
paint
(Graphics g, JComponent c) protected void
paintThumb
(Graphics g, JComponent c, Rectangle thumbBounds) protected void
paintTrack
(Graphics g, JComponent c, Rectangle trackBounds) void
scrollByBlock
(int direction) void
scrollByUnits
(int direction, int units) Scrolls the associated scroll bar.protected void
protected void
Methods inherited from class javax.swing.plaf.basic.BasicScrollBarUI
addLayoutComponent, configureScrollBarColors, createModelListener, createPropertyChangeListener, createScrollListener, getMaximumSize, getMaximumThumbSize, getMinimumThumbSize, getSupportsAbsolutePositioning, getThumbBounds, getTrackBounds, installKeyboardActions, installUI, isThumbRollover, layoutContainer, minimumLayoutSize, paintDecreaseHighlight, paintIncreaseHighlight, preferredLayoutSize, removeLayoutComponent, scrollByUnit, setThumbBounds, setThumbRollover, uninstallDefaults, uninstallKeyboardActions, uninstallUI
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize, update
-
Field Details
-
mySecondDecreaseButton
The second decrease button. Is shown underSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT
,SubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE
andSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE_BOTH
modes.- Since:
- version 3.1
-
mySecondIncreaseButton
The second increase button. Is shown only underSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE_BOTH
mode.- Since:
- version 3.1
-
compositeStateTransitionTracker
-
scrollBarWidth
protected int scrollBarWidthScroll bar width. -
substanceAdjustmentListener
Listener on adjustments made to the scrollbar model - this is for repaiting both scrollbars with the viewport.- Since:
- version 3.2
-
compositeScrollTrackModel
protected org.pushingpixels.substance.internal.ui.SubstanceScrollBarUI.CompositeButtonModel compositeScrollTrackModelSurrogate model to sync between rollover effects of scroll buttons and scroll track / scroll thumb.- Since:
- version 3.2
-
-
Constructor Details
-
SubstanceScrollBarUI
Simple constructor.- Parameters:
b
- Associated component.
-
-
Method Details
-
createUI
-
createGeneralDecreaseButton
Creates a decrease button.- Parameters:
orientation
- Button orientation.isRegular
- iftrue
, the regular (upper / left) decrease button is created, iffalse
, the additional (lower / right) decrease button is created forSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT
,SubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE
andSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE_BOTH
kinds.- Returns:
- Decrease button.
-
createDecreaseButton
- Overrides:
createDecreaseButton
in classBasicScrollBarUI
-
createIncreaseButton
- Overrides:
createIncreaseButton
in classBasicScrollBarUI
-
createGeneralIncreaseButton
Creates a increase button.- Parameters:
orientation
- Button orientation.isRegular
- iftrue
, the regular (lower / right) increase button is created, iffalse
, the additional (upper / left) increase button is created forSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE_BOTH
kind.- Returns:
- Increase button.
-
getState
Returns the scroll button state.- Parameters:
scrollButton
- Scroll button.- Returns:
- Scroll button state.
-
paintTrack
- Overrides:
paintTrack
in classBasicScrollBarUI
-
paintThumb
- Overrides:
paintThumb
in classBasicScrollBarUI
-
paint
- Overrides:
paint
in classBasicScrollBarUI
-
installDefaults
protected void installDefaults()- Overrides:
installDefaults
in classBasicScrollBarUI
-
installComponents
protected void installComponents()- Overrides:
installComponents
in classBasicScrollBarUI
-
uninstallComponents
protected void uninstallComponents()- Overrides:
uninstallComponents
in classBasicScrollBarUI
-
installListeners
protected void installListeners()- Overrides:
installListeners
in classBasicScrollBarUI
-
uninstallListeners
protected void uninstallListeners()- Overrides:
uninstallListeners
in classBasicScrollBarUI
-
isInside
Description copied from interface:TransitionAwareUI
Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.- Specified by:
isInside
in interfaceTransitionAwareUI
- Parameters:
me
- Mouse event.- Returns:
true
if the mouse position of the specified event lies inside the area of the component designated for transition effects,false
otherwise.
-
getTransitionTracker
Description copied from interface:TransitionAwareUI
Returns the model for tracking the transitions.- Specified by:
getTransitionTracker
in interfaceTransitionAwareUI
- Returns:
- Model for tracking the transitions.
-
scrollByBlock
public void scrollByBlock(int direction) - Overrides:
scrollByBlock
in classBasicScrollBarUI
-
scrollByUnits
public void scrollByUnits(int direction, int units) Scrolls the associated scroll bar.- Parameters:
direction
- Direction.units
- Scroll units.
-
layoutVScrollbar
- Overrides:
layoutVScrollbar
in classBasicScrollBarUI
-
layoutHScrollbar
- Overrides:
layoutHScrollbar
in classBasicScrollBarUI
-
layoutVScrollbarAdjacent
Lays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT
.- Parameters:
sb
- Scroll bar.
-
layoutVScrollbarNone
Lays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT
.- Parameters:
sb
- Scroll bar.
-
layoutVScrollbarMultiple
Lays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE
.- Parameters:
sb
- Scroll bar.
-
layoutVScrollbarMultipleBoth
Lays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE_BOTH
.- Parameters:
sb
- Scroll bar.
-
layoutHScrollbarAdjacent
Lays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT
.- Parameters:
sb
- Scroll bar.
-
layoutHScrollbarNone
Lays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.NONE
.- Parameters:
sb
- Scroll bar.
-
layoutHScrollbarMultiple
Lays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE
.- Parameters:
sb
- Scroll bar.
-
layoutHScrollbarMultipleBoth
Lays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE
.- Parameters:
sb
- Scroll bar.
-
getMemoryUsage
Returns the memory usage string.- Returns:
- The memory usage string.
-
createTrackListener
- Overrides:
createTrackListener
in classBasicScrollBarUI
-
createArrowButtonListener
- Overrides:
createArrowButtonListener
in classBasicScrollBarUI
-
getPreferredSize
- Overrides:
getPreferredSize
in classBasicScrollBarUI
-