Class ModelTransformationsManager
- java.lang.Object
-
- com.nomagic.magicdraw.modeltransformations.ModelTransformationsManager
-
@OpenApiAll public final class ModelTransformationsManager extends java.lang.Object
ModelTransformationsManager organizes process of application of model transformation. This class is responsible for Undo/redo commands etc.Use this class as singleton.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTransformation(ModelTransformationInfo info)
Adds the given model transformation in registered model transformations collection.boolean
doTransformation(ModelTransformationsWizardInformation wi, ModelTransformationInfo mti)
boolean
doUpdateTransformation(ModelTransformationInfo mti_final, Package transformedPackage_final, boolean sync_final, PropertyManager prop)
static ModelTransformationsManager
getInstance()
Returns a shared instance of model transformations manager.ModelTransformationInfo
getTransformationInfoByName(java.lang.String transformationName)
Returns transformation info by transformation namejava.util.Collection<ModelTransformationInfo>
getTransformations()
Returns all registered model transformations.static void
loadTransformationProperties(Style style, ModelTransformationsWizardInformation wi, Project project)
static Style
loadTransformationProperties(Package transformedPackage, ModelTransformationsWizardInformation wi)
void
removeTransformation(ModelTransformationInfo info)
Removes the given model transformation from registered collection of model transformations.void
saveTransformationProperties(ModelTransformationsWizardInformation wizardInformation)
boolean
transform(java.util.List<? extends BaseElement> selectedElements)
Displays transformation wizard and runs transformationvoid
updateProperties(PropertyManager source, PropertyManager propertiesToUpdate)
boolean
updateTransformation(Package transformed)
Checks for already applied transformations, sets the right one and runs transformation updateboolean
updateTransformation(Package transformed, boolean testingMode)
-
-
-
Method Detail
-
getInstance
public static ModelTransformationsManager getInstance()
Returns a shared instance of model transformations manager.- Returns:
- instance of model transformations manager.
-
addTransformation
public void addTransformation(ModelTransformationInfo info)
Adds the given model transformation in registered model transformations collection.- Parameters:
info
- the give transformation to add.
-
removeTransformation
public void removeTransformation(ModelTransformationInfo info)
Removes the given model transformation from registered collection of model transformations.- Parameters:
info
- the given transformation to remove.
-
getTransformations
public java.util.Collection<ModelTransformationInfo> getTransformations()
Returns all registered model transformations.- Returns:
- a collection of registered model transformations.
-
getTransformationInfoByName
@CheckForNull public ModelTransformationInfo getTransformationInfoByName(java.lang.String transformationName)
Returns transformation info by transformation name- Parameters:
transformationName
- transformation name- Returns:
- transformation info
-
transform
public boolean transform(java.util.List<? extends BaseElement> selectedElements)
Displays transformation wizard and runs transformation- Parameters:
selectedElements
- list of elements to transform- Returns:
- true if transformation was successful
-
doTransformation
public boolean doTransformation(ModelTransformationsWizardInformation wi, ModelTransformationInfo mti)
-
updateTransformation
public boolean updateTransformation(Package transformed, boolean testingMode)
-
updateTransformation
public boolean updateTransformation(Package transformed)
Checks for already applied transformations, sets the right one and runs transformation update- Parameters:
transformed
- list of elements to transform- Returns:
- true if transformation update was successful
-
doUpdateTransformation
public boolean doUpdateTransformation(ModelTransformationInfo mti_final, Package transformedPackage_final, boolean sync_final, @CheckForNull PropertyManager prop)
-
updateProperties
public void updateProperties(PropertyManager source, PropertyManager propertiesToUpdate)
-
loadTransformationProperties
@CheckForNull public static Style loadTransformationProperties(Package transformedPackage, ModelTransformationsWizardInformation wi)
-
loadTransformationProperties
public static void loadTransformationProperties(Style style, ModelTransformationsWizardInformation wi, Project project)
-
saveTransformationProperties
public void saveTransformationProperties(ModelTransformationsWizardInformation wizardInformation) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-