Spec-Zone .ru
спецификации, руководства, описания, API
JavaTM 2 Platform
Standard Edition

javax.swing.plaf.metal
Class MetalSliderUI

java.lang.Object
  |
  +--javax.swing.plaf.ComponentUI
        |
        +--javax.swing.plaf.SliderUI
              |
              +--javax.swing.plaf.basic.BasicSliderUI
                    |
                    +--javax.swing.plaf.metal.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. A future release of Swing will provide support for long term persistence.


Inner Class Summary
protected  class MetalSliderUI.MetalPropertyListener
           
 
Inner classes inherited from class javax.swing.plaf.basic.BasicSliderUI
BasicSliderUI.ActionScroller, BasicSliderUI.ChangeHandler, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener
 
Field Summary
protected static Color darkShadowColor
           
protected  boolean filledSlider
           
protected static Color highlightColor
           
protected static Icon horizThumbIcon
           
protected  String SLIDER_FILL
           
protected static Color thumbColor
           
protected  int TICK_BUFFER
           
protected static int tickLength
           
protected static int trackWidth
           
protected static Icon vertThumbIcon
           
 
Fields inherited from class javax.swing.plaf.basic.BasicSliderUI
changeListener, componentListener, contentRect, focusInsets, focusListener, focusRect, insetCache, labelRect, MAX_SCROLL, MIN_SCROLL, NEGATIVE_SCROLL, POSITIVE_SCROLL, propertyChangeListener, scrollListener, scrollTimer, slider, thumbRect, tickRect, trackBuffer, trackListener, trackRect
 
Constructor Summary
MetalSliderUI()
           
 
Method Summary
protected  PropertyChangeListener createPropertyChangeListener(JSlider slider)
           
static ComponentUI createUI(JComponent c)
           
protected  int getThumbOverhang()
          Returns the amount that the thumb goes past the slide bar.
protected  Dimension getThumbSize()
           
 int getTickLength()
          Gets the height of the tick area for horizontal sliders and the width of the tick area for vertical sliders.
protected  int getTrackLength()
          Returns the longer dimension of the slide bar.
protected  int getTrackWidth()
          Returns the shorter dimension of the track.
 void installUI(JComponent c)
           
 void paintFocus(Graphics g)
           
protected  void paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x)
           
protected  void paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds, int y)
           
protected  void paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x)
           
protected  void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds, int y)
           
 void paintThumb(Graphics g)
           
 void paintTrack(Graphics g)
           
protected  void scrollDueToClickInTrack(int dir)
          This function is called when a mousePressed was detected in the track, not in the thumb.
 
Methods inherited from class javax.swing.plaf.basic.BasicSliderUI
calculateContentRect, calculateFocusRect, calculateGeometry, calculateLabelRect, calculateThumbLocation, calculateThumbSize, calculateTickRect, calculateTrackBuffer, calculateTrackRect, createChangeListener, createComponentListener, createFocusListener, createScrollListener, createTrackListener, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValueLabel, getHighlightColor, getLowestValueLabel, getMaximumSize, getMinimumHorizontalSize, getMinimumSize, getMinimumVerticalSize, getPreferredHorizontalSize, getPreferredSize, getPreferredVerticalSize, getShadowColor, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installDefaults, installKeyboardActions, installListeners, paint, paintHorizontalLabel, paintLabels, paintTicks, paintVerticalLabel, recalculateIfInsetsChanged, scrollByBlock, scrollByUnit, setThumbLocation, uninstallKeyboardActions, uninstallListeners, uninstallUI, valueForXPosition, valueForYPosition, xPositionForValue, yPositionForValue
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TICK_BUFFER

protected final int TICK_BUFFER

filledSlider

protected boolean filledSlider

thumbColor

protected static Color thumbColor

highlightColor

protected static Color highlightColor

darkShadowColor

protected static Color darkShadowColor

trackWidth

protected static int trackWidth

tickLength

protected static int tickLength

horizThumbIcon

protected static Icon horizThumbIcon

vertThumbIcon

protected static Icon vertThumbIcon

SLIDER_FILL

protected final String SLIDER_FILL
Constructor Detail

MetalSliderUI

public MetalSliderUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent c)

installUI

public void installUI(JComponent c)
Overrides:
installUI in class BasicSliderUI

createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener(JSlider slider)
Overrides:
createPropertyChangeListener in class BasicSliderUI

paintThumb

public void paintThumb(Graphics g)
Overrides:
paintThumb in class BasicSliderUI

paintTrack

public void paintTrack(Graphics g)
Overrides:
paintTrack in class BasicSliderUI

paintFocus

public void paintFocus(Graphics g)
Overrides:
paintFocus in class BasicSliderUI

getThumbSize

protected Dimension getThumbSize()
Overrides:
getThumbSize in class BasicSliderUI

getTickLength

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

getTrackWidth

protected int getTrackWidth()
Returns the shorter dimension of the track.

getTrackLength

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

getThumbOverhang

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

scrollDueToClickInTrack

protected void scrollDueToClickInTrack(int dir)
Description copied from class: BasicSliderUI
This function is called when a mousePressed was detected in the track, not in the thumb. The default behavior is to scroll by block. You can override this method to stop it from scrolling or to add additional behavior.
Overrides:
scrollDueToClickInTrack in class BasicSliderUI

paintMinorTickForHorizSlider

protected void paintMinorTickForHorizSlider(Graphics g,
                                            Rectangle tickBounds,
                                            int x)
Overrides:
paintMinorTickForHorizSlider in class BasicSliderUI

paintMajorTickForHorizSlider

protected void paintMajorTickForHorizSlider(Graphics g,
                                            Rectangle tickBounds,
                                            int x)
Overrides:
paintMajorTickForHorizSlider in class BasicSliderUI

paintMinorTickForVertSlider

protected void paintMinorTickForVertSlider(Graphics g,
                                           Rectangle tickBounds,
                                           int y)
Overrides:
paintMinorTickForVertSlider in class BasicSliderUI

paintMajorTickForVertSlider

protected void paintMajorTickForVertSlider(Graphics g,
                                           Rectangle tickBounds,
                                           int y)
Overrides:
paintMajorTickForVertSlider in class BasicSliderUI

JavaTM 2 Platform
Standard Edition

Submit a bug or feature
Java, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.