Examples of Lane


Examples of org.eclipse.bpmn2.Lane

    }

  @Override
    public void setValue(String value, IDirectEditingContext context) {
    PictogramElement pe = context.getPictogramElement();
    Lane lane = (Lane) getBusinessObjectForPictogramElement(pe);
    lane.setName(value);
    updatePictogramElement(((Shape) pe).getContainer());
    }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    FeatureSupport.redraw(context.getTargetContainer());
    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);
    }
    process.getLaneSets().get(0).getLanes().add(movedLane);

    Lane fromLane = (Lane) getBusinessObjectForPictogramElement(context.getSourceContainer());
    fromLane.getChildLaneSet().getLanes().remove(movedLane);
    if (fromLane.getChildLaneSet().getLanes().isEmpty()) {
      fromLane.setChildLaneSet(null);
    }
  }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

  public static boolean isLaneOnTop(Lane lane) {
    return lane.getChildLaneSet() == null || lane.getChildLaneSet().getLanes().isEmpty();
  }

  public static boolean isTargetLaneOnTop(ITargetContext context) {
    Lane lane = BusinessObjectUtil.getFirstElementOfType(context.getTargetContainer(), Lane.class);
    return lane.getChildLaneSet() == null || lane.getChildLaneSet().getLanes().isEmpty();
  }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

      return a.getText();
    } else if (o instanceof Participant) {
      Participant p = (Participant) o;
      return p.getName();
    } else if (o instanceof Lane) {
      Lane l = (Lane) o;
      return l.getName();
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

import org.eclipse.graphiti.mm.pictograms.Shape;

final class SiblingLaneComparator implements Comparator<Shape> {
  @Override
  public int compare(Shape o1, Shape o2) {
    Lane l1 = BusinessObjectUtil.getFirstElementOfType(o1, Lane.class);
    Lane l2 = BusinessObjectUtil.getFirstElementOfType(o2, Lane.class);

    if (l1 != null && l2 != null && l1.eContainer().equals(l2.eContainer())) {
      int y1 = o1.getGraphicsAlgorithm().getY();
      int y2 = o2.getGraphicsAlgorithm().getY();
      return new Integer(y1).compareTo(y2);
    }
    return 0;
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    }
    return participant.getProcessRef();
  }

  public Lane createLane(Lane targetLane) {
    Lane lane = FACTORY.createLane();
//    lane.setId(EcoreUtil.generateUUID());
    ModelUtil.setID(lane,resource);

    if (targetLane.getChildLaneSet() == null) {
      targetLane.setChildLaneSet(ModelHandler.FACTORY.createLaneSet());
    }

    LaneSet targetLaneSet = targetLane.getChildLaneSet();
    targetLaneSet.getLanes().add(lane);

    lane.getFlowNodeRefs().addAll(targetLane.getFlowNodeRefs());
    targetLane.getFlowNodeRefs().clear();

    return lane;
  }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    return lane;
  }

  public Lane createLane(Object target) {
    Lane lane = FACTORY.createLane();
//    lane.setId(EcoreUtil.generateUUID());
    ModelUtil.setID(lane,resource);
    FlowElementsContainer container = getFlowElementContainer(target);
    if (container.getLaneSets().isEmpty()) {
      LaneSet laneSet = FACTORY.createLaneSet();
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    return intoDiagram || intoLane || intoParticipant || intoSubProcess;
  }

  @Override
  public Object[] create(ICreateContext context) {
    Lane lane = null;
    try {
      ModelHandler mh = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      Object o = getBusinessObjectForPictogramElement(context.getTargetContainer());
      if (FeatureSupport.isTargetLane(context)) {
        Lane targetLane = (Lane) o;
        lane = mh.createLane(targetLane);
      } else {
        lane = mh.createLane(o);
      }
      lane.setName("Lane nr " + index++);
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

        assertTrue(definitions.getRootElements().size() == 1);
        assertTrue(definitions.getRootElements().get(0) instanceof Process);
        Process process = (Process) definitions.getRootElements().get(0);
        assertTrue(process.getLaneSets().size() == 1);
        assertTrue(process.getLaneSets().get(0).getLanes().size() == 1);
        Lane l = process.getLaneSets().get(0).getLanes().get(0);
        assertEquals("my first lane", l.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

        Process process = (Process) definitions.getRootElements().get(0);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        assertTrue(process.getLaneSets().size() == 1);
        assertTrue(process.getLaneSets().get(0).getLanes().size() == 1);
        Lane firstLane = process.getLaneSets().get(0).getLanes().get(0);
        assertEquals("First lane", firstLane.getName());
        Lane secondLane = firstLane.getChildLaneSet().getLanes().get(0);
        assertEquals("Second lane", secondLane.getName());
        assertEquals(g, secondLane.getFlowNodeRefs().get(0));
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.