To customize the appearance of a dependency matrix, you have to register cell renderer components. There are three types of the renderers:

  • A cell renderer
  • A column header cell renderer
  • A row header cell renderer

To register a cell renderer component, use the instance of the com.nomagic.magicdraw.dependencymatrix.configuration.DependencyMatrixConfigurator class, created while registering a custom dependency matrix. All these renderers should implement the standard javax.swing.table.TableCellRenderer interface.

The cell renderer is used to represent dependencies in a dependency matrix. The renderer component of a single cell gets either the value of the Integer class or the instance of the com.nomagic.magicdraw.dependencymatrix.datamodel.cell.MatrixCellView class. The java.lang.Integer class represents dependency count. And the MatrixCellView class has a reference to the com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell class, which has all the information about the dependencies in the cell.

The row and column cell renderers works the same way. To get the particular row or column header element inside the cell, use the com.nomagic.magicdraw.dependencymatrix.ui.table.renderer.RendererHelper.getHeaderElement(javax.swing.JTable, int, int) method.