| java.lang.Object org.wings.SComponent org.wings.SProgressBar
SProgressBar | public class SProgressBar extends SComponent (Code) | | Graphical bar which can be used to visualize the progress of an operation.
author: Armin Haaf |
Field Summary | |
protected transient ChangeEvent | changeEvent Only one ChangeEvent is needed per instance since the
event's only interesting property is the immutable source, which
is the progress bar. | protected ChangeListener | changeListener Listens for change events sent by the progress bar's model,
redispatching them
to change-event listeners registered upon
this progress bar. | protected BoundedRangeModel | model The object that holds the data for the progress bar. | protected int | orientation Whether the progress bar is horizontal or vertical. | protected boolean | paintString Whether to textually display a string on the progress bar.
The default is false .
Setting this to true causes a textual
display of the progress to be rendered on the progress bar. | protected String | progressString An optional string that can be displayed on the progress bar.
The default is null . |
Constructor Summary | |
public | SProgressBar() Creates a horizontal progress bar
that displays a border but no progress string. | public | SProgressBar(int orient) Creates a progress bar with the specified orientation,
which can be
either SProgressBar.VERTICAL or
SProgressBar.HORIZONTAL . | public | SProgressBar(int min, int max) Creates a horizontal progress bar
with the specified minimum and maximum. | public | SProgressBar(int orient, int min, int max) Creates a progress bar using the specified orientation,
minimum, and maximum. | public | SProgressBar(BoundedRangeModel newModel) Creates a horizontal progress bar
that uses the specified model
to hold the progress bar's data. |
Method Summary | |
public void | addChangeListener(ChangeListener l) Adds the specified ChangeListener to the progress bar. | protected ChangeListener | createChangeListener() Subclasses that want to handle change events
from the model differently
can override this to return
an instance of a custom ChangeListener implementation. | protected void | fireStateChanged() Notifies all listeners that have registered interest in
ChangeEvent s. | public ChangeListener[] | getChangeListeners() Returns an array of all the ChangeListener s added
to this progress bar with addChangeListener . | public Color | getFilledColor() | public int | getMaximum() Returns the progress bar's maximum value,
which is stored in the progress bar's BoundedRangeModel . | public int | getMinimum() Returns the progress bar's minimum value,
which is stored in the progress bar's BoundedRangeModel . | public BoundedRangeModel | getModel() Returns the data model used by this progress bar. | public int | getOrientation() Returns SProgressBar.VERTICAL or
SProgressBar.HORIZONTAL , depending on the orientation
of the progress bar. | public double | getPercentComplete() Returns the percent complete for the progress bar. | public SDimension | getProgressBarDimension() | public String | getString() Returns the current value of the progress string. | public Color | getUnfilledColor() | public int | getValue() Returns the progress bar's current value,
which is stored in the progress bar's BoundedRangeModel .
The value is always between the
minimum and maximum values, inclusive. | public boolean | isIndeterminate() Returns the value of the indeterminate property. | public boolean | isStringPainted() Returns the value of the stringPainted property. | public void | removeChangeListener(ChangeListener l) Removes a ChangeListener from the progress bar. | public void | setCG(ProgressBarCG cg) Sets the look-and-feel object that renders this component. | public void | setFilledColor(Color c) | public void | setIndeterminate(boolean newValue) Sets the indeterminate property of the progress bar,
which determines whether the progress bar is in determinate
or indeterminate mode. | public void | setMaximum(int n) Sets the progress bar's maximum value
(stored in the progress bar's data model) to n . | public void | setMinimum(int n) Sets the progress bar's minimum value
(stored in the progress bar's data model) to n . | public void | setModel(BoundedRangeModel newModel) Sets the data model used by the SProgressBar . | public void | setOrientation(int newOrientation) Sets the progress bar's orientation to newOrientation ,
which must be SProgressBar.VERTICAL or
SProgressBar.HORIZONTAL . | public void | setProgressBarDimension(SDimension dimension) Sets the size of the graphically rendered progress bar element. | public void | setString(String s) Sets the value of the progress string. | public void | setStringPainted(boolean b) Sets the value of the stringPainted property,
which determines whether the progress bar
should render a progress string. | public void | setUnfilledColor(Color c) | public void | setValue(int n) Sets the progress bar's current value
(stored in the progress bar's data model) to n . |
changeEvent | protected transient ChangeEvent changeEvent(Code) | | Only one ChangeEvent is needed per instance since the
event's only interesting property is the immutable source, which
is the progress bar.
|
paintString | protected boolean paintString(Code) | | Whether to textually display a string on the progress bar.
The default is false .
Setting this to true causes a textual
display of the progress to be rendered on the progress bar. If
the progressString is null ,
the percentage of completion is displayed on the progress bar.
Otherwise, the progressString is
rendered on the progress bar.
See Also: SProgressBar.setStringPainted |
progressString | protected String progressString(Code) | | An optional string that can be displayed on the progress bar.
The default is null . Setting this to a non-null
value does not imply that the string will be displayed.
See Also: SProgressBar.setString |
SProgressBar | public SProgressBar(int min, int max)(Code) | | Creates a horizontal progress bar
with the specified minimum and maximum.
Sets the initial value of the progress bar to the specified minimum.
By default, a border is painted but a progress string is not.
The BoundedRangeModel that holds the progress bar's data
handles any issues that may arise from improperly setting the
minimum, initial, and maximum values on the progress bar.
Parameters: min - the minimum value of the progress bar Parameters: max - the maximum value of the progress bar See Also: BoundedRangeModel See Also: SProgressBar.setOrientation See Also: SProgressBar.setStringPainted See Also: SProgressBar.setString See Also: SProgressBar.setIndeterminate |
SProgressBar | public SProgressBar(int orient, int min, int max)(Code) | | Creates a progress bar using the specified orientation,
minimum, and maximum.
By default, a border is painted but a progress string is not.
Sets the initial value of the progress bar to the specified minimum.
The BoundedRangeModel that holds the progress bar's data
handles any issues that may arise from improperly setting the
minimum, initial, and maximum values on the progress bar.
Parameters: orient - the desired orientation of the progress bar Parameters: min - the minimum value of the progress bar Parameters: max - the maximum value of the progress bar See Also: BoundedRangeModel See Also: SProgressBar.setOrientation See Also: SProgressBar.setStringPainted See Also: SProgressBar.setString See Also: SProgressBar.setIndeterminate |
addChangeListener | public void addChangeListener(ChangeListener l)(Code) | | Adds the specified ChangeListener to the progress bar.
Parameters: l - the ChangeListener to add |
fireStateChanged | protected void fireStateChanged()(Code) | | Notifies all listeners that have registered interest in
ChangeEvent s.
The event instance
is created if necessary.
See Also: javax.swing.event.EventListenerList |
getChangeListeners | public ChangeListener[] getChangeListeners()(Code) | | Returns an array of all the ChangeListener s added
to this progress bar with addChangeListener .
all of the ChangeListener s added or an emptyarray if no listeners have been added since: 1.4 |
getFilledColor | public Color getFilledColor()(Code) | | Returns the color in which the fille region is painted
|
getOrientation | public int getOrientation()(Code) | | Returns SProgressBar.VERTICAL or
SProgressBar.HORIZONTAL , depending on the orientation
of the progress bar. The default orientation is
HORIZONTAL .
HORIZONTAL or VERTICAL See Also: SProgressBar.setOrientation |
getPercentComplete | public double getPercentComplete()(Code) | | Returns the percent complete for the progress bar.
Note that this number is between 0.0 and 1.0.
the percent complete for this progress bar |
getProgressBarDimension | public SDimension getProgressBarDimension()(Code) | | The size of the graphically rendered progress bar element if it has been set, else null |
getString | public String getString()(Code) | | Returns the current value of the progress string.
If you are providing a custom progress string
by overriding this method,
make sure your implementation calls setString before
calling super.getString .
the value of the percent string See Also: SProgressBar.setString |
getUnfilledColor | public Color getUnfilledColor()(Code) | | Returns the color in which the unfilled region is painted
|
getValue | public int getValue()(Code) | | Returns the progress bar's current value,
which is stored in the progress bar's BoundedRangeModel .
The value is always between the
minimum and maximum values, inclusive. By default, the
value is initialized to be equal to the minimum value.
the current value of the progress bar See Also: SProgressBar.setValue See Also: BoundedRangeModel.getValue |
isIndeterminate | public boolean isIndeterminate()(Code) | | Returns the value of the indeterminate property.
the value of the indeterminate property or normal (false)? See Also: SProgressBar.setIndeterminate |
removeChangeListener | public void removeChangeListener(ChangeListener l)(Code) | | Removes a ChangeListener from the progress bar.
Parameters: l - the ChangeListener to remove |
setCG | public void setCG(ProgressBarCG cg)(Code) | | Sets the look-and-feel object that renders this component.
Parameters: cg - a ProgressBarCG object |
setFilledColor | public void setFilledColor(Color c)(Code) | | Sets the color in which the fille region is painted
Parameters: c - a Color value |
setIndeterminate | public void setIndeterminate(boolean newValue)(Code) | | Sets the indeterminate property of the progress bar,
which determines whether the progress bar is in determinate
or indeterminate mode.
By default, the progress bar is determinate.
An indeterminate progress bar continuously displays animation
indicating that an operation of unknown length is occurring.
Some look and feels might not support indeterminate progress bars;
they will ignore this property.
Parameters: newValue - true if the progress bar should change to indeterminate mode;false if it should revert to normal. See Also: SProgressBar.isIndeterminate() |
setMaximum | public void setMaximum(int n)(Code) | | Sets the progress bar's maximum value
(stored in the progress bar's data model) to n .
The underlying BoundedRangeModel handles any mathematical
issues arising from assigning faulty values.
If the maximum value is different from the previous maximum,
all change listeners are notified.
Parameters: n - the new maximumdescription: The progress bar's maximum value. See Also: SProgressBar.getMaximum See Also: SProgressBar.addChangeListener See Also: BoundedRangeModel.setMaximum |
setMinimum | public void setMinimum(int n)(Code) | | Sets the progress bar's minimum value
(stored in the progress bar's data model) to n .
The data model (a BoundedRangeModel instance)
handles any mathematical
issues arising from assigning faulty values.
If the minimum value is different from the previous minimum,
all change listeners are notified.
Parameters: n - the new minimumdescription: The progress bar's minimum value. See Also: SProgressBar.getMinimum See Also: SProgressBar.addChangeListener See Also: BoundedRangeModel.setMinimum |
setModel | public void setModel(BoundedRangeModel newModel)(Code) | | Sets the data model used by the SProgressBar .
Parameters: newModel - the BoundedRangeModel to usedescription: The data model used by the SProgressBar. |
setOrientation | public void setOrientation(int newOrientation)(Code) | | Sets the progress bar's orientation to newOrientation ,
which must be SProgressBar.VERTICAL or
SProgressBar.HORIZONTAL . The default orientation
is HORIZONTAL .
Parameters: newOrientation - HORIZONTAL or VERTICAL throws: IllegalArgumentException - if newOrientation is an illegal value See Also: SProgressBar.getOrientation |
setProgressBarDimension | public void setProgressBarDimension(SDimension dimension)(Code) | | Sets the size of the graphically rendered progress bar element.
Parameters: dimension - the size as dimension |
setString | public void setString(String s)(Code) | | Sets the value of the progress string. By default,
this string is null .
If you have provided a custom progress string and want to revert to
the built-in behavior, set the string back to null .
If you are providing a custom progress string
by overriding this method,
make sure that you call setString before
calling getString .
The progress string is painted only if
the isStringPainted method returns true .
Parameters: s - the value of the percent string See Also: SProgressBar.getString See Also: SProgressBar.setStringPainted See Also: SProgressBar.isStringPainted |
setStringPainted | public void setStringPainted(boolean b)(Code) | | Sets the value of the stringPainted property,
which determines whether the progress bar
should render a progress string.
The default is false :
no string is painted.
Some look and feels might not support progress strings
or might support them only when the progress bar is in determinate mode.
Parameters: b - true if the progress bar should render a string See Also: SProgressBar.isStringPainted See Also: SProgressBar.setString |
setUnfilledColor | public void setUnfilledColor(Color c)(Code) | | Sets the color in which the unfilled region is painted
Parameters: c - a Color value |
setValue | public void setValue(int n)(Code) | | Sets the progress bar's current value
(stored in the progress bar's data model) to n .
The data model (a BoundedRangeModel instance)
handles any mathematical
issues arising from assigning faulty values.
If the new value is different from the previous value,
all change listeners are notified.
Parameters: n - the new valuedescription: The progress bar's current value. See Also: SProgressBar.getValue See Also: BoundedRangeModel.setValue |
Methods inherited from org.wings.SComponent | final public void addComponentListener(SComponentListener l)(Code)(Java Doc) public void addDynamicStyle(Style style)(Code)(Java Doc) final protected void addEventListener(Class<T> type, T listener)(Code)(Java Doc) public void addNotify()(Code)(Java Doc) final public void addParentFrameListener(SParentFrameListener l)(Code)(Java Doc) final public void addRenderListener(SRenderListener renderListener)(Code)(Java Doc) final public void addScriptListener(ScriptListener listener)(Code)(Java Doc) public void addStyle(String additionalCssClassName)(Code)(Java Doc) public Object clone()(Code)(Java Doc) protected void fireComponentChangeEvent(SComponentEvent aEvent)(Code)(Java Doc) public void fireFinalEvents()(Code)(Java Doc) protected void fireKeyEvents()(Code)(Java Doc) final public void fireRenderEvent(int type)(Code)(Java Doc) public ActionMap getActionMap()(Code)(Java Doc) public Color getBackground()(Code)(Java Doc) public SBorder getBorder()(Code)(Java Doc) public ComponentCG getCG()(Code)(Java Doc) final public Object getClientProperty(Object key)(Code)(Java Doc) public SPopupMenu getComponentPopupMenu()(Code)(Java Doc) public Style getDynamicStyle(Selector selector)(Code)(Java Doc) public Collection getDynamicStyles()(Code)(Java Doc) public int getFocusTraversalIndex()(Code)(Java Doc) public SFont getFont()(Code)(Java Doc) public Color getForeground()(Code)(Java Doc) public int getHorizontalAlignment()(Code)(Java Doc) public InputMap getInputMap()(Code)(Java Doc) public InputMap getInputMap(int condition)(Code)(Java Doc) final protected int getListenerCount(Class type)(Code)(Java Doc) final protected Object[] getListenerList()(Code)(Java Doc) final public EventListener[] getListeners(Class<? extends EventListener> type)(Code)(Java Doc) public String getLowLevelEventId()(Code)(Java Doc) final public String getName()(Code)(Java Doc) final public SContainer getParent()(Code)(Java Doc) public SFrame getParentFrame()(Code)(Java Doc) public SDimension getPreferredSize()(Code)(Java Doc) public RequestURL getRequestURL()(Code)(Java Doc) public boolean getResidesInForm()(Code)(Java Doc) public List<ScriptListener> getScriptListenerList()(Code)(Java Doc) public ScriptListener[] getScriptListeners()(Code)(Java Doc) final public Session getSession()(Code)(Java Doc) public boolean getShowAsFormComponent()(Code)(Java Doc) public String getStyle()(Code)(Java Doc) public String getToolTipText()(Code)(Java Doc) public int getVerticalAlignment()(Code)(Java Doc) public void invite(ComponentVisitor visitor) throws Exception(Code)(Java Doc) protected static boolean isDifferent(Object oldObject, Object newObject)(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) public boolean isFocusOwner()(Code)(Java Doc) public boolean isRecursivelyVisible()(Code)(Java Doc) public boolean isReloadForced()(Code)(Java Doc) protected boolean isUpdatePossible()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) protected String paramString()(Code)(Java Doc) protected void processComponentEvent(SComponentListener listener, SComponentEvent e)(Code)(Java Doc) protected boolean processKeyEvents(String[] values)(Code)(Java Doc) protected void processLowLevelEvent(String name, String[] values)(Code)(Java Doc) final public void putClientProperty(Object key, Object value)(Code)(Java Doc) final void register()(Code)(Java Doc) public void reload()(Code)(Java Doc) final protected void reloadIfChange(Object oldVal, Object newVal)(Code)(Java Doc) final protected void reloadIfChange(int oldVal, int newVal)(Code)(Java Doc) final protected void reloadIfChange(boolean oldVal, boolean newVal)(Code)(Java Doc) final protected void reloadIfChange(byte oldVal, byte newVal)(Code)(Java Doc) final protected void reloadIfChange(short oldVal, short newVal)(Code)(Java Doc) final protected void reloadIfChange(long oldVal, long newVal)(Code)(Java Doc) final protected void reloadIfChange(float oldVal, float newVal)(Code)(Java Doc) final protected void reloadIfChange(double oldVal, double newVal)(Code)(Java Doc) final protected void reloadIfChange(char oldVal, char newVal)(Code)(Java Doc) final public void removeComponentListener(SComponentListener l)(Code)(Java Doc) public void removeDynamicStyle(Selector selector)(Code)(Java Doc) final protected void removeEventListener(Class<T> type, T listener)(Code)(Java Doc) public void removeNotify()(Code)(Java Doc) final public void removeParentFrameListener(SParentFrameListener l)(Code)(Java Doc) final public void removeRenderListener(SRenderListener renderListener)(Code)(Java Doc) final public void removeScriptListener(ScriptListener listener)(Code)(Java Doc) public void removeStyle(String cssStyleClassName)(Code)(Java Doc) public void requestFocus()(Code)(Java Doc) public void scrollRectToVisible(Rectangle aRect)(Code)(Java Doc) public void setActionMap(ActionMap actionMap)(Code)(Java Doc) public void setAttribute(String cssPropertyName, String value)(Code)(Java Doc) public void setAttribute(CSSProperty property, String propertyValue)(Code)(Java Doc) public void setAttribute(Selector selector, CSSProperty property, String propertyValue)(Code)(Java Doc) public void setAttribute(Selector selector, CSSProperty property, SIcon icon)(Code)(Java Doc) public void setAttribute(Selector selector, CSSProperty property, Color color)(Code)(Java Doc) public void setAttributes(Selector selector, CSSAttributeSet attributes)(Code)(Java Doc) public void setBackground(Color color)(Code)(Java Doc) public void setBorder(SBorder border)(Code)(Java Doc) public void setCG(ComponentCG newCG)(Code)(Java Doc) public void setComponentPopupMenu(SPopupMenu popupMenu)(Code)(Java Doc) public void setDynamicStyles(Collection dynamicStyles)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setFocusTraversalIndex(int index)(Code)(Java Doc) public void setFont(SFont font)(Code)(Java Doc) public void setForeground(Color color)(Code)(Java Doc) public void setHorizontalAlignment(int alignment)(Code)(Java Doc) public void setInputMap(InputMap inputMap)(Code)(Java Doc) public void setInputMap(int condition, InputMap inputMap)(Code)(Java Doc) public void setName(String uniqueName)(Code)(Java Doc) public void setNameRaw(String uncheckedName)(Code)(Java Doc) public void setParent(SContainer parent)(Code)(Java Doc) protected void setParentFrame(SFrame parentFrame)(Code)(Java Doc) public void setPreferredSize(SDimension preferredSize)(Code)(Java Doc) public void setReloadForced(boolean forced)(Code)(Java Doc) public void setShowAsFormComponent(boolean showAsFormComponent)(Code)(Java Doc) public void setStyle(String cssClassName)(Code)(Java Doc) public void setToolTipText(String t)(Code)(Java Doc) public void setVerticalAlignment(int alignment)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc) public String toString()(Code)(Java Doc) final void unregister()(Code)(Java Doc) public void update(Update update)(Code)(Java Doc) public void updateCG()(Code)(Java Doc) public void write(Device s) throws IOException(Code)(Java Doc)
|
|
|