|
|||||||||
| 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 indicator 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 |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
|---|
config, configOnly, id, isElementSet, scClassName |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Slider()
|
|
Slider(JavaScriptObject jsObj)
|
|
Slider(String title)
|
|
| Method Summary | |
|---|---|
HandlerRegistration |
addValueChangedHandler(ValueChangedHandler handler)
Add a valueChanged handler. |
protected JavaScriptObject |
create()
|
Boolean |
getAnimateThumb()
Should the thumb be animated to its new position when the value is changed programmatically, or by clicking in the slider track. |
Boolean |
getAnimateThumbInit()
If thumb animation is enabled, should the thumb be animated to its initial value? |
int |
getAnimateThumbTime()
Duration of thumb animation, in milliseconds. |
Boolean |
getCanFocus()
Indicates whether keyboard manipulation of the slider is allowed. |
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). |
String |
getHThumbStyle()
Optional CSS style for the thumb for a horizontally oriented slider. |
String |
getHTrackStyle()
Optional CSS style for the track for a horizontally oriented 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. |
float |
getMaxValue()
The maximum slider value. |
String |
getMaxValueLabel()
The text displayed in the label for the maximum value of the slider. |
float |
getMinValue()
The minimum slider value. |
String |
getMinValueLabel()
The text displayed in the label for the minimum value of the slider. |
Integer |
getNumValues()
The number of discrete values represented by slider. |
static Slider |
getOrCreateRef(JavaScriptObject jsObj)
|
int |
getRoundPrecision()
If roundValues is false, the slider value will be rounded to
this number of decimal places. |
Boolean |
getRoundValues()
Specifies whether the slider value should be rounded to the nearest integer. |
Boolean |
getShowRange()
Indicates whether labels for the min and max values of the slider should be displayed. |
Boolean |
getShowTitle()
Indicates whether the slider's title should be displayed. |
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. |
String |
getThumbSrc()
The base filename for the slider thumb images. |
int |
getThumbThickWidth()
The dimension of the thumb perpendicular to the slider track. |
int |
getThumbThinWidth()
The dimension of the thumb parallel to the slider track. |
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. |
String |
getTrackSrc()
The base filename for the slider track images. |
int |
getTrackWidth()
The thickness of the track. |
float |
getValue()
The slider value. |
Boolean |
getVertical()
Indicates whether this is a vertical or horizontal slider. |
String |
getVThumbStyle()
Optional CSS style for the thumb for a vertically oriented slider. |
String |
getVTrackStyle()
Optional CSS style for the track for a vertically oriented slider. |
void |
setAnimateThumb(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(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(Boolean canFocus)
Indicates whether keyboard manipulation of the slider is allowed. |
static void |
setDefaultProperties(Slider sliderProperties)
Class level method to set the default properties of this class. |
void |
setFlipValues(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 |
setHThumbStyle(String hThumbStyle)
Optional CSS style for the thumb for a horizontally oriented slider. |
void |
setHTrackStyle(String hTrackStyle)
Optional CSS style for the track for a horizontally oriented 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. |
void |
setMaxValue(float maxValue)
The maximum slider value. |
void |
setMaxValueLabel(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(String minValueLabel)
The text displayed in the label for the minimum value of the slider. |
void |
setNumValues(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(Boolean roundValues)
Specifies whether the slider value should be rounded to the nearest integer. |
void |
setShowRange(Boolean showRange)
Indicates whether labels for the min and max values of the slider should be displayed. |
void |
setShowTitle(Boolean showTitle)
Indicates whether the slider's title should be displayed. |
void |
setShowValue(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(String thumbSrc)
The base filename for the slider thumb images. |
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(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(String trackSrc)
The base filename for the slider track images. |
void |
setTrackWidth(int trackWidth)
The thickness of the track. |
void |
setValue(float value)
The slider value. |
void |
setVertical(Boolean vertical)
Indicates whether this is a vertical or horizontal slider. |
void |
setVThumbStyle(String vThumbStyle)
Optional CSS style for the thumb for a vertically oriented slider. |
void |
setVTrackStyle(String vTrackStyle)
Optional CSS style for the track for a vertically oriented slider. |
Boolean |
valueIsChanging()
Call this method in your Slider.valueChanged 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 |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
| 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, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, 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(JavaScriptObject jsObj)
public Slider(String title)
| Method Detail |
|---|
public static Slider getOrCreateRef(JavaScriptObject jsObj)
protected JavaScriptObject create()
create in class Canvaspublic void setAnimateThumb(Boolean animateThumb)
animateThumb - animateThumb Default value is truepublic Boolean getAnimateThumb()
public void setAnimateThumbInit(Boolean animateThumbInit)
animateThumbInit - animateThumbInit Default value is falsepublic Boolean getAnimateThumbInit()
public void setAnimateThumbTime(int animateThumbTime)
animateThumbTime - animateThumbTime Default value is 250public int getAnimateThumbTime()
public void setCanFocus(Boolean canFocus)
setCanFocus in class CanvascanFocus - canFocus Default value is trueFocus overview and related methods,
Focus & Tabbing Examplepublic Boolean getCanFocus()
getCanFocus in class CanvasFocus overview and related methods,
Focus & Tabbing Examplepublic void setFlipValues(Boolean flipValues)
flipValues property of the slider
flipValues - flip slider values?. Default value is falsepublic Boolean getFlipValues()
public void setHThumbStyle(String hThumbStyle)
throws IllegalStateException
Will have the suffix "down" added when the mouse is down on the thumb, and "Disabled" added when the slider is disabled.
hThumbStyle - hThumbStyle Default value is null
IllegalStateException - this property cannot be changed after the component has been createdpublic String getHThumbStyle()
Will have the suffix "down" added when the mouse is down on the thumb, and "Disabled" added when the slider is disabled.
public void setHTrackStyle(String hTrackStyle)
throws IllegalStateException
Will have the suffix "Disabled" added when the slider is disabled.
hTrackStyle - hTrackStyle Default value is null
IllegalStateException - this property cannot be changed after the component has been createdpublic String getHTrackStyle()
Will have the suffix "Disabled" added when the slider is disabled.
public void setLabelHeight(int labelHeight)
labelHeight property of the slider
labelHeight - new label height. Default value is 20public int getLabelHeight()
public void setLabelSpacing(int labelSpacing)
labelSpacing property of the slider
labelSpacing - new label spacing. Default value is 5public int getLabelSpacing()
public void setLabelWidth(int labelWidth)
labelWidth property of the slider
labelWidth - new label width. Default value is 50public int getLabelWidth()
public void setLength(int length)
length - length Default value is 200public int getLength()
public void setMaxValue(float maxValue)
maximum value of the slider
maxValue - the new maximum value. Default value is 100setFlipValues(java.lang.Boolean),
Slider Examplepublic float getMaxValue()
getFlipValues(),
Slider Examplepublic void setMaxValueLabel(String maxValueLabel)
maxValueLabel property of the slider
maxValueLabel - new label text. Default value is nullsetShowRange(java.lang.Boolean),
setMaxValue(float)public String getMaxValueLabel()
getShowRange(),
getMaxValue()public void setMinValue(float minValue)
minimum value of the slider
minValue - the new minimum value. Default value is 1setFlipValues(java.lang.Boolean),
Slider Examplepublic float getMinValue()
getFlipValues(),
Slider Examplepublic void setMinValueLabel(String minValueLabel)
minValueLabel - minValueLabel Default value is nullsetShowRange(java.lang.Boolean),
setMinValue(float)public String getMinValueLabel()
getShowRange(),
getMinValue()public void setNumValues(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.
number of values for the slider
numValues - the new number of values. Default value is nullpublic 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 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 property of the slider
roundPrecision - new round precision. 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 setRoundValues(Boolean roundValues)
roundPrecision.
roundValues property of the slider
roundValues - round slider values?. Default value is truepublic Boolean getRoundValues()
roundPrecision.
public void setShowRange(Boolean showRange)
showRange property of the slider
showRange - show the slider range?. Default value is truesetMinValueLabel(java.lang.String),
setMaxValueLabel(java.lang.String)public Boolean getShowRange()
getMinValueLabel(),
getMaxValueLabel()public void setShowTitle(Boolean showTitle)
showTitle property of the slider
showTitle - show the slider title?. Default value is truesetTitle(java.lang.String)public Boolean getShowTitle()
getTitle()public void setShowValue(Boolean showValue)
showValue property of the slider
showValue - show the slider value?. Default value is truesetValue(float)public Boolean getShowValue()
getValue()public void setStepPercent(float stepPercent)
stepPercent property of the slider
stepPercent - new slider step percent. Default value is 5public float getStepPercent()
public void setThumbSrc(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}_Disabled.{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}_Disabled.{extension}: appearance when the slider is disabled. thumbSrc property of the slider
thumbSrc - new thumbSrc. Default value is "thumb.gif"public 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}_Disabled.{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}_Disabled.{extension}: appearance when the slider is disabled.
public void setThumbThickWidth(int thumbThickWidth)
thumbThickWidth property of the slider
thumbThickWidth - new thumbThickWidth. Default value is 23public int getThumbThickWidth()
public void setThumbThinWidth(int thumbThinWidth)
thumbThinWidth property of the slider
thumbThinWidth - new thumbThinWidth. Default value is 17public int getThumbThinWidth()
public void setTitle(String title)
title of the slider
setTitle in class Canvastitle - new title for the slider. Default value is "Set Value"setShowTitle(java.lang.Boolean)public String getTitle()
getTitle in class CanvasgetShowTitle()public void setTrackCapSize(int trackCapSize)
trackCapSize property of the slider
trackCapSize - new trackCapSize. Default value is 6public int getTrackCapSize()
public void setTrackImageType(ImageStyle trackImageType)
trackImageType property of the slider
trackImageType - new trackImageType. Default value is "stretch"ImageStyle,
StretchImg.setImageType(com.smartgwt.client.types.ImageStyle)public ImageStyle getTrackImageType()
ImageStyle,
StretchImg.getImageType()public void setTrackSrc(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}_Disabled_start.{extension}: start (left edge) of the track for a slider that is
disabled. h{baseName}_Disabled_stretch.{extension}: the track for a disabled slider; this may be
centered, tiled, or stretched. h{baseName}_Disabled_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}_Disabled_start.{extension}: start (bottom edge) of the track for a slider that is
disabled. v{baseName}_Disabled_stretch.{extension}: the track for a disabled slider; this may be
centered, tiled, or stretched. v{baseName}_end.{extension}: end (top edge) of the track for a slider
that is disabled. trackSrc property of the slider
trackSrc - new trackSrc. Default value is "track.gif"setTrackImageType(com.smartgwt.client.types.ImageStyle)public 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}_Disabled_start.{extension}: start (left edge) of the track for a slider that is
disabled. h{baseName}_Disabled_stretch.{extension}: the track for a disabled slider; this may be
centered, tiled, or stretched. h{baseName}_Disabled_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}_Disabled_start.{extension}: start (bottom edge) of the track for a slider that is
disabled. v{baseName}_Disabled_stretch.{extension}: the track for a disabled slider; this may be
centered, tiled, or stretched. v{baseName}_end.{extension}: end (top edge) of the track for a slider
that is disabled.
getTrackImageType()public void setTrackWidth(int trackWidth)
trackWidth property of the slider
trackWidth - new trackWidth. Default value is 7public int getTrackWidth()
public void setValue(float value)
value - the new value. Default value is 1setMinValue(float),
setMaxValue(float),
setFlipValues(java.lang.Boolean),
setShowValue(java.lang.Boolean)public float getValue()
getMinValue(),
getMaxValue(),
getFlipValues(),
getShowValue()public void setVertical(Boolean vertical)
vertical property of the slider
vertical - is the slider vertical. Default value is truepublic Boolean getVertical()
public void setVThumbStyle(String vThumbStyle)
throws IllegalStateException
hThumbStyle for state suffixes.
vThumbStyle - vThumbStyle Default value is null
IllegalStateException - this property cannot be changed after the component has been createdpublic String getVThumbStyle()
hThumbStyle for state suffixes.
public void setVTrackStyle(String vTrackStyle)
throws IllegalStateException
Will have the suffix "Disabled" added when the slider is disabled.
vTrackStyle - vTrackStyle Default value is null
IllegalStateException - this property cannot be changed after the component has been createdpublic String getVTrackStyle()
Will have the suffix "Disabled" added when the slider is disabled.
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 HasValueChangedHandlershandler - the valueChanged handler
HandlerRegistration used to remove this handlerpublic Boolean valueIsChanging()
Slider.valueChanged 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.
public static void setDefaultProperties(Slider sliderProperties)
Note: This method is intended for setting default attributes only and will effect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead.
sliderProperties - properties that should be used as new defaults when instances of this class are created
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||