|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.elckerlyc.planunit.AbstractPlanUnit
public abstract class AbstractPlanUnit
| Field Summary | |
|---|---|
private List<String> |
availableSyncs
|
private String |
bmlBlockId
|
protected BMLBlockPeg |
bmlBlockPeg
|
private ArrayList<BMLFeedbackListener> |
feedbackListeners
|
private String |
id
|
private static org.slf4j.Logger |
logger
|
private PlanUnitState |
state
|
private boolean |
subUnit
|
| Constructor Summary | |
|---|---|
AbstractPlanUnit(BMLBlockPeg bmlPeg,
String i,
String bmlId)
|
|
AbstractPlanUnit(BMLBlockPeg bmlPeg,
String i,
String bmlId,
boolean sub)
|
|
| Method Summary | |
|---|---|
void |
addFeedbackListener(BMLFeedbackListener fb)
Adds a feedback listener |
void |
feedback(BMLSyncPointProgressFeedback fb)
Send feedback to all feedback listeners |
List<String> |
getAvailableSyncs()
Get the list of sync ids that can be used in this behavior. |
BMLBlockPeg |
getBMLBlockPeg()
Get the BML block to which this PlanUnit belongs |
String |
getBMLId()
Get the BML block id of the PlanUnit |
String |
getId()
Get the behaviour id of the PlanUnit |
double |
getPreferedDuration()
0 is unknown/persistent |
double |
getRelativeTime(String syncId)
Get the relative timing of this sync id Implementing classes should at least provide valid relative times for the BML sync points |
String |
getReplacementGroup()
Get the PlanUnit replacement group (=typically the BML behavior) Used to determine the currently active persistent PlanUnit for this group in the player Only one group is active at a time null is none |
PlanUnitState |
getState()
Get the plan unit state |
double |
getTime(String syncId)
Get the global time of sync syncId of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet) |
boolean |
isDone()
State is done? |
boolean |
isLurking()
State is lurking? |
boolean |
isPlaying()
In PlanUnitState.IN_EXEC or PlanUnitState.SUBSIDING |
boolean |
isSubUnit()
Return true if this unit is a subunit of another planunit (e.g. a visime or speech-related timed motion unit) |
void |
play(double time)
Plays the unit at global time time. |
protected abstract void |
playUnit(double time)
|
void |
reset()
Resets the plan unit. |
protected void |
resetUnit()
|
void |
setState(PlanUnitState newState)
Set the plan unit state |
void |
setSubUnit(boolean sub)
|
void |
start(double time)
Starts the Plan unit, is called only once before the first play is called. |
protected void |
startUnit(double time)
Starts the PlanUnit, is only called once at start |
void |
stop(double time)
Stop the Plan unit. |
protected abstract void |
stopUnit(double time)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface hmi.elckerlyc.planunit.PlanUnit |
|---|
getEndTime, getStartTime, getTimePeg, hasValidTiming, setParameterValue, setParameterValue, setTimePeg |
| Field Detail |
|---|
protected final BMLBlockPeg bmlBlockPeg
private boolean subUnit
private final String id
private final String bmlBlockId
private final ArrayList<BMLFeedbackListener> feedbackListeners
private static org.slf4j.Logger logger
private final List<String> availableSyncs
private PlanUnitState state
| Constructor Detail |
|---|
public AbstractPlanUnit(BMLBlockPeg bmlPeg,
String i,
String bmlId,
boolean sub)
public AbstractPlanUnit(BMLBlockPeg bmlPeg,
String i,
String bmlId)
| Method Detail |
|---|
public void setSubUnit(boolean sub)
protected abstract void playUnit(double time)
throws PlayException
PlayException
protected abstract void stopUnit(double time)
throws PlayException
PlayException
protected void startUnit(double time)
throws PlayException
time - global start time
PlayExceptionprotected void resetUnit()
public boolean isSubUnit()
PlanUnit
isSubUnit in interface PlanUnitpublic String getReplacementGroup()
PlanUnit
getReplacementGroup in interface PlanUnit
public final void play(double time)
throws PlayException
PlanUnit
play in interface PlanUnitPlayExceptionpublic final void reset()
PlanUnit
reset in interface PlanUnit
public final void stop(double time)
throws PlayException
PlanUnit
stop in interface PlanUnittime - global time, used for feedback
PlayException
public final void start(double time)
throws PlayException
PlanUnit
start in interface PlanUnittime - global time, used for feedback
PlayExceptionpublic BMLBlockPeg getBMLBlockPeg()
PlanUnit
getBMLBlockPeg in interface PlanUnitpublic String getBMLId()
PlanUnit
getBMLId in interface PlanUnitpublic String getId()
PlanUnit
getId in interface PlanUnitpublic void feedback(BMLSyncPointProgressFeedback fb)
PlanUnit
feedback in interface PlanUnitfb - feedback to sendpublic void addFeedbackListener(BMLFeedbackListener fb)
PlanUnit
addFeedbackListener in interface PlanUnitfb - feedback listener to addpublic void setState(PlanUnitState newState)
PlanUnit
setState in interface PlanUnitpublic PlanUnitState getState()
PlanUnit
getState in interface PlanUnitpublic boolean isPlaying()
PlanUnit
isPlaying in interface PlanUnitpublic boolean isLurking()
PlanUnit
isLurking in interface PlanUnitpublic boolean isDone()
PlanUnit
isDone in interface PlanUnitpublic double getPreferedDuration()
PlanUnit
getPreferedDuration in interface PlanUnit
public double getRelativeTime(String syncId)
throws RelativeSyncNotFoundException
PlanUnit
getRelativeTime in interface PlanUnitRelativeSyncNotFoundExceptionpublic double getTime(String syncId)
PlanUnit
getTime in interface PlanUnitpublic List<String> getAvailableSyncs()
PlanUnit
getAvailableSyncs in interface PlanUnit
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||