You can add custom commands to the command bar of a dependency matrix as well as assign custom shortcut keys for the commands.
To add a new command to the command bar, add an instance of the com.nomagic.actions.AMConfigurator interface to the com.nomagic.magicdraw.actions.ActionsConfiguratorsManager class, as is shown in the following example:
ActionsConfiguratorsManager.getInstance().addDiagramCommandBarConfigurator( DependencyMatrixConfigurator.DEFAULT_DEPENDENCY_MATRIX_DIAGRAM_TYPE, new AMConfigurator() { @Override public void configure(ActionsManager mngr) { mngr.addCategory(new ActionsCategory("ID", "My Category")); } @Override public int getPriority() { return AMConfigurator.HIGH_PRIORITY; } });
When customizing the default dependency matrix type, provide the name defined in the com.nomagic.magicdraw.dependencymatrix.configuration.DependencyMatrixConfigurator.DEFAULT_DEPENDENCY_MATRIX_DIAGRAM_TYPE constant. And when customizing a custom dependency matrix type, provide the name defined in the instance of the DependencyMatrixConfigurator class as well as in the Customize Dependency Matrix Wizard dialog.
The same code example can be used for the shortcut key configuration:
ActionsConfiguratorsManager.getInstance().addDiagramShortcutsConfigurator(...)