|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.pogamut.shed.presenter.PrimitivePresenter<PRIMITIVE_TYPE>
PRIMITIVE_TYPE - Either Sense or TriggeredAction
depending on which primitive is used.public abstract class PrimitivePresenter<PRIMITIVE_TYPE extends cz.cuni.amis.pogamut.sposh.elements.PoshElement & cz.cuni.amis.pogamut.sposh.elements.INamedElement>
Base class presenter for primitives, i.e. actions and senses. Since both actions and senses presenters are quite similar, use this class as base class for both of them.
| Field Summary | |
|---|---|
protected ShedPresenter |
presenter
Presenter that is mainly used to modify the scene |
protected PRIMITIVE_TYPE |
primitive
The primitive that is being presented by this presenter. |
protected cz.cuni.amis.pogamut.sposh.elements.LapChain |
primitiveChain
Chain of variables from the root to the primitive. |
protected ShedWidget |
primitiveWidget
Widget that represents the primitive in the scene. |
protected ShedScene |
scene
Scene this presenter is modifying. |
| Constructor Summary | |
|---|---|
protected |
PrimitivePresenter(ShedScene scene,
ShedPresenter presenter,
PRIMITIVE_TYPE primitive,
ShedWidget primitiveWidget,
cz.cuni.amis.pogamut.sposh.elements.LapChain primitiveChain)
Create new presenter for @primitive, detect and project all changes on the @primitive and @primitiveChain to the @primitiveWidget. |
| Method Summary | ||
|---|---|---|
protected cz.cuni.amis.pogamut.sposh.elements.TriggeredAction |
extractAction(List<cz.cuni.amis.pogamut.sposh.elements.TriggeredAction> actions,
cz.cuni.amis.pogamut.sposh.elements.PoshElement action)
|
|
protected cz.cuni.amis.pogamut.sposh.elements.ActionPattern |
extractActionPattern(List<cz.cuni.amis.pogamut.sposh.elements.ActionPattern> actionPatterns,
cz.cuni.amis.pogamut.sposh.elements.PoshElement actionPattern)
Assert that @actionPattern is in the @actionPatterns and return it. |
|
protected cz.cuni.amis.pogamut.sposh.elements.Competence |
extractCompetence(List<cz.cuni.amis.pogamut.sposh.elements.Competence> competences,
cz.cuni.amis.pogamut.sposh.elements.PoshElement competence)
Assert that @competence is in the @competences and return it. |
|
protected cz.cuni.amis.pogamut.sposh.elements.DriveElement |
extractDrive(List<cz.cuni.amis.pogamut.sposh.elements.DriveElement> drives,
cz.cuni.amis.pogamut.sposh.elements.PoshElement drive)
|
|
protected cz.cuni.amis.pogamut.sposh.elements.CompetenceElement |
extractChoice(List<cz.cuni.amis.pogamut.sposh.elements.CompetenceElement> choices,
cz.cuni.amis.pogamut.sposh.elements.PoshElement choice)
Assert that @choice is in the @choices and return it. |
|
protected cz.cuni.amis.pogamut.sposh.elements.Sense |
extractSense(cz.cuni.amis.pogamut.sposh.elements.Trigger<?> trigger,
cz.cuni.amis.pogamut.sposh.elements.PoshElement sense)
Assert that sense is a part of the trigger and return it. |
|
AbstractAcceptAction[] |
getAcceptProviders()
Get array of accept providers of this |
|
protected
|
getPosition(List<T> list,
T element)
Get position of the element in the list. |
|
protected abstract String |
getTitleText()
Method used by the updateWidget() to |
|
void |
childElementAdded(PRIMITIVE_TYPE parent,
cz.cuni.amis.pogamut.sposh.elements.PoshElement child)
|
|
void |
childElementMoved(PRIMITIVE_TYPE parent,
cz.cuni.amis.pogamut.sposh.elements.PoshElement child,
int oldIndex,
int newIndex)
|
|
void |
childElementRemoved(PRIMITIVE_TYPE parent,
cz.cuni.amis.pogamut.sposh.elements.PoshElement child,
int removedChildIndex)
|
|
protected boolean |
isAction(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
|
|
protected boolean |
isActionPattern(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
Is the element ActionPattern? |
|
protected boolean |
isCompetence(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
Is the element Competence? |
|
protected boolean |
isDrive(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
|
|
protected boolean |
isChoice(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
Is the element CompetenceElement? |
|
protected boolean |
isSense(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
Is passed element a Sense? |
|
void |
nameMapChanged(String key,
String oldName,
String newName)
Notify the listener that mapping for the @key has changed. |
|
void |
notifyLinkChanged()
When some link of the @primitiveChain is changed, this method is notified and it will update the widget. |
|
void |
register()
Register its listeners into the lap tree. |
|
void |
unregister()
Unregister its listeners that were registered in the IPresenter.register()
method. |
|
protected void |
updateWidget()
Update widget to reflect current state of the #action. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.beans.PropertyChangeListener |
|---|
propertyChange |
| Methods inherited from interface cz.cuni.pogamut.shed.presenter.IPresenter |
|---|
getEditAction, getMenuActions |
| Field Detail |
|---|
protected final PRIMITIVE_TYPE extends cz.cuni.amis.pogamut.sposh.elements.PoshElement & cz.cuni.amis.pogamut.sposh.elements.INamedElement primitive
protected final ShedWidget primitiveWidget
protected final cz.cuni.amis.pogamut.sposh.elements.LapChain primitiveChain
protected final ShedScene scene
protected final ShedPresenter presenter
| Constructor Detail |
|---|
protected PrimitivePresenter(ShedScene scene,
ShedPresenter presenter,
PRIMITIVE_TYPE primitive,
ShedWidget primitiveWidget,
cz.cuni.amis.pogamut.sposh.elements.LapChain primitiveChain)
scene - Scene that will be manipulated by this presenterpresenter - The basic presenterprimitive - The primitiver that is being presented.primitiveWidget - Widget that is representing the @primitive in theprimitiveChain - Chain of variables from the root to the @primitive| Method Detail |
|---|
public void register()
IPresenter
register in interface IPresenterpublic void unregister()
IPresenterIPresenter.register()
method.
unregister in interface IPresenter
public final void childElementAdded(PRIMITIVE_TYPE parent,
cz.cuni.amis.pogamut.sposh.elements.PoshElement child)
childElementAdded in interface cz.cuni.amis.pogamut.sposh.elements.PoshElementListener<PRIMITIVE_TYPE extends cz.cuni.amis.pogamut.sposh.elements.PoshElement & cz.cuni.amis.pogamut.sposh.elements.INamedElement>
public final void childElementMoved(PRIMITIVE_TYPE parent,
cz.cuni.amis.pogamut.sposh.elements.PoshElement child,
int oldIndex,
int newIndex)
childElementMoved in interface cz.cuni.amis.pogamut.sposh.elements.PoshElementListener<PRIMITIVE_TYPE extends cz.cuni.amis.pogamut.sposh.elements.PoshElement & cz.cuni.amis.pogamut.sposh.elements.INamedElement>
public final void childElementRemoved(PRIMITIVE_TYPE parent,
cz.cuni.amis.pogamut.sposh.elements.PoshElement child,
int removedChildIndex)
childElementRemoved in interface cz.cuni.amis.pogamut.sposh.elements.PoshElementListener<PRIMITIVE_TYPE extends cz.cuni.amis.pogamut.sposh.elements.PoshElement & cz.cuni.amis.pogamut.sposh.elements.INamedElement>
public final void nameMapChanged(String key,
String oldName,
String newName)
key - FQN of a classoldName - What was the original human readable name for the keynewName - Waht is the new human readable name for the key.public final void notifyLinkChanged()
notifyLinkChanged in interface cz.cuni.amis.pogamut.sposh.elements.ILapChainListenerprotected abstract String getTitleText()
updateWidget() to
protected final void updateWidget()
#action.
protected final boolean isSense(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
Sense?
element - element to check.
protected final cz.cuni.amis.pogamut.sposh.elements.Sense extractSense(cz.cuni.amis.pogamut.sposh.elements.Trigger<?> trigger,
cz.cuni.amis.pogamut.sposh.elements.PoshElement sense)
trigger - Trigger against which the method is testing.sense - tested sense
protected final boolean isAction(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
protected final cz.cuni.amis.pogamut.sposh.elements.TriggeredAction extractAction(List<cz.cuni.amis.pogamut.sposh.elements.TriggeredAction> actions,
cz.cuni.amis.pogamut.sposh.elements.PoshElement action)
protected final boolean isDrive(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
protected final cz.cuni.amis.pogamut.sposh.elements.DriveElement extractDrive(List<cz.cuni.amis.pogamut.sposh.elements.DriveElement> drives,
cz.cuni.amis.pogamut.sposh.elements.PoshElement drive)
protected final boolean isChoice(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
CompetenceElement?
element - Tested element
CompetenceElement or its
subclass, false otherwise.
protected final cz.cuni.amis.pogamut.sposh.elements.CompetenceElement extractChoice(List<cz.cuni.amis.pogamut.sposh.elements.CompetenceElement> choices,
cz.cuni.amis.pogamut.sposh.elements.PoshElement choice)
choices - List of choices that must contain the @choice.choice - Choice must be contained in the @choices
protected final boolean isActionPattern(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
ActionPattern?
element - Tested element
ActionPattern or its subclass,
false otherwise.
protected final cz.cuni.amis.pogamut.sposh.elements.ActionPattern extractActionPattern(List<cz.cuni.amis.pogamut.sposh.elements.ActionPattern> actionPatterns,
cz.cuni.amis.pogamut.sposh.elements.PoshElement actionPattern)
PoshElement to ActionPattern.
actionPatterns - List of ActionPatterns that must contain
the @actionPattern.actionPattern - The ActionPattern that must be contained in
the @actionPatterns
protected final boolean isCompetence(cz.cuni.amis.pogamut.sposh.elements.PoshElement element)
Competence?
element - Tested element
Competence or its subclass, false
otherwise.
protected final cz.cuni.amis.pogamut.sposh.elements.Competence extractCompetence(List<cz.cuni.amis.pogamut.sposh.elements.Competence> competences,
cz.cuni.amis.pogamut.sposh.elements.PoshElement competence)
PoshElement to Competence.
competences - List of Competences that must contain thecompetence - The Competence that must be contained in the
protected final <T extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> int getPosition(List<T> list,
T element)
T - Type of elementlist - list in which we determine position of the elemnt.element - The element for whic we want position in the list. Must be
there, otherwise assert error.
public AbstractAcceptAction[] getAcceptProviders()
IPresenter
getAcceptProviders in interface IPresenter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||