Package java.util.concurrent

Examples of java.util.concurrent.Exchanger$Participant


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

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
    Participant internalParticipant = null;

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

    LaneSet laneSet = null;
    for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
      if (set.getLanes().contains(movedLane)) {
        laneSet = set;
        break;
      }
    }

    if (laneSet != null) {
      laneSet.getLanes().remove(movedLane);
      if (laneSet.getLanes().isEmpty()) {
        sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
      }

      Process process = internalParticipant.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


    Lane movedLane = getMovedLane(context);
    Lane toLane = getTargetLane(context);

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

    Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());

    LaneSet laneSet = null;
    for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
      if (set.getLanes().contains(movedLane)) {
        laneSet = set;
        break;
      }
    }

    if (laneSet != null) {
      laneSet.getLanes().remove(movedLane);
      if (laneSet.getLanes().isEmpty()) {
        sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
      }
    }

    if (toLane.getChildLaneSet() == null) {
      LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
View Full Code Here

    super(fp);
  }

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

    if (p1.equals(p2)) {
      return false;
    }

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

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

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

    return false;
  }
View Full Code Here

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

  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);
    }

    Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());

    LaneSet laneSet = null;
    for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
      if (set.getLanes().contains(movedLane)) {
        laneSet = set;
        break;
      }
    }

    if (laneSet != null) {
      laneSet.getLanes().remove(movedLane);
      if (laneSet.getLanes().isEmpty()) {
        sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
      }

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

    ChoreographyActivity choreography = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
        ChoreographyActivity.class);

    String id = peService.getPropertyValue(context.getPictogramElement(), INITIATING_PARTICIPANT_REF);
    Participant participant = choreography.getInitiatingParticipantRef();

    if ((id == null || id.equals("null")) && participant == null) {
      return Reason.createFalseReason();
    }

    if (participant != null && (id != null && id.equals(participant.getId()))) {
      return Reason.createFalseReason();
    }

    return Reason.createTrueReason();
  }
View Full Code Here

        ChoreographyActivity.class);

    boolean hasInitiatingParticipant = choreography.getInitiatingParticipantRef() != null;

    for (ContainerShape band : ChoreographyUtil.getParticipantBandContainerShapes(container)) {
      Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
      boolean isInitiating = hasInitiatingParticipant
          && participant.equals(choreography.getInitiatingParticipantRef());
      Color color = manageColor(isInitiating ? IColorConstant.WHITE : IColorConstant.LIGHT_GRAY);
      band.getGraphicsAlgorithm().setBackground(color);
      BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
      bpmnShape.setParticipantBandKind(getParticipantBandKind(isInitiating, bpmnShape.getParticipantBandKind()));
    }

    Participant initiatingParticipant = choreography.getInitiatingParticipantRef();
    String id = initiatingParticipant == null ? "null" : initiatingParticipant.getId();
    peService.setPropertyValue(context.getPictogramElement(), INITIATING_PARTICIPANT_REF, id);

    return true;
  }
View Full Code Here

  protected void postMoveShape(final IMoveShapeContext context) {
    super.postMoveShape(context);
    IPeService peService = Graphiti.getPeService();
    Collection<Shape> shapes = peService.getAllContainedShapes((ContainerShape) context.getShape());
    for (Shape s : shapes) {
      Participant participant = BusinessObjectUtil.getFirstElementOfType(s, Participant.class);
      if (participant != null) {
        ContainerShape container = (ContainerShape) s;
        GraphicsAlgorithm ga = container.getGraphicsAlgorithm();

        BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(s, BPMNShape.class);
View Full Code Here

    for (BPMNShape bpmnShape : filteredShapes) {
      ParticipantBandKind bandKind = bpmnShape.getParticipantBandKind();
      ContainerShape createdShape = ChoreographyUtil.createParticipantBandContainerShape(bandKind,
          choreographyContainer, bpmnShape, isShowNames());
      createDIShape(createdShape, bpmnShape.getBpmnElement(), bpmnShape);
      Participant p = (Participant) bpmnShape.getBpmnElement();
      if (p.getParticipantMultiplicity() != null && p.getParticipantMultiplicity().getMaximum() > 1) {
        drawMultiplicityMarkers(createdShape);
      }
    }

    peService.setPropertyValue(choreographyContainer, PARTICIPANT_REF_IDS,
        ChoreographyUtil.getParticipantRefIds(choreography));
    Participant initiatingParticipant = choreography.getInitiatingParticipantRef();
    String id = initiatingParticipant == null ? "null" : initiatingParticipant.getId();
    peService.setPropertyValue(choreographyContainer, INITIATING_PARTICIPANT_REF, id);
  }
View Full Code Here

    }

  @Override
    public String getInitialValue(IDirectEditingContext context) {
    PictogramElement pe = context.getPictogramElement();
    Participant participant = (Participant) getBusinessObjectForPictogramElement(pe);
    return participant.getName();
    }
View Full Code Here

    }

  @Override
    public void setValue(String value, IDirectEditingContext context) {
    PictogramElement pe = context.getPictogramElement();
    Participant participant = (Participant) getBusinessObjectForPictogramElement(pe);
    participant.setName(value);
    updatePictogramElement(((Shape) pe).getContainer());
    }
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.