Package org.eclipse.graphiti.features

Examples of org.eclipse.graphiti.features.IAddFeature.canAdd()


    addContext.setX(x);
    addContext.setY(y);
    y += 100;

    IAddFeature addFeature = featureProvider.getAddFeature(addContext);
    if (addFeature.canAdd(addContext)) {
      PictogramElement destState = null;
      if (processedNodes.contains(node) == false) {
        destState = addFeature.add(addContext);
      } else {
        destState = featureProvider.getPictogramElementForBusinessObject(node);
View Full Code Here


    addContext.setTargetContainer(getDiagram());

    // execute the add to diagram action
    IAddFeature addFeature = getFeatureProvider().getAddFeature(addContext);
    PictogramElement newNode = null;
    if (addFeature.canAdd(addContext)) {
      newNode = addFeature.add(addContext);
      if (newNode != null) {
        RouteSupport selectedRoute = Activator.getDiagramEditor().getSelectedRoute();
        if (selectedRoute != null) {
          selectedRoute.addChild(node);
View Full Code Here

    } else {
      context.setTargetContainer(diagram);
      context.setLocation((int) shape.getBounds().getX(), (int) shape.getBounds().getY());
    }

    if (addFeature.canAdd(context)) {
      PictogramElement newContainer = addFeature.add(context);
      featureProvider.link(newContainer, new Object[] { bpmnElement, shape });
      if (bpmnElement instanceof Participant) {
        elements.put(((Participant) bpmnElement).getProcessRef(), newContainer);
      }
View Full Code Here

        AddContext context = new AddContext();
        context.setTargetContainer((ContainerShape) newContainer);
        context.setNewObject(obj);

        IAddFeature aFeat = featureProvider.getAddFeature(context);
        if (aFeat != null && aFeat.canAdd(context)) {
          aFeat.add(context);
        }
      }
    }
  }
View Full Code Here

    AddConnectionContext context = new AddConnectionContext(sourceAnchor, targetAnchor);
    context.setNewObject(bpmnEdge.getBpmnElement());

    IAddFeature addFeature = featureProvider.getAddFeature(context);
    if (addFeature != null && addFeature.canAdd(context)) {
      context.putProperty(IMPORT_PROPERTY, true);
      Connection connection = (Connection) addFeature.add(context);

      if (connection instanceof FreeFormConnectionImpl) {
        FreeFormConnectionImpl freeForm = (FreeFormConnectionImpl) connection;
View Full Code Here

    IAddFeature addFeature = getFeatureProvider().getAddFeature(laneContext);
    laneContext.setNewObject(lane);
    laneContext.setSize(poolElement.getGraphicsAlgorithm().getWidth() - 20, poolElement.getGraphicsAlgorithm().getHeight());
    laneContext.setTargetContainer((ContainerShape) poolElement);
    laneContext.setLocation(20, 0);
    if (addFeature.canAdd(laneContext)) {
      PictogramElement laneContainer = addFeature.add(laneContext);
      getFeatureProvider().link(laneContainer, new Object[] { lane });
    }

    // return newly created business object(s)
View Full Code Here

    }

    context.setLocation(x, y);

    PictogramElement pictElement = null;
    if (addFeature.canAdd(context)) {
      pictElement = addFeature.add(context);
      featureProvider.link(pictElement, new Object[] { element });
    }

    return pictElement;
View Full Code Here

              AddContext boundaryContext = new AddContext(new AreaContext(), boundaryEvent);
              boundaryContext.setTargetContainer(container);
              Point location = getLocation(container);
              boundaryContext.setLocation((int) graphicInfo.getX() - location.x, (int) graphicInfo.getY() - location.y);

              if (addFeature.canAdd(boundaryContext)) {
                PictogramElement newBoundaryContainer = addFeature.add(boundaryContext);
                featureProvider.link(newBoundaryContainer, new Object[] { boundaryEvent });
              }
            }
          }
View Full Code Here

                PictogramElement newBoundaryContainer = addFeature.add(boundaryContext);
                featureProvider.link(newBoundaryContainer, new Object[] { boundaryEvent });
              }
            }
          }
        } else if (addFeature.canAdd(context)) {
          PictogramElement newContainer = addFeature.add(context);
          featureProvider.link(newContainer, new Object[] { flowElement });

          if (flowElement instanceof SubProcess) {
            drawFlowElements(((SubProcess) flowElement).getFlowElements(), locationMap, (ContainerShape) newContainer, process);
View Full Code Here

          final Point location = getLocation(parentContainer);

          context.setLocation((int) gi.getX() - location.x, (int) gi.getY() - location.y);
        }

        if (addFeature.canAdd(context)) {
          final PictogramElement newContainer = addFeature.add(context);
          featureProvider.link(newContainer, new Object[] { artifact });
        }
      }
    }
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.