SilverStream
Application Server 3.5

com.sssw.rt.jform
Class AgcJSlider

java.lang.Object
 |
 +--java.awt.Component
       |
       +--java.awt.Container
             |
             +--javax.swing.JComponent
                   |
                   +--javax.swing.JSlider
                         |
                         +--com.sssw.rt.jform.AgcJSlider
All Implemented Interfaces:
Accessible, AgiHelpInfo, ChangeListener, EventListener, ImageObserver, MenuContainer, Serializable, SwingConstants

public class AgcJSlider
extends JSlider
implements ChangeListener, AgiHelpInfo

A lightweight component that lets the user graphically select a value by sliding a knob within a bounded interval. The slider can show major tick marks, minor tick marks, and tick labels.

AgcJSlider uses the model DefaultBoundedRangeModel, which holds the minimum, maximum, and current values. However, you don't have to interact directly with the model; methods inherited from the JSlider class let you set values in the model.

There are also inherited methods for specifying:

This code changes the minimum value of the slider.

 	slider.setMinimum( -100 );
 

This code creates a new model, sets values, and assigns it to a slider control.

 	DefaultBoundedRangeModel m = 
 		new DefaultBoundedRangeModel();
 	
 	m.setMinimum( fldMin.getValue() );
 	m.setMaximum( fldMax.getValue() );
 	
 	slider.setModel( m );
 	
 

This code changes tick marks and labels.

 	// Calculate increment for 10 labels
 	int increment = ( slider.getMaximum() - slider.getMinimum() ) / 10 ;
 
 	// Display 10 tick marks and label the marks
 	slider.setMajorTickSpacing(increment);
 	Hashtable hshLabels = slider.createStandardLabels(increment);
 	slider.setLabelTable(hshLabels);
 

Properties:
Control Type, Data Column, Enabled, Height, Help Page, Initial Value, Inverted, Left, Major Tick Spacing, Maximum Value, Minimum Value, Minor Tick Spacing, Name, Orientation, Show Labels, Show Ticks, Snap to Ticks, Tool Tip, Top, Visible, Width
Events:
focusGained, focusLost, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, validationFailed, validationTest, valueChanged
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JSlider
JSlider.AccessibleJSlider
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JSlider
changeEvent, changeListener, majorTickSpacing, minorTickSpacing, orientation, sliderModel, snapToTicks
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, 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
 
Constructor Summary
AgcJSlider()
          Creates a horizontal slider with the range 0 to 100 and an initial value of 50.
AgcJSlider(BoundedRangeModel brm)
          Creates a horizontal slider using the specified BoundedRangeModel.
AgcJSlider(int orientation)
          Creates a slider using the specified orientation with the range 0 to 100 and an initial value of 50.
AgcJSlider(int min, int max)
          Creates a horizontal slider with the specified range.
AgcJSlider(int min, int max, int value)
          Creates a horizontal slider with the specified range and initial value.
AgcJSlider(int orientation, int min, int max, int value)
          Creates a slider with the specified orientation, range, and initial value.
 
Method Summary
 Integer getIntegerValue()
          Gets the slider value as an Integer object.
 void setIntegerValue(Integer value)
          Sets the slider value with an Integer object.
 
Methods inherited from class javax.swing.JSlider
addChangeListener, createChangeListener, createStandardLabels, createStandardLabels, fireStateChanged, getAccessibleContext, getExtent, getInverted, getLabelTable, getMajorTickSpacing, getMaximum, getMinimum, getMinorTickSpacing, getModel, getOrientation, getPaintLabels, getPaintTicks, getPaintTrack, getSnapToTicks, getUI, getUIClassID, getValue, getValueIsAdjusting, paramString, removeChangeListener, setExtent, setInverted, setLabelTable, setMajorTickSpacing, setMaximum, setMinimum, setMinorTickSpacing, setModel, setOrientation, setPaintLabels, setPaintTicks, setPaintTrack, setSnapToTicks, setUI, setValue, setValueIsAdjusting, updateLabelUIs, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods implemented from interface com.sssw.rt.form.AgiHelpInfo
getHelpInfo, setHelpInfo
 
Methods implemented from interface javax.swing.event.ChangeListener
stateChanged
 

Constructor Detail

AgcJSlider

public AgcJSlider()
Creates a horizontal slider with the range 0 to 100 and an initial value of 50.

AgcJSlider

public AgcJSlider(BoundedRangeModel brm)
Creates a horizontal slider using the specified BoundedRangeModel.

AgcJSlider

public AgcJSlider(int orientation)
Creates a slider using the specified orientation with the range 0 to 100 and an initial value of 50.
Parameters:
orientation - specifies the slider's orientation; that is, whether the slider knob moves side to side or up and down. Use the constants VERTICAL or HORIZONTAL, which are defined in SwingConstants.
See Also:
SwingConstants

AgcJSlider

public AgcJSlider(int min,
                  int max)
Creates a horizontal slider with the specified range.
Parameters:
min - the value at the low end of the slider.
max - the value at the high end of the slider.

AgcJSlider

public AgcJSlider(int min,
                  int max,
                  int value)
Creates a horizontal slider with the specified range and initial value.
Parameters:
min - the value at the low end of the slider.
max - the value at the high end of the slider.
value - the initial value of the slider knob.

AgcJSlider

public AgcJSlider(int orientation,
                  int min,
                  int max,
                  int value)
Creates a slider with the specified orientation, range, and initial value.
Parameters:
orientation - specifies the slider's orientation; that is, whether the slider knob moves side to side or up and down. Use the constants VERTICAL or HORIZONTAL, which are defined in SwingConstants.
min - the value at the low end of the slider.
max - the value at the high end of the slider.
value - the initial value of the slider knob.
Method Detail

getIntegerValue

public Integer getIntegerValue()
Gets the slider value as an Integer object.
Returns:
an Integer object.

setIntegerValue

public void setIntegerValue(Integer value)
Sets the slider value with an Integer object.
Parameters:
value - an Integer object whose value you want to assign to the slider.

SilverStream
Application Server 3.5