Showing Interface Caption for all ArchiMate diagram in the project

By default in ArchiMate Diagram the caption for interface type elements (i.e. Business Interface, Application Interface, Technology Interface) will have its caption hide away. This is aimed to make the diagrams looks clean and tidy. You can turn on the display of caption individual interface type in your active editing diagram via the Presentation Options menu, or using this plugin to turn on the display of caption for all interface types in all your ArchiMate diagram.

Retrieve ArchiMate diagrams in project

We first retrieve the ArchiMate diagrams in the project.

IProject project = ApplicationManager.instance().getProjectManager().getProject();
IDiagramUIModel[] diagrams = project.toDiagramArray();

Turn on the display of interface caption

Once the ArchiMate diagram is found we first see is the diagram being opened. If not then we open it.

if (diagram instanceof IArchiMateDiagramUIModel) {
  if (diagram.isOpened()) {
    openingDiagram = diagram;
  }

After that we set the option to turn on the display of caption for all interface types. After that close the diagram.

ApplicationManager.instance().getDiagramManager().openDiagram(diagram);
((IArchiMateDiagramUIModel) diagram).setShowActivityStateNodeCaption(524287);
diagram.closeDiagram();

Finally if the diagram previously was already opened then we open it again.

if (openingDiagram != null) {
  ApplicationManager.instance().getDiagramManager().openDiagram(openingDiagram);				
}

Sample Plugin

The sample plugin demonstrate how to turn on the display of caption for interface elements in all ArchiMate diagrams in the project. After you deploy the plugin into Visual Paradigm you can press the Show ArchiMate Interface Caption button in application toolbar to trigger it.

Trigger sample plugin

Trigger sample plugin

Download Sample Plugin

You can click this link to download the sample plugin.

 

Related Know-how

Related Link

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply