![]() SwimlaneShape.addChild(cellSeattleOrderProcessor) Create Model Elements and Views in the Compartment Add the compartment shape as child of swimlane shape Specify the ID of the vertical and horizontal headerĬtVerticalPartitionId(partitionSeattleHeader.getId()) ĬtHorizontalPartitionId(partitionOrderProcessorHeader.getId()) ĬtBounds(50+PARTITION_HEADER_HEIGHT, 80, 450-PARTITION_HEADER_HEIGHT, 200) IActivitySwimlane2CompartmentUIModel cellSeattleOrderProcessor = (IActivitySwimlane2CompartmentUIModel) diagramManager.createDiagramElement(diagram, IShapeTypeConstants.SHAPE_TYPE_ACTIVITY_SWIMLANE2_COMPARTMENT) Create compartment shape between Seattle partition and Order Processor partition You can imagine it is the cell which joining the partitions. Next we have to create the compartments ( IActivitySwimlane2CompartmentUIModel) for the partition. tVerticalPartitionIds(new String ) Create Compartment for partitions Associate the ID of partition header to the vertical and horizontal partition When the partitions are created we can associate them to the view of swimlane. Try it yourself to create the other 3 partitions. tBounds(50+PARTITION_HEADER_HEIGHT, 80, 450-PARTITION_HEADER_HEIGHT, PARTITION_HEADER_HEIGHT) Make sure it is within the bounds of the swimlane Specify the location of the partition header. SwimlaneShape.addChild(partitionSeattleHeader) Making the swimlane shape and partition header shape reference to each other Specify the same as a vertical partition ![]() ![]() IActivityPartitionHeaderUIModel partitionSeattleHeader = (IActivityPartitionHeaderUIModel) diagramManager.createDiagramElement(diagram, partitionSeattle) Create vertical partition header shape Add the partition model as child model of swimlaneĪfter that we create the view of the partition shape, which is the IActivityPartitionHeaderUIModel. Swimlane.addVerticalPartition(partitionSeattle) IActivityPartition partitionSeattle = IModelElementFactory.instance().createActivityPartition() First we have to create the partition model. tRequestResetCaption(true) Create Partition for SwimlaneĪfter create the swimlane we can start create partitions ( IActivityPartition) on the swimlane. Trigger the automatic calculate caption position Specify the size and location of the swimlane IActivitySwimlane2NewUIModel swimlaneShape = (IActivitySwimlane2NewUIModel) diagramManager.createDiagramElement(diagram, swimlane) IActivitySwimlane2 swimlane = IModelElementFactory.instance().createActivitySwimlane2() When the diagram is ready we can start to create the swimlane ( IActivitySwimlane2). IActivityDiagramUIModel diagram = (IActivityDiagramUIModel) diagramManager.createDiagram(IDiagramTypeConstants.DIAGRAM_TYPE_ACTIVITY_DIAGRAM) Create Model and View for Swimlane Create activity diagramĭiagramManager diagramManager = ApplicationManager.instance().getDiagramManager() We can use DiagramManager.createDiagram operation to create a blank new diagram. It contain a swimlane with 2 dimension partitions and elements organized across the partitions. This is the activity diagram we are going to create.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |