private static class JRangeSlider.JRangeSliderBasicUI extends BasicSliderUI
| Modifier and Type | Class and Description |
|---|---|
class |
JRangeSlider.JRangeSliderBasicUI.ChangeHandler
Listener to handle model change events.
|
class |
JRangeSlider.JRangeSliderBasicUI.RangeTrackListener
Listener to handle mouse movements in the slider track.
|
BasicSliderUI.ActionScroller, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener| Modifier and Type | Field and Description |
|---|---|
private boolean |
lowerDragging
Indicator set when lower thumb is being dragged.
|
private Color |
rangeColor
Color of selected range.
|
private boolean |
upperDragging
Indicator set when upper thumb is being dragged.
|
private Rectangle |
upperThumbRect
Location and size of thumb for upper value.
|
private boolean |
upperThumbSelected
Indicator that determines whether upper thumb is selected.
|
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 and Description |
|---|
JRangeSliderBasicUI(JSlider slider)
Constructs a RangeSliderUI for the specified slider component.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateThumbLocation()
Updates the locations for both thumbs.
|
protected void |
calculateThumbSize()
Updates the dimensions for both thumbs.
|
protected ChangeListener |
createChangeListener(JSlider slider)
Creates a listener to handle change events in the specified slider.
|
private Shape |
createThumbShape(int width,
int height)
Returns a Shape representing a thumb.
|
protected BasicSliderUI.TrackListener |
createTrackListener(JSlider slider)
Creates a listener to handle track events in the specified slider.
|
void |
installUI(JComponent c)
Installs this UI delegate on the specified component.
|
void |
paint(Graphics g,
JComponent c)
Paints the slider.
|
private void |
paintLowerThumb(Graphics g)
Paints the thumb for the lower value using the specified graphics object.
|
void |
paintTrack(Graphics g)
Paints the track.
|
private void |
paintUpperThumb(Graphics g)
Paints the thumb for the upper value using the specified graphics object.
|
void |
scrollByBlock(int direction)
Moves the selected thumb in the specified direction by a block increment.
|
void |
scrollByUnit(int direction)
Moves the selected thumb in the specified direction by a unit increment.
|
private void |
setUpperThumbLocation(int x,
int y)
Sets the location of the upper thumb, and repaints the slider.
|
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, getThumbSize, getTickLength, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installDefaults, installKeyboardActions, installListeners, isDragging, labelsHaveSameBaselines, paintFocus, paintHorizontalLabel, paintLabels, paintMajorTickForHorizSlider, paintMajorTickForVertSlider, paintMinorTickForHorizSlider, paintMinorTickForVertSlider, paintThumb, paintTicks, paintVerticalLabel, recalculateIfInsetsChanged, recalculateIfOrientationChanged, scrollDueToClickInTrack, setThumbLocation, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI, valueForXPosition, valueForYPosition, xPositionForValue, yPositionForValue, yPositionForValuecontains, getAccessibleChild, getAccessibleChildrenCount, updateprivate Color rangeColor
private Rectangle upperThumbRect
private boolean upperThumbSelected
private transient boolean lowerDragging
private transient boolean upperDragging
public JRangeSliderBasicUI(JSlider slider)
b - RangeSliderpublic void installUI(JComponent c)
installUI in class BasicSliderUIprotected BasicSliderUI.TrackListener createTrackListener(JSlider slider)
createTrackListener in class BasicSliderUIprotected ChangeListener createChangeListener(JSlider slider)
createChangeListener in class BasicSliderUIprotected void calculateThumbSize()
calculateThumbSize in class BasicSliderUIprotected void calculateThumbLocation()
calculateThumbLocation in class BasicSliderUIpublic void paint(Graphics g, JComponent c)
paint in class BasicSliderUIpublic void paintTrack(Graphics g)
paintTrack in class BasicSliderUIprivate void paintLowerThumb(Graphics g)
private void paintUpperThumb(Graphics g)
private Shape createThumbShape(int width, int height)
private void setUpperThumbLocation(int x,
int y)
setThumbLocation() method performs the same task for the
lower thumb.public void scrollByBlock(int direction)
scrollByBlock in class BasicSliderUIpublic void scrollByUnit(int direction)
scrollByUnit in class BasicSliderUICopyright © 2007–2017 Gephi Consortium. All rights reserved.