Business Components

oracle.jbo.uicli.jui
Class JUSliderAttrBinding

java.lang.Object
  |
  +--oracle.jbo.uicli.binding.JUControlBinding
        |
        +--oracle.jbo.uicli.binding.JUCtrlValueBinding
              |
              +--oracle.jbo.uicli.binding.JUCtrlAttrsBinding
                    |
                    +--oracle.jbo.uicli.jui.JUSliderAttrBinding
All Implemented Interfaces:
AttributeList, javax.swing.BoundedRangeModel, javax.swing.event.ChangeListener, java.util.EventListener

public class JUSliderAttrBinding
extends JUCtrlAttrsBinding
implements javax.swing.BoundedRangeModel, javax.swing.event.ChangeListener

Implements binding a JSlider control with a BC4J Attribute

This binding sets the minimum, maximum and the extent values of the slider and on change of currency in the associated rowset, displays the associated value by adjusting the slider between the minimum and maximum values. Note that the minimum and maximum values should be provided such that all possible values of the associated attribute in a RowSet can be displayed in the slider.


Constructor Summary
JUSliderAttrBinding(javax.swing.JSlider control, JUIteratorBinding iterBinding, java.lang.String attrName, int min, int max, int ext)
          Binds the given slider control to display and update values from the given attribute in a BC4J RowSet.
 
Method Summary
TypeMethod
 void addChangeListener(javax.swing.event.ChangeListener x)
           
 void addControlToPanel(java.lang.Object panel, java.lang.Object layoutObject, java.lang.Object layoutCons)
          *** For internal framework use only ***
static javax.swing.BoundedRangeModel createAttributeBinding(JUFormBinding formBinding, javax.swing.JSlider control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, int min, int max, int ext)
          Creates a binding for the JSlider control.
 int getExtent()
           
static javax.swing.BoundedRangeModel getInstance(JUFormBinding formBinding, javax.swing.JSlider control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, java.lang.String attrName, int min, int max, int ext)
          Deprecated. use createAttributeBinding method instead.
 int getMaximum()
           
 int getMinimum()
           
protected  javax.swing.BoundedRangeModel getModelImpl(javax.swing.JSlider sb)
          Registers the BoundedRangeModel that this binding works with.
 int getValue()
           
 java.lang.Object getValueAt(int attrIndex)
          Returns the current value indicated by the JSlider control.
 boolean getValueIsAdjusting()
           
 void removeChangeListener(javax.swing.event.ChangeListener x)
           
 void setDataValueAt(java.lang.Object value, int attrIndex)
          Use this method to update the slider value as well as value in the associated BC4J attribute.
 void setExtent(int newExtent)
           
 void setMaximum(int newMaximum)
           
 void setMinimum(int newMinimum)
           
 void setRangeProperties(int value, int extent, int min, int max, boolean adjusting)
           
 void setValue(int newValue)
           
 void setValueAt(java.lang.Object value, int attrIndex)
          Sets the current value in the JSlider control.
 void setValueIsAdjusting(boolean b)
           
 void stateChanged(javax.swing.event.ChangeEvent e)
          Sets the BC4J attribute value as per the change in the JSlider current value.
 
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlAttrsBinding
updateNavigated, updateRangeScrolled, updateValuesFromRow, updateValuesFromRows
 
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding
findAttributeDef, getAttribute, getAttribute, getAttributeCount, getAttributeDef, getAttributeDefs, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeIndexOf, getAttributeNames, isAttributeUpdateable, setAttribute, setAttribute, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, stopEditing, updateRowDeleted, updateRowInserted
 
Methods inherited from class oracle.jbo.uicli.binding.JUControlBinding
executeQuery, executeQueryIfNeeded, getAllRowsInRange, getApplicationModule, getControl, getCurrentRow, getDef, getFormBinding, getIteratorBinding, getLayoutObject, getName, getRowAtRangeIndex, getRowIterator, getTransaction, getViewObject, isControlQueriable, reportException, setFormBinding, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JUSliderAttrBinding

public JUSliderAttrBinding(javax.swing.JSlider control,
                           JUIteratorBinding iterBinding,
                           java.lang.String attrName,
                           int min,
                           int max,
                           int ext)
Binds the given slider control to display and update values from the given attribute in a BC4J RowSet.
Parameters:
control - JSlider control to bind a BC4J attribute with.
iterBinding - Iterator binding that provides the RowSet which this binding should work with.
attrName - The attribute name in the RowSet which this binding works with.
min - Minimum value that the JSlider displays (what the starting value should be in the JSlider control.
max - Maximum value that the JSlider displays (what the end value should be in the control).
ext - Determines the Extent value for the JSlider control.
Method Detail

getModelImpl

protected javax.swing.BoundedRangeModel getModelImpl(javax.swing.JSlider sb)
Registers the BoundedRangeModel that this binding works with. If the slider has a model, this method registers that with this binding and returns the model. If the control or model is null, then this method creates a DefaultBoundedRangeModel and returns that.

addControlToPanel

public void addControlToPanel(java.lang.Object panel,
                              java.lang.Object layoutObject,
                              java.lang.Object layoutCons)
*** For internal framework use only ***
Overrides:
addControlToPanel in class JUControlBinding

getValueAt

public java.lang.Object getValueAt(int attrIndex)
Returns the current value indicated by the JSlider control.
Overrides:
getValueAt in class JUCtrlAttrsBinding

setValueAt

public void setValueAt(java.lang.Object value,
                       int attrIndex)
Sets the current value in the JSlider control. This method adjusts the position of JSlider current value indicator based on the input value and the minimum and maximum value the JSlider is set to handle.
Overrides:
setValueAt in class JUCtrlAttrsBinding

setDataValueAt

public void setDataValueAt(java.lang.Object value,
                           int attrIndex)
Use this method to update the slider value as well as value in the associated BC4J attribute.
Overrides:
setDataValueAt in class JUCtrlAttrsBinding

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Sets the BC4J attribute value as per the change in the JSlider current value.
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

getMinimum

public int getMinimum()
Specified by:
getMinimum in interface javax.swing.BoundedRangeModel

setMinimum

public void setMinimum(int newMinimum)
Specified by:
setMinimum in interface javax.swing.BoundedRangeModel

getMaximum

public int getMaximum()
Specified by:
getMaximum in interface javax.swing.BoundedRangeModel

setMaximum

public void setMaximum(int newMaximum)
Specified by:
setMaximum in interface javax.swing.BoundedRangeModel

getValue

public int getValue()
Specified by:
getValue in interface javax.swing.BoundedRangeModel

setValue

public void setValue(int newValue)
Specified by:
setValue in interface javax.swing.BoundedRangeModel

setValueIsAdjusting

public void setValueIsAdjusting(boolean b)
Specified by:
setValueIsAdjusting in interface javax.swing.BoundedRangeModel

getValueIsAdjusting

public boolean getValueIsAdjusting()
Specified by:
getValueIsAdjusting in interface javax.swing.BoundedRangeModel

getExtent

public int getExtent()
Specified by:
getExtent in interface javax.swing.BoundedRangeModel

setExtent

public void setExtent(int newExtent)
Specified by:
setExtent in interface javax.swing.BoundedRangeModel

setRangeProperties

public void setRangeProperties(int value,
                               int extent,
                               int min,
                               int max,
                               boolean adjusting)
Specified by:
setRangeProperties in interface javax.swing.BoundedRangeModel

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener x)
Specified by:
addChangeListener in interface javax.swing.BoundedRangeModel

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener x)
Specified by:
removeChangeListener in interface javax.swing.BoundedRangeModel

createAttributeBinding

public static javax.swing.BoundedRangeModel createAttributeBinding(JUFormBinding formBinding,
                                                                   javax.swing.JSlider control,
                                                                   java.lang.String voInstanceName,
                                                                   java.lang.String voIterName,
                                                                   java.lang.String voIterBindingName,
                                                                   java.lang.String attrName,
                                                                   int min,
                                                                   int max,
                                                                   int ext)
Creates a binding for the JSlider control.
Parameters:
formBinding - The containing JUPanelBinding in which the given iterator binding would be found/created.
control - JSlider control to bind a BC4J attribute with.
voInstanceName - Name of the instance of the ViewObject in a BC4J ApplicationModule
voIterName - Runtime instance name of the iterator in the ViewObject (optional)
voIterBindingName - Instance name of the iterator binding that uniquely identifies an
attrName - The attribute name in the RowSet which this binding works with.
min - Minimum value that the JSlider displays (what the starting value should be in the JSlider control.
max - Maximum value that the JSlider displays (what the end value should be in the control).
ext - Determines the Extent value for the JSlider control.

getInstance

public static javax.swing.BoundedRangeModel getInstance(JUFormBinding formBinding,
                                                        javax.swing.JSlider control,
                                                        java.lang.String voInstanceName,
                                                        java.lang.String voIterName,
                                                        java.lang.String voIterBindingName,
                                                        java.lang.String attrName,
                                                        int min,
                                                        int max,
                                                        int ext)
Deprecated. use createAttributeBinding method instead.


Business Components