|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component visad.browser.Slider
public class Slider
A simple slider widget.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
GRIP_BOTTOM_Y
Y-coordinate of bottom of grip. |
static int |
GRIP_HEIGHT
Height of grip. |
static int |
GRIP_TOP_Y
Y-coordinate of top of grip. |
static int |
GRIP_WIDTH
Width of grip. |
static int |
LINE_LEVEL
Y-coordinate of slider line. |
protected float |
maximum
Maximum value of slider. |
protected Dimension |
maxSize
Maximum widget size. |
protected float |
minimum
Minimum value of slider. |
protected Dimension |
minSize
Minimum widget size. |
protected Dimension |
prefSize
Preferred widget size. |
static int |
SLIDER_PREF_HEIGHT
Preferred slider height. |
static int |
SLIDER_PREF_WIDTH
Preferred slider width. |
protected float |
value
Current value of slider. |
protected int |
width
Current width of slider. |
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 | |
---|---|
Slider()
Constructs a slider with default value, minimum and maximum. |
|
Slider(float value,
float min,
float max)
Constructs a slider with the specified value, minimum and maximum. |
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
Adds a listener to be notified of slider changes. |
float |
getMaximum()
Gets maximum slider value. |
Dimension |
getMaximumSize()
Returns maximum size oa slider. |
float |
getMinimum()
Gets minimum slider value. |
Dimension |
getMinimumSize()
Returns minimum size of slider. |
Dimension |
getPreferredSize()
Returns preferred size of slider. |
float |
getValue()
Gets current slider value. |
static void |
main(String[] argv)
Main method for testing purposes. |
void |
mouseClicked(MouseEvent e)
Not used. |
void |
mouseDragged(MouseEvent e)
MouseMotionListener method for moving grip. |
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 grip. |
void |
mouseReleased(MouseEvent e)
MouseListener method for moving grip. |
void |
notifyListeners()
Notifies listeners of slider change. |
void |
paint(Graphics g)
Draws the slider. |
void |
removeActionListener(ActionListener l)
Removes a listener to be notified of slider changes. |
void |
repaint()
|
void |
setActionCommand(String cmd)
Sets command string for slider change notification. |
void |
setBounds(float min,
float max)
Sets minimum and maximum slider values. |
void |
setBounds(int x,
int y,
int w,
int h)
Detects changes in slider width. |
void |
setMaximumSize(Dimension dim)
Sets preferred size of slider. |
void |
setMinimumSize(Dimension dim)
Sets minimum size of slider. |
void |
setPreferredSize(Dimension dim)
Sets preferred size of slider. |
void |
setValue(float value)
Sets current slider value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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 LINE_LEVEL
protected int width
protected float value
protected float minimum
protected float maximum
protected Dimension minSize
protected Dimension prefSize
protected Dimension maxSize
Constructor Detail |
---|
public Slider()
public Slider(float value, float min, float max)
Method Detail |
---|
public float getValue()
public float getMinimum()
public float getMaximum()
public void setValue(float value)
public void setBounds(float min, float max)
public void setBounds(int x, int y, int w, int h)
setBounds
in class Component
public void addActionListener(ActionListener l)
public void removeActionListener(ActionListener l)
public void setActionCommand(String cmd)
public void notifyListeners()
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
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 |