|
|||||||||
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
jsky.util.gui.VRangeSlider
public class VRangeSlider
A slider widget that allows users to select a lower and upper bound.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected boolean |
drawLabels
Flag determining whether text labels are drawn. |
protected EventListenerList |
listenerList
list of listeners for change events |
protected double |
maxLimit
Maximum slider value. |
protected Dimension |
maxSize
Maximum widget size. |
protected double |
maxValue
Percent through scale of max gripper. |
protected double |
minLimit
Minimum slider value. |
protected Dimension |
minSize
Minimum widget size. |
protected double |
minValue
Percent through scale of min gripper. |
protected Dimension |
prefSize
Preferred widget size. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, TOOL_TIP_TEXT_KEY, ui, 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 | |
---|---|
VRangeSlider(String label,
double min,
double max)
Constructs a VRangeSlider with the specified range of values. |
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener l)
register to receive change events from this object whenever the min or max values are changed. |
protected void |
fireChange()
Notify any listeners of a change in the image or cut levels. |
boolean |
getDrawLabels()
Indicates whether textual annotations will be drawn near this widget. |
Dimension |
getMaximumSize()
Returns maximum size of range slider. |
double |
getMaxValue()
Percent through scale of max gripper. |
Dimension |
getMinimumSize()
Returns minimum size of range slider. |
double[] |
getMinMaxValues()
Gets minimum and maximum slider values. |
double |
getMinValue()
Percent through scale of min gripper. |
Dimension |
getPreferredSize()
Returns preferred size of range slider. |
static void |
main(String[] argv)
Main method for testing purposes. |
void |
mouseClicked(MouseEvent e)
Not used. |
void |
mouseDragged(MouseEvent e)
MouseMotionListener method for moving slider. |
void |
mouseEntered(MouseEvent e)
Not used. |
void |
mouseExited(MouseEvent e)
Not used. |
void |
mouseMoved(MouseEvent e)
Not used. |
void |
mousePressed(MouseEvent e)
MouseListener method for moving slider. |
void |
mouseReleased(MouseEvent e)
MouseListener method for moving slider. |
void |
paintComponent(Graphics g)
Draws the slider from scratch. |
void |
removeChangeListener(ChangeListener l)
Stop receiving change events from this object. |
protected void |
resetValues(double min,
double max)
Resets the minimum and maximum values. |
void |
setBounds(double min,
double max)
Sets the slider's lo and hi bounds. |
void |
setBounds(int x,
int y,
int w,
int h)
Redraws the slider if the widget width changes. |
void |
setDrawLabels(boolean drawLabels)
Determines whether textual annotations should be drawn near this widget. |
void |
setMaximumSize(Dimension dim)
Sets preferred size of range slider. |
void |
setMinimumSize(Dimension dim)
Sets minimum size of range slider. |
void |
setName(String name)
Sets the slider's name. |
void |
setPreferredSize(Dimension dim)
Sets preferred size of range slider. |
void |
setValues(double lo,
double hi)
Sets the slider's lo and hi values. |
void |
valuesUpdated()
Called whenever the min or max value is updated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double minValue
protected double maxValue
protected double minLimit
protected double maxLimit
protected Dimension minSize
protected Dimension prefSize
protected Dimension maxSize
protected boolean drawLabels
protected EventListenerList listenerList
Constructor Detail |
---|
public VRangeSlider(String label, double min, double max)
Method Detail |
---|
public double getMinValue()
public double getMaxValue()
public double[] getMinMaxValues()
protected void resetValues(double min, double max)
public void setName(String name)
setName
in class Component
public void setBounds(double min, double max)
public void setValues(double lo, double hi)
public void setBounds(int x, int y, int w, int h)
setBounds
in class Component
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void addChangeListener(ChangeListener l)
public void removeChangeListener(ChangeListener l)
protected void fireChange()
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public void setMinimumSize(Dimension dim)
setMinimumSize
in class JComponent
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void setPreferredSize(Dimension dim)
setPreferredSize
in class JComponent
public Dimension getMaximumSize()
getMaximumSize
in class JComponent
public void setMaximumSize(Dimension dim)
setMaximumSize
in class JComponent
public void valuesUpdated()
public void paintComponent(Graphics g)
paintComponent
in class JComponent
public void setDrawLabels(boolean drawLabels)
drawLabels
- whether to draw textual annotationpublic boolean getDrawLabels()
public static void main(String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |