Package PamView.sliders
Class PamRangeSliderUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.SliderUI
javax.swing.plaf.basic.BasicSliderUI
PamView.sliders.PamSliderUI
PamView.sliders.PamRangeSliderUI
- Direct Known Subclasses:
 ColourRangeSliderUI
UI delegate for the RangeSlider component.  RangeSliderUI paints two thumbs,
 one for the lower value and one for the upper value.
 
PamRangeSliderUI is based on code from Ernie Yu. http://ernienotes.wordpress.com/2010/12/27/creating-a-java-swing-range-slider/ (28/09/2013)
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassListener to handle model change events.classListener to handle mouse movements in the slider track.Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicSliderUI
BasicSliderUI.ActionScroller, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener - 
Field Summary
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
ConstructorsConstructorDescriptionConstructs a RangeSliderUI for the specified slider component. - 
Method Summary
Modifier and TypeMethodDescriptionprotected voidUpdates the locations for both thumbs.protected voidUpdates the dimensions for both thumbs.protected ChangeListenercreateChangeListener(JSlider slider) Creates a listener to handle change events in the specified slider.protected BasicSliderUI.TrackListenercreateTrackListener(JSlider slider) Creates a listener to handle track events in the specified slider.voidInstalls this UI delegate on the specified component.booleanbooleanvoidpaint(Graphics g, JComponent c) Paints the slider.voidOverrides superclass method to do nothing.voidPaints the track.voidscrollByBlock(int direction) Moves the selected thumb in the specified direction by a block increment.voidscrollByUnit(int direction) Moves the selected thumb in the specified direction by a unit increment.voidsetRangeSliderColour(Color rangeColor) voidsetTrackDragging(boolean trackDragging) voidsetUpperDragging(boolean upperDragging) voidsetUpperThumbFill(Color upperThumbFill) voidsetUpperThumbOutline(Color upperThumbOutline) voidsetUpperThumbRect(Rectangle upperThumbRect) voidsetUpperThumbSelected(boolean upperThumbSelected) Methods inherited from class PamView.sliders.PamSliderUI
getThumbSize, paintThumb, setThumbSizesMethods inherited from class javax.swing.plaf.basic.BasicSliderUI
calculateContentRect, calculateFocusRect, calculateGeometry, calculateLabelRect, calculateTickRect, calculateTrackBuffer, calculateTrackRect, createComponentListener, createFocusListener, createPropertyChangeListener, createScrollListener, createUI, drawInverted, getBaseline, getBaselineResizeBehavior, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValue, getHighestValueLabel, getHighlightColor, getLowestValue, getLowestValueLabel, getMaximumSize, getMinimumHorizontalSize, getMinimumSize, getMinimumVerticalSize, getPreferredHorizontalSize, getPreferredSize, getPreferredVerticalSize, getShadowColor, getTickLength, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installDefaults, installKeyboardActions, installListeners, isDragging, labelsHaveSameBaselines, paintFocus, paintHorizontalLabel, paintLabels, paintMajorTickForHorizSlider, paintMajorTickForVertSlider, paintMinorTickForHorizSlider, paintMinorTickForVertSlider, paintTicks, paintVerticalLabel, recalculateIfInsetsChanged, recalculateIfOrientationChanged, scrollDueToClickInTrack, setThumbLocation, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI, valueForXPosition, valueForYPosition, xPositionForValue, yPositionForValue, yPositionForValueMethods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update 
- 
Constructor Details
- 
PamRangeSliderUI
Constructs a RangeSliderUI for the specified slider component.- Parameters:
 b- RangeSlider
 
 - 
 - 
Method Details
- 
installUI
Installs this UI delegate on the specified component.- Overrides:
 installUIin classBasicSliderUI
 - 
createTrackListener
Creates a listener to handle track events in the specified slider.- Overrides:
 createTrackListenerin classBasicSliderUI
 - 
createChangeListener
Creates a listener to handle change events in the specified slider.- Overrides:
 createChangeListenerin classBasicSliderUI
 - 
calculateThumbSize
protected void calculateThumbSize()Updates the dimensions for both thumbs.- Overrides:
 calculateThumbSizein classBasicSliderUI
 - 
calculateThumbLocation
protected void calculateThumbLocation()Updates the locations for both thumbs.- Overrides:
 calculateThumbLocationin classBasicSliderUI
 - 
paint
Paints the slider. The selected thumb is always painted on top of the other thumb.- Overrides:
 paintin classPamSliderUI
 - 
paintTrack
Paints the track.- Overrides:
 paintTrackin classBasicSliderUI
 - 
paintThumb
Overrides superclass method to do nothing. Thumb painting is handled within thepaint()method.- Overrides:
 paintThumbin classPamSliderUI
 - 
scrollByBlock
public void scrollByBlock(int direction) Moves the selected thumb in the specified direction by a block increment. This method is called when the user presses the Page Up or Down keys.- Overrides:
 scrollByBlockin classBasicSliderUI
 - 
scrollByUnit
public void scrollByUnit(int direction) Moves the selected thumb in the specified direction by a unit increment. This method is called when the user presses one of the arrow keys.- Overrides:
 scrollByUnitin classBasicSliderUI
 - 
getUpperThumbRect
 - 
setUpperThumbRect
 - 
getRangeSliderColour
 - 
setRangeSliderColour
 - 
getUpperThumbFill
 - 
getUpperThumbOutline
 - 
isUpperThumbSelected
public boolean isUpperThumbSelected() - 
isUpperDragging
public boolean isUpperDragging() - 
setUpperThumbFill
 - 
setUpperThumbOutline
 - 
setUpperThumbSelected
public void setUpperThumbSelected(boolean upperThumbSelected)  - 
setUpperDragging
public void setUpperDragging(boolean upperDragging)  - 
setTrackDragging
public void setTrackDragging(boolean trackDragging)  
 -