Examples of Lane


Examples of org.eclipse.bpmn2.Lane

    return true;
  }

  @Override
  protected void internalMove(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    Lane targetLane = getTargetLane(context);
    Lane sourceLane = getSourceLane(context);

    modifyModelStructure(sourceLane, targetLane, movedLane);

    FeatureSupport.redraw(context.getSourceContainer());
    FeatureSupport.redraw(context.getTargetContainer());
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

      return isSourceLane(context);
    }

    @Override
    public void move(FlowNode node, Object source, Object target) {
      Lane lane = (Lane) source;
      lane.getFlowNodeRefs().remove(node);
      node.getLanes().remove(lane);
    }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

      return FeatureSupport.isTargetLane(context);
    }

    @Override
    public boolean isMoveAllowed(Object source, Object target) {
      Lane lane = (Lane) target;
      return lane.getChildLaneSet() == null || lane.getChildLaneSet().getLanes().isEmpty();
    }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

      return lane.getChildLaneSet() == null || lane.getChildLaneSet().getLanes().isEmpty();
    }

    @Override
    public void move(FlowNode node, Object source, Object target) {
      Lane lane = (Lane) target;
      lane.getFlowNodeRefs().add(node);
      node.getLanes().add(lane);
      super.move(node, source, target);
    }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    return isLane && (intoDiagram || intoLane || intoParticipant || intoSubprocess);
  }

  @Override
  public PictogramElement add(IAddContext context) {
    Lane lane = (Lane) context.getNewObject();

    IPeCreateService peCreateService = Graphiti.getPeCreateService();
    ContainerShape containerShape = peCreateService.createContainerShape(context.getTargetContainer(), true);
    IGaService gaService = Graphiti.getGaService();

    int width = context.getWidth() > 0 ? context.getWidth() : 600;
    int height = context.getHeight() > 0 ? context.getHeight() : 100;

    Rectangle rect = gaService.createRectangle(containerShape);

    StyleUtil.applyBGStyle(rect, this);

    if (FeatureSupport.isTargetLane(context) || FeatureSupport.isTargetParticipant(context)) {
      GraphicsAlgorithm ga = context.getTargetContainer().getGraphicsAlgorithm();

      if (getNumberOfLanes(context) == 1) {
        gaService.setLocationAndSize(rect, 15, 0, width - 15, height);
        for (Shape s : getFlowNodeShapes(context, lane)) {
          Graphiti.getPeService().sendToFront(s);
          s.setContainer(containerShape);
        }
      } else {
        if (context.getWidth() == -1 || context.getHeight() == -1) {
          gaService.setLocationAndSize(rect, 15, ga.getWidth() - 1, ga.getHeight() - 15, height);
          // gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);
        } else {
          ILayoutService layoutService = Graphiti.getLayoutService();
          ILocation loc = layoutService.getLocationRelativeToDiagram(containerShape);
          int x = context.getX() - loc.getX();
          int y = context.getY() - loc.getY();
          gaService.setLocationAndSize(rect, x - 15, y, ga.getWidth() - 15, height);
        }
      }
      containerShape.setContainer(context.getTargetContainer());
    } else {
      gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);
    }

    Shape textShape = peCreateService.createShape(containerShape, false);
    Text text = gaService.createText(textShape, lane.getName());
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setAngle(-90);
    gaService.setLocationAndSize(text, 0, 0, 15, height);
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

  private int getNumberOfLanes(ITargetContext context) {
    ContainerShape targetContainer = context.getTargetContainer();
    Object bo = getBusinessObjectForPictogramElement(targetContainer);
    if (bo instanceof Lane) {
      Lane lane = (Lane) bo;
      return lane.getChildLaneSet().getLanes().size();
    } else if (bo instanceof Participant) {
      List<LaneSet> laneSets = ((Participant) bo).getProcessRef().getLaneSets();
      if (laneSets.size() > 0) {
        return laneSets.get(0).getLanes().size();
      }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    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

Examples of org.eclipse.bpmn2.Lane

  @Override
  protected void internalMove(IMoveShapeContext context) {
    IGaService gaService = Graphiti.getGaService();

    Lane movedLane = getMovedLane(context);
    GraphicsAlgorithm laneGa = context.getShape().getGraphicsAlgorithm();

    Lane targetLane = getTargetLane(context);
    GraphicsAlgorithm tga = context.getTargetContainer().getGraphicsAlgorithm();

    List<Shape> shapes = getFlowNodeShapes(context, targetLane);
    modifyModelStructure(targetLane, movedLane);
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    return shapes;
  }

  private int getNumberOfLanes(ITargetContext context) {
    ContainerShape targetContainer = context.getTargetContainer();
    Lane lane = (Lane) getBusinessObjectForPictogramElement(targetContainer);
    return lane.getChildLaneSet().getLanes().size();
  }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    }

  @Override
    public String getInitialValue(IDirectEditingContext context) {
    PictogramElement pe = context.getPictogramElement();
    Lane lane = (Lane) getBusinessObjectForPictogramElement(pe);
    return lane.getName();
    }
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.