rvl.awt
Class Slider

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--rvl.awt.Slider
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
PiSlider

public class Slider
extends java.awt.Container
implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.FocusListener

GUI Object that implements a slider for display/input of real values. When 0 is included in the scale, there is the option of using a bar connecting the value to 0.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
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(java.lang.String label, double value)
          Construct a slider with given label and initial value.
Slider(java.lang.String label, double value, double min, double max)
          Construct a slider with given initial value, min, and max
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addActionListener(java.awt.event.ActionListener l)
          Add an action listener for this component
 void focusGained(java.awt.event.FocusEvent fe)
           
 void focusLost(java.awt.event.FocusEvent fe)
           
 double getMaximum()
          Get maximum of slider
 double getMinimum()
          Get minimum of slider
 java.awt.Dimension getMinimumSize()
           
 java.awt.Dimension getPreferredSize()
           
 double getValue()
          Get current value of slider
 boolean isEditable()
           
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void keyPressed(java.awt.event.KeyEvent ke)
           
 void keyReleased(java.awt.event.KeyEvent ke)
           
 void keyTyped(java.awt.event.KeyEvent ke)
           
 java.awt.Dimension minimumSize()
           
 void paint(java.awt.Graphics g)
           
 java.awt.Dimension preferredSize()
           
 void processMouseEvent(java.awt.event.MouseEvent e)
           
 void processMouseMotionEvent(java.awt.event.MouseEvent e)
           
 void repaint()
           
 void setButtonColor(java.awt.Color c)
          Set color of buttons
 void setDigits(int d)
          Set # digits
 void setDotColor(java.awt.Color c)
          Set color of dot and connecting bar.
 void setEditable(boolean e)
           
 void setLabel(java.lang.String label)
          Set label
 void setMaximum(double x)
          Set maximum of slider (if mutable)
 void setMinimum(double x)
          Set minimum of slider (if mutable)
 void setMutable(boolean minMut, boolean maxMut)
          Set whether endpoints are allowed to be changed.
 void setScaleColor(java.awt.Color c)
          Set color of axis, tick marks, and tick labels
 void setValue(double x)
          Set value of slider
 java.lang.String toString()
          Print method
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, insets, invalidate, isAncestorOf, layout, list, list, locate, paintComponents, paramString, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Slider

public Slider(java.lang.String label,
              double value)
Construct a slider with given label and initial value. Tries to set scale endpoints in a reasonable way

Slider

public Slider(java.lang.String label,
              double value,
              double min,
              double max)
Construct a slider with given initial value, min, and max
Method Detail

setMutable

public void setMutable(boolean minMut,
                       boolean maxMut)
Set whether endpoints are allowed to be changed. An argument of true enables changing that endpoint

setValue

public void setValue(double x)
Set value of slider

setMinimum

public void setMinimum(double x)
Set minimum of slider (if mutable)
See Also:
setMutable

setMaximum

public void setMaximum(double x)
Set maximum of slider (if mutable)
See Also:
setMutable

setDigits

public void setDigits(int d)
Set # digits

setEditable

public void setEditable(boolean e)

isEditable

public boolean isEditable()

setLabel

public void setLabel(java.lang.String label)
Set label

getValue

public double getValue()
Get current value of slider

getMinimum

public double getMinimum()
Get minimum of slider

getMaximum

public double getMaximum()
Get maximum of slider

setDotColor

public void setDotColor(java.awt.Color c)
Set color of dot and connecting bar. NOTE: May also use setForeground() and setBackground() to change the most important colors

setButtonColor

public void setButtonColor(java.awt.Color c)
Set color of buttons

setScaleColor

public void setScaleColor(java.awt.Color c)
Set color of axis, tick marks, and tick labels

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class java.awt.Container

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class java.awt.Container

preferredSize

public java.awt.Dimension preferredSize()
Overrides:
preferredSize in class java.awt.Container

minimumSize

public java.awt.Dimension minimumSize()
Overrides:
minimumSize in class java.awt.Container

repaint

public void repaint()
Overrides:
repaint in class java.awt.Component

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container

toString

public java.lang.String toString()
Print method
Overrides:
toString in class java.awt.Component

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Add an action listener for this component

processMouseEvent

public void processMouseEvent(java.awt.event.MouseEvent e)
Overrides:
processMouseEvent in class java.awt.Component

processMouseMotionEvent

public void processMouseMotionEvent(java.awt.event.MouseEvent e)
Overrides:
processMouseMotionEvent in class java.awt.Component

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent ke)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent ke)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent ke)
Specified by:
keyTyped in interface java.awt.event.KeyListener

focusGained

public void focusGained(java.awt.event.FocusEvent fe)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent fe)
Specified by:
focusLost in interface java.awt.event.FocusListener