|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component visad.browser.RangeSlider
public class RangeSlider
A slider widget that allows users to select a lower and upper bound.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
DEFAULT_NAME
Default variable name. |
static int |
FONT_BOTTOM_Y
Y-coordinate of bottom of font. |
static int |
FONT_HEIGHT
Height of font. |
static int |
FONT_TOP_Y
Y-coordinate of top of font. |
static int |
GRIP_BOTTOM_Y
Y-coordinate of bottom of grip. |
static int |
GRIP_HEIGHT
Height of grip. |
static int |
GRIP_MIDDLE_Y
Y-coordinate of middle of grip. |
static int |
GRIP_TOP_Y
Y-coordinate of top of grip. |
static int |
GRIP_WIDTH
Width of grip. |
protected boolean |
lSlideMoved
Flag whether left gripper has moved. |
protected int |
maxGrip
Location of max gripper. |
protected float |
maxLimit
Maximum slider value. |
protected Dimension |
maxSize
Maximum widget size. |
protected float |
maxValue
Percent through scale of max gripper. |
protected int |
minGrip
Location of min gripper. |
protected float |
minLimit
Minimum slider value. |
protected Dimension |
minSize
Minimum widget size. |
protected float |
minValue
Percent through scale of min gripper. |
protected Dimension |
prefSize
Preferred widget size. |
protected boolean |
rSlideMoved
Flag whether right gripper has moved. |
static int |
SLIDER_LINE_HEIGHT
Height of slider line. |
static int |
SLIDER_LINE_WIDTH
Width of slider line. |
static int |
SLIDER_PREF_HEIGHT
Preferred slider height. |
static int |
SLIDER_PREF_WIDTH
Preferred slider width. |
protected boolean |
textChanged
Flag whether current text string value needs updating. |
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 | |
---|---|
RangeSlider(String n,
float min,
float max)
Constructs a RangeSlider with the specified range of values. |
Method Summary | |
---|---|
Dimension |
getMaximumSize()
Returns maximum size of range slider. |
Dimension |
getMinimumSize()
Returns minimum size of range slider. |
float[] |
getMinMaxValues()
Gets minimum and maximum slider values. |
Dimension |
getPreferredSize()
Returns preferred size of range slider. |
protected float |
gripToValue(int pos,
int width)
|
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 |
paint(Graphics g)
Draws the slider from scratch. |
void |
repaint()
Repaints anything that needs it. |
protected void |
resetValues(float min,
float max)
Resets the minimum and maximum values. |
void |
setBounds(float min,
float 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 |
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(float lo,
float hi)
Sets the slider's lo and hi values. |
void |
valuesUpdated()
Called whenever the min or max value is updated. |
protected int |
valueToGrip(float value,
int width)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_NAME
public static final int SLIDER_PREF_HEIGHT
public static final int SLIDER_PREF_WIDTH
public static final int GRIP_WIDTH
public static final int GRIP_HEIGHT
public static final int GRIP_TOP_Y
public static final int GRIP_BOTTOM_Y
public static final int GRIP_MIDDLE_Y
public static final int SLIDER_LINE_HEIGHT
public static final int SLIDER_LINE_WIDTH
public static final int FONT_HEIGHT
public static final int FONT_TOP_Y
public static final int FONT_BOTTOM_Y
protected float minValue
protected float maxValue
protected float minLimit
protected float maxLimit
protected int minGrip
protected int maxGrip
protected boolean lSlideMoved
protected boolean rSlideMoved
protected boolean textChanged
protected Dimension minSize
protected Dimension prefSize
protected Dimension maxSize
Constructor Detail |
---|
public RangeSlider(String n, float min, float max)
Method Detail |
---|
public float[] getMinMaxValues()
protected void resetValues(float min, float max)
public void setName(String name)
setName
in class Component
public void setBounds(float min, float max)
public void setValues(float lo, float 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 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 Component
public void setMinimumSize(Dimension dim)
setMinimumSize
in class Component
public Dimension getPreferredSize()
getPreferredSize
in class Component
public void setPreferredSize(Dimension dim)
setPreferredSize
in class Component
public Dimension getMaximumSize()
getMaximumSize
in class Component
public void setMaximumSize(Dimension dim)
setMaximumSize
in class Component
protected float gripToValue(int pos, int width)
protected int valueToGrip(float value, int width)
public void valuesUpdated()
public void paint(Graphics g)
paint
in class Component
public void repaint()
repaint
in class Component
public static void main(String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |