Create an Implementation Plan Diagram Using Open API

Implementation Plan is a project management tool that shows how a software project will evolve at a high level. This article will show you how to create an Implementation Plan Diagram using Open API.

The Implementation Plan Diagram will be created by the plugin.

Create Blank Implementation Plan Diagram

First, create a blank implementation plan diagram using the method Diagrammanager.createDiagram().

//Create Blank Diagram
DiagramManager diagramManager = ApplicationManager.instance().getDiagramManager();
IArchitectureRoadmapUIModel implementationDiagram = (IArchitectureRoadmapUIModel) diagramManager.createDiagram(IDiagramTypeConstants.DIAGRAM_TYPE_ARCHITECTURE_ROADMAP);
implementationDiagram.setName("Sample Implementation Plan Diagram");

Create Diagram Model

Unlike other charts and diagrams, a implementation charts’ elements are automatically rendered by the model, which is IArchitectureRoadmapModel. The model can be created using method IModelElementFactory.instance().createArchitectureRoadmapModel(). You will also have to set the widths of the time frames and the Lane using IArchitectureRoadmapModel. setTimeFrameWidth() and IArchitectureRoadmapModel. setLaneHeaderWidth() respectively.

//Create model
IArchitectureRoadmapModel implementation = IModelElementFactory.instance().createArchitectureRoadmapModel();
implementationDiagram.setArchitectureRoadmapModelAddress(implementation.getAddress());
//Set the width for every time frame
implementation.setTimeFrameWidth(75);
//Set the length for every lane
implementation.setLaneHeaderWidth(200);

Create Time Frames

Once the models are created, time frames can then be created from IModelElementactory.

//Create time frames
IArchitectureRoadmapTimeFrame jan1 = IModelElementFactory.instance().createArchitectureRoadmapTimeFrame();
jan1.setName("Jan-01");
implementation.addTimeFrame(jan1);

You can try using this method to create more time frames.

Create Lanes

Lanes can also be created from IModelElementactory when the model is created.

//Create lanes
IArchitectureRoadmapLane brmsBuild = IModelElementFactory.instance().createArchitectureRoadmapLane();
brmsBuild.setName("BRMSBuild");
//Specify the lane's color (and the corresponding bars) in RGB value
brmsBuild.setColor(Color.BLUE.getRGB());
//Add the lane to the diagram
implementation.addLane(brmsBuild);

It is now your turn to create more lanes.

Create Bars (Activities)

When both time frames and lanes are created, we can then create bars using IArchitectureRoadmapLane.createArchitectureRoadmapBar(). When after indicating the start and end time, and index, the bar can then be added to the Lane by the method IArchitectureRoadmapLane.addBar(). Please be noted that the start and end time pixels are calculated starting from the zero time frame.

//Create Bars
IArchitectureRoadmapBar analysis = brmsBuild.createArchitectureRoadmapBar();
analysis.setName("Analysis");
//Specify the start time
analysis.setStartTime(0);
//Specify the end time
analysis.setEndTime(100);
//Index = n -> the bar is sitting on row (n+1) on the lane
analysis.setIndex(0);
//Add the bar to the lane
brmsBuild.addBar(analysis);

You can use the same method to create more bars on the diagram.

Show Up Diagram

Finally show up the diagram.

//Show up the diagram
diagramManager.openDiagram(implementationDiagram);

Sample Plugin

The sample plugin demonstrate how to create Implementation Plan Diagram using Open API. After you deploy the plugin into Visual Paradigm you can then click the plugin button in the application toolbar to trigger it.

Download Sample Plugin

You can click here 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