|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echo.Component nextapp.echo.Container echopoint.EchoPointComponent echopoint.ProgressBar
The ProgressBar
> component provides a visual display for
an integer value within a bounded interval.
A ProgressBar
typically communicates the progress of an
event by displaying its percentage of completion and possibly a textual
display of this percentage.
The ProgressBar comes with a standard width and height that is optimised for HORIZONATL orientation. If you change the orientation, be sure to flip the height and width otherwise it will look strange. This is done by default on the basic setOrientation() method.
The width and height of the ProgressBar can be adjusted slightly by the ProgressBarRenderer, so it can fit the block size exactly. So dont assume its size is always exact.
Nested Class Summary | |
static class |
ProgressBar.NestedStyleInfo
Nested public static StyleInfo class. |
Field Summary | |
static java.lang.String |
BLOCKS_CHANGED_PROPERTY
|
static java.lang.String |
BORDER_COLOR_CHANGED_PROPERTY
|
static java.lang.String |
BORDER_SIZE_CHANGED_PROPERTY
|
protected nextapp.echo.Color |
borderColor
The border color of the ProgressBar |
protected int |
borderSize
The border size of the ProgressBar |
protected nextapp.echo.event.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 nextapp.echo.event.ChangeListener |
changeListener
|
static java.lang.String |
COLORS_CHANGED_PROPERTY
|
protected nextapp.echo.Color |
completedColor
The completed color of the ProgressBar |
static int |
defaultHeight
The default height for a progress bar is 30 pixels . |
static int |
defaultMaximum
The default maximum for a progress bar is 100. |
static int |
defaultMinimum
The default minimum for a progress bar is 0. |
static int |
defaultOrientation
The default orientation for a progress bar is HORIZONTAL. |
static int |
defaultWidth
The default width for a progress bar is 146 pixels. |
protected int |
height
The height of the ProgressBar |
static java.lang.String |
IMAGE_CHANGED_PROPERTY
|
protected BoundedRangeModel |
model
The data structure that holds the various values for the progress bar. |
static java.lang.String |
MODEL_CHANGED_PROPERTY
|
protected boolean |
needsRedraw
An internal flag to control whether the component needs redrawing |
protected int |
numberOfBlocks
The number of blocks shown in the progress bar |
protected int |
orientation
The orientation to display the progress bar. |
static java.lang.String |
ORIENTATION_CHANGED_PROPERTY
Public property change names |
static int |
ORIENTATION_HORIZONTAL
The orientation values for the the progress bar. |
static int |
ORIENTATION_VERTICAL
|
protected boolean |
paintString
Whether to textually display a String on the progress bar. |
static java.lang.String |
PROGRESS_STRING_CHANGED_PROPERTY
|
static java.lang.String |
PROGRESS_STRING_PAINTED_CHANGED_PROPERTY
|
protected nextapp.echo.ImageReference |
progressBarImage
This is our progress bar imaegt hat changes when ever the model changes. |
protected java.lang.String |
progressString
A optional Progress String that can be displayed on the progress bar. |
static java.lang.String |
RENDER_CHANGED_PROPERTY
|
protected ProgressBarRenderer |
renderer
The progress bar renderer |
static java.lang.String |
STYLE_BORDER_COLOR
A style constant for the Border Color property. |
static java.lang.String |
STYLE_BORDER_SIZE
A style constant for the Border Size property. |
static java.lang.String |
STYLE_COMPLETED_COLOR
A style constant for the Completed Color property. |
static java.lang.String |
STYLE_HEIGHT
A style constant for the Height property. |
static java.lang.String |
STYLE_MAXIMUM
A style constant for the Maximum property. |
static java.lang.String |
STYLE_MINIMUM
A style constant for the Minimum property. |
static java.lang.String |
STYLE_NUMBER_OF_BLOCKS
A style constant for the Number Of Blocks property. |
static java.lang.String |
STYLE_ORIENTATION
A style constant for the Orientation property. |
static java.lang.String |
STYLE_PROGRESS_STRING
A style constant for the Progress String property. |
static java.lang.String |
STYLE_PROGRESS_STRING_PAINTED
A style constant for the Progress String Painted property. |
static java.lang.String |
STYLE_UNCOMPLETED_COLOR
A style constant for the UnCompleted Color property. |
static java.lang.String |
STYLE_VALUE
A style constant for the Value property. |
static java.lang.String |
STYLE_WIDTH
A style constant for the Width property. |
protected nextapp.echo.Color |
uncompletedColor
The uncompleted color of the ProgressBar |
protected int |
width
The width of the ProgressBar |
static java.lang.String |
WIDTH_HEIGHT_CHANGED_PROPERTY
|
Fields inherited from class echopoint.EchoPointComponent |
STYLE_TOOL_TIP_TEXT, TOOL_TIP_TEXT_CHANGED_PROPERTY, toolTipPopUp |
Fields inherited from class nextapp.echo.Component |
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY |
Fields inherited from interface echopoint.positionable.MouseCursorable |
borderStyleSymbolics, CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI |
Constructor Summary | |
ProgressBar()
Creates a horizontal progress bar. * The default orientation for progress bars is ProgressBar.HORIZONTAL .
|
|
ProgressBar(BoundedRangeModel newModel)
Creates a horizontal progress bar, the default orientation. |
|
ProgressBar(int orient)
Creates a progress bar with the specified orientation, which can be either ProgressBar.VERTICAL or ProgressBar.HORIZONTAL .
|
|
ProgressBar(int min,
int max)
Creates a horizontal progress bar, which is the default. |
|
ProgressBar(int orient,
int min,
int max)
Creates a progress bar using the specified orientation, minimum, and maximum. |
Method Summary | |
void |
addChangeListener(nextapp.echo.event.ChangeListener l)
Adds a ChangeListener to the ProgressBar. |
void |
applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. |
protected nextapp.echo.event.ChangeListener |
createChangeListener()
Subclasses that want to handle ChangeEvents differently can override this to return a subclass of ModelListener or another ChangeListener implementation. |
protected void |
fireStateChanged()
Notify all listeners that have registered interest for notification on this event type. |
nextapp.echo.Color |
getBorderColor()
|
int |
getBorderSize()
|
nextapp.echo.Color |
getCompletedColor()
|
int |
getHeight()
Returns height of the ProgressBar |
int |
getMaximum()
Returns the model's maximum value. |
int |
getMinimum()
Returns the model's minimum value. |
BoundedRangeModel |
getModel()
Returns the data model used by the ProgressBar . |
int |
getNumberOfBlocks()
|
int |
getOrientation()
Returns ProgressBar.ORIENTATION_VERTICAL or
ProgressBar.ORIENTATION_HORIZONTAL , depending on the orientation
of the progress bar. |
double |
getPercentComplete()
Returns the percentage/percent complete for the progress bar. |
nextapp.echo.ImageReference |
getProgressBarImage()
This returns the image used to represent the ProgressBar. |
java.lang.String |
getProgressString()
Returns the current value of the Progress String. |
ProgressBarRenderer |
getRenderer()
Returns the renderer used by the ProgressBar . |
nextapp.echo.Color |
getUncompletedColor()
|
int |
getValue()
Returns the model's current value. |
int |
getWidth()
Returns width of the ProgressBar |
void |
invalidate()
Can be called to invalidate the ProgressBar so that it will redraw its internals when next rendered. |
boolean |
isProgressStringPainted()
Returns true if the progress bar will render a string onto the representation of the progress bar. |
void |
removeChangeListener(nextapp.echo.event.ChangeListener l)
Removes a ChangeListener from the ProgressBar. |
java.lang.Object |
set(java.lang.reflect.Field field,
java.lang.Object newValue)
Called to save the old value of a field, set in a new value and return the old value of a field. |
void |
setBorderColor(nextapp.echo.Color newBorderColor)
Sets the border Color of the ProgressBar .
|
void |
setBorderSize(int newBorderSize)
Sets the border size of the ProgressBar .
|
void |
setCompletedColor(nextapp.echo.Color newColor)
Sets the completed Color of the ProgressBar .
|
void |
setHeight(int newValue)
Sets the height of the ProgressBar< |
void |
setMaximum(int n)
Sets the model's maximum to n. |
void |
setMinimum(int n)
Sets the model's minimum to n. |
void |
setModel(BoundedRangeModel newModel)
Sets the data model used by the ProgressBar. |
void |
setNumberOfBlocks(int newValue)
Sets the number of blocks used when displaying the ProgressBar< |
void |
setOrientation(int newOrientation)
Sets the progress bar's orientation to newOrientation, which must be ProgressBar.ORIENTATION_VERTICAL or ProgressBar.ORIENTATION_HORIZONTAL .
|
void |
setOrientation(int newOrientation,
boolean flipWidthAndHeight)
Sets the progress bar's orientation to newOrientation, which must be ProgressBar.ORIENTATION_VERTICAL or ProgressBar.ORIENTATION_HORIZONTAL .
|
void |
setProgressString(java.lang.String s)
Sets the value of the Progress String. |
void |
setProgressStringPainted(boolean b)
Sets whether the progress bar will render a string. |
void |
setRenderer(ProgressBarRenderer newRenderer)
Sets the renderer used by the ProgressBar. |
void |
setUncompletedColor(nextapp.echo.Color newColor)
Sets the uncompleted Color of the ProgressBar .
|
void |
setValue(int n)
Sets the model's value to n. |
void |
setWidth(int newValue)
Sets the width of the ProgressBar< |
java.lang.String |
toString()
|
void |
validate()
Validates this component. |
Methods inherited from class echopoint.EchoPointComponent |
getMouseCursor, getMouseCursorURI, getToolTipPopUp, getToolTipText, set, set, set, set, set, set, set, set, set, setEnabledAllChildren, setMouseCursor, setMouseCursorURI, setToolTipText |
Methods inherited from class nextapp.echo.Component |
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ORIENTATION_HORIZONTAL
public static final int ORIENTATION_VERTICAL
public static final java.lang.String STYLE_BORDER_COLOR
nextapp.echo.Color.
public static final java.lang.String STYLE_BORDER_SIZE
Integer.
public static final java.lang.String STYLE_COMPLETED_COLOR
nextapp.echo.Color.
public static final java.lang.String STYLE_HEIGHT
int
public static final java.lang.String STYLE_MINIMUM
int
public static final java.lang.String STYLE_MAXIMUM
int
public static final java.lang.String STYLE_NUMBER_OF_BLOCKS
int
public static final java.lang.String STYLE_ORIENTATION
int
public static final java.lang.String STYLE_PROGRESS_STRING
String
public static final java.lang.String STYLE_PROGRESS_STRING_PAINTED
boolean
public static final java.lang.String STYLE_UNCOMPLETED_COLOR
nextapp.echo.Color.
public static final java.lang.String STYLE_VALUE
int
public static final java.lang.String STYLE_WIDTH
int
public static final java.lang.String ORIENTATION_CHANGED_PROPERTY
public static final java.lang.String MODEL_CHANGED_PROPERTY
public static final java.lang.String IMAGE_CHANGED_PROPERTY
public static final java.lang.String PROGRESS_STRING_CHANGED_PROPERTY
public static final java.lang.String PROGRESS_STRING_PAINTED_CHANGED_PROPERTY
public static final java.lang.String WIDTH_HEIGHT_CHANGED_PROPERTY
public static final java.lang.String BORDER_COLOR_CHANGED_PROPERTY
public static final java.lang.String BORDER_SIZE_CHANGED_PROPERTY
public static final java.lang.String RENDER_CHANGED_PROPERTY
public static final java.lang.String BLOCKS_CHANGED_PROPERTY
public static final java.lang.String COLORS_CHANGED_PROPERTY
public static final int defaultMinimum
public static final int defaultMaximum
public static final int defaultOrientation
public static final int defaultWidth
public static final int defaultHeight
protected int orientation
protected BoundedRangeModel model
protected java.lang.String progressString
protected boolean paintString
protected nextapp.echo.ImageReference progressBarImage
protected int width
protected int height
protected int borderSize
protected nextapp.echo.Color borderColor
protected nextapp.echo.Color completedColor
protected nextapp.echo.Color uncompletedColor
protected ProgressBarRenderer renderer
protected int numberOfBlocks
protected boolean needsRedraw
protected transient nextapp.echo.event.ChangeEvent changeEvent
protected nextapp.echo.event.ChangeListener changeListener
Constructor Detail |
public ProgressBar()
ProgressBar.HORIZONTAL
.
By default, the ProgressString is set to null
and the
ProgressStringPainted is not painted.
Uses the defaultMinimum (0) and defaultMaximum (100). Uses the defaultMinimum for the initial value of the progress bar.
public ProgressBar(int orient)
ProgressBar.VERTICAL
or ProgressBar.HORIZONTAL
.
By default, the ProgressString is set to null
and the
ProgressStringPainted is not painted.
Uses the defaultMinimum (0) and defaultMaximum (100). Uses the defaultMinimum for the initial value of the progress bar.
public ProgressBar(int min, int max)
By default, the ProgressString is set to null
and the
ProgressStringPainted is not painted.
Uses the specified minimum and maximum. Uses the specified minimum for the initial value of the progress bar.
public ProgressBar(int orient, int min, int max)
By default, the ProgressString is set to null
and the
ProgressStringPainted is not painted.
Sets the inital value of the progress bar to the specified minimum. The BoundedRangeModel that sits underneath the progress bar handles any issues that may arrise from improperly setting the minimum, value, and maximum on the progress bar.
public ProgressBar(BoundedRangeModel newModel)
By default, the ProgressString is set to null
and the
ProgressStringPainted is not painted.
Uses the specified BoundedRangeModel which holds the minimum, value, and maximum.
Method Detail |
public void addChangeListener(nextapp.echo.event.ChangeListener l)
l
- the ChangeListener to addpublic void applyStyle(nextapp.echo.Style style)
nextapp.echo.Component
style names can be used as well.
applyStyle
in interface MouseCursorable
applyStyle
in class EchoPointComponent
Component.applyStyle(nextapp.echo.Style)
protected nextapp.echo.event.ChangeListener createChangeListener()
protected void fireStateChanged()
public nextapp.echo.Color getBorderColor()
Color
of the ProgressBar's
border.public int getBorderSize()
ProgressBar's
border.public nextapp.echo.Color getCompletedColor()
Color
of the ProgressBar's
completed blocks.public int getHeight()
ProgressBar
public int getMaximum()
100
.
public int getMinimum()
0
.
public BoundedRangeModel getModel()
ProgressBar
.
public int getNumberOfBlocks()
ProgressBar
.public int getOrientation()
ProgressBar.ORIENTATION_VERTICAL
or
ProgressBar.ORIENTATION_HORIZONTAL
, depending on the orientation
of the progress bar. The default orientation is
ORIENTATION_HORIZONTAL
.
public double getPercentComplete()
public nextapp.echo.ImageReference getProgressBarImage()
Notice that their is no setProgressBarImage() method. The internal image is updated whenever the model is changed.
This is done by making a call to the ProgressBarRenderer.drawProgressBar method, which subclasses can override to customise how the progress bar is drawn.
public java.lang.String getProgressString()
public ProgressBarRenderer getRenderer()
ProgressBar
.
public nextapp.echo.Color getUncompletedColor()
Color
of the ProgressBar's
uncompleted blocks.public int getValue()
public int getWidth()
ProgressBar
public void invalidate()
public boolean isProgressStringPainted()
public void removeChangeListener(nextapp.echo.event.ChangeListener l)
l
- the ChangeListener to removepublic void setBorderColor(nextapp.echo.Color newBorderColor)
Color
of the ProgressBar
.
PropertyChangeEvent
with a
getPropertyName()
value of
ProgressBar.BORDER_COLOR_CHANGED_PROPERTY
public void setBorderSize(int newBorderSize)
ProgressBar
.
PropertyChangeEvent
with a
getPropertyName()
value of
ProgressBar.BORDER_SIZE_CHANGED_PROPERTY
public void setCompletedColor(nextapp.echo.Color newColor)
Color
of the ProgressBar
.
PropertyChangeEvent
with a
getPropertyName()
value of
ProgressBar.COLORS_CHANGED_PROPERTY
public void setHeight(int newValue)
ProgressBar<
public void setMaximum(int n)
Notifies any listeners if the data changes.
public void setMinimum(int n)
The underlying BoundedRangeModel will handle any mathematical issues arrising from assigning faulty values.
Notifies any listeners if the data changes.
public void setModel(BoundedRangeModel newModel)
public void setNumberOfBlocks(int newValue)
ProgressBar<
public void setOrientation(int newOrientation)
ProgressBar.ORIENTATION_VERTICAL
or ProgressBar.ORIENTATION_HORIZONTAL
.
The default orientation is ORIENTATION_HORIZONTAL
.
public void setOrientation(int newOrientation, boolean flipWidthAndHeight)
ProgressBar.ORIENTATION_VERTICAL
or ProgressBar.ORIENTATION_HORIZONTAL
.
The default orientation is ORIENTATION_HORIZONTAL
.
If the flipWidthAndHeight parameter is true, then the width and height properties will be flipped around.
public void setProgressString(java.lang.String s)
null
.
public void setProgressStringPainted(boolean b)
public void setRenderer(ProgressBarRenderer newRenderer)
public void setUncompletedColor(nextapp.echo.Color newColor)
Color
of the ProgressBar
.
PropertyChangeEvent
with a
getPropertyName()
value of
ProgressBar.COLORS_CHANGED_PROPERTY
public void setValue(int n)
The underlying BoundedRangeModel will handle any mathematical issues arrising from assigning faulty values.
Notifies any listeners if the data changes.
public void setWidth(int newValue)
ProgressBar<
public java.lang.String toString()
public void validate()
validate
in class EchoPointComponent
Component.validate()
public java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue) throws java.lang.Exception
ReflectionSetter
public Object set(Field f, Object newValue) throws Exception { Object oldValue = f.get(this); f.set(this,newValue); return oldValue; }
field
- - the field to be setnewValue
- - the new value to be set
java.lang.Exception
ReflectionSetter.set(Field, Object)
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |