java.lang.Object
com.nomagic.magicdraw.dependencymatrix.configuration.MatrixDataHelper

@OpenApiAll public class MatrixDataHelper extends Object
Helper used to get and manage Dependency Matrix Data from external plugins.

Please pay attention, that if the Dependency Matrix diagram is not opened, its data is not collected and dependency matrix component needs to be built.

  • Constructor Details

    • MatrixDataHelper

      public MatrixDataHelper()
  • Method Details

    • getMatrixData

      @CheckForNull public static MatrixData getMatrixData(Diagram matrix)
      Gets the matrix diagram data object. Pleas note, that if the matrix is not already opened, it will be witout data. If you need to manage not opened matrices use MatrixDataHelper.buildMatrix() method
      Parameters:
      matrix - diagram of the dependency matrix
      Returns:
      Dependency Matrix data component for specified diagram or null if this dependency matrix was not found. Before using data make sure if the matrix data is up to date and does not need to be rebuilt
    • buildMatrix

      @CheckForNull public static MatrixData buildMatrix(Diagram matrix)
      Collects all data for provided matrix data component. This may be CPU/Time intensive task, so use it only in cases, when not opened matrix diagrams have to be used
      Parameters:
      matrix - Dependency Matrix diagram instance
      Returns:
      Dependency Matrix data component for specified diagram or null if this dependency matrix was not found
    • isRebuildNeeded

      public static boolean isRebuildNeeded(Diagram matrix)
      Checks if the current Dependency Matrix data is up to date or even are collected. If this method returns true you need to call MatrixDataHelper.buildMatrix() in order to get correct data
      Parameters:
      matrix - Dependency Matrix diagram instance
      Returns:
      true if rebuild is required
    • refreshMatrix

      public static void refreshMatrix(Diagram matrix)
      Immediately rebuilds dependency matrix
      Parameters:
      matrix - diagram element of dependency matrix to rebuild
    • isEditable

      public static boolean isEditable(Diagram matrix, ElementNode rowNode, ElementNode columnNode)
      Checks whether the relation can be created/deleted between row node and column node depending on matrix dependency criteria.
      Parameters:
      matrix - diagram element of dependency matrix
      rowNode - row node that needs to be checked
      columnNode - column node that needs to be checked
      Returns:
      whether the relation can be created/deleted between given row/column nodes