|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbuoy.event.EventSource
buoy.widget.Widget
buoy.widget.BSpinner
public class BSpinner
A BSpinner is a Widget that allows the user to select a value from an ordered sequence. It allows the user to enter a value, and also provides a pair of arrows for stepping through the values in the sequence.
The list of allowed values is determined by a javax.swing.SpinnerModel
. BSpinner
provides constructors for handling the most common cases: a range of numbers, a date, or a fixed
list of objects. For other cases, you can explicitly set the model by calling setModel()
,
or by using the constructor which takes a SpinnerModel
.
In addition to the event types generated by all Widgets, BSpinners generate the following event types:
Constructor Summary | |
---|---|
BSpinner()
Create a new BSpinner which allows the user to select an arbitrary integer. |
|
BSpinner(java.util.Date date)
Create a new BSpinner which allows the user to select a date. |
|
BSpinner(double value,
double min,
double max,
double step)
Create a new BSpinner which allows the user to select floating point numbers in a fixed range. |
|
BSpinner(int value,
int min,
int max,
int step)
Create a new BSpinner which allows the user to select integers in a fixed range. |
|
BSpinner(java.lang.Object[] values)
Create a new BSpinner which allows the user to select from a fixed list of objects. |
|
BSpinner(javax.swing.SpinnerModel model)
Create a new BSpinner. |
Method Summary | |
---|---|
void |
commitEdit()
If the user adjusts the spinner by typing a value (rather than clicking the arrows), the new value is not actually parsed and "committed" until they press return. |
javax.swing.JSpinner |
getComponent()
Get the java.awt.Component corresponding to this Widget. |
javax.swing.SpinnerModel |
getModel()
Get the model for this spinner. |
java.lang.Object |
getValue()
Get the current value of the spinner. |
void |
setModel(javax.swing.SpinnerModel model)
Set the model for this spinner. |
void |
setValue(java.lang.Object value)
Set the current value of the spinner. |
Methods inherited from class buoy.widget.Widget |
---|
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible |
Methods inherited from class buoy.event.EventSource |
---|
addEventLink, addEventLink, removeEventLink |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BSpinner()
public BSpinner(javax.swing.SpinnerModel model)
model
- the model which specifies the values for the spinner.public BSpinner(int value, int min, int max, int step)
value
- the initial valuemin
- the minimum allowed valuemax
- the maximum allowed valuestep
- the amount by which the value changes when the user clicks the arrowspublic BSpinner(double value, double min, double max, double step)
value
- the initial valuemin
- the minimum allowed valuemax
- the maximum allowed valuestep
- the amount by which the value changes when the user clicks the arrowspublic BSpinner(java.util.Date date)
date
- the initial valuepublic BSpinner(java.lang.Object[] values)
values
- the list of allowed valuesMethod Detail |
---|
public javax.swing.JSpinner getComponent()
Widget
getComponent
in class Widget
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
public void commitEdit() throws java.text.ParseException
Note: calling commitEdit() will not generate a ValueChangedEvent.
java.text.ParseException
public javax.swing.SpinnerModel getModel()
public void setModel(javax.swing.SpinnerModel model)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |