anl.aida.client.widget
Class RangeSliderUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.SliderUI
          extended by javax.swing.plaf.basic.BasicSliderUI
              extended by anl.aida.client.widget.RangeSliderUI

public class RangeSliderUI
extends javax.swing.plaf.basic.BasicSliderUI

Based on the MetalSliderUI.


Nested Class Summary
protected  class RangeSliderUI.MetalPropertyListener
           
 class RangeSliderUI.RangeTrackListener
           
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicSliderUI
javax.swing.plaf.basic.BasicSliderUI.ActionScroller, javax.swing.plaf.basic.BasicSliderUI.ChangeHandler, javax.swing.plaf.basic.BasicSliderUI.ComponentHandler, javax.swing.plaf.basic.BasicSliderUI.FocusHandler, javax.swing.plaf.basic.BasicSliderUI.PropertyChangeHandler, javax.swing.plaf.basic.BasicSliderUI.ScrollListener, javax.swing.plaf.basic.BasicSliderUI.TrackListener
 
Field Summary
protected static java.awt.Color darkShadowColor
           
protected  boolean filledSlider
           
protected static java.awt.Color highlightColor
           
protected static javax.swing.Icon horizThumbIcon
          A default horizontal thumb Icon.
private  boolean isDragging
           
private  java.awt.Rectangle otherThumbRect
           
private static javax.swing.Icon SAFE_HORIZ_THUMB_ICON
           
private static javax.swing.Icon SAFE_VERT_THUMB_ICON
           
protected  java.lang.String SLIDER_FILL
           
private  java.awt.Color sliderAltTrackColor
           
protected static java.awt.Color thumbColor
           
protected  int TICK_BUFFER
           
protected static int tickLength
           
protected static int trackWidth
           
private static java.awt.Rectangle unionRect
           
protected static javax.swing.Icon vertThumbIcon
          A default vertical thumb Icon.
 
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
RangeSliderUI()
           
 
Method Summary
protected  void calculateThumbLocation()
           
protected  void calculateThumbSize()
           
private  java.awt.Color chooseColor(boolean chooseFirst, java.awt.Color c1, java.awt.Color c2)
          If chooseFirstis true, c1 is returned, otherwise c2.
protected  java.beans.PropertyChangeListener createPropertyChangeListener(javax.swing.JSlider slider)
           
protected  javax.swing.plaf.basic.BasicSliderUI.TrackListener createTrackListener(javax.swing.JSlider slider)
           
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
           
private static javax.swing.Icon getHorizThumbIcon()
           
private  java.awt.Rectangle getPaintTrackRect()
          Returns a rectangle enclosing the track that will be painted.
private  RangeSlider getSlider()
           
private  int getSnappedValue(int value)
           
protected  int getThumbOverhang()
          Returns the amount that the thumb goes past the slide bar.
protected  java.awt.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.
private static javax.swing.Icon getVertThumbIcon()
           
protected  void installListeners(javax.swing.JSlider slider)
           
 void installUI(javax.swing.JComponent c)
           
(package private) static boolean isLeftToRight(java.awt.Component c)
           
private  void oceanPaintTrack(java.awt.Graphics g)
           
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
           
 void paintFocus(java.awt.Graphics g)
           
protected  void paintMajorTickForHorizSlider(java.awt.Graphics g, java.awt.Rectangle tickBounds, int x)
           
protected  void paintMajorTickForVertSlider(java.awt.Graphics g, java.awt.Rectangle tickBounds, int y)
           
protected  void paintMinorTickForHorizSlider(java.awt.Graphics g, java.awt.Rectangle tickBounds, int x)
           
protected  void paintMinorTickForVertSlider(java.awt.Graphics g, java.awt.Rectangle tickBounds, int y)
           
 void paintThumb(java.awt.Graphics g)
           
 void paintTrack(java.awt.Graphics g)
           
protected  void scrollDueToClickInTrack(int dir)
           
 void setThumbLocation(int x, int y, java.awt.Rectangle rect)
           
protected  void uninstallListeners(javax.swing.JSlider slider)
           
 
Methods inherited from class javax.swing.plaf.basic.BasicSliderUI
calculateContentRect, calculateFocusRect, calculateGeometry, calculateLabelRect, calculateTickRect, calculateTrackBuffer, calculateTrackRect, createChangeListener, createComponentListener, createFocusListener, createScrollListener, drawInverted, getBaseline, getBaselineResizeBehavior, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValue, getHighestValueLabel, getHighlightColor, getLowestValue, getLowestValueLabel, getMaximumSize, getMinimumHorizontalSize, getMinimumSize, getMinimumVerticalSize, getPreferredHorizontalSize, getPreferredSize, getPreferredVerticalSize, getShadowColor, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installDefaults, installKeyboardActions, isDragging, labelsHaveSameBaselines, paintHorizontalLabel, paintLabels, paintTicks, paintVerticalLabel, recalculateIfInsetsChanged, recalculateIfOrientationChanged, scrollByBlock, scrollByUnit, setThumbLocation, uninstallKeyboardActions, uninstallUI, valueForXPosition, valueForYPosition, xPositionForValue, yPositionForValue, 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
See Also:
Constant Field Values

filledSlider

protected boolean filledSlider

thumbColor

protected static java.awt.Color thumbColor

highlightColor

protected static java.awt.Color highlightColor

darkShadowColor

protected static java.awt.Color darkShadowColor

trackWidth

protected static int trackWidth

tickLength

protected static int tickLength

horizThumbIcon

protected static javax.swing.Icon horizThumbIcon
A default horizontal thumb Icon. This field might not be used. To change the Icon used by this delgate directly set it using the Slider.horizontalThumbIcon UIManager property.


vertThumbIcon

protected static javax.swing.Icon vertThumbIcon
A default vertical thumb Icon. This field might not be used. To change the Icon used by this delgate directly set it using the Slider.verticalThumbIcon UIManager property.


SAFE_HORIZ_THUMB_ICON

private static javax.swing.Icon SAFE_HORIZ_THUMB_ICON

SAFE_VERT_THUMB_ICON

private static javax.swing.Icon SAFE_VERT_THUMB_ICON

SLIDER_FILL

protected final java.lang.String SLIDER_FILL
See Also:
Constant Field Values

sliderAltTrackColor

private java.awt.Color sliderAltTrackColor

otherThumbRect

private java.awt.Rectangle otherThumbRect

isDragging

private boolean isDragging

unionRect

private static java.awt.Rectangle unionRect
Constructor Detail

RangeSliderUI

public RangeSliderUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)

getSlider

private RangeSlider getSlider()

getHorizThumbIcon

private static javax.swing.Icon getHorizThumbIcon()

getVertThumbIcon

private static javax.swing.Icon getVertThumbIcon()

uninstallListeners

protected void uninstallListeners(javax.swing.JSlider slider)
Overrides:
uninstallListeners in class javax.swing.plaf.basic.BasicSliderUI

installListeners

protected void installListeners(javax.swing.JSlider slider)
Overrides:
installListeners in class javax.swing.plaf.basic.BasicSliderUI

installUI

public void installUI(javax.swing.JComponent c)
Overrides:
installUI in class javax.swing.plaf.basic.BasicSliderUI

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Overrides:
paint in class javax.swing.plaf.basic.BasicSliderUI

calculateThumbSize

protected void calculateThumbSize()
Overrides:
calculateThumbSize in class javax.swing.plaf.basic.BasicSliderUI

getSnappedValue

private int getSnappedValue(int value)

calculateThumbLocation

protected void calculateThumbLocation()
Overrides:
calculateThumbLocation in class javax.swing.plaf.basic.BasicSliderUI

createPropertyChangeListener

protected java.beans.PropertyChangeListener createPropertyChangeListener(javax.swing.JSlider slider)
Overrides:
createPropertyChangeListener in class javax.swing.plaf.basic.BasicSliderUI

paintThumb

public void paintThumb(java.awt.Graphics g)
Overrides:
paintThumb in class javax.swing.plaf.basic.BasicSliderUI

chooseColor

private java.awt.Color chooseColor(boolean chooseFirst,
                                   java.awt.Color c1,
                                   java.awt.Color c2)
If chooseFirstis true, c1 is returned, otherwise c2.


isLeftToRight

static boolean isLeftToRight(java.awt.Component c)

getPaintTrackRect

private java.awt.Rectangle getPaintTrackRect()
Returns a rectangle enclosing the track that will be painted.


paintTrack

public void paintTrack(java.awt.Graphics g)
Overrides:
paintTrack in class javax.swing.plaf.basic.BasicSliderUI

oceanPaintTrack

private void oceanPaintTrack(java.awt.Graphics g)

paintFocus

public void paintFocus(java.awt.Graphics g)
Overrides:
paintFocus in class javax.swing.plaf.basic.BasicSliderUI

getThumbSize

protected java.awt.Dimension getThumbSize()
Overrides:
getThumbSize in class javax.swing.plaf.basic.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 javax.swing.plaf.basic.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)
Overrides:
scrollDueToClickInTrack in class javax.swing.plaf.basic.BasicSliderUI

paintMinorTickForHorizSlider

protected void paintMinorTickForHorizSlider(java.awt.Graphics g,
                                            java.awt.Rectangle tickBounds,
                                            int x)
Overrides:
paintMinorTickForHorizSlider in class javax.swing.plaf.basic.BasicSliderUI

paintMajorTickForHorizSlider

protected void paintMajorTickForHorizSlider(java.awt.Graphics g,
                                            java.awt.Rectangle tickBounds,
                                            int x)
Overrides:
paintMajorTickForHorizSlider in class javax.swing.plaf.basic.BasicSliderUI

paintMinorTickForVertSlider

protected void paintMinorTickForVertSlider(java.awt.Graphics g,
                                           java.awt.Rectangle tickBounds,
                                           int y)
Overrides:
paintMinorTickForVertSlider in class javax.swing.plaf.basic.BasicSliderUI

paintMajorTickForVertSlider

protected void paintMajorTickForVertSlider(java.awt.Graphics g,
                                           java.awt.Rectangle tickBounds,
                                           int y)
Overrides:
paintMajorTickForVertSlider in class javax.swing.plaf.basic.BasicSliderUI

setThumbLocation

public void setThumbLocation(int x,
                             int y,
                             java.awt.Rectangle rect)

createTrackListener

protected javax.swing.plaf.basic.BasicSliderUI.TrackListener createTrackListener(javax.swing.JSlider slider)
Overrides:
createTrackListener in class javax.swing.plaf.basic.BasicSliderUI