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 classListener on arrow buttons.protected classTrack 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.CompositeButtonModelSurrogate model to sync between rollover effects of scroll buttons and scroll track / scroll thumb.protected StateTransitionTrackerprotected JButtonThe second decrease button.protected JButtonThe second increase button.protected intScroll bar width.protected AdjustmentListenerListener 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, trackRectFields 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.ArrowButtonListenerprotected JButtoncreateDecreaseButton(int orientation) protected JButtoncreateGeneralDecreaseButton(int orientation, boolean isRegular) Creates a decrease button.protected JButtoncreateGeneralIncreaseButton(int orientation, boolean isRegular) Creates a increase button.protected JButtoncreateIncreaseButton(int orientation) protected BasicScrollBarUI.TrackListenerstatic ComponentUIcreateUI(JComponent comp) static StringReturns the memory usage string.protected ComponentStateReturns the scroll button state.Returns the model for tracking the transitions.protected voidprotected voidprotected voidbooleanisInside(MouseEvent me) Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.protected voidprotected voidLays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT.protected voidLays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE.protected voidLays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE.protected voidLays out the horizontal scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.NONE.protected voidprotected voidLays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT.protected voidLays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE.protected voidLays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE_BOTH.protected voidLays out the vertical scroll bar when the button policy isSubstanceConstants.ScrollPaneButtonPolicyKind.ADJACENT.voidpaint(Graphics g, JComponent c) protected voidpaintThumb(Graphics g, JComponent c, Rectangle thumbBounds) protected voidpaintTrack(Graphics g, JComponent c, Rectangle trackBounds) voidscrollByBlock(int direction) voidscrollByUnits(int direction, int units) Scrolls the associated scroll bar.protected voidprotected voidMethods 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, uninstallUIMethods 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.MULTIPLEandSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE_BOTHmodes.- Since:
- version 3.1
-
mySecondIncreaseButton
The second increase button. Is shown only underSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE_BOTHmode.- 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.MULTIPLEandSubstanceConstants.ScrollPaneButtonPolicyKind.MULTIPLE_BOTHkinds.- Returns:
- Decrease button.
-
createDecreaseButton
- Overrides:
createDecreaseButtonin classBasicScrollBarUI
-
createIncreaseButton
- Overrides:
createIncreaseButtonin 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_BOTHkind.- Returns:
- Increase button.
-
getState
Returns the scroll button state.- Parameters:
scrollButton- Scroll button.- Returns:
- Scroll button state.
-
paintTrack
- Overrides:
paintTrackin classBasicScrollBarUI
-
paintThumb
- Overrides:
paintThumbin classBasicScrollBarUI
-
paint
- Overrides:
paintin classBasicScrollBarUI
-
installDefaults
protected void installDefaults()- Overrides:
installDefaultsin classBasicScrollBarUI
-
installComponents
protected void installComponents()- Overrides:
installComponentsin classBasicScrollBarUI
-
uninstallComponents
protected void uninstallComponents()- Overrides:
uninstallComponentsin classBasicScrollBarUI
-
installListeners
protected void installListeners()- Overrides:
installListenersin classBasicScrollBarUI
-
uninstallListeners
protected void uninstallListeners()- Overrides:
uninstallListenersin classBasicScrollBarUI
-
isInside
Description copied from interface:TransitionAwareUIChecks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.- Specified by:
isInsidein interfaceTransitionAwareUI- Parameters:
me- Mouse event.- Returns:
trueif the mouse position of the specified event lies inside the area of the component designated for transition effects,falseotherwise.
-
getTransitionTracker
Description copied from interface:TransitionAwareUIReturns the model for tracking the transitions.- Specified by:
getTransitionTrackerin interfaceTransitionAwareUI- Returns:
- Model for tracking the transitions.
-
scrollByBlock
public void scrollByBlock(int direction) - Overrides:
scrollByBlockin classBasicScrollBarUI
-
scrollByUnits
public void scrollByUnits(int direction, int units) Scrolls the associated scroll bar.- Parameters:
direction- Direction.units- Scroll units.
-
layoutVScrollbar
- Overrides:
layoutVScrollbarin classBasicScrollBarUI
-
layoutHScrollbar
- Overrides:
layoutHScrollbarin 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:
createTrackListenerin classBasicScrollBarUI
-
createArrowButtonListener
- Overrides:
createArrowButtonListenerin classBasicScrollBarUI
-
getPreferredSize
- Overrides:
getPreferredSizein classBasicScrollBarUI
-