Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.view.swing
Class SSlider  view SSlider download SSlider.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JSlider
                  extended byorg.scopemvc.view.swing.SSlider
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, org.scopemvc.view.util.ModelBindable, org.scopemvc.core.PropertyView, Refreshable, java.io.Serializable, javax.swing.SwingConstants, org.scopemvc.core.View

public class SSlider
extends javax.swing.JSlider
implements org.scopemvc.core.PropertyView, org.scopemvc.view.util.ModelBindable, Refreshable

A JSlider whose value is bound to an int property of a model object.

Note that the Selector specified for a SCheckbox must select a single Integer or int property.

SSlider responds to the bound model or the particular bound property becoming read-only by disabling itself. A SSlider is also disabled if it has no bound model or property, or the property is a null Integer.

Version:
$Revision: 1.3 $ $Date: 2002/01/26 09:46:20 $

Nested Class Summary
 
Nested classes inherited from class javax.swing.JSlider
javax.swing.JSlider.AccessibleJSlider
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  SwingBoundModel boundModel
          Helper to manage model to view binding.
private static org.apache.commons.logging.Log LOG
           
private  ValidationHelper validationHelper
          Helper to manage validation state.
private  boolean valueIsNull
          SSlider can "hold" a null when bound to a Integer property that happens to be null.
 
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.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SSlider()
           
 
Method Summary
 javax.swing.JToolTip createToolTip()
          Return the toolTip property of this component, creating it and setting it if it is currently null.
protected  void fireStateChanged()
          Sends a ChangeEvent to all registered listeners, with this slider as the source.
 java.lang.Object getBoundModel()
           
 org.scopemvc.core.Controller getController()
          Don't assign a Controller to SCheckBox, instead delegate to the containing SwingView that has a parent Controller.
 org.scopemvc.core.Selector getSelector()
           
 java.lang.Object getViewValue()
          Get the current value (what would be set as a property of the bound model object) being presented on the View.
 void issueControl(org.scopemvc.core.Control inControl)
          Don't assign a Controller to SSlider, instead delegate to the containing SwingView that has a parent Controller.
 void refresh()
          Update the widget with the current state of the bound model.
 void setBoundModel(java.lang.Object inModel)
           
 void setController(org.scopemvc.core.Controller inController)
          Don't assign a Controller to SCheckBox, instead delegate to the containing SwingView that has a parent Controller.
 void setSelector(org.scopemvc.core.Selector inSelector)
           
 void setSelectorString(java.lang.String inSelectorString)
           
 void updateFromProperty(java.lang.Object inValue, boolean inReadOnly)
          Incoming value is a Boolean or null.
 void validationFailed(java.lang.Exception inException)
          Validation failed while getting a value from View into the bound model object.
 void validationSuccess()
          Clear previous validation failure.
 
Methods inherited from class javax.swing.JSlider
addChangeListener, createChangeListener, createStandardLabels, createStandardLabels, getAccessibleContext, getChangeListeners, 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, addVetoableChangeListener, computeVisibleRect, contains, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.image.ImageObserver
imageUpdate
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent, remove
 

Field Detail

LOG

private static final org.apache.commons.logging.Log LOG

boundModel

private SwingBoundModel boundModel
Helper to manage model to view binding.


validationHelper

private ValidationHelper validationHelper
Helper to manage validation state.


valueIsNull

private boolean valueIsNull
SSlider can "hold" a null when bound to a Integer property that happens to be null.

Constructor Detail

SSlider

public SSlider()
Method Detail

getBoundModel

public final java.lang.Object getBoundModel()
Specified by:
getBoundModel in interface org.scopemvc.core.View

setBoundModel

public final void setBoundModel(java.lang.Object inModel)
Specified by:
setBoundModel in interface org.scopemvc.core.View

getSelector

public final org.scopemvc.core.Selector getSelector()
Specified by:
getSelector in interface org.scopemvc.core.PropertyView

setSelector

public final void setSelector(org.scopemvc.core.Selector inSelector)
Specified by:
setSelector in interface org.scopemvc.core.PropertyView

setSelectorString

public final void setSelectorString(java.lang.String inSelectorString)

updateFromProperty

public void updateFromProperty(java.lang.Object inValue,
                               boolean inReadOnly)
Incoming value is a Boolean or null.

Specified by:
updateFromProperty in interface org.scopemvc.view.util.ModelBindable

getViewValue

public java.lang.Object getViewValue()
Description copied from interface: org.scopemvc.view.util.ModelBindable
Get the current value (what would be set as a property of the bound model object) being presented on the View.

Specified by:
getViewValue in interface org.scopemvc.view.util.ModelBindable

validationFailed

public void validationFailed(java.lang.Exception inException)
Description copied from interface: org.scopemvc.view.util.ModelBindable
Validation failed while getting a value from View into the bound model object. Use this to indicate to the user that the value being edited is invalid.

Specified by:
validationFailed in interface org.scopemvc.view.util.ModelBindable

validationSuccess

public void validationSuccess()
Description copied from interface: org.scopemvc.view.util.ModelBindable
Clear previous validation failure.

Specified by:
validationSuccess in interface org.scopemvc.view.util.ModelBindable

createToolTip

public javax.swing.JToolTip createToolTip()
Description copied from class: javax.swing.JComponent
Return the toolTip property of this component, creating it and setting it if it is currently null. This method can be overridden in subclasses which wish to control the exact form of tooltip created.


fireStateChanged

protected void fireStateChanged()
Description copied from class: javax.swing.JSlider
Sends a javax.swing.event.ChangeEvent to all registered listeners, with this slider as the source.


setController

public void setController(org.scopemvc.core.Controller inController)
Don't assign a Controller to SCheckBox, instead delegate to the containing SwingView that has a parent Controller.

Specified by:
setController in interface org.scopemvc.core.View

getController

public org.scopemvc.core.Controller getController()
Don't assign a Controller to SCheckBox, instead delegate to the containing SwingView that has a parent Controller.

Specified by:
getController in interface org.scopemvc.core.View

issueControl

public void issueControl(org.scopemvc.core.Control inControl)
Don't assign a Controller to SSlider, instead delegate to the containing SwingView that has a parent Controller.

Specified by:
issueControl in interface org.scopemvc.core.View

refresh

public void refresh()
Description copied from interface: Refreshable
Update the widget with the current state of the bound model. Probably something like this:
     Object propertyValue = boundModel.getPropertyValue();
     boolean propertyReadOnly = boundModel.getPropertyReadOnly();
     updateFromProperty(propertyValue, propertyReadOnly);
 

Specified by:
refresh in interface Refreshable