|
||||||||||
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.BSlider
public class BSlider
A BSlider is a Widget that allows the user to select a single value by dragging a "thumb" along a bar. It can optionally show tick marks, labels, or both along the bar.
In addition to the event types generated by all Widgets, BSliders generate the following event types:
Nested Class Summary | |
---|---|
static class |
BSlider.Orientation
This inner class represents an orientation for the slider. |
Field Summary | |
---|---|
static BSlider.Orientation |
HORIZONTAL
|
static BSlider.Orientation |
VERTICAL
|
Constructor Summary | |
---|---|
BSlider()
Create a new vertical BSlider. |
|
BSlider(int value,
int minimum,
int maximum,
BSlider.Orientation orientation)
Create a new BSlider. |
Method Summary | |
---|---|
javax.swing.JSlider |
getComponent()
Get the java.awt.Component corresponding to this Widget. |
int |
getMajorTickSpacing()
Get the spacing between major tick marks on the slider. |
int |
getMaximum()
Get the maximum value of the range represented by this BSlider. |
int |
getMinimum()
Get the minimum value of the range represented by this BSlider. |
int |
getMinorTickSpacing()
Get the spacing between minor tick marks on the slider. |
BSlider.Orientation |
getOrientation()
Get the orientation (HORIZONTAL or VERTICAL) of this BSlider. |
boolean |
getShowLabels()
Get whether labels are shown on the slider at the major tick positions. |
boolean |
getShowTicks()
Get whether tick marks are shown on the slider. |
boolean |
getSnapToTicks()
Get whether the thumb of the slider should always snap to the nearest tick position. |
int |
getValue()
Get the current value of this BSlider. |
void |
setMajorTickSpacing(int spacing)
Set the spacing between major tick marks on the slider. |
void |
setMaximum(int value)
Set the maximum value of the range represented by this BSlider. |
void |
setMinimum(int value)
Set the minimum value of the range represented by this BSlider. |
void |
setMinorTickSpacing(int spacing)
Set the spacing between minor tick marks on the slider. |
void |
setOrientation(BSlider.Orientation orientation)
Set the orientation (HORIZONTAL or VERTICAL) of this BSlider. |
void |
setShowLabels(boolean show)
Set whether labels are shown on the slider at the major tick positions. |
void |
setShowTicks(boolean show)
Set whether tick marks are shown on the slider. |
void |
setSnapToTicks(boolean snap)
Set whether the thumb of the slider should always snap to the nearest tick position. |
void |
setValue(int value)
Set the current value of this BSlider. |
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 |
Field Detail |
---|
public static final BSlider.Orientation HORIZONTAL
public static final BSlider.Orientation VERTICAL
Constructor Detail |
---|
public BSlider()
public BSlider(int value, int minimum, int maximum, BSlider.Orientation orientation)
value
- the BSlider's initial valueminimum
- the minimum value for the range represented by the BSlidermaximum
- the maximum value for the range represented by the BSliderorientation
- defines how the BSlider should be drawn and positioned. This should be
HORIZONTAL or VERTICAL.Method Detail |
---|
public javax.swing.JSlider getComponent()
Widget
getComponent
in class Widget
public int getMinimum()
public void setMinimum(int value)
public int getMaximum()
public void setMaximum(int value)
public int getValue()
public void setValue(int value)
public BSlider.Orientation getOrientation()
public void setOrientation(BSlider.Orientation orientation)
public int getMajorTickSpacing()
public void setMajorTickSpacing(int spacing)
The major tick spacing can never be smaller than the minor tick spacing. If the current minor tick spacing is greater than the value passed to this method, then the minor tick spacing will also be set to the same value.
public int getMinorTickSpacing()
public void setMinorTickSpacing(int spacing)
The minor tick spacing can never be larger than the major tick spacing. If the current major tick spacing is less than the value passed to this method, then the major tick spacing will also be set to the same value.
public boolean getShowTicks()
public void setShowTicks(boolean show)
public boolean getShowLabels()
public void setShowLabels(boolean show)
public boolean getSnapToTicks()
public void setSnapToTicks(boolean snap)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |