|
||||||||||
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.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.SimplePanel
com.google.gwt.user.client.ui.FocusPanel
com.google.gwt.widgetideas.client.SliderBar
public class SliderBar
A widget that allows the user to select a value within a range of possible values using a sliding bar that responds to mouse events.
SliderBar listens for the following key events. Holding down a key will repeat the action until the key is released.
Nested Class Summary | |
---|---|
static interface |
SliderBar.LabelFormatter
A formatter used to format the labels displayed in the widget. |
static interface |
SliderBar.SliderBarImages
An ImageBundle that provides images for SliderBar . |
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.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
SliderBar(double minValue,
double maxValue)
Create a slider bar. |
|
SliderBar(double minValue,
double maxValue,
SliderBar.LabelFormatter labelFormatter)
Create a slider bar. |
|
SliderBar(double minValue,
double maxValue,
SliderBar.LabelFormatter labelFormatter,
SliderBar.SliderBarImages images)
Create a slider bar. |
Method Summary | |
---|---|
void |
addChangeListener(com.google.gwt.user.client.ui.ChangeListener listener)
Add a change listener to this SliderBar. |
protected java.lang.String |
formatLabel(double value)
Format the label to display above the ticks Override this method in a subclass to customize the format. |
double |
getCurrentValue()
Return the current value. |
protected double |
getKnobPercent()
Get the percentage of the knob's position relative to the size of the line. |
SliderBar.LabelFormatter |
getLabelFormatter()
Return the label formatter. |
double |
getMaxValue()
Return the max value. |
double |
getMinValue()
Return the minimum value. |
int |
getNumLabels()
Return the number of labels. |
int |
getNumTicks()
Return the number of ticks. |
double |
getStepSize()
Return the step size. |
double |
getTotalRange()
Return the total range between the minimum and maximum values. |
void |
onBrowserEvent(com.google.gwt.user.client.Event event)
Listen for events that will move the knob. |
protected void |
onLoad()
This method is called immediately after a widget becomes attached to the browser's document. |
void |
onResize(int width,
int height)
This method is called when the dimensions of the parent element change. |
void |
redraw()
Redraw the progress bar when something changes the layout. |
void |
removeChangeListener(com.google.gwt.user.client.ui.ChangeListener listener)
Remove a change listener from this SliderBar. |
void |
setCurrentValue(double curValue)
Set the current value and fire the onValueChange event. |
void |
setCurrentValue(double curValue,
boolean fireEvent)
Set the current value and optionally fire the onValueChange event. |
void |
setLabelFormatter(SliderBar.LabelFormatter labelFormatter)
Set the label formatter. |
void |
setMaxValue(double maxValue)
Set the max value. |
void |
setMinValue(double minValue)
Set the minimum value. |
void |
setNumLabels(int numLabels)
Set the number of labels to show on the line. |
void |
setNumTicks(int numTicks)
Set the number of ticks to show on the line. |
void |
setStepSize(double stepSize)
Set the step size. |
void |
shiftLeft(int numSteps)
Shift to the left (smaller value). |
void |
shiftRight(int numSteps)
Shift to the right (greater value). |
Methods inherited from class com.google.gwt.user.client.ui.FocusPanel |
---|
addClickListener, addFocusListener, addKeyboardListener, addMouseListener, addMouseWheelListener, getTabIndex, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setFocus, setTabIndex |
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel |
---|
add, getContainerElement, getWidget, iterator, remove, setWidget |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
---|
adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, onUnload, orphan |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
getParent, isAttached, onAttach, onDetach, removeFromParent, setElement |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.widgetideas.client.ResizableWidget |
---|
getElement, isAttached |
Constructor Detail |
---|
public SliderBar(double minValue, double maxValue)
minValue
- the minimum value in the rangemaxValue
- the maximum value in the rangepublic SliderBar(double minValue, double maxValue, SliderBar.LabelFormatter labelFormatter)
minValue
- the minimum value in the rangemaxValue
- the maximum value in the rangelabelFormatter
- the label formatterpublic SliderBar(double minValue, double maxValue, SliderBar.LabelFormatter labelFormatter, SliderBar.SliderBarImages images)
minValue
- the minimum value in the rangemaxValue
- the maximum value in the rangelabelFormatter
- the label formatterimages
- the images to use for the sliderMethod Detail |
---|
public void addChangeListener(com.google.gwt.user.client.ui.ChangeListener listener)
addChangeListener
in interface com.google.gwt.user.client.ui.SourcesChangeEvents
listener
- the listener to addpublic double getCurrentValue()
public SliderBar.LabelFormatter getLabelFormatter()
public double getMaxValue()
public double getMinValue()
public int getNumLabels()
public int getNumTicks()
public double getStepSize()
public double getTotalRange()
public void onBrowserEvent(com.google.gwt.user.client.Event event)
onBrowserEvent
in interface com.google.gwt.user.client.EventListener
onBrowserEvent
in class com.google.gwt.user.client.ui.FocusPanel
event
- the event that occurredpublic void onResize(int width, int height)
onResize
in interface ResizableWidget
width
- the new client width of the elementheight
- the new client height of the elementpublic void redraw()
public void removeChangeListener(com.google.gwt.user.client.ui.ChangeListener listener)
removeChangeListener
in interface com.google.gwt.user.client.ui.SourcesChangeEvents
listener
- the listener to removepublic void setCurrentValue(double curValue)
curValue
- the current valuepublic void setCurrentValue(double curValue, boolean fireEvent)
curValue
- the current valuefireEvent
- fire the onValue change event if truepublic void setLabelFormatter(SliderBar.LabelFormatter labelFormatter)
labelFormatter
- the label formatterpublic void setMaxValue(double maxValue)
maxValue
- the current valuepublic void setMinValue(double minValue)
minValue
- the current valuepublic void setNumLabels(int numLabels)
numLabels
- the number of labels to showpublic void setNumTicks(int numTicks)
numTicks
- the number of ticks to showpublic void setStepSize(double stepSize)
stepSize
- the current valuepublic void shiftLeft(int numSteps)
numSteps
- the number of steps to shiftpublic void shiftRight(int numSteps)
numSteps
- the number of steps to shiftprotected java.lang.String formatLabel(double value)
value
- the value at the label
protected double getKnobPercent()
protected void onLoad()
onLoad
in class com.google.gwt.user.client.ui.Panel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |