To create a custom dependency matrix type:
- Create a new plugin to register components of the new dependency matrix type.
- Register the new dependency matrix type that it was added to modeling tool toolbars and menus.
Creating a plugin for custom dependency matrix type
Use the com.nomagic.magicdraw.dependencymatrix.configuration.DependencyMatrixConfigurator class to register components of the new dependency matrix type as shown in the following example:
public class DependencyMatrixExample extends Plugin { @Override public void init() { DependencyMatrixConfigurator.registerConfiguration(new DependencyMatrixSampleConfigurator("Sample Extended Matrix")); } @Override public boolean close() { return true; } @Override public boolean isSupported() { return true; } }
Remember the name of the new dependency matrix type that you pass as an argument while creating a new instance of the DependencyMatrixConfigurator class (in the preceding example, it is “Sample Extended Matrix”). You will have to specify the exact name when registering a new diagram type.
The sample of more detailed configuration code is provided in <program installation folder>\openapi\examples\dependencymatrix.
Registering a new dependency matrix type in UI
Once the plugin is created, you have to register the new dependency matrix type by using the Customize Dependency Matrix Wizard dialog. Only then it will be added to program toolbars and menus.
To register a new dependency matrix type
- Start a modeling tool, for example, MagicDraw.
- On the Diagrams menu, click Customize. The Customize Diagrams dialog opens.
- Click Create and then select Dependency Matrix Type. The Customize Dependency Matrix Wizard dialog opens.
- In the Type box, specify the name of the new dependency matrix type. The value must be the same as the one passed to the DependencyMatrixConfigurator class as the argument.
Specifying name of new Dependency Matrix type
5. In the Abbreviation box, specify the abbreviation of the new dependency matrix type.
6. Click Finish.
7. Restart your modeling tool.
You can now create a custom dependency matrix.
For more information on how to customize a new dependency matrix type by using the Customize Dependency Matrix Wizard dialog, see “Creating New Dependency Matrix Type” in the MagicDraw UMLProfiling&DSL UserGuide.pdf.