Examples of IFeatureProvider


Examples of org.eclipse.graphiti.features.IFeatureProvider

   * (non-Javadoc)
   * @see org.eclipse.graphiti.tb.DefaultToolBehaviorProvider#getClickArea(org.eclipse.graphiti.mm.pictograms.PictogramElement)
   */
  @Override
  public GraphicsAlgorithm[] getClickArea(PictogramElement pe) {
    IFeatureProvider featureProvider = getFeatureProvider();
    Object bo = featureProvider.getBusinessObjectForPictogramElement(pe);
    if (bo instanceof AbstractNode && !(bo instanceof Flow)) {
      GraphicsAlgorithm invisible = pe.getGraphicsAlgorithm();
      GraphicsAlgorithm rectangle = invisible;
      if (invisible.getGraphicsAlgorithmChildren().size() > 0) {
        rectangle = invisible.getGraphicsAlgorithmChildren().get(0);
View Full Code Here

Examples of org.eclipse.graphiti.features.IFeatureProvider

   * (non-Javadoc)
   * @see org.eclipse.graphiti.tb.DefaultToolBehaviorProvider#getSelectionBorder(org.eclipse.graphiti.mm.pictograms.PictogramElement)
   */
  @Override
  public GraphicsAlgorithm getSelectionBorder(PictogramElement pe) {
    IFeatureProvider featureProvider = getFeatureProvider();
    Object bo = featureProvider.getBusinessObjectForPictogramElement(pe);
    if (bo instanceof AbstractNode) {
      GraphicsAlgorithm invisible = pe.getGraphicsAlgorithm();
      GraphicsAlgorithm rectangle = invisible;
      if (invisible.getGraphicsAlgorithmChildren().size() > 0) {
        rectangle = invisible.getGraphicsAlgorithmChildren().get(0);
View Full Code Here

Examples of org.eclipse.graphiti.features.IFeatureProvider

   * @see org.eclipse.graphiti.notification.INotificationService#updatePictogramElements(org.eclipse.graphiti.mm.pictograms.PictogramElement[])
   */
  @Override
  public void updatePictogramElements(PictogramElement[] dirtyPes) {
    final IDiagramTypeProvider dtp = getDiagramTypeProvider();
    final IFeatureProvider fp = dtp.getFeatureProvider();
    for (PictogramElement pe : dirtyPes) {
      final UpdateContext updateContext = new UpdateContext(pe);
      // fp.updateIfPossible(updateContext);
      fp.updateIfPossibleAndNeeded(updateContext);
    }
  }
View Full Code Here

Examples of org.eclipse.graphiti.features.IFeatureProvider

   *            the changed and related BOs list
   * @return the pictogram element[]
   */
  protected PictogramElement[] calculateLinkedPictogramElements(ArrayList<Object> changedAndRelatedBOsList) {
    ArrayList<PictogramElement> retList = new ArrayList<PictogramElement>();
    final IFeatureProvider featureProvider = getDiagramTypeProvider().getFeatureProvider();
    for (Object crbo : changedAndRelatedBOsList) {
      final PictogramElement[] allPictogramElementsForBusinessObject = featureProvider.getAllPictogramElementsForBusinessObject(crbo);
      for (PictogramElement pe : allPictogramElementsForBusinessObject) {
        retList.add(pe);
      }
    }
    return retList.toArray(new PictogramElement[0]);
View Full Code Here

Examples of org.eclipse.graphiti.features.IFeatureProvider

      // TODO Auto-generated constructor stub
    }

    @Override
    public boolean canUpdate(IUpdateContext context) {
      IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();

      ContainerShape gatewayShape = (ContainerShape) context.getPictogramElement();
      for (Anchor anchor : gatewayShape.getAnchors()) {
        for (Connection connection : anchor.getIncomingConnections() ) {
          IUpdateContext updateCtx = new UpdateContext(connection);
          IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
          if (updateFeature != null) {
            boolean ret = updateFeature.canUpdate(updateCtx);
            if (ret)
              return ret;
          }
        }
        for (Connection connection : anchor.getOutgoingConnections() ) {
          IUpdateContext updateCtx = new UpdateContext(connection);
          IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
          if (updateFeature != null) {
            boolean ret = updateFeature.canUpdate(updateCtx);
            if (ret)
              return ret;
          }
View Full Code Here

Examples of org.eclipse.graphiti.features.IFeatureProvider

      return super.canUpdate(context);
    }

    @Override
    public IReason updateNeeded(IUpdateContext context) {
      IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();

      ContainerShape gatewayShape = (ContainerShape) context.getPictogramElement();
      for (Anchor anchor : gatewayShape.getAnchors()) {
        for (Connection connection : anchor.getIncomingConnections() ) {
          IUpdateContext updateCtx = new UpdateContext(connection);
          IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
          if (updateFeature != null) {
            IReason ret = updateFeature.updateNeeded(updateCtx);
            if (ret.toBoolean())
              return ret;
          }
        }
        for (Connection connection : anchor.getOutgoingConnections() ) {
          IUpdateContext updateCtx = new UpdateContext(connection);
          IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
          if (updateFeature != null) {
            IReason ret = updateFeature.updateNeeded(updateCtx);
            if (ret.toBoolean())
              return ret;
          }
View Full Code Here

Examples of org.eclipse.graphiti.features.IFeatureProvider

      return super.updateNeeded(context);
    }

    @Override
    public boolean update(IUpdateContext context) {
      IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();

      ContainerShape gatewayShape = (ContainerShape) context.getPictogramElement();
      for (Anchor anchor : gatewayShape.getAnchors()) {
        for (Connection connection : anchor.getIncomingConnections() ) {
          IUpdateContext updateCtx = new UpdateContext(connection);
          IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
          if (updateFeature != null) {
            updateFeature.update(updateCtx);
          }
        }
        for (Connection connection : anchor.getOutgoingConnections() ) {
          IUpdateContext updateCtx = new UpdateContext(connection);
          IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
          if (updateFeature != null) {
            updateFeature.update(updateCtx);
          }
        }
      }
View Full Code Here

Examples of org.eclipse.graphiti.features.IFeatureProvider

    super(fp);
  }

  @Override
  public void delete(IDeleteContext context) {
    IFeatureProvider fp = getFeatureProvider();
    PictogramElement pictogramElement = context.getPictogramElement();
    if (pictogramElement instanceof ContainerShape) {
      ContainerShape cShape = (ContainerShape) pictogramElement;
      EList<Anchor> anchors = cShape.getAnchors();
      for (Anchor anchor : anchors) {
View Full Code Here

Examples of org.eclipse.graphiti.features.IFeatureProvider

    List<IPaletteCompartmentEntry> ret = new ArrayList<IPaletteCompartmentEntry>();

    // add compartments from super class

    IFeatureProvider featureProvider = getFeatureProvider();

    createConnectors(pref, ret, featureProvider);

    createEventsCompartments(pref, ret, featureProvider);
    createTasksCompartments(pref, ret, featureProvider);
View Full Code Here

Examples of org.eclipse.graphiti.features.IFeatureProvider

    for (SequenceFlow outgoingSequenceFlow : flowNode.getOutgoingFlows()) {
      toDeleteSequenceFlows.add(outgoingSequenceFlow);
    }
    for (SequenceFlow deleteObject : toDeleteSequenceFlows) {
      IRemoveContext rc = new RemoveContext(getFeatureProvider().getPictogramElementForBusinessObject(deleteObject));
      IFeatureProvider featureProvider = getFeatureProvider();
      IRemoveFeature removeFeature = featureProvider.getRemoveFeature(rc);
      if (removeFeature != null) {
        removeFeature.remove(rc);
      }
     
      Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
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.