@Override public void initializeWatchedModel( DefaultParticipantEditorModel watchedModel, CollaborationBean modelToBind) { this.initialized = false; if(!modelToBind.getParticipants().isEmpty()) { for(IParticipantBean p : modelToBind.getParticipants()) { if(p.getProcess()!=null && !p.getProcess().getFlowNodes().isEmpty()) { this.participant = p; break; } } } modelToBind.addParticipant(participant); DefaultParticipants.setDefaultParticipant(modelToBind, participant); watchedModel.setName(participant.getName()); watchedModel.setDocumentation(participant.getDocumentation()); watchedModel.setInterfaces(participant.getInterfaces()); this.initialized = true; }
@Override public void visitParticipant(IParticipantBean participantBean) { Participant participant = newInstance(Participant.class); participant.setId(participantBean.getId()); participant.setName(participantBean.getName()); if(participantBean.getProcess()!=null){ participant.setProcessRef(getBaseElementRef(participantBean.getProcess())); } setDocumentationAndExtensions(participant, participantBean); currentCollaboration.addParticipant(participant); currentParticipant = participant; }
protected ProcessChoosingPanel(IDefinitionsBean defs) { setTitle("Choose the processes that will be deployed"); setAutoScroll(true); setLayout(new FitLayout()); setBorder(false); processTreeNodes = new HashSet<ProcessTreeNode>(); diagramPanel = new TreePanel("BPMN Diagram"); diagramPanel.setAutoScroll(true); diagramPanel.setBorder(false); diagramPanel.setEnableDD(true); TreeNode rootNode = new TreeNode(((defs.getName()==null || defs.getName().isEmpty()) ? "Diagram" : defs.getName())); rootNode.setExpanded(true); rootNode.setAllowDrop(false); rootNode.setAllowDrag(false); diagramPanel.setRootNode(rootNode); for(IParticipantBean participant : defs.getCollaborations().get(0).getParticipants()){ //skip empty/collapsed pools if(participant.getProcess()==null || participant.getProcess().getFlowNodes().isEmpty()) continue; TreeNode poolNode = new ProcessTreeNode(participant.getProcess()); poolNode.setChecked(false); poolNode.setAllowDrag(false); String text = (participant.getName()==null ? participant.getId() : participant.getName()); poolNode.setText(text); poolNode.setIcon(POOL_ICON); rootNode.appendChild(poolNode); } this.add(diagramPanel); }