Inheritance diagram for JRangeSlider:
Public Member Functions | |
JRangeSlider (BoundedRangeModel model, int orientation, int direction) | |
Create a new range slider. | |
JRangeSlider (int minimum, int maximum, int lowValue, int highValue, int orientation) | |
Create a new range slider. | |
JRangeSlider (int minimum, int maximum, int lowValue, int highValue, int orientation, int direction) | |
Create a new range slider. | |
void | addChangeListener (ChangeListener cl) |
Registers a listener for ChangeEvents. | |
int | getHighValue () |
Returns the current "high" value shown by the range slider's bar. | |
int | getLowValue () |
Returns the current "low" value shown by the range slider's bar. | |
int | getMaximum () |
Gets the maximum possible value for either the low value or the high value. | |
int | getMinimum () |
Gets the minimum possible value for either the low value or the high value. | |
BoundedRangeModel | getModel () |
Get the BoundedRangeModel backing this slider. | |
Dimension | getPreferredSize () |
Color | getThumbColor () |
Get the slider thumb color. | |
void | keyPressed (KeyEvent e) |
void | keyReleased (KeyEvent e) |
void | keyTyped (KeyEvent e) |
void | mouseClicked (MouseEvent e) |
void | mouseDragged (MouseEvent e) |
void | mouseEntered (MouseEvent e) |
void | mouseExited (MouseEvent e) |
void | mouseMoved (MouseEvent e) |
void | mousePressed (MouseEvent e) |
void | mouseReleased (MouseEvent e) |
void | paintComponent (Graphics g) |
void | removeChangeListener (ChangeListener cl) |
Removes a listener for ChangeEvents. | |
void | setEmpty (boolean empty) |
Sets whether this slider is empty. | |
void | setHighValue (int highValue) |
Sets the high value shown by this range slider. | |
void | setLowValue (int lowValue) |
Sets the low value shown by this range slider. | |
void | setMaximum (int maximum) |
Sets the maximum possible value for either the low value or the high value. | |
void | setMinExtent (int minExtent) |
Sets the minimum extent (difference between low and high values). | |
void | setMinimum (int minimum) |
Sets the minimum possible value for either the low value or the high value. | |
void | setModel (BoundedRangeModel brm) |
Set the BoundedRangeModel backing this slider. | |
void | setRange (int lowValue, int highValue) |
Set the slider range span. | |
void | setThumbColor (Color thumbColor) |
Set the slider thumb color. | |
Static Public Attributes | |
static final int | HORIZONTAL = 1 |
static final int | LEFTRIGHT_TOPBOTTOM = 0 |
static final int | PREFERRED_BREADTH = 16 |
static final int | PREFERRED_LENGTH = 300 |
static final int | RIGHTLEFT_BOTTOMTOP = 1 |
static final int | VERTICAL = 0 |
Protected Member Functions | |
ChangeListener | createListener () |
Create a listener to relay change events from the bounded range model. | |
void | customPaint (Graphics2D g, int width, int height) |
Override this method to perform custom painting of the slider trough. | |
void | fireChangeEvent () |
Fire a change event to all listeners. | |
void | paint3DRectLighting (Graphics2D g2, int x, int y, int width, int height) |
Adds Windows2K type 3D lighting effects. | |
void | paintArrow (Graphics2D g2, double x, double y, int w, int h, boolean topDown) |
This draws an arrow as a series of lines within the specified box. | |
int | toLocal (int xOrY) |
Converts from screen coordinates to a range value. | |
int | toScreen (int xOrY) |
Converts from a range value to screen coordinates. | |
double | toScreenDouble (int xOrY) |
Converts from a range value to screen coordinates. | |
Protected Attributes | |
ChangeEvent | changeEvent = null |
ChangeListener | changeListener |
int | direction |
boolean | empty |
int | increment = 1 |
ArrayList | listeners = new ArrayList() |
int | minExtent = 0 |
BoundedRangeModel | model |
int | orientation |
Color | thumbColor = new Color(150, 180, 220) |
Static Protected Attributes | |
static final int | ARROW_HEIGHT = 4 |
static final int | ARROW_SZ = 16 |
static final int | ARROW_WIDTH = 8 |
Package Attributes | |
int | mouse |
int | pick |
int | pickOffsetHigh |
int | pickOffsetLow |
Classes | |
class | RangeSliderChangeListener |
Listener that fires a change event when it receives change event from the slider list model. More... |
Jesse Grosjean
Jon Meyer
Lance Good
jeffrey heer
Ron B. Yeh
Definition at line 38 of file JRangeSlider.java.
JRangeSlider | ( | BoundedRangeModel | model, | |
int | orientation, | |||
int | direction | |||
) |
Create a new range slider.
model | - a BoundedRangeModel specifying the slider's range | |
orientation | - construct a horizontal or vertical slider? | |
direction | - Is the slider left-to-right/top-to-bottom or right-to-left/bottom-to-top |
Definition at line 137 of file JRangeSlider.java.
References JRangeSlider.changeListener, and JRangeSlider.createListener().
JRangeSlider | ( | int | minimum, | |
int | maximum, | |||
int | lowValue, | |||
int | highValue, | |||
int | orientation | |||
) |
Create a new range slider.
minimum | - the minimum value of the range. | |
maximum | - the maximum value of the range. | |
lowValue | - the current low value shown by the range slider's bar. | |
highValue | - the current high value shown by the range slider's bar. | |
orientation | - construct a horizontal or vertical slider? |
Definition at line 166 of file JRangeSlider.java.
References JRangeSlider.LEFTRIGHT_TOPBOTTOM.
JRangeSlider | ( | int | minimum, | |
int | maximum, | |||
int | lowValue, | |||
int | highValue, | |||
int | orientation, | |||
int | direction | |||
) |
Create a new range slider.
minimum | - the minimum value of the range. | |
maximum | - the maximum value of the range. | |
lowValue | - the current low value shown by the range slider's bar. | |
highValue | - the current high value shown by the range slider's bar. | |
orientation | - construct a horizontal or vertical slider? | |
direction | - Is the slider left-to-right/top-to-bottom or right-to-left/bottom-to-top |
Definition at line 187 of file JRangeSlider.java.
void addChangeListener | ( | ChangeListener | cl | ) |
Registers a listener for ChangeEvents.
cl | the ChangeListener to add |
Definition at line 197 of file JRangeSlider.java.
References JRangeSlider.listeners.
ChangeListener createListener | ( | ) | [protected] |
Create a listener to relay change events from the bounded range model.
Definition at line 207 of file JRangeSlider.java.
Referenced by JRangeSlider.JRangeSlider().
void customPaint | ( | Graphics2D | g, | |
int | width, | |||
int | height | |||
) | [protected] |
Override this method to perform custom painting of the slider trough.
g | a Graphics2D context for rendering | |
width | the width of the slider trough | |
height | the height of the slider trough |
Reimplemented in EventSlider.
Definition at line 221 of file JRangeSlider.java.
Referenced by JRangeSlider.paintComponent().
int getHighValue | ( | ) |
Returns the current "high" value shown by the range slider's bar.
The high value meets the constraint minimum <= lowValue <= highValue <= maximum.
Definition at line 244 of file JRangeSlider.java.
References JRangeSlider.model.
Referenced by EventSlider.customPaint(), JRangeSlider.keyPressed(), JRangeSlider.mouseDragged(), JRangeSlider.mousePressed(), and JRangeSlider.paintComponent().
int getLowValue | ( | ) |
Returns the current "low" value shown by the range slider's bar.
The low value meets the constraint minimum <= lowValue <= highValue <= maximum.
Definition at line 252 of file JRangeSlider.java.
References JRangeSlider.model.
Referenced by EventSlider.customPaint(), JRangeSlider.keyPressed(), JRangeSlider.mouseDragged(), JRangeSlider.mousePressed(), and JRangeSlider.paintComponent().
int getMaximum | ( | ) |
Gets the maximum possible value for either the low value or the high value.
Definition at line 261 of file JRangeSlider.java.
References JRangeSlider.model.
Referenced by EventSlider.customPaint(), JRangeSlider.keyPressed(), JRangeSlider.mouseDragged(), JRangeSlider.toLocal(), JRangeSlider.toScreen(), and JRangeSlider.toScreenDouble().
int getMinimum | ( | ) |
Gets the minimum possible value for either the low value or the high value.
Definition at line 270 of file JRangeSlider.java.
References JRangeSlider.model.
Referenced by EventSlider.customPaint(), JRangeSlider.keyPressed(), JRangeSlider.mouseDragged(), JRangeSlider.toLocal(), JRangeSlider.toScreen(), and JRangeSlider.toScreenDouble().
BoundedRangeModel getModel | ( | ) |
Get the BoundedRangeModel backing this slider.
Definition at line 279 of file JRangeSlider.java.
References JRangeSlider.model.
Dimension getPreferredSize | ( | ) |
Definition at line 286 of file JRangeSlider.java.
References JRangeSlider.orientation, JRangeSlider.PREFERRED_BREADTH, JRangeSlider.PREFERRED_LENGTH, and JRangeSlider.VERTICAL.
Color getThumbColor | ( | ) |
Get the slider thumb color.
This is the part of the slider between the range resize buttons.
Definition at line 299 of file JRangeSlider.java.
References JRangeSlider.thumbColor.
void keyPressed | ( | KeyEvent | e | ) |
Definition at line 314 of file JRangeSlider.java.
References JRangeSlider.getHighValue(), JRangeSlider.getLowValue(), JRangeSlider.getMaximum(), JRangeSlider.getMinimum(), JRangeSlider.orientation, and JRangeSlider.VERTICAL.
void keyReleased | ( | KeyEvent | e | ) |
Definition at line 349 of file JRangeSlider.java.
void keyTyped | ( | KeyEvent | e | ) |
Definition at line 355 of file JRangeSlider.java.
void mouseClicked | ( | MouseEvent | e | ) |
Definition at line 361 of file JRangeSlider.java.
void mouseDragged | ( | MouseEvent | e | ) |
Definition at line 367 of file JRangeSlider.java.
References JRangeSlider.getHighValue(), JRangeSlider.getLowValue(), JRangeSlider.getMaximum(), JRangeSlider.getMinimum(), JRangeSlider.minExtent, JRangeSlider.orientation, JRangeSlider.pick, JRangeSlider.pickOffsetHigh, JRangeSlider.pickOffsetLow, JRangeSlider.setHighValue(), JRangeSlider.setLowValue(), JRangeSlider.toLocal(), and JRangeSlider.VERTICAL.
void mouseEntered | ( | MouseEvent | e | ) |
Definition at line 425 of file JRangeSlider.java.
void mouseExited | ( | MouseEvent | e | ) |
Definition at line 431 of file JRangeSlider.java.
void mouseMoved | ( | MouseEvent | e | ) |
Definition at line 440 of file JRangeSlider.java.
References JRangeSlider.orientation, and JRangeSlider.VERTICAL.
void mousePressed | ( | MouseEvent | e | ) |
Definition at line 477 of file JRangeSlider.java.
References JRangeSlider.getHighValue(), JRangeSlider.getLowValue(), JRangeSlider.mouse, JRangeSlider.orientation, JRangeSlider.pick, JRangeSlider.pickOffsetHigh, JRangeSlider.pickOffsetLow, JRangeSlider.toScreen(), and JRangeSlider.VERTICAL.
void mouseReleased | ( | MouseEvent | e | ) |
Definition at line 495 of file JRangeSlider.java.
References JRangeSlider.pick.
void paintArrow | ( | Graphics2D | g2, | |
double | x, | |||
double | y, | |||
int | w, | |||
int | h, | |||
boolean | topDown | |||
) | [protected] |
This draws an arrow as a series of lines within the specified box.
The last boolean specifies whether the point should be at the right/bottom or left/top.
Definition at line 525 of file JRangeSlider.java.
References JRangeSlider.orientation, and JRangeSlider.VERTICAL.
Referenced by JRangeSlider.paintComponent().
void paintComponent | ( | Graphics | g | ) |
Definition at line 586 of file JRangeSlider.java.
References JRangeSlider.ARROW_HEIGHT, JRangeSlider.ARROW_SZ, JRangeSlider.ARROW_WIDTH, JRangeSlider.customPaint(), JRangeSlider.direction, JRangeSlider.empty, JRangeSlider.getHighValue(), JRangeSlider.getLowValue(), JRangeSlider.LEFTRIGHT_TOPBOTTOM, JRangeSlider.orientation, JRangeSlider.paint3DRectLighting(), JRangeSlider.paintArrow(), JRangeSlider.thumbColor, JRangeSlider.toScreen(), and JRangeSlider.VERTICAL.
void removeChangeListener | ( | ChangeListener | cl | ) |
Removes a listener for ChangeEvents.
cl | the ChangeListener to remove |
Definition at line 741 of file JRangeSlider.java.
References JRangeSlider.listeners.
void setEmpty | ( | boolean | empty | ) |
Sets whether this slider is empty.
empty | true if set to empty, false otherwise |
Definition at line 751 of file JRangeSlider.java.
void setHighValue | ( | int | highValue | ) |
Sets the high value shown by this range slider.
This causes the range slider to be repainted and a ChangeEvent to be fired.
highValue | the high value to use |
Definition at line 763 of file JRangeSlider.java.
References JRangeSlider.model.
Referenced by JRangeSlider.mouseDragged().
void setLowValue | ( | int | lowValue | ) |
Sets the low value shown by this range slider.
This causes the range slider to be repainted and a ChangeEvent to be fired.
lowValue | the low value to use |
Definition at line 774 of file JRangeSlider.java.
References JRangeSlider.model.
Referenced by JRangeSlider.mouseDragged().
void setMaximum | ( | int | maximum | ) |
Sets the maximum possible value for either the low value or the high value.
maximum | the maximum possible range value |
Definition at line 786 of file JRangeSlider.java.
References JRangeSlider.model.
void setMinExtent | ( | int | minExtent | ) |
Sets the minimum extent (difference between low and high values).
This method does not change the current state of the model, but can affect all subsequent interaction.
minExtent | the minimum extent allowed in subsequent interaction |
Definition at line 797 of file JRangeSlider.java.
void setMinimum | ( | int | minimum | ) |
Sets the minimum possible value for either the low value or the high value.
minimum | the minimum possible range value |
Definition at line 807 of file JRangeSlider.java.
References JRangeSlider.model.
void setModel | ( | BoundedRangeModel | brm | ) |
Set the BoundedRangeModel backing this slider.
brm | the slider range model to use |
Definition at line 817 of file JRangeSlider.java.
References JRangeSlider.changeListener, and JRangeSlider.model.
void setRange | ( | int | lowValue, | |
int | highValue | |||
) |
Set the slider range span.
lowValue | the low value of the slider range | |
highValue | the high value of the slider range |
Definition at line 832 of file JRangeSlider.java.
References JRangeSlider.model.
void setThumbColor | ( | Color | thumbColor | ) |
Set the slider thumb color.
This is the part of the slider between the range resize buttons.
thumbColor | the slider thumb color |
Definition at line 843 of file JRangeSlider.java.