Class DependencyMatrixConfigurator


  • @OpenApiAll
    public class DependencyMatrixConfigurator
    extends java.lang.Object
    This class allows to customize standard matrix behaviour and view. Custom matrix configurator must be derived from this class and registered in configurators registry with custom matrix descriptor.
    • Constructor Summary

      Constructors 
      Constructor Description
      DependencyMatrixConfigurator​(java.lang.String diagramType)
      create new instance of the configurator
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configureDependencyHandlers​(java.util.Collection<DependencyExtractor> extractors, java.util.Collection<DependencyEditor> editors)
      Creates Matrix Dependency handlers, which are responsible for extracting and editing dependencies shown in the matrix
      javax.swing.table.TableCellRenderer createColumnCellRenderer()
      Create renderer, which is responsible for displaying table header header row elements Make sure that TableCellRenderer also implements com.nomagic.magicdraw.ui.zoom.Zoomable interface to properly display scaled (zoomed) matrix.
      javax.swing.table.TableCellRenderer createRowCellRenderer()
      Create renderer, which is responsible for displaying row header column elements Make sure that provided TableCellRenderer also implements com.nomagic.magicdraw.ui.zoom.Zoomable interface to properly display scaled (zoomed) matrix.
      javax.swing.table.TableCellRenderer createTableCellRenderer()
      Create renderer, which is responsible for displaying cell elements Make sure that TableCellRenderer also implements com.nomagic.magicdraw.ui.zoom.Zoomable interface to properly display scaled (zoomed) matrix.
      static DependencyMatrixConfigurator getConfigurator​(Diagram diagram)
      Returns registered configurator for this diagram
      static DependencyMatrixConfigurator getConfigurator​(java.lang.String diagramType)
      Returns registered configurator for this diagram
      java.lang.String getDiagramType()
      Diagram type of the current configurator
      static java.util.Collection<java.lang.String> getRegisteredMatrixTypes()
      Returns list of all dependency matrix types
      static void registerConfiguration​(DependencyMatrixConfigurator configurator)
      Registers new configurator in the matrix configurator registry
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_DEPENDENCY_MATRIX_DIAGRAM_TYPE

        public static final java.lang.String DEFAULT_DEPENDENCY_MATRIX_DIAGRAM_TYPE
        Default dependency matrix diagram type
        See Also:
        Constant Field Values
      • mDiagramType

        private final java.lang.String mDiagramType
        Reference to the full matrix configurator
    • Constructor Detail

      • DependencyMatrixConfigurator

        public DependencyMatrixConfigurator​(java.lang.String diagramType)
        create new instance of the configurator
        Parameters:
        diagramType - diagram type name
    • Method Detail

      • getConfigurator

        @CheckForNull
        public static DependencyMatrixConfigurator getConfigurator​(Diagram diagram)
        Returns registered configurator for this diagram
        Parameters:
        diagram - diagram instance
        Returns:
        configurator used to create this kind of Dependency Matrix
      • getConfigurator

        @CheckForNull
        public static DependencyMatrixConfigurator getConfigurator​(java.lang.String diagramType)
        Returns registered configurator for this diagram
        Parameters:
        diagramType - diagram type name
        Returns:
        configurator used to create this kind of Dependency Matrix
      • registerConfiguration

        public static void registerConfiguration​(DependencyMatrixConfigurator configurator)
        Registers new configurator in the matrix configurator registry
        Parameters:
        configurator - new registered configurator
      • getDiagramType

        public java.lang.String getDiagramType()
        Diagram type of the current configurator
        Returns:
        diagram type
      • createTableCellRenderer

        public javax.swing.table.TableCellRenderer createTableCellRenderer()
        Create renderer, which is responsible for displaying cell elements Make sure that TableCellRenderer also implements com.nomagic.magicdraw.ui.zoom.Zoomable interface to properly display scaled (zoomed) matrix.
        Returns:
        new cell renderer component
      • createColumnCellRenderer

        public javax.swing.table.TableCellRenderer createColumnCellRenderer()
        Create renderer, which is responsible for displaying table header header row elements Make sure that TableCellRenderer also implements com.nomagic.magicdraw.ui.zoom.Zoomable interface to properly display scaled (zoomed) matrix.
        Returns:
        new column renderer component
      • createRowCellRenderer

        public javax.swing.table.TableCellRenderer createRowCellRenderer()
        Create renderer, which is responsible for displaying row header column elements Make sure that provided TableCellRenderer also implements com.nomagic.magicdraw.ui.zoom.Zoomable interface to properly display scaled (zoomed) matrix.
        Returns:
        new row renderer component
      • configureDependencyHandlers

        public void configureDependencyHandlers​(java.util.Collection<DependencyExtractor> extractors,
                                                java.util.Collection<DependencyEditor> editors)
        Creates Matrix Dependency handlers, which are responsible for extracting and editing dependencies shown in the matrix

        In order to add custom dependency extraction algorithms use DependencyExtractor In order to add custom dependency editors (add and remove dependency actions) use DependencyEditor

        Parameters:
        extractors - dependency extractor instances
        editors - Dependency editor instances
      • getRegisteredMatrixTypes

        public static java.util.Collection<java.lang.String> getRegisteredMatrixTypes()
        Returns list of all dependency matrix types
        Returns:
        all known dependency matrix types.