Package com.formdev.flatlaf.ui
Class FlatSliderUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.SliderUI
-
- javax.swing.plaf.basic.BasicSliderUI
-
- com.formdev.flatlaf.ui.FlatSliderUI
-
- All Implemented Interfaces:
FlatStylingSupport.StyleableUI
public class FlatSliderUI extends BasicSliderUI implements FlatStylingSupport.StyleableUI
Provides the Flat LaF UI delegate forJSlider.- UiDefault:
- Slider.font Font, Slider.background Color, Slider.foreground Color unused, Slider.tickColor Color, Slider.horizontalSize Dimension preferred horizontal size; height is ignored; computed slider height is used, Slider.verticalSize Dimension preferred vertical size; width is ignored; computed slider width is used, Slider.minimumHorizontalSize Dimension height is ignored; computed slider height is used, Slider.minimumVerticalSize Dimension width is ignored; computed slider width is used, Slider.border Border , Slider.trackWidth int, Slider.thumbSize Dimension, Slider.focusWidth int, Slider.thumbBorderWidth int or float, Slider.trackValueColor Color optional; defaults to Slider.thumbColor, Slider.trackColor Color, Slider.thumbColor Color, Slider.thumbBorderColor Color optional; if null, no border is painted, Slider.focusedColor Color optional; defaults to Component.focusColor, Slider.focusedThumbBorderColor Color optional; defaults to Component.focusedBorderColor, Slider.hoverThumbColor Color optional, Slider.pressedThumbColor Color optional, Slider.disabledTrackColor Color, Slider.disabledThumbColor Color, Slider.disabledThumbBorderColor Color optional; defaults to Component.disabledBorderColor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classFlatSliderUI.FlatTrackListener-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicSliderUI
BasicSliderUI.ActionScroller, BasicSliderUI.ChangeHandler, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener
-
-
Field Summary
Fields Modifier and Type Field Description protected ColordisabledThumbBorderColorprotected ColordisabledThumbColorprotected ColordisabledTrackColorprotected ColorfocusBaseColorprotected ColorfocusedColorprotected ColorfocusedThumbBorderColorprotected intfocusWidthprotected ColorhoverThumbColorprotected ColorpressedThumbColorprotected ColorthumbBorderColorprotected floatthumbBorderWidthprotected ColorthumbColorprotected booleanthumbHoverprotected booleanthumbPressedprotected DimensionthumbSizeprotected ColortickColorprotected ColortrackColorprotected ColortrackValueColorprotected inttrackWidth-
Fields inherited from class javax.swing.plaf.basic.BasicSliderUI
changeListener, componentListener, contentRect, focusInsets, focusListener, focusRect, insetCache, labelRect, leftToRightCache, MAX_SCROLL, MIN_SCROLL, NEGATIVE_SCROLL, POSITIVE_SCROLL, propertyChangeListener, scrollListener, scrollTimer, slider, thumbRect, tickRect, trackBuffer, trackListener, trackRect
-
-
Constructor Summary
Constructors Constructor Description FlatSliderUI()
-
Method Summary
-
Methods inherited from class javax.swing.plaf.basic.BasicSliderUI
calculateContentRect, calculateFocusRect, calculateGeometry, calculateLabelRect, calculateThumbLocation, calculateThumbSize, calculateTickRect, calculateTrackBuffer, calculateTrackRect, createChangeListener, createComponentListener, createFocusListener, createScrollListener, drawInverted, getBaselineResizeBehavior, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValue, getHighestValueLabel, getHighlightColor, getLowestValue, getLowestValueLabel, getMaximumSize, getMinimumSize, getPreferredSize, getShadowColor, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installKeyboardActions, installListeners, isDragging, labelsHaveSameBaselines, paintHorizontalLabel, paintMajorTickForHorizSlider, paintMajorTickForVertSlider, paintMinorTickForHorizSlider, paintMinorTickForVertSlider, paintVerticalLabel, recalculateIfInsetsChanged, recalculateIfOrientationChanged, scrollByBlock, scrollByUnit, scrollDueToClickInTrack, uninstallKeyboardActions, uninstallListeners, uninstallUI, valueForXPosition, valueForYPosition, xPositionForValue, yPositionForValue, yPositionForValue
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
-
-
-
Field Detail
-
trackWidth
protected int trackWidth
-
thumbSize
protected Dimension thumbSize
-
focusWidth
protected int focusWidth
-
thumbBorderWidth
protected float thumbBorderWidth
- Since:
- 2
-
trackValueColor
protected Color trackValueColor
-
trackColor
protected Color trackColor
-
thumbColor
protected Color thumbColor
-
thumbBorderColor
protected Color thumbBorderColor
-
focusBaseColor
protected Color focusBaseColor
-
focusedColor
protected Color focusedColor
-
focusedThumbBorderColor
protected Color focusedThumbBorderColor
-
hoverThumbColor
protected Color hoverThumbColor
-
pressedThumbColor
protected Color pressedThumbColor
-
disabledTrackColor
protected Color disabledTrackColor
-
disabledThumbColor
protected Color disabledThumbColor
-
disabledThumbBorderColor
protected Color disabledThumbBorderColor
-
tickColor
protected Color tickColor
-
thumbHover
protected boolean thumbHover
-
thumbPressed
protected boolean thumbPressed
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installUI
public void installUI(JComponent c)
- Overrides:
installUIin classBasicSliderUI
-
installDefaults
protected void installDefaults(JSlider slider)
- Overrides:
installDefaultsin classBasicSliderUI
-
uninstallDefaults
protected void uninstallDefaults(JSlider slider)
- Overrides:
uninstallDefaultsin classBasicSliderUI
-
createTrackListener
protected BasicSliderUI.TrackListener createTrackListener(JSlider slider)
- Overrides:
createTrackListenerin classBasicSliderUI
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener(JSlider slider)
- Overrides:
createPropertyChangeListenerin classBasicSliderUI
-
installStyle
protected void installStyle()
- Since:
- 2
-
applyStyle
protected void applyStyle(Object style)
- Since:
- 2
-
getStyleableInfos
public Map<String,Class<?>> getStyleableInfos(JComponent c)
- Specified by:
getStyleableInfosin interfaceFlatStylingSupport.StyleableUI- Since:
- 2
-
getStyleableValue
public Object getStyleableValue(JComponent c, String key)
- Specified by:
getStyleableValuein interfaceFlatStylingSupport.StyleableUI- Since:
- 2.5
-
getBaseline
public int getBaseline(JComponent c, int width, int height)
- Overrides:
getBaselinein classBasicSliderUI
-
getPreferredHorizontalSize
public Dimension getPreferredHorizontalSize()
- Overrides:
getPreferredHorizontalSizein classBasicSliderUI
-
getPreferredVerticalSize
public Dimension getPreferredVerticalSize()
- Overrides:
getPreferredVerticalSizein classBasicSliderUI
-
getMinimumHorizontalSize
public Dimension getMinimumHorizontalSize()
- Overrides:
getMinimumHorizontalSizein classBasicSliderUI
-
getMinimumVerticalSize
public Dimension getMinimumVerticalSize()
- Overrides:
getMinimumVerticalSizein classBasicSliderUI
-
getTickLength
protected int getTickLength()
- Overrides:
getTickLengthin classBasicSliderUI
-
getThumbSize
protected Dimension getThumbSize()
- Overrides:
getThumbSizein classBasicSliderUI
-
calcThumbSize
public static Dimension calcThumbSize(JSlider slider, Dimension thumbSize, int focusWidth)
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paintin classBasicSliderUI
-
paintLabels
public void paintLabels(Graphics g)
- Overrides:
paintLabelsin classBasicSliderUI
-
paintFocus
public void paintFocus(Graphics g)
- Overrides:
paintFocusin classBasicSliderUI
-
paintTrack
public void paintTrack(Graphics g)
- Overrides:
paintTrackin classBasicSliderUI
-
paintTicks
public void paintTicks(Graphics g)
- Overrides:
paintTicksin classBasicSliderUI
-
paintThumb
public void paintThumb(Graphics g)
- Overrides:
paintThumbin classBasicSliderUI
-
paintThumb
public static void paintThumb(Graphics g, JSlider slider, Rectangle thumbRect, boolean roundThumb, Color thumbColor, Color thumbBorderColor, Color focusedColor, float thumbBorderWidth, int focusWidth)
-
createRoundThumbShape
public static Shape createRoundThumbShape(float x, float y, float w, float h)
-
createDirectionalThumbShape
public static Shape createDirectionalThumbShape(float x, float y, float w, float h, float arc)
-
getTrackValueColor
protected Color getTrackValueColor()
-
getTrackColor
protected Color getTrackColor()
-
getThumbColor
protected Color getThumbColor()
-
stateColor
public static Color stateColor(JSlider slider, boolean hover, boolean pressed, Color enabledColor, Color disabledColor, Color focusedColor, Color hoverColor, Color pressedColor)
-
isRoundThumb
protected boolean isRoundThumb()
-
setThumbLocation
public void setThumbLocation(int x, int y)- Overrides:
setThumbLocationin classBasicSliderUI
-
-