Package org.osm2world.core.world.modules

Examples of org.osm2world.core.world.modules.RoadModule$Lane


        assertTrue(definitions.getRootElements().size() == 1);
        assertTrue(definitions.getRootElements().get(0) instanceof Process);
        Process process = getRootProcess(definitions);
        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


            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.LANE: {
            Lane lane = (Lane) theEObject;
            T result = caseLane(lane);
            if (result == null)
                result = caseBaseElement(lane);
            if (result == null)
                result = defaultCase(theEObject);
View Full Code Here

      BaseElement parentElement, Map<String, JsonNode> shapeMap,Map<String, List<JsonNode>> sourceAndTargetMap,Definitions model) {
      for (JsonNode shapeNode : shapesArrayNode) {
        String stencilId = BpmnJsonConverterUtil.getStencilId(shapeNode);
        //先处理lane,lane中会包含child元素
        if(STENCIL_LANE.equals(stencilId)){
          Lane lane = Bpmn2Factory.eINSTANCE.createLane();
          String override = BpmnJsonConverterUtil.getElementId(shapeNode);
          String laneNameString = JsonConverterUtil.getPropertyValueAsString(PROPERTY_NAME, shapeNode);
          lane.setId(override);
          lane.setName(laneNameString);
          if(parentElement instanceof Lane){
            Lane parentLane = ((Lane)parentElement);
            if(parentLane.getChildLaneSet() == null){
              LaneSet laneSet = Bpmn2Factory.eINSTANCE.createLaneSet();
                laneSet.getLanes().add(lane);
                parentLane.setChildLaneSet(laneSet);
            }else{
              parentLane.getChildLaneSet().getLanes().add(lane);
            }
          }else if(parentElement instanceof Process){
            Process process = (Process)parentElement;
            if(process.getLaneSets().size() >0){
              process.getLaneSets().get(0).getLanes().add(lane);
View Full Code Here

      ((Process) parentElement).getFlowElements().add(flowElement);
    } else if (parentElement instanceof SubProcess) {
      ((SubProcess) parentElement).getFlowElements().add(flowElement);
    } else if (parentElement instanceof Lane) {
      Process process = (Process)this.model.getRootElements().get(0);
      Lane lane = (Lane) parentElement;
      process.getFlowElements().add(flowElement);
      lane.getFlowNodeRefs().add((FlowNode)flowElement);
    }
  }
View Full Code Here

  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)) {
View Full Code Here

    modifyModelStructure(context);
    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());
View Full Code Here

    GraphicsAlgorithm ga = ((ContainerShape) context.getPictogramElement()).getGraphicsAlgorithm();

    int i = compare(ga.getHeight(), ga.getWidth(), context.getHeight(), context.getWidth());

    Lane lane = (Lane) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), Lane.class);

    if (i < 0 && lane.getFlowNodeRefs().size() == 0) {
      return true;
    }

    if (i > 0) {
      return true;
View Full Code Here

    super(fp);
  }

  @Override
  public boolean canMoveShape(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    boolean moveableHasFlowNodes = movedLane.getFlowNodeRefs().size() > 0;

    Lane targetLane = getTargetLane(context);
    boolean targetHasFlowNodeRefs = targetLane.getFlowNodeRefs().size() > 0;

    if (!moveableHasFlowNodes && !targetHasFlowNodeRefs) {
      return true;
    }
View Full Code Here

    ContainerShape targetContainer = context.getTargetContainer();
    return (Lane) getBusinessObjectForPictogramElement(targetContainer);
  }

  private void modifyModelStructure(IMoveShapeContext context) {
    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();
//      createLaneSet.setId(EcoreUtil.generateUUID());
      toLane.setChildLaneSet(createLaneSet);
      ModelUtil.setID(createLaneSet);
    }
    toLane.getChildLaneSet().getLanes().add(movedLane);
  }
View Full Code Here

    FeatureSupport.redraw(context.getSourceContainer());
    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);
View Full Code Here

TOP

Related Classes of org.osm2world.core.world.modules.RoadModule$Lane

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.