|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
edu.harvard.seas.iis.util.ui.JRangeSlider
public class JRangeSlider
Implements a Swing-based Range slider, which allows the user to enter a range (minimum and maximum) value.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.BaselineResizeBehavior |
Field Summary | |
---|---|
static int |
HORIZONTAL
|
static int |
LEFTRIGHT_TOPBOTTOM
|
static int |
PREFERRED_BREADTH
|
static int |
PREFERRED_LENGTH
|
static int |
RIGHTLEFT_BOTTOMTOP
|
static int |
VERTICAL
|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int VERTICAL
public static final int HORIZONTAL
public static final int LEFTRIGHT_TOPBOTTOM
public static final int RIGHTLEFT_BOTTOMTOP
public static final int PREFERRED_BREADTH
public static final int PREFERRED_LENGTH
Constructor Detail |
---|
public JRangeSlider(int minimum, int maximum, int lowValue, int highValue, int orientation)
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?public JRangeSlider(int minimum, int maximum, int lowValue, int highValue, int orientation, int direction)
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-toppublic JRangeSlider(BoundedRangeModel model, int orientation, int direction)
model
- - a BoundedRangeModel specifying the slider's rangeorientation
- - construct a horizontal or vertical slider?direction
- - Is the slider left-to-right/top-to-bottom or right-to-left/bottom-to-topMethod Detail |
---|
public int getLowValue()
public void setLowValue(int lowValue)
lowValue
- the low value to usepublic int getHighValue()
public void setHighValue(int highValue)
highValue
- the high value to usepublic void setRange(int lowValue, int highValue)
lowValue
- the low value of the slider rangehighValue
- the high value of the slider rangepublic int getMinimum()
public void setMinimum(int minimum)
minimum
- the minimum possible range valuepublic int getMaximum()
public void setMaximum(int maximum)
maximum
- the maximum possible range valuepublic void setMinExtent(int minExtent)
minExtent
- the minimum extent allowed in subsequent interactionpublic void setEmpty(boolean empty)
empty
- true if set to empty, false otherwisepublic Color getThumbColor()
public void setThumbColor(Color thumbColor)
thumbColor
- the slider thumb colorpublic BoundedRangeModel getModel()
public void setModel(BoundedRangeModel brm)
brm
- the slider range model to usepublic void addChangeListener(ChangeListener cl)
cl
- the ChangeListener to addpublic void removeChangeListener(ChangeListener cl)
cl
- the ChangeListener to removepublic Dimension getPreferredSize()
getPreferredSize
in class JComponent
Component.getPreferredSize()
public void paintComponent(Graphics g)
paintComponent
in class JComponent
JComponent.paintComponent(java.awt.Graphics)
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
MouseListener.mousePressed(java.awt.event.MouseEvent)
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
MouseListener.mouseReleased(java.awt.event.MouseEvent)
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
MouseMotionListener.mouseMoved(java.awt.event.MouseEvent)
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
MouseListener.mouseClicked(java.awt.event.MouseEvent)
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
MouseListener.mouseEntered(java.awt.event.MouseEvent)
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
MouseListener.mouseExited(java.awt.event.MouseEvent)
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
KeyListener.keyPressed(java.awt.event.KeyEvent)
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
KeyListener.keyReleased(java.awt.event.KeyEvent)
public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
KeyListener.keyTyped(java.awt.event.KeyEvent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |