You can create a message from IModelElementFactory. ShapeFragmentEachItem.resetCaption() Create Messages and Found/Lost Messages ShapeFragmentEachItem.addChild(shapeEachItem) add the operand shape as child of the fragment ICombinedFragmentUIModel shapeFragmentEachItem = (ICombinedFragmentUIModel) diagramManager.createDiagramElement(sequence, fragmentEachItem) this fragment will cover three life linesįragmentEachItem.addCoveredLifeLine(lifelineOrder) įragmentEachItem.addCoveredLifeLine(lifelineCareful) įragmentEachItem.addCoveredLifeLine(lifelineRegular) ICombinedFragment fragmentEachItem = IModelElementFactory.instance().createCombinedFragment() įtName("Loop for each item") įtInteractionOperator(ICombinedFragment.INTERACTION_OPERATOR_LOOP) You will need to state the covering lifelines and the used operands with ICombinedFragment.addCoveredLifeLine() and ICombinedFragment.addOperand() respectively. We can now create some combined fragments once the operands are created. IInteractionOperandUIModel shapeEachItem = (IInteractionOperandUIModel) diagramManager.createDiagramElement(sequence, eachItem) Create Combined Fragments IInteractionConstraint constraintEachItem = IModelElementFactory.instance().createInteractionConstraint() ĬtName("for each item") ĬtConstraint("for each item") IInteractionOperand eachItem = IModelElementFactory.instance().createInteractionOperand() Once the constraint is created, it will then be assigned to a operands using tGuard(). We will also have to create a constraint for each operands. We can create some operands from IModelElementFactory. tBounds(246, 100, IActivationUIModel.BODY_WIDTH, 400) Create Operands IActivationUIModel shapeActivationOrder = (IActivationUIModel) diagramManager.createDiagramElement(sequence, activationOrder) LifelineOrder.addActivation(activationOrder) make this activation a part of the life line Order IActivation activationOrder = IModelElementFactory.instance().createActivation() Remember to use IInteractionLifeLine.addActivation() to make the activation a child of a lifeline. Once the lifelines are created, you can create activation from IModelElementFactory. ShapeOrder.resetCaption() Create Activation IInteractionLifeLineUIModel shapeOrder = (IInteractionLifeLineUIModel) diagramManager.createDiagramElement(sequence, lifelineOrder) declare which class does this lifeline associates to IInteractionLifeLine lifelineOrder = IModelElementFactory.instance().createInteractionLifeLine() Do not forget to add the a class as a lifeline’s base classifier using tBaseClassifier(). Model.addChild(classOrder) Create LifelinesĪfter all classes are created, you can now use IModelElementfactory to create some timelines. IClass classOrder = IModelElementFactory.instance().createClass() ĬtVisibility(IClass.VISIBILITY_PUBLIC) Model.addSubDiagram(sequence) Create Classesīefore creating any lifeline, you will need to create the corresponding class for every lifeline from IModelElementFactory. IModel model = IModelElementFactory.instance().createModel() Then, make the diagram a sub diagram of the model using IModel.addSubDiagram(). Once the diagram is created, create a model. IFrame rootFrame = sequence.getRootFrame(true) Create Model Retrieve root frame of the interaction IInteractionDiagramUIModel sequence = (IInteractionDiagramUIModel) diagramManager.createDiagram(IDiagramTypeConstants.DIAGRAM_TYPE_INTERACTION_DIAGRAM) Create blank diagramĭiagramManager diagramManager = ApplicationManager.instance().getDiagramManager() The sequence diagram will be created by the plugin.įirst create a blank diagram using DiagramManager.createDiagram().
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |