|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.component.progressindicator.AbstractProgressIndicatorModel
net.rim.device.api.ui.component.progressindicator.ProgressIndicatorModel
public class ProgressIndicatorModel
Implementation of AbstractProgressIndicatorModel
.
This model represents progress where the work being accomplished
can be represented by a measurable quantity. This model uses an
Adjustment
to allow for threaded access to the
data model and to allow progress to be represented by integer values.
The progress takes a minimum value, a maximum value, and an initial value.
Additionally, the Adjustment
allows for optional use of a stepping and paging increment
to advance progress.
This model allows the value to also be changed by the user.
Any AbstractProgressIndicatorController
that allows for users
to edit the value should call ProgressIndicatorModel.setNonProgrammaticValue(int)
. This will update the model,
notifying every ProgressIndicatorListener
that the update
is non-programmatic.
This model caps all values at the provided maximum value.
An Adjustment
is created during initialization of this class based
on the provided parameters. Setting an Adjustment
later
will override the one created during initialization.
Constructor Summary | ||
---|---|---|
ProgressIndicatorModel()
Constructs a new ProgressIndicatorModel . |
||
ProgressIndicatorModel(int initial,
int max,
int min)
Constructs a new ProgressIndicatorModel . |
||
ProgressIndicatorModel(int pageSize,
int stepSize,
int initial,
int max,
int min)
Constructs a new ProgressIndicatorModel . |
Method Summary | ||
---|---|---|
int |
getInitialValue()
Returns the initial value that was provided when the model was initialized. |
|
int |
getValue()
Returns the value that the model is currently set to. |
|
int |
getValueMax()
Returns the maximum value that is set for the model. |
|
int |
getValueMin()
Returns the minimum value that is set for the model. |
|
void |
initialize(int initial,
int max,
int min)
Initializes the model. |
|
void |
initialize(int pageSize,
int stepSize,
int initial,
int max,
int min)
Initializes the model. |
|
boolean |
isComplete()
Indicates whether or not the progress has reached completion. |
|
void |
page()
Advances the current value by one page. |
|
void |
reset(int initial,
int max,
int min)
Resets the data model and changes the parameters to those provided. |
|
void |
reset(int pageSize,
int stepSize,
int initial,
int max,
int min)
Resets the data model and changes the parameters to those provided. |
|
void |
setInitialValue(int initial)
Overrides the initial value that was set when this model was initialized. |
|
void |
setNonProgrammaticValue(int value)
Sets a value such that such that every ProgressIndicatorListener
is notified that the update is from a non-programmatic source. |
|
void |
setValue(int value)
Sets the current value of the model. |
|
void |
setValueMax(int max)
Sets the maximum value for this model. |
|
void |
setValueMin(int min)
Sets the minimum value for this model. |
|
void |
step()
Advances the current value by the amount that is assigned to a step. |
Methods inherited from class net.rim.device.api.ui.component.progressindicator.AbstractProgressIndicatorModel |
---|
addListener, cancel, getAdjustment, getController, removeAdjustment, removeListener, reset, resume, setAdjustment, setController |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProgressIndicatorModel()
ProgressIndicatorModel
.
Sets all values to 0.
public ProgressIndicatorModel(int initial, int max, int min)
ProgressIndicatorModel
.
Sets both page and step amounts to 0.
initial
- The value at which the model is initialized.max
- The maximum value that the progress is allowed to reach.min
- The minimum value that the progress is allowed to have.public ProgressIndicatorModel(int pageSize, int stepSize, int initial, int max, int min)
ProgressIndicatorModel
.
pageSize
- The amount to increase the value by when ProgressIndicatorModel.page()
is called.stepSize
- the amount to increase the value by when ProgressIndicatorModel.step()
is called.initial
- The value at which the model is initialized.max
- The maximum value that the progress is allowed to reach.min
- The minimum value that the progress is allowed to have.Method Detail |
---|
public int getInitialValue()
public int getValue()
public int getValueMax()
public int getValueMin()
public void initialize(int initial, int max, int min)
Adjustment
based on the provided parameters
and assigns it to this model. Sets the values used for step
and page to 0
.
initial
- The initial value for the model.max
- The maximum value that the model can reach.min
- The minimum value for the model.public void initialize(int pageSize, int stepSize, int initial, int max, int min)
Adjustment
based on the provided parameters
and assigns it to this model.
pageSize
- The amount by which to increment the value when paging.stepSize
- The amount by which to increment the value when stepping.initial
- The initial value for the model.max
- The maximum value that the model can reach.min
- The minimum value for the model.public boolean isComplete()
isComplete
in class AbstractProgressIndicatorModel
true
if the progress is complete, false
otherwise.public void page()
Adjustment.pageStepUp()
public void reset(int initial, int max, int min)
Adjustment
will
be updated to reflect the changes.
Note that this method retains
the existing values for page and step in the currently set Adjustment
.
initial
- The initial value for the model.max
- The maximum value that the model can reach.min
- The minimum value for the model.public void reset(int pageSize, int stepSize, int initial, int max, int min)
Adjustment
will
be updated to reflect these changes.
pageSize
- The amount to increment the value by when paging.stepSize
- The amount to increment the value by when stepping.initial
- The initial value for the model.max
- The maximum value that the model can reach.min
- The minimum value for the model.public void setInitialValue(int initial)
initial
- The value to set as the initial value for this model.public void setNonProgrammaticValue(int value)
ProgressIndicatorListener
is notified that the update is from a non-programmatic source.
This is intended for use when the user changes the value.
The value assigned will be bounded by the current minimum and maximum values.
setNonProgrammaticValue
in class AbstractProgressIndicatorModel
value
- The new value for the model.public void setValue(int value)
value
- The value to set the model to.public void setValueMax(int max)
max
- The value to set as the maximum value.public void setValueMin(int min)
min
- The value to set as the minimum value.public void step()
Adjustment.stepUp()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.