borland Packages  Class Hierarchy  dbswing Package 

DBSliderDataBinder component

java.lang.Object
   +----com.borland.dbswing.DBSliderDataBinder

About the DBSliderDataBinder component

Constructors  Properties  Methods  

Implements DBDataBinder, AccessListener, ColumnAware, DataChangeListener, DataSetAware, Designable, NavigationListener, PropertyChangeListener, Serializable, EventListener, ChangeListener

Note: This is a feature of JBuilder Professional and Enterprise.

DBSliderDataBinder maps the state of a JSlider's BoundedRangeModel to a value in a DataSet numeric type Column. JdbSlider automatically uses a DBSliderDataBinder, and therefore it becomes a data-aware component.

There are two ways to hook up a JSlider to a DBSliderDataBinder. The easier way is to set the JSlider property to a JSlider or a subclass of JSlider. The second way is to make any component using a BoundedRangeModel data-aware by setting DBSliderDataBinder's boundedRangeModel property to the component's model. Note that when you use this approach, you are responsible for opening the DataSet before using it.

You must also set the DBSliderDataBinder's dataSet and columnName properties to specify the DataSet and Column from which the slider value (its current position) is read and to which the slider value is written.

If you set the JSlider property, DBSliderDataBinder binds the background, foreground, and font properties from those defined on Column columnName, if one exists. This does not happen if these properties are set explicitly on DBSliderDataBinder itself.

Besides writing a value to a DataSet when a slider is adjusted, DBSliderDataBinder also ensures that the position of the slider is consistent with the current value of the DataSet Column to which it is attached. If the value in the DataSet is outside the range of DBSliderDataBinder's bounds, DBSliderDataBinder moves the slider to whichever value is closest to the DataSet's value. You can set the unknownDataValueMode property, however, to one of the following values to specify different behavior:

Example:

JSlider jSlider = new JSlider();
DBSliderDataBinder dBSliderDataBinder = new DBSliderDataBinder();
	
// attach the slider to DBSliderDataBinder
dBSliderDataBinder.setJSlider(jSlider);
	
// set the target DataSet and Column
dBSliderDataBinder.setDataSet(dataSet);
dBSliderDataBinder.setColumnName("Quantity")

See also: JdbSlider


DBSliderDataBinder constructors

DBSliderDataBinder properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

DBSliderDataBinder methods

Methods implemented in this class

Methods implemented in java.lang.Object


DBSliderDataBinder constructors

DBSliderDataBinder()

  public DBSliderDataBinder()
Creates a DBSliderDataBinder. Calls the null constructor of its superclass.

DBSliderDataBinder(javax.swing.JSlider)

  public DBSliderDataBinder(JSlider slider)
Creates a DBSliderDataBinder and specifies the JSlider it makes data aware. Calls the null constructor of its superclass.

Parameters:

slider
The JSlider to which DBSliderDataBinder binds to make it data-aware.

DBSliderDataBinder properties

boundedRangeModel

 public BoundedRangeModel getBoundedRangeModel()
 public void setBoundedRangeModel(BoundedRangeModel boundedRangeModel)
Returns and sets the model of the component that DBSliderDataBinder makes data-aware. When you set this property, you are responsible for opening the DataSet before using it. Specifying the model binds the DBSliderDataBinder to the component the model supplies data values to.

columnName

 public String getColumnName()
 public void setColumnName(String columnName)
Returns and sets the column name of the DataSet from which data values are to be read and to which data values are to be written.

See also: DataSet

dataSet

 public DataSet getDataSet()
 public void setDataSet(DataSet dataSet)
Returns and sets the DataSet from which data values are to be read and to which data values are to be written.

See also: columnName

JSlider

 public JSlider getJSlider()
 public void setJSlider(JSlider slider)
Returns and specifies the slider component to which DBSliderDataBinder binds to make it data-aware.

Parameters:

slider
The JSlider that DBSliderDataBinder makes data-aware.

unknownDataValueMode

 public int getUnknownDataValueMode()
 public void setUnknownDataValueMode(int mode)
Returns and sets the policy for setting slider position when synchronizing a slider with a DataSet value outside its bounded model's range. These are the possible values: