Class MetalSliderUI


public class MetalSliderUI extends BasicSliderUI
A Java L&F implementation of SliderUI.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see XMLEncoder.

  • Field Details Link icon

    • TICK_BUFFER Link icon

      protected final int TICK_BUFFER
      The buffer of a tick.
      See Also:
    • filledSlider Link icon

      protected boolean filledSlider
      The value of the property JSlider.isFilled. By default, false if the property is not set, true for Ocean theme.
    • thumbColor Link icon

      protected static Color thumbColor
      The color of a thumb
    • highlightColor Link icon

      protected static Color highlightColor
      The color of highlighting.
    • darkShadowColor Link icon

      protected static Color darkShadowColor
      The color of dark shadow.
    • trackWidth Link icon

      protected static int trackWidth
      The width of a track.
    • tickLength Link icon

      protected static int tickLength
      The length of a tick.
    • horizThumbIcon Link icon

      protected static Icon horizThumbIcon
      A default horizontal thumb Icon. This field might not be used. To change the Icon used by this delegate directly set it using the Slider.horizontalThumbIcon UIManager property.
    • vertThumbIcon Link icon

      protected static Icon vertThumbIcon
      A default vertical thumb Icon. This field might not be used. To change the Icon used by this delegate directly set it using the Slider.verticalThumbIcon UIManager property.
    • SLIDER_FILL Link icon

      protected final String SLIDER_FILL
      Property for JSlider.isFilled.
      See Also:
  • Constructor Details Link icon

    • MetalSliderUI Link icon

      public MetalSliderUI()
      Constructs a MetalSliderUI instance.
  • Method Details Link icon

    • createUI Link icon

      public static ComponentUI createUI(JComponent c)
      Constructs a MetalSliderUI instance.
      Parameters:
      c - a component
      Returns:
      a MetalSliderUI instance
    • createPropertyChangeListener Link icon

      protected PropertyChangeListener createPropertyChangeListener(JSlider slider)
      Constructs MetalPropertyListener.
      Overrides:
      createPropertyChangeListener in class BasicSliderUI
      Parameters:
      slider - a JSlider
      Returns:
      the MetalPropertyListener
    • getTickLength Link icon

      public int getTickLength()
      Gets the height of the tick area for horizontal sliders and the width of the tick area for vertical sliders. BasicSliderUI uses the returned value to determine the tick area rectangle.
      Overrides:
      getTickLength in class BasicSliderUI
      Returns:
      an integer representing the height of the tick area for horizontal sliders, and the width of the tick area for the vertical sliders
    • getTrackWidth Link icon

      protected int getTrackWidth()
      Returns the shorter dimension of the track.
      Returns:
      the shorter dimension of the track
    • getTrackLength Link icon

      protected int getTrackLength()
      Returns the longer dimension of the slide bar. (The slide bar is only the part that runs directly under the thumb)
      Returns:
      the longer dimension of the slide bar
    • getThumbOverhang Link icon

      protected int getThumbOverhang()
      Returns the amount that the thumb goes past the slide bar.
      Returns:
      the amount that the thumb goes past the slide bar