Documentation

1. Getting Started

1.1 Installation

Install

The SequenceDiagram is a plugin, you can install from the marketplace:

  • goto `Settings > plugins`
  • and search `SequenceDiagram` will find it,
  • then click install button.

Or you install here:

1.2 Quick Access

When installed. You can quickly access it with shortcut-keys:

  • Open `JAVA`, `kotlin`, `Scala` file
  • Generate sequence diagram with shortcut `Alt S` for windows, `Option S` for macOS.

Tips:

  • Place caret at name of method will fastest, generate diagram for the method.
  • Place caret at class name, will pop up list to choose which method to be generated.
  • Place caret at anywhere in the source file, will pop up choose list too.
  • Place caret at files other than `JAVA`, `kotlin`, `Scala`, will raise info window say `Unsupported source file.`

1.3 Code navigation

Navigation code

Code navigation is powerful function of SequenceDiagram plugin. When you generated a diagram for the method, you can double-click the shape in the diagram to jump to the code:

  • Double-click the call link name, will jump to the code call the method.
  • Double-click the method bar, will jump to the method definition.
  • Double-click the class name will open the class.

Or, you can navigate to code by choose context menu `Go to Source`.

Tips:

  • Double-click implementation dummy call, or double-click its method bar, will jump to the same place: the definition of implemented method.

2. Advanced Usage

2.1 Generate Settings

generate setting

You can make some options before you generate.

  • Open Sequence Diagram tool window in idea.
  • Click``to open `Sequence diagram options` windows,
  • then make some choice.

Tips:

  • Uncheck the `Display only project classes` option, will fast the generation process, because classes outside the project will trigger the decompile process.
  • Click`` in the bottom of `Sequence diagram options` windows, will open system settings of SequenceDiagram, more setting can be set there.

2.2 System Settings

system setting

SequenceDiagram plugin has more setting place in Idea's system settings. You can customize color of shape, font, and some useful options.

  • Open Idea's `Settings...`
  • Navigate to `Tools` > `SequenceDiagram` in side tree to open the system settings for SequenceDiagram.

Tips:

  • `Object overlay color mapping` setting are useful, when you need tag some class you concern. It will show additional color dot overlay on the class shape.
  • `Exclude from diagram` setting are more powerful, when you need exclude some class from generate process.

2.3 Remove shape

Remove shape

After the sequence diagram generated. You can still customize the diagram by remove shapes, which will make diagram more clean as you wish. The `Remove ***` action are locate in the context menu:

  • Right click class shape, `Remove class 'ClassA'`, will remove class from diagram.
  • Right click method bar, `Remove Method 'methodA()'`, will remove the method and it's subsequence.
  • Right click call link same as method bar.

Tips:

  • How to reverse removed shape? you can use `Filter manager` to manage all the removed actions. You can reverse single remove action, clear all removed actions.
  • The remove action will not change the source code, it only removes shape from diagram.

2.4 Filter Manager

Filter manager

Filter manager is tool useful when you remove shape from diagram, and you regret the deletion.

  • Click the `` toolwindow icon to open `Filter Manager` window.
  • Disable/Enable the filter(remove method or class).
  • Click `Clear All` to clean all filters.

2.5 Export Diagram

Export Diagram

SequenceDiagram plugin support export diagram as image file, SVG, PNG, JPG, TIFF or as plantUML, Mermaid file.

  • Click `` toolwindow icon to show export menu
  • Choose export menu, a file name dialog windows will ask the export file name and location.
  • Click `OK` confirm the export.

2.6 Expend Implementation

Expend Implementation Expend popup

Scenario: interface `IA` with many implementations `ClassA`, `ClassB`, `ClassC`.

    interface IA {
        void methodA();
    }
                

when generate sequence diagram for the method `main`,

    public void main(IA a) {
        a.methodA();
    }
                

Right-click on the method bar of `methodA`, will show a menu `Expend...`, click it, pop up a list of implementations for you, choose one of them to show in the diagram.

Tips:

  • the expend function only work for those interface, `Smart Interface` fail to find correct implementation. e.g. when generate sequence diagram for the method `main2`:
        public void main2() {
            IA a = new ClassA();
            a.methodA();
        }
                            
    the `Smart Interface` will find `ClassA` as an implementation for interface `IA`. Only ClassA will draw in the diagram, even you `Expend...` and choose a different implementation, ClassB or ClassC.
  • Some time you can disable the `Smart Interface` in settings, when you need choose implementation by hand.