org.jlab.coda.afecs.ui.rcgui.util
Class AScrollSlider

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Scrollbar
          extended by org.jlab.coda.afecs.ui.rcgui.util.AScrollSlider
All Implemented Interfaces:
java.awt.Adjustable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class AScrollSlider
extends java.awt.Scrollbar

JSA: Thomas Jefferson National Accelerator Facility
This software was developed under a United States Government license,
described in the NOTICE file included as part of this distribution.
Copyright (c), Nov 23, 2009

floating point version of JSlider. replaces the original integer get/set Minimum/Maximum/Value methods with the floating point versions: get/set FloatMinimum/FloatMaximum/FloatValue. it is an error to call the original versions or other methods related to them. note that unlike in the base class, values set via setFloatValue(val) are allowed to be outside the min/max range values. in those cases the slider thumb will clamp to the appropriate slider end (just like in the base class) but the out-of-range value will still be retrivable with getFloatValue().

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Scrollbar
java.awt.Scrollbar.AccessibleAWTScrollBar
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class java.awt.Scrollbar
HORIZONTAL, VERTICAL
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.Adjustable
NO_ORIENTATION
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AScrollSlider(int orientation, double cur, double min, double max)
          uses default visible(20), resolution(1000), and scale (linear).
AScrollSlider(int orientation, double cur, double min, double max, boolean log)
          uses default visible(20) and resolution(1000).
AScrollSlider(int orientation, double cur, int vis, double min, double max, int res)
          uses default scale (linear).
AScrollSlider(int orientation, double cur, int vis, double min, double max, int res, boolean log)
          constructs a FloatSlider using a given number of slider positions.
 
Method Summary
 double getFloatMaximum()
           
 double getFloatMinimum()
           
 double getFloatValue()
           
static void main(java.lang.String[] args)
          simple test program for ScrollSlider class.
protected  int rangeValue(double dval)
          returns the closest integer in the range of the actual int extents of the base Scrollbar.
 void setAll(double newmin, double newmax, double newcur)
           
 void setFloatMaximum(double newmax)
           
 void setFloatMinimum(double newmin)
           
 void setFloatValue(double newcur)
           
 
Methods inherited from class java.awt.Scrollbar
addAdjustmentListener, addNotify, getAccessibleContext, getAdjustmentListeners, getBlockIncrement, getLineIncrement, getListeners, getMaximum, getMinimum, getOrientation, getPageIncrement, getUnitIncrement, getValue, getValueIsAdjusting, getVisible, getVisibleAmount, paramString, processAdjustmentEvent, processEvent, removeAdjustmentListener, setBlockIncrement, setLineIncrement, setMaximum, setMinimum, setOrientation, setPageIncrement, setUnitIncrement, setValue, setValueIsAdjusting, setValues, setVisibleAmount
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AScrollSlider

public AScrollSlider(int orientation,
                     double cur,
                     int vis,
                     double min,
                     double max,
                     int res,
                     boolean log)
constructs a FloatSlider using a given number of slider positions.

Parameters:
orientation - - Scrollbar.VERTICAL or Scrollbar.HORIZONTAL.
cur - - real valued initial value.
vis - - same as in Scrollbar base class.
min - - real valued range minimum.
max - - real valued range maximum.
res - - number of descrete slider positions.
log - - log scale if true, linear otherwise.

AScrollSlider

public AScrollSlider(int orientation,
                     double cur,
                     int vis,
                     double min,
                     double max,
                     int res)
uses default scale (linear).

Parameters:
orientation - - Scrollbar.VERTICAL or Scrollbar.HORIZONTAL.
cur - - real valued initial value.
vis - - same as in Scrollbar base class.
min - - real valued range minimum.
max - - real valued range maximum.
res - - number of descrete slider positions.

AScrollSlider

public AScrollSlider(int orientation,
                     double cur,
                     double min,
                     double max,
                     boolean log)
uses default visible(20) and resolution(1000).

Parameters:
orientation - - Scrollbar.VERTICAL or Scrollbar.HORIZONTAL.
cur - - real valued initial value.
min - - real valued range minimum.
max - - real valued range maximum.
log - - log scale if true, linear otherwise.

AScrollSlider

public AScrollSlider(int orientation,
                     double cur,
                     double min,
                     double max)
uses default visible(20), resolution(1000), and scale (linear).

Parameters:
orientation - - Scrollbar.VERTICAL or Scrollbar.HORIZONTAL.
cur - - real valued initial value.
min - - real valued range minimum.
max - - real valued range maximum.
Method Detail

rangeValue

protected int rangeValue(double dval)
returns the closest integer in the range of the actual int extents of the base Scrollbar.


getFloatMinimum

public double getFloatMinimum()

getFloatMaximum

public double getFloatMaximum()

getFloatValue

public double getFloatValue()

setFloatMinimum

public void setFloatMinimum(double newmin)

setFloatMaximum

public void setFloatMaximum(double newmax)

setFloatValue

public void setFloatValue(double newcur)

setAll

public void setAll(double newmin,
                   double newmax,
                   double newcur)

main

public static void main(java.lang.String[] args)
simple test program for ScrollSlider class.