Package com.formdev.flatlaf.ui
Class FlatScrollBarUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ScrollBarUI
-
- javax.swing.plaf.basic.BasicScrollBarUI
-
- com.formdev.flatlaf.ui.FlatScrollBarUI
-
- All Implemented Interfaces:
FlatStylingSupport.StyleableLookupProvider
,FlatStylingSupport.StyleableUI
,LayoutManager
,SwingConstants
public class FlatScrollBarUI extends BasicScrollBarUI implements FlatStylingSupport.StyleableUI, FlatStylingSupport.StyleableLookupProvider
Provides the Flat LaF UI delegate forJScrollBar
.- UiDefault:
- ScrollBar.background Color, ScrollBar.foreground Color unused, ScrollBar.track Color, ScrollBar.thumb Color, ScrollBar.width int, ScrollBar.minimumThumbSize Dimension, ScrollBar.maximumThumbSize Dimension, ScrollBar.allowsAbsolutePositioning boolean , ScrollBar.minimumButtonSize Dimension, ScrollBar.trackInsets Insets, ScrollBar.thumbInsets Insets, ScrollBar.trackArc int, ScrollBar.thumbArc int, ScrollBar.hoverTrackColor Color optional, ScrollBar.hoverThumbColor Color optional, ScrollBar.hoverThumbWithTrack boolean, ScrollBar.pressedTrackColor Color optional, ScrollBar.pressedThumbColor Color optional, ScrollBar.pressedThumbWithTrack boolean, Component.arrowType String chevron (default) or triangle, ScrollBar.showButtons boolean, ScrollBar.buttonArrowColor Color, ScrollBar.buttonDisabledArrowColor Color, ScrollBar.hoverButtonBackground Color optional, ScrollBar.pressedButtonBackground Color optional
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
FlatScrollBarUI.FlatScrollBarButton
-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicScrollBarUI
BasicScrollBarUI.ArrowButtonListener, BasicScrollBarUI.ModelListener, BasicScrollBarUI.PropertyChangeHandler, BasicScrollBarUI.ScrollListener, BasicScrollBarUI.TrackListener
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
allowsAbsolutePositioning
protected String
arrowType
protected Color
buttonArrowColor
protected Color
buttonDisabledArrowColor
protected Color
hoverButtonBackground
protected boolean
hoverThumb
protected Color
hoverThumbColor
protected boolean
hoverThumbWithTrack
protected boolean
hoverTrack
protected Color
hoverTrackColor
protected Dimension
minimumButtonSize
protected Color
pressedButtonBackground
protected Color
pressedThumbColor
protected boolean
pressedThumbWithTrack
protected Color
pressedTrackColor
protected boolean
showButtons
protected int
thumbArc
protected Insets
thumbInsets
protected int
trackArc
protected Insets
trackInsets
-
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, scrollBarWidth, 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 Constructor Description FlatScrollBarUI()
-
Method Summary
-
Methods inherited from class javax.swing.plaf.basic.BasicScrollBarUI
addLayoutComponent, configureScrollBarColors, createArrowButtonListener, createModelListener, createScrollListener, createTrackListener, getMaximumSize, getThumbBounds, getTrackBounds, installComponents, installKeyboardActions, isThumbRollover, layoutContainer, layoutHScrollbar, layoutVScrollbar, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, scrollByBlock, scrollByUnit, setThumbBounds, setThumbRollover, uninstallComponents, uninstallKeyboardActions, uninstallUI
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize, update
-
-
-
-
Field Detail
-
allowsAbsolutePositioning
protected boolean allowsAbsolutePositioning
-
minimumButtonSize
protected Dimension minimumButtonSize
- Since:
- 2.1
-
trackInsets
protected Insets trackInsets
-
thumbInsets
protected Insets thumbInsets
-
trackArc
protected int trackArc
-
thumbArc
protected int thumbArc
-
hoverTrackColor
protected Color hoverTrackColor
-
hoverThumbColor
protected Color hoverThumbColor
-
hoverThumbWithTrack
protected boolean hoverThumbWithTrack
-
pressedTrackColor
protected Color pressedTrackColor
-
pressedThumbColor
protected Color pressedThumbColor
-
pressedThumbWithTrack
protected boolean pressedThumbWithTrack
-
showButtons
protected boolean showButtons
-
arrowType
protected String arrowType
-
buttonArrowColor
protected Color buttonArrowColor
-
buttonDisabledArrowColor
protected Color buttonDisabledArrowColor
-
hoverButtonBackground
protected Color hoverButtonBackground
-
pressedButtonBackground
protected Color pressedButtonBackground
-
hoverTrack
protected boolean hoverTrack
-
hoverThumb
protected boolean hoverThumb
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installUI
public void installUI(JComponent c)
- Overrides:
installUI
in classBasicScrollBarUI
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classBasicScrollBarUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classBasicScrollBarUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classBasicScrollBarUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in classBasicScrollBarUI
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
- Overrides:
createPropertyChangeListener
in classBasicScrollBarUI
-
installStyle
protected void installStyle()
- Since:
- 2
-
applyStyle
protected void applyStyle(Object style)
- Since:
- 2
-
getStyleableInfos
public Map<String,Class<?>> getStyleableInfos(JComponent c)
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2
-
getStyleableValue
public Object getStyleableValue(JComponent c, String key)
- Specified by:
getStyleableValue
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2.5
-
getLookupForStyling
public MethodHandles.Lookup getLookupForStyling()
- Specified by:
getLookupForStyling
in interfaceFlatStylingSupport.StyleableLookupProvider
- Since:
- 2.5
-
getPreferredSize
public Dimension getPreferredSize(JComponent c)
- Overrides:
getPreferredSize
in classBasicScrollBarUI
-
createDecreaseButton
protected JButton createDecreaseButton(int orientation)
- Overrides:
createDecreaseButton
in classBasicScrollBarUI
-
createIncreaseButton
protected JButton createIncreaseButton(int orientation)
- Overrides:
createIncreaseButton
in classBasicScrollBarUI
-
isShowButtons
protected boolean isShowButtons()
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paint
in classBasicScrollBarUI
-
paintTrack
protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
- Overrides:
paintTrack
in classBasicScrollBarUI
-
paintThumb
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
- Overrides:
paintThumb
in classBasicScrollBarUI
-
paintTrackOrThumb
protected void paintTrackOrThumb(Graphics g, JComponent c, Rectangle bounds, Insets insets, int arc)
-
paintDecreaseHighlight
protected void paintDecreaseHighlight(Graphics g)
- Overrides:
paintDecreaseHighlight
in classBasicScrollBarUI
-
paintIncreaseHighlight
protected void paintIncreaseHighlight(Graphics g)
- Overrides:
paintIncreaseHighlight
in classBasicScrollBarUI
-
getTrackColor
protected Color getTrackColor(JComponent c, boolean hover, boolean pressed)
-
getThumbColor
protected Color getThumbColor(JComponent c, boolean hover, boolean pressed)
-
getMinimumThumbSize
protected Dimension getMinimumThumbSize()
- Overrides:
getMinimumThumbSize
in classBasicScrollBarUI
-
getMaximumThumbSize
protected Dimension getMaximumThumbSize()
- Overrides:
getMaximumThumbSize
in classBasicScrollBarUI
-
getSupportsAbsolutePositioning
public boolean getSupportsAbsolutePositioning()
- Overrides:
getSupportsAbsolutePositioning
in classBasicScrollBarUI
-
-