ides.api.plugin.model
Interface DESModel

All Superinterfaces:
Annotable, DESModelPublisher
All Known Subinterfaces:
FSAModel, FSASupervisor, ParentModel, SupervisoryEventSet

public interface DESModel
extends Annotable, DESModelPublisher

The interface for all models which IDES will handle.

Author:
Lenko Grigorov

Method Summary
 DESEventSet getEventSet()
          Obtains the set of events in the model.
 DESModelType getModelType()
          Returns the model type.
 java.lang.String getName()
          Returns the display name of the model.
 ParentModel getParentModel()
          Returns the parent model, if any, of the model.
 void metadataChanged()
          Notifies the model that some associated metadata has been changed.
 void modelSaved()
          Notifies the model that it has been saved.
 boolean needsSave()
          Returns true if the information about the model needs to be saved; false otherwise.
 void setName(java.lang.String name)
          Sets the display name of the model.
 void setParentModel(ParentModel model)
          Sets the parent model of the model.
 
Methods inherited from interface ides.api.core.Annotable
getAnnotation, hasAnnotation, removeAnnotation, setAnnotation
 
Methods inherited from interface ides.api.plugin.model.DESModelPublisher
addSubscriber, getDESModelSubscribers, removeSubscriber
 

Method Detail

setName

void setName(java.lang.String name)
Sets the display name of the model.

Parameters:
name - new display name for the model

getName

java.lang.String getName()
Returns the display name of the model.

Returns:
the display name of the model

getModelType

DESModelType getModelType()
Returns the model type.

Returns:
the model type

metadataChanged

void metadataChanged()
Notifies the model that some associated metadata has been changed.


modelSaved

void modelSaved()
Notifies the model that it has been saved.


needsSave

boolean needsSave()
Returns true if the information about the model needs to be saved; false otherwise. This method should also consider changes to the associated metadata (see metadataChanged()). E.g., if the user moves a node of a FSAGraph, this method will return true since the updated position of the node has to be saved.

Returns:
true if the information maintained by the model needs to be saved; false otherwise

getParentModel

ParentModel getParentModel()
Returns the parent model, if any, of the model.

The parent model of a model is the model which is responsible for the maintenance of the child model, e.g., keeping track of changes, saving and loading, etc. If a model has a parent model, IDES will treat the child model as a temporary "view" into the parent model (e.g., it will not ask to save the model on closing, it will not allow renaming of the model, etc.)

Returns:
the parent model of the model; null if there is no parent

setParentModel

void setParentModel(ParentModel model)
Sets the parent model of the model.

Parameters:
model - the parent model for the model
See Also:
getParentModel()

getEventSet

DESEventSet getEventSet()
Obtains the set of events in the model. If there are no events in the model, returns an empty set.

Returns:
the set of events in the model.