|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.smartgwt.client.widgets.BaseWidget
com.smartgwt.client.widgets.Canvas
com.smartgwt.client.widgets.Slider
public class Slider
The Slider class implements a GUI slider widget allowing the user to select a numeric value from within a range by dragging a visual indicicator up and down a track.
The slider will generate events as the user interacts with it and changes its value.
If slider.sliderTarget is specified, moving the slider thumb generates a custom
event named 'sliderMove', sent to the sliderTarget.
If a sliderMove
handler stringMethod is defined on the target, it will be
fired when the slider is moved. The second parameter (available via the variable name
eventInfo
if the handler is a string) is a pointer back to the slider.
The slider will also fire a valueChanged()
method whenever its value is
changed. This can be observed or overridden on the Slider instance to perform some action.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
---|
config, configOnly, id, isElementSet |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
Slider()
|
|
Slider(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
Slider(java.lang.String title)
|
Method Summary | |
---|---|
HandlerRegistration |
addValueChangedHandler(ValueChangedHandler handler)
Add a valueChanged handler. |
protected com.google.gwt.core.client.JavaScriptObject |
create()
|
java.lang.Boolean |
getAnimateThumb()
Should the thumb be animated to its new position when the value is changed programmatically, or by clicking in the slider track. |
java.lang.Boolean |
getAnimateThumbInit()
If thumb animation is enabled, should the thumb be animated to its initial value? |
int |
getAnimateThumbTime()
Duration of thumb animation, in milliseconds. |
java.lang.Boolean |
getCanFocus()
Indicates whether keyboard manipulation of the slider is allowed. |
java.lang.Boolean |
getFlipValues()
Specifies whether the value range of the slider should be flipped so that values increase as the thumb is moved down (for a vertical slider) or to the left (for a horizontal slider). |
int |
getLabelHeight()
The height of the labels used to display the minimum, maximum and current values of the slider. |
int |
getLabelSpacing()
The space around the labels used to display the minimum, maximum and current values of the slider. |
int |
getLabelWidth()
The width of the labels used to display the minimum, maximum and current values of the slider. |
int |
getLength()
Used to set slider height if vertical, slider width if horizontal. Applied to the slider track, not necessarily the entire widget. Overridden by an explicit width/height specification for the widget. |
float |
getMaxValue()
The maximum slider value. |
java.lang.String |
getMaxValueLabel()
The text displayed in the label for the maximum value of the slider. |
float |
getMinValue()
The minimum slider value. |
java.lang.String |
getMinValueLabel()
The text displayed in the label for the minimum value of the slider. |
java.lang.Integer |
getNumValues()
The number of discrete values represented by slider. |
static Slider |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
int |
getRoundPrecision()
If roundValues is false, the slider value will be rounded to this number of
decimal places. |
java.lang.Boolean |
getRoundValues()
Specifies whether the slider value should be rounded to the nearest integer. |
java.lang.Boolean |
getShowRange()
Indicates whether labels for the min and max values of the slider should be displayed. |
java.lang.Boolean |
getShowTitle()
Indicates whether the slider's title should be displayed. |
java.lang.Boolean |
getShowValue()
Indicates whether a label for the value of the slider should be displayed. |
float |
getStepPercent()
The percentage of the total slider that constitutes one discrete step. |
java.lang.String |
getThumbSrc()
The base filename for the slider thumb images. The filenames for the thumb icons are assembled from this base filename and the state of the thumb, as follows: Assume the thumbSrc is set to {baseName}.{extension} The full set of images to be displayed is: For horizontal sliders: h{baseName}.{extension} : default enabled appearance.
h{baseName}_down.{extension} : appearance when the slider is enabled and the
thumb is clicked.
h{baseName}_off.{extension} : appearance when the slider is disabled.
For vertical sliders:
v{baseName}.{extension} : default enabled appearance.
v{baseName}_down.{extension} : appearance when the slider is enabled and the
thumb is clicked.
v{baseName}_off.{extension} : appearance when the slider is disabled.
|
int |
getThumbThickWidth()
The dimension of the thumb perpendicular to the slider track. |
int |
getThumbThinWidth()
The dimension of the thumb parallel to the slider track. |
java.lang.String |
getTitle()
Optional display title for the slider. |
int |
getTrackCapSize()
The height of vertical slider start and end images, or width of horizontal slider start and end images. |
ImageStyle |
getTrackImageType()
The imageType setting for the slider track. |
java.lang.String |
getTrackSrc()
The base filename for the slider track images. The filenames for the track icons are assembled from this base filename and the state of the slider, as follows: Assume the trackSrc is set to {baseName}.{extension} The full set of images to be displayed is: For horizontal sliders: h{baseName}_start.{extension} : start (left edge) of the track for a slider
that is enabled.
h{baseName}_stretch.{extension} : the track for an enabled slider; this may
be centered, tiled, or stretched.
h{baseName}_end.{extension} : end (right edge) of the track for a slider
that is enabled.
h{baseName}_off_start.{extension} : start (left edge) of the track for a slider
that is disabled.
h{baseName}_off_stretch.{extension} : the track for a disabled slider; this
may be centered, tiled, or stretched.
h{baseName}_off_end.{extension} : end (right edge) of the track for a slider
that is disabled.
For vertical sliders:
v{baseName}_start.{extension} : start (bottom edge) of the track for a slider
that is enabled.
v{baseName}_stretch.{extension} : the track for an enabled slider; this may
be centered, tiled, or stretched.
v{baseName}_end.{extension} : end (top edge) of the track for a slider
that is enabled.
v{baseName}_off_start.{extension} : start (bottom edge) of the track for a slider
that is disabled.
v{baseName}_off_stretch.{extension} : the track for a disabled slider; this
may be centered, tiled, or stretched.
v{baseName}_off_end.{extension} : end (top edge) of the track for a slider
that is disabled.
|
int |
getTrackWidth()
The thickness of the track. |
float |
getValue()
The slider value. |
java.lang.Boolean |
getVertical()
Indicates whether this is a vertical or horizontal slider. |
void |
setAnimateThumb(java.lang.Boolean animateThumb)
Should the thumb be animated to its new position when the value is changed programmatically, or by clicking in the slider track. |
void |
setAnimateThumbInit(java.lang.Boolean animateThumbInit)
If thumb animation is enabled, should the thumb be animated to its initial value? |
void |
setAnimateThumbTime(int animateThumbTime)
Duration of thumb animation, in milliseconds. |
void |
setCanFocus(java.lang.Boolean canFocus)
Indicates whether keyboard manipulation of the slider is allowed. |
void |
setFlipValues(java.lang.Boolean flipValues)
Specifies whether the value range of the slider should be flipped so that values increase as the thumb is moved down (for a vertical slider) or to the left (for a horizontal slider). |
void |
setLabelHeight(int labelHeight)
The height of the labels used to display the minimum, maximum and current values of the slider. |
void |
setLabelSpacing(int labelSpacing)
The space around the labels used to display the minimum, maximum and current values of the slider. |
void |
setLabelWidth(int labelWidth)
The width of the labels used to display the minimum, maximum and current values of the slider. |
void |
setLength(int length)
Used to set slider height if vertical, slider width if horizontal. Applied to the slider track, not necessarily the entire widget. Overridden by an explicit width/height specification for the widget. |
void |
setMaxValue(float maxValue)
The maximum slider value. |
void |
setMaxValueLabel(java.lang.String maxValueLabel)
The text displayed in the label for the maximum value of the slider. |
void |
setMinValue(float minValue)
The minimum slider value. |
void |
setMinValueLabel(java.lang.String minValueLabel)
The text displayed in the label for the minimum value of the slider. |
void |
setNumValues(java.lang.Integer numValues)
The number of discrete values represented by slider. |
void |
setRoundPrecision(int roundPrecision)
If roundValues is false, the slider value will be rounded to this number of
decimal places. |
void |
setRoundValues(java.lang.Boolean roundValues)
Specifies whether the slider value should be rounded to the nearest integer. |
void |
setShowRange(java.lang.Boolean showRange)
Indicates whether labels for the min and max values of the slider should be displayed. |
void |
setShowTitle(java.lang.Boolean showTitle)
Indicates whether the slider's title should be displayed. |
void |
setShowValue(java.lang.Boolean showValue)
Indicates whether a label for the value of the slider should be displayed. |
void |
setStepPercent(float stepPercent)
The percentage of the total slider that constitutes one discrete step. |
void |
setThumbSrc(java.lang.String thumbSrc)
The base filename for the slider thumb images. The filenames for the thumb icons are assembled from this base filename and the state of the thumb, as follows: Assume the thumbSrc is set to {baseName}.{extension} The full set of images to be displayed is: For horizontal sliders: h{baseName}.{extension} : default enabled appearance.
h{baseName}_down.{extension} : appearance when the slider is enabled and the
thumb is clicked.
h{baseName}_off.{extension} : appearance when the slider is disabled.
For vertical sliders:
v{baseName}.{extension} : default enabled appearance.
v{baseName}_down.{extension} : appearance when the slider is enabled and the
thumb is clicked.
v{baseName}_off.{extension} : appearance when the slider is disabled.
|
void |
setThumbThickWidth(int thumbThickWidth)
The dimension of the thumb perpendicular to the slider track. |
void |
setThumbThinWidth(int thumbThinWidth)
The dimension of the thumb parallel to the slider track. |
void |
setTitle(java.lang.String title)
Optional display title for the slider. |
void |
setTrackCapSize(int trackCapSize)
The height of vertical slider start and end images, or width of horizontal slider start and end images. |
void |
setTrackImageType(ImageStyle trackImageType)
The imageType setting for the slider track. |
void |
setTrackSrc(java.lang.String trackSrc)
The base filename for the slider track images. The filenames for the track icons are assembled from this base filename and the state of the slider, as follows: Assume the trackSrc is set to {baseName}.{extension} The full set of images to be displayed is: For horizontal sliders: h{baseName}_start.{extension} : start (left edge) of the track for a slider
that is enabled.
h{baseName}_stretch.{extension} : the track for an enabled slider; this may
be centered, tiled, or stretched.
h{baseName}_end.{extension} : end (right edge) of the track for a slider
that is enabled.
h{baseName}_off_start.{extension} : start (left edge) of the track for a slider
that is disabled.
h{baseName}_off_stretch.{extension} : the track for a disabled slider; this
may be centered, tiled, or stretched.
h{baseName}_off_end.{extension} : end (right edge) of the track for a slider
that is disabled.
For vertical sliders:
v{baseName}_start.{extension} : start (bottom edge) of the track for a slider
that is enabled.
v{baseName}_stretch.{extension} : the track for an enabled slider; this may
be centered, tiled, or stretched.
v{baseName}_end.{extension} : end (top edge) of the track for a slider
that is enabled.
v{baseName}_off_start.{extension} : start (bottom edge) of the track for a slider
that is disabled.
v{baseName}_off_stretch.{extension} : the track for a disabled slider; this
may be centered, tiled, or stretched.
v{baseName}_off_end.{extension} : end (top edge) of the track for a slider
that is disabled.
|
void |
setTrackWidth(int trackWidth)
The thickness of the track. |
void |
setValue(float value)
The slider value. |
void |
setVertical(java.lang.Boolean vertical)
Indicates whether this is a vertical or horizontal slider. |
java.lang.Boolean |
valueIsChanging()
Call this method in your addValueChangedHandler(com.smartgwt.client.widgets.events.ValueChangedHandler) handler to determine whether the
value change is due to an ongoing drag interaction (true) or due to a thumb-release,
mouse click, keypress, or programmatic event (false). |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public Slider()
public Slider(com.google.gwt.core.client.JavaScriptObject jsObj)
public Slider(java.lang.String title)
Method Detail |
---|
public static Slider getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
protected com.google.gwt.core.client.JavaScriptObject create()
create
in class Canvas
public void setTitle(java.lang.String title)
setTitle
in class Canvas
title
- title Default value is "Set Value"public java.lang.String getTitle()
getTitle
in class Canvas
public void setLength(int length)
length
- length Default value is 200public int getLength()
public void setVertical(java.lang.Boolean vertical)
vertical
- vertical Default value is truepublic java.lang.Boolean getVertical()
public void setThumbThickWidth(int thumbThickWidth)
thumbThickWidth
- thumbThickWidth Default value is 23public int getThumbThickWidth()
public void setThumbThinWidth(int thumbThinWidth)
thumbThinWidth
- thumbThinWidth Default value is 17public int getThumbThinWidth()
public void setTrackWidth(int trackWidth)
trackWidth
- trackWidth Default value is 7public int getTrackWidth()
public void setThumbSrc(java.lang.String thumbSrc)
{baseName}.{extension}
h{baseName}.{extension}
: default enabled appearance.
h{baseName}_down.{extension}
: appearance when the slider is enabled and the
thumb is clicked.
h{baseName}_off.{extension}
: appearance when the slider is disabled.
v{baseName}.{extension}
: default enabled appearance.
v{baseName}_down.{extension}
: appearance when the slider is enabled and the
thumb is clicked.
v{baseName}_off.{extension}
: appearance when the slider is disabled.
thumbSrc
- thumbSrc Default value is "thumb.gif"public java.lang.String getThumbSrc()
{baseName}.{extension}
h{baseName}.{extension}
: default enabled appearance.
h{baseName}_down.{extension}
: appearance when the slider is enabled and the
thumb is clicked.
h{baseName}_off.{extension}
: appearance when the slider is disabled.
v{baseName}.{extension}
: default enabled appearance.
v{baseName}_down.{extension}
: appearance when the slider is enabled and the
thumb is clicked.
v{baseName}_off.{extension}
: appearance when the slider is disabled.
public void setTrackSrc(java.lang.String trackSrc)
{baseName}.{extension}
h{baseName}_start.{extension}
: start (left edge) of the track for a slider
that is enabled.
h{baseName}_stretch.{extension}
: the track for an enabled slider; this may
be centered, tiled, or stretched.
h{baseName}_end.{extension}
: end (right edge) of the track for a slider
that is enabled.
h{baseName}_off_start.{extension}
: start (left edge) of the track for a slider
that is disabled.
h{baseName}_off_stretch.{extension}
: the track for a disabled slider; this
may be centered, tiled, or stretched.
h{baseName}_off_end.{extension}
: end (right edge) of the track for a slider
that is disabled.
v{baseName}_start.{extension}
: start (bottom edge) of the track for a slider
that is enabled.
v{baseName}_stretch.{extension}
: the track for an enabled slider; this may
be centered, tiled, or stretched.
v{baseName}_end.{extension}
: end (top edge) of the track for a slider
that is enabled.
v{baseName}_off_start.{extension}
: start (bottom edge) of the track for a slider
that is disabled.
v{baseName}_off_stretch.{extension}
: the track for a disabled slider; this
may be centered, tiled, or stretched.
v{baseName}_off_end.{extension}
: end (top edge) of the track for a slider
that is disabled.
trackSrc
- trackSrc Default value is "track.gif"public java.lang.String getTrackSrc()
{baseName}.{extension}
h{baseName}_start.{extension}
: start (left edge) of the track for a slider
that is enabled.
h{baseName}_stretch.{extension}
: the track for an enabled slider; this may
be centered, tiled, or stretched.
h{baseName}_end.{extension}
: end (right edge) of the track for a slider
that is enabled.
h{baseName}_off_start.{extension}
: start (left edge) of the track for a slider
that is disabled.
h{baseName}_off_stretch.{extension}
: the track for a disabled slider; this
may be centered, tiled, or stretched.
h{baseName}_off_end.{extension}
: end (right edge) of the track for a slider
that is disabled.
v{baseName}_start.{extension}
: start (bottom edge) of the track for a slider
that is enabled.
v{baseName}_stretch.{extension}
: the track for an enabled slider; this may
be centered, tiled, or stretched.
v{baseName}_end.{extension}
: end (top edge) of the track for a slider
that is enabled.
v{baseName}_off_start.{extension}
: start (bottom edge) of the track for a slider
that is disabled.
v{baseName}_off_stretch.{extension}
: the track for a disabled slider; this
may be centered, tiled, or stretched.
v{baseName}_off_end.{extension}
: end (top edge) of the track for a slider
that is disabled.
public void setTrackCapSize(int trackCapSize)
trackCapSize
- trackCapSize Default value is 6public int getTrackCapSize()
public void setTrackImageType(ImageStyle trackImageType)
trackImageType
- trackImageType Default value is "stretch"public ImageStyle getTrackImageType()
public void setShowTitle(java.lang.Boolean showTitle)
showTitle
- showTitle Default value is truepublic java.lang.Boolean getShowTitle()
public void setShowRange(java.lang.Boolean showRange)
showRange
- showRange Default value is truepublic java.lang.Boolean getShowRange()
public void setShowValue(java.lang.Boolean showValue)
showValue
- showValue Default value is truepublic java.lang.Boolean getShowValue()
public void setLabelWidth(int labelWidth)
labelWidth
- labelWidth Default value is 50public int getLabelWidth()
public void setLabelHeight(int labelHeight)
labelHeight
- labelHeight Default value is 20public int getLabelHeight()
public void setLabelSpacing(int labelSpacing)
labelSpacing
- labelSpacing Default value is 5public int getLabelSpacing()
public void setValue(float value)
value
- the new value. Default value is 1public float getValue()
public void setMinValue(float minValue)
minValue
- minValue Default value is 1public float getMinValue()
public void setMinValueLabel(java.lang.String minValueLabel)
minValueLabel
- minValueLabel Default value is nullpublic java.lang.String getMinValueLabel()
public void setMaxValue(float maxValue)
maxValue
- maxValue Default value is 100public float getMaxValue()
public void setMaxValueLabel(java.lang.String maxValueLabel)
maxValueLabel
- maxValueLabel Default value is nullpublic java.lang.String getMaxValueLabel()
public void setNumValues(java.lang.Integer numValues)
minValue
and maxValue
) will be divided into
this many steps. As the thumb is moved along the track it will only select these values
and appear to jump between the steps.
numValues
- numValues Default value is nullpublic java.lang.Integer getNumValues()
minValue
and maxValue
) will be divided into
this many steps. As the thumb is moved along the track it will only select these values
and appear to jump between the steps.
public void setRoundValues(java.lang.Boolean roundValues)
roundPrecision
.
roundValues
- roundValues Default value is truepublic java.lang.Boolean getRoundValues()
roundPrecision
.
public void setRoundPrecision(int roundPrecision)
roundValues
is false, the slider value will be rounded to this number of
decimal places. If set to null the value will not be rounded
roundPrecision
- roundPrecision Default value is 1public int getRoundPrecision()
roundValues
is false, the slider value will be rounded to this number of
decimal places. If set to null the value will not be rounded
public void setFlipValues(java.lang.Boolean flipValues)
flipValues
- flipValues Default value is falsepublic java.lang.Boolean getFlipValues()
public void setCanFocus(java.lang.Boolean canFocus)
setCanFocus
in class Canvas
canFocus
- canFocus Default value is truepublic java.lang.Boolean getCanFocus()
getCanFocus
in class Canvas
public void setStepPercent(float stepPercent)
stepPercent
- stepPercent Default value is 5public float getStepPercent()
public void setAnimateThumb(java.lang.Boolean animateThumb)
animateThumb
- animateThumb Default value is truepublic java.lang.Boolean getAnimateThumb()
public void setAnimateThumbTime(int animateThumbTime)
animateThumbTime
- animateThumbTime Default value is 250public int getAnimateThumbTime()
public void setAnimateThumbInit(java.lang.Boolean animateThumbInit)
animateThumbInit
- animateThumbInit Default value is falsepublic java.lang.Boolean getAnimateThumbInit()
public HandlerRegistration addValueChangedHandler(ValueChangedHandler handler)
This method is called when the slider value changes. This occurs when the setValue method is called, or when the slider is moved. Observe this method to be notified when the slider value changes.
addValueChangedHandler
in interface HasValueChangedHandlers
handler
- the valueChanged handler
HandlerRegistration
used to remove this handlerpublic java.lang.Boolean valueIsChanging()
addValueChangedHandler(com.smartgwt.client.widgets.events.ValueChangedHandler)
handler to determine whether the
value change is due to an ongoing drag interaction (true) or due to a thumb-release,
mouse click, keypress, or programmatic event (false). You may choose to execute temporary or
partial updates while the slider thumb is dragged, and final updates or persistence of the value
in response to the other events.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |