Package ca.phon.app.opgraph.editor
Class OpgraphEditorModelFactory
java.lang.Object
ca.phon.app.opgraph.editor.OpgraphEditorModelFactory
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMap<Class<? extends OpgraphEditorModel>,
IPluginExtensionFactory<? extends OpgraphEditorModel>> List<Class<? extends OpgraphEditorModel>>
Return a list of available models types.fromGraph
(ca.phon.opgraph.OpGraph graph) Create a newOpgraphEditorModel
from the givenOpGraph
.fromType
(Class<? extends OpgraphEditorModel> modelType)
-
Field Details
-
MODEL_TYPE_KEY
- See Also:
-
-
Constructor Details
-
OpgraphEditorModelFactory
public OpgraphEditorModelFactory()
-
-
Method Details
-
availableModelTypes
Return a list of available models types. Each model should be a subclass ofOpgraphEditorModel
. Each subclass should implement both the default constructor and theOpGraph
constructor as well as handle both cases in theIPluginExtensionFactory
implementation.- Returns:
- list of available editor model types
-
availableFactories
public Map<Class<? extends OpgraphEditorModel>,IPluginExtensionFactory<? extends OpgraphEditorModel>> availableFactories() -
fromType
-
fromGraph
Create a newOpgraphEditorModel
from the givenOpGraph
. If theOpGraph
includes a a setting for the propertyca.phon.app.opgraph.editor.modeltype
this method will attempt to create the appropriate model using the registered factory. Otherwise aMacroOpgraphEditorModel
is returned.- Parameters:
graph
-- Throws:
ClassNotFoundException
-