Package java.util.concurrent

Examples of java.util.concurrent.Exchanger$Participant


    }
    Iterator<Participant> iterator = choreography.getParticipantRefs().iterator();
    String delim = ":";
    StringBuilder sb = new StringBuilder();
    while (iterator.hasNext()) {
      Participant participant = iterator.next();
      sb.append(participant.getId());
      if (iterator.hasNext()) {
        sb.append(delim);
      }
    }
    return sb.toString();
View Full Code Here


      }
    }

    Iterator<Participant> iterator = newParticipants.iterator();
    while (iterator.hasNext()) {
      Participant participant = iterator.next();

      ContainerShape bandShape = peService.createContainerShape(choreographyContainer, true);

      ParticipantBandKind bandKind = getNewParticipantBandKind(choreography, participant, first,
          !iterator.hasNext());

      boolean multiple = participant.getParticipantMultiplicity() != null
          && participant.getParticipantMultiplicity().getMaximum() > 1;

      int w = size.getWidth();
      int h = multiple ? 40 : 20;

      BPMNShape bpmnShape = DIUtils.createDIShape(bandShape, participant, 0, y + h, w, h, fp, diagram);
View Full Code Here

    band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
    band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
        diagram, IColorConstant.LIGHT_GRAY));
    gaService.setLocationAndSize(band, 0, 0, w, h);

    Participant p = (Participant) bpmnShape.getBpmnElement();
    if (showNames) {
      addBandLabel(bandShape, p.getName(), w, h);
    }
    AnchorUtil.addFixedPointAnchors(bandShape, band);
    peService.setPropertyValue(bandShape, ChoreographyProperties.BAND, Boolean.toString(true));
    peService.setPropertyValue(bandShape, ChoreographyProperties.MESSAGE_VISIBLE,
        Boolean.toString(bpmnShape.isIsMessageVisible()));
View Full Code Here

    band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
    band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
        diagram, IColorConstant.LIGHT_GRAY));
    gaService.setLocationAndSize(band, 0, y, w, h);

    Participant p = (Participant) bpmnShape.getBpmnElement();
    if (showNames) {
      addBandLabel(bandShape, p.getName(), w, h);
    }
    AnchorUtil.addFixedPointAnchors(bandShape, band);
    peService.setPropertyValue(bandShape, ChoreographyProperties.BAND, Boolean.toString(true));
    peService.setPropertyValue(bandShape, ChoreographyProperties.MESSAGE_VISIBLE,
        Boolean.toString(bpmnShape.isIsMessageVisible()));
View Full Code Here

    band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
    band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
        diagram, IColorConstant.LIGHT_GRAY));
    gaService.setLocationAndSize(band, 0, y, w, h);

    Participant p = (Participant) bpmnShape.getBpmnElement();
    if (showNames) {
      addBandLabel(bandShape, p.getName(), w, h);
    }
    AnchorUtil.addFixedPointAnchors(bandShape, band);
    peService.setPropertyValue(bandShape, ChoreographyProperties.BAND, Boolean.toString(true));
    peService.setPropertyValue(bandShape, ChoreographyProperties.MESSAGE_VISIBLE,
        Boolean.toString(bpmnShape.isIsMessageVisible()));
View Full Code Here

    }
  }

  private static String getMessageName(List<MessageFlow> messageFlows, List<ContainerShape> bands) {
    for (ContainerShape band : bands) {
      Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
      BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
      if (bpmnShape.isIsMessageVisible()) {
        for (MessageFlow flow : messageFlows) {
          if (flow.getSourceRef().equals(participant)) {
            return flow.getName();
View Full Code Here

    return context.getTargetContainer() instanceof Diagram;
    }

  @Override
    public Object[] create(ICreateContext context) {
    Participant p = null;
   
    try {
          ModelHandler mh = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
          p = mh.addParticipant();
          p.setName("Pool nr " + index++);
        } catch (IOException e) {
          Activator.logError(e);
        }
       
        addGraphicalRepresentation(context, p);
View Full Code Here

    FeatureSupport.redraw(context.getSourceContainer());
  }

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());

    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      handler.moveLane(movedLane, targetParticipant);
    } catch (IOException e) {
      Activator.logError(e);
    }

    Process process = targetParticipant.getProcessRef();
    if (process.getLaneSets().isEmpty()) {
      LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
//      createLaneSet.setId(EcoreUtil.generateUUID());
      process.getLaneSets().add(createLaneSet);
      ModelUtil.setID(createLaneSet);
View Full Code Here

    super(fp);
  }

  @Override
  public boolean canMoveShape(IMoveShapeContext context) {
    Participant p = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());

    if (getMovedLane(context).getFlowNodeRefs().isEmpty()) {
      return true;
    }

    if (p.getProcessRef() == null) {
      return true;
    }

    if (!p.getProcessRef().getLaneSets().isEmpty()) {
      return true;
    }

    return false;
  }
View Full Code Here

    FeatureSupport.redraw(context.getTargetContainer());
  }

  private void modifyModelStructure(IMoveShapeContext context) {
    try {
      Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context
          .getTargetContainer());
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      Lane movedLane = getMovedLane(context);
      handler.moveLane(movedLane, targetParticipant);
      Participant internalParticipant = handler.getParticipant(getDiagram());
      LaneSet laneSet = null;
      for (LaneSet set : internalParticipant.getProcessRef().getLaneSets()) {
        if (set.getLanes().contains(movedLane)) {
          laneSet = set;
          break;
        }
      }
      if (laneSet != null) {
        laneSet.getLanes().remove(movedLane);
        if (laneSet.getLanes().isEmpty()) {
          internalParticipant.getProcessRef().getLaneSets().remove(laneSet);
        }

        Process process = targetParticipant.getProcessRef();
        if (process.getLaneSets().isEmpty()) {
          LaneSet claneSet = ModelHandler.FACTORY.createLaneSet();
View Full Code Here

TOP

Related Classes of java.util.concurrent.Exchanger$Participant

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.