Examples of IPeService


Examples of org.eclipse.graphiti.services.IPeService

      return true;
    }
  }

  private static void setConditionalSequenceFlow(Connection connection) {
    IPeService peService = Graphiti.getPeService();
    SequenceFlow flow = BusinessObjectUtil.getFirstElementOfType(connection, SequenceFlow.class);

    Tuple<ConnectionDecorator, ConnectionDecorator> decorators = getConnectionDecorators(connection);
    ConnectionDecorator def = decorators.getFirst();
    ConnectionDecorator cond = decorators.getSecond();

    if (flow.getConditionExpression() != null && flow.getSourceRef() instanceof Activity && def == null) {
      ConnectionDecorator decorator = createConditionalConnectionDecorator(connection);
      GraphicsAlgorithm ga = decorator.getGraphicsAlgorithm();
      ga.setFilled(true);
      ga.setForeground(manageColor(connection, StyleUtil.CLASS_FOREGROUND));
      ga.setBackground(manageColor(connection, IColorConstant.WHITE));
    } else if (cond != null) {
      peService.deletePictogramElement(cond);
    }

    peService.setPropertyValue(connection, IS_CONDITIONAL_FLOW_PROPERTY,
        Boolean.toString(flow.getConditionExpression() != null));
  }
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

    }
    return null;
  }

  private static Tuple<ConnectionDecorator, ConnectionDecorator> getConnectionDecorators(Connection connection) {
    IPeService peService = Graphiti.getPeService();

    ConnectionDecorator defaultDecorator = null;
    ConnectionDecorator conditionalDecorator = null;

    Iterator<ConnectionDecorator> iterator = connection.getConnectionDecorators().iterator();
    while (iterator.hasNext()) {
      ConnectionDecorator connectionDecorator = iterator.next();
      String defProp = peService.getPropertyValue(connectionDecorator, DEFAULT_MARKER_PROPERTY);
      if (defProp != null && new Boolean(defProp)) {
        defaultDecorator = connectionDecorator;
        continue;
      }
      String condProp = peService.getPropertyValue(connectionDecorator, CONDITIONAL_MARKER_PROPERTY);
      if (condProp != null && new Boolean(condProp)) {
        conditionalDecorator = connectionDecorator;
      }
    }
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

      return canUpdate;
    }

    @Override
    public IReason updateNeeded(IUpdateContext context) {
      IPeService peService = Graphiti.getPeService();
      String property = peService.getPropertyValue(context.getPictogramElement(), IS_DEFAULT_FLOW_PROPERTY);
      if (property == null || !canUpdate(context)) {
        return Reason.createFalseReason();
      }
      SequenceFlow flow = BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
          SequenceFlow.class);
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

    public IReason updateNeeded(IUpdateContext context) {
      // NOTE: if this method returns "true" the very first time it's called by the refresh
      // framework, the connection line will be drawn as a red dotted line, so make sure
      // all properties have been correctly set to their initial values in the AddFeature!
      // see https://issues.jboss.org/browse/JBPM-3102
      IPeService peService = Graphiti.getPeService();
      Connection connection = (Connection) context.getPictogramElement();
      SequenceFlow flow = BusinessObjectUtil.getFirstElementOfType(connection, SequenceFlow.class);
      String property = peService.getPropertyValue(connection, IS_CONDITIONAL_FLOW_PROPERTY);
      if (property == null || !canUpdate(context)) {
        return Reason.createFalseReason();
      }
      boolean changed = flow.getConditionExpression() != null != new Boolean(property);
      return changed ? Reason.createTrueReason() : Reason.createFalseReason();
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

        connectionLine.setLineStyle(LineStyle.DOT);
      }

      @Override
      protected void createConnectionDecorators(Connection connection) {
        IPeService peService = Graphiti.getPeService();
        IGaService gaService = Graphiti.getGaService();

        ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);

        int w = 5;
        int l = 10;

        Polyline polyline = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w });
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

        connectionLine.setLineStyle(LineStyle.DOT);
      }

      @Override
      protected void createConnectionDecorators(Connection connection) {
        IPeService peService = Graphiti.getPeService();
        IGaService gaService = Graphiti.getGaService();

        ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);

        int w = 5;
        int l = 10;

        Polyline polyline = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w });
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

        connectionLine.setLineStyle(LineStyle.DASH);
      }

      @Override
      protected void createConnectionDecorators(Connection connection) {
        IPeService peService = Graphiti.getPeService();
        IGaService gaService = Graphiti.getGaService();

        ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);
        ConnectionDecorator startDecorator = peService.createConnectionDecorator(connection, false, 0, true);

        int w = 5;
        int l = 15;
       
        Polyline polyline = gaService.createPolygon(endDecorator, new int[] { -l, w, 0, 0, -l, -w, -l, w });
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

      return o != null && o instanceof StartEvent;
    }

    @Override
    public IReason updateNeeded(IUpdateContext context) {
      IPeService peService = Graphiti.getPeService();
      PictogramElement element = context.getPictogramElement();

      String prop = peService.getPropertyValue(element, INTERRUPTING);
      if (prop == null) {
        return Reason.createFalseReason();
      }

      StartEvent event = (StartEvent) getBusinessObjectForPictogramElement(element);
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

      return reason;
    }

    @Override
    public boolean update(IUpdateContext context) {
      IPeService peService = Graphiti.getPeService();
      ContainerShape container = (ContainerShape) context.getPictogramElement();
      StartEvent event = (StartEvent) getBusinessObjectForPictogramElement(container);

      Ellipse ellipse = (Ellipse) peService.getAllContainedShapes(container).iterator().next()
          .getGraphicsAlgorithm();
      LineStyle style = event.isIsInterrupting() ? LineStyle.SOLID : LineStyle.DASH;
      ellipse.setLineStyle(style);

      peService.setPropertyValue(container, INTERRUPTING, Boolean.toString(event.isIsInterrupting()));
      return true;
    }
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

    Object property = context.getProperty(ActivityMoveFeature.ACTIVITY_MOVE_PROPERTY);
    if (activity != null && property == null) {
      ContainerShape taskContainer = context.getTargetContainer();
      ContainerShape parentContainer = (ContainerShape) context.getPictogramElement().eContainer();

      IPeService peService = Graphiti.getPeService();

      ILocation loc = peService.getLocationRelativeToDiagram(taskContainer);
      MoveShapeContext c = (MoveShapeContext) context;
      int eventX = loc.getX() + context.getX();
      int eventY = loc.getY() + context.getY();

      if (!(parentContainer instanceof Diagram)) {
        loc = peService.getLocationRelativeToDiagram(parentContainer);
        eventX = eventX - loc.getX();
        eventY = eventY - loc.getY();
      }

      c.setLocation(eventX, eventY);
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.