- java.lang.Object
-
- org.arakhne.afc.progress.DefaultProgression
-
- org.arakhne.afc.progress.SubProgressionModel
-
- All Implemented Interfaces:
Progression
class SubProgressionModel extends DefaultProgression
An object that permits to indicates the progression of a task.- Version:
- 17.0 2020-01-04 14:41:38
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- util
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.progress.DefaultProgression
listeners
-
-
Constructor Summary
Constructors Constructor Description SubProgressionModel(DefaultProgression parent, double minPValue, double maxPValue, boolean isIndeterminate, boolean adjusting, boolean overwriteComment)
Create a progress model with the specified determinate state.SubProgressionModel(DefaultProgression parent, double minPValue, double maxPValue, int minValue, int maxValue, boolean isIndeterminate, boolean adjusting, boolean overwriteComment)
Create a progress model with the specified determinate state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
disconnect()
Set the parent value and disconnect this subtask from its parent.void
end()
Force this progression task to end its indicator.protected void
fireValueChange()
Notify listeners about value change.double
getMaxInParent()
Returns the maximal value of this task progression in its parent.double
getMinInParent()
Returns the minimal value of this task progression in its parent.protected DefaultProgression
getParent()
Returns the parent task.Progression
getSuperTask()
Replies the super task of this task model.int
getTaskDepth()
Replies the depth level of this task.boolean
isRootModel()
Replies if is task model is a root model.-
Methods inherited from class org.arakhne.afc.progress.DefaultProgression
addProgressionListener, disconnectSubTask, ensureNoSubTask, fireStateChange, getComment, getFloatValue, getMaximum, getMinimum, getPercent, getProgressionFactor, getSubTask, getValue, increment, increment, increment, increment, isAdjusting, isIndeterminate, removeProgressionListener, setAdjusting, setComment, setIndeterminate, setMaximum, setMinimum, setProperties, setProperties, setValue, setValue, setValue, subTask, subTask, subTask, subTask
-
-
-
-
Constructor Detail
-
SubProgressionModel
SubProgressionModel(DefaultProgression parent, double minPValue, double maxPValue, int minValue, int maxValue, boolean isIndeterminate, boolean adjusting, boolean overwriteComment)
Create a progress model with the specified determinate state.- Parameters:
parent
- is the parent modelminPValue
- is the value at which this sub-model is starting in its parent.maxPValue
- is the value at which this sub-model is ending in its parent.minValue
- is the minimum value of this progression model.maxValue
- is the maximum value of this progression model.isIndeterminate
- indicates if this model is under progression.adjusting
- indicates if this model is adjusting its value.overwriteComment
- indicates if the comment of this subtask may overwrite the comment of its parent when it is disconnected.
-
SubProgressionModel
SubProgressionModel(DefaultProgression parent, double minPValue, double maxPValue, boolean isIndeterminate, boolean adjusting, boolean overwriteComment)
Create a progress model with the specified determinate state.- Parameters:
parent
- is the parent modelminPValue
- is the value at which this sub-model is starting in its parent.maxPValue
- is the value at which this sub-model is ending in its parent.isIndeterminate
- indicates if this model is under progression.adjusting
- indicates if this model is adjusting its value.overwriteComment
- indicates if the comment of this subtask may overwrite the comment of its parent when it is disconnected.
-
-
Method Detail
-
disconnect
void disconnect()
Set the parent value and disconnect this subtask from its parent.
-
getMinInParent
public double getMinInParent()
Returns the minimal value of this task progression in its parent.- Returns:
- the value at which this model is supposed to start in its parent.
-
getMaxInParent
public double getMaxInParent()
Returns the maximal value of this task progression in its parent.- Returns:
- the value at which this model is supposed to end in its parent.
-
getParent
protected DefaultProgression getParent()
Returns the parent task.- Returns:
- the parent task.
-
end
public void end()
Description copied from interface:Progression
Force this progression task to end its indicator.- Specified by:
end
in interfaceProgression
- Overrides:
end
in classDefaultProgression
-
fireValueChange
protected void fireValueChange()
Description copied from class:DefaultProgression
Notify listeners about value change.- Overrides:
fireValueChange
in classDefaultProgression
-
isRootModel
public boolean isRootModel()
Description copied from interface:Progression
Replies if is task model is a root model.isRootMode() == (getTaskDepth()==0)
- Specified by:
isRootModel
in interfaceProgression
- Overrides:
isRootModel
in classDefaultProgression
- Returns:
true
if this model is a root model, otherwisefalse
-
getSuperTask
public Progression getSuperTask()
Description copied from interface:Progression
Replies the super task of this task model.- Specified by:
getSuperTask
in interfaceProgression
- Overrides:
getSuperTask
in classDefaultProgression
- Returns:
- the super task or
null
this task was not a decomposition of a super task.
-
getTaskDepth
public int getTaskDepth()
Description copied from interface:Progression
Replies the depth level of this task. The root task (ie. a task without parent task) has always a depth of0
. A subtask of the root task has a depth of1
. A subtask of this subtask has a depth of2
, etc.isRootMode() == (getTaskDepth()==0)
- Specified by:
getTaskDepth
in interfaceProgression
- Overrides:
getTaskDepth
in classDefaultProgression
- Returns:
- the depth of the task.
-
-