Examples of IPeService


Examples of org.eclipse.graphiti.services.IPeService

  }

  public static PictogramElement getFirstBaseElementFromDiagram(Diagram diagram, BaseElement e) {
    PictogramElement foundElem = null;

    IPeService peService = Graphiti.getPeService();
    Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
    for (PictogramElement pe : elements) {
      BaseElement be = getFirstElementOfType(pe, e.getClass());
      if (be != null && be.equals(e)) {
        foundElem = pe;
        break;
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

    layoutPictogramElement(container);
    return container;
  }

  private Shape createCollectionShape(ContainerShape container, int[] xy) {
    IPeService peService = Graphiti.getPeService();
    IGaService gaService = Graphiti.getGaService();
    Shape collectionShape = peService.createShape(container, false);
    Polyline line = gaService.createPolyline(collectionShape, xy);
    line.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
    line.setLineWidth(1);
    line.setLineVisible(false);
    peService.setPropertyValue(collectionShape, Properties.HIDEABLE_PROPERTY, Boolean.toString(true));
    return collectionShape;
  }
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

  }

  public static PictogramElement getPictogramElementFromDiagram(Diagram diagram, BPMNShape bpmnShape) {
    PictogramElement foundElem = null;

    IPeService peService = Graphiti.getPeService();
    Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
    for (PictogramElement pe : elements) {
      BPMNShape s = getFirstElementOfType(pe, BPMNShape.class);
      if (s != null && s.equals(bpmnShape)) {
        foundElem = pe;
        break;
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

    peService.setPropertyValue(crossShape, DELETABLE_PROPERTY, "true");
    return cross;
  }

  public static Asterisk createGatewayAsterisk(ContainerShape container) {
    IPeService service = Graphiti.getPeService();

    Shape verticalShape = service.createShape(container, false);
    Polyline vertical = gaService.createPolyline(verticalShape, new int[] { 23, 8, 23, 42 });
    vertical.setLineWidth(5);
    peService.setPropertyValue(verticalShape, DELETABLE_PROPERTY, "true");

    Shape horizontalShape = service.createShape(container, false);
    Polyline horizontal = gaService.createPolyline(horizontalShape, new int[] { 8, 24, 42, 24 });
    horizontal.setLineWidth(5);
    peService.setPropertyValue(horizontalShape, DELETABLE_PROPERTY, "true");

    Shape diagonalDescShape = service.createShape(container, false);
    Polyline diagonalDesc = gaService.createPolyline(diagonalDescShape, new int[] { 13, 14, 37, 37 });
    diagonalDesc.setLineWidth(4);
    peService.setPropertyValue(diagonalDescShape, DELETABLE_PROPERTY, "true");

    Shape diagonalAscShape = service.createShape(container, false);
    Polyline diagonalAsc = gaService.createPolyline(diagonalAscShape, new int[] { 37, 14, 13, 37 });
    diagonalAsc.setLineWidth(4);
    peService.setPropertyValue(diagonalAscShape, DELETABLE_PROPERTY, "true");

    Asterisk a = new Asterisk();
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

  @Override
  public PictogramElement add(IAddContext context) {
    Gateway addedGateway = (Gateway) context.getNewObject();
    IGaService gaService = Graphiti.getGaService();
    IPeService peService = Graphiti.getPeService();

    int d = 2 * GraphicsUtil.GATEWAY_RADIUS;
    int p = GraphicsUtil.GATEWAY_TEXT_AREA;

    ContainerShape containerShape = peService.createContainerShape(context.getTargetContainer(), true);
    Rectangle rect = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(rect, context.getX(), context.getY(), d, d + p);

    Shape gatewayShape = peService.createShape(containerShape, false);
    Polygon gateway = GraphicsUtil.createGateway(gatewayShape);
    StyleUtil.applyBGStyle(gateway, this);
    gaService.setLocationAndSize(gateway, 0, 0, d, d);
    decorateGateway(containerShape);

    Shape textShape = peService.createShape(containerShape, false);
    peService.setPropertyValue(textShape, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
    Text text = gaService.createDefaultText(getDiagram(), textShape, addedGateway.getName());
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
    gaService.setLocationAndSize(text, 0, d, d, p);

    createDIShape(containerShape, addedGateway);
    peService.createChopboxAnchor(containerShape);
    AnchorUtil.addFixedPointAnchors(containerShape, gateway);
    layoutPictogramElement(containerShape);
    return containerShape;
  }
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

  }

  @Override
  public PictogramElement add(IAddContext context) {
    IGaService gaService = Graphiti.getGaService();
    IPeService peService = Graphiti.getPeService();
    Conversation c = (Conversation) context.getNewObject();

    int w = context.getWidth() > 0 ? context.getWidth() : 30;
    int h = context.getHeight() > 0 ? context.getHeight() : 30;

    ContainerShape containerShape = peService.createContainerShape(context.getTargetContainer(), true);
    Rectangle rect = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(rect, context.getX(), context.getY(), w, h);

    int w_5th = w / 5;
    int[] xy = { w_5th, 0, w_5th * 4, 0, w, h / 2, w_5th * 4, h, w_5th, h, 0, h / 2 };
    Polygon hexagon = gaService.createPolygon(rect, xy);

    StyleUtil.applyBGStyle(hexagon, this);

    peService.createChopboxAnchor(containerShape);
    AnchorUtil.addFixedPointAnchors(containerShape, rect);

    link(containerShape, c);
    createDIShape(containerShape, c);
    return containerShape;
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

import org.eclipse.graphiti.services.IPeService;

public abstract class AbstractBoundaryEventOperation {

  public void doWork(Activity activity, Diagram diagram) {
    IPeService peService = Graphiti.getPeService();
    Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
    for (PictogramElement e : elements) {
      BoundaryEvent boundaryEvent = BusinessObjectUtil.getFirstElementOfType(e, BoundaryEvent.class);
      if (boundaryEvent != null && activity.getBoundaryEventRefs().contains(boundaryEvent)) {
        ContainerShape container = (ContainerShape) e;
        doWorkInternal(container);
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

  @Override
  public PictogramElement add(IAddContext context) {
    Event e = (Event) context.getNewObject();

    IPeService peService = Graphiti.getPeService();
    ContainerShape containerShape = peService.createContainerShape(context.getTargetContainer(), true);

    IGaService gaService = Graphiti.getGaService();

    Rectangle invisibleRect = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(invisibleRect, context.getX(), context.getY(), EVENT_SIZE, EVENT_SIZE
            + EVENT_TEXT_AREA);

    Shape ellipseShape = peService.createShape(containerShape, false);
    peService.setPropertyValue(ellipseShape, EVENT_ELEMENT, EVENT_CIRCLE);
    Ellipse ellipse = createEventShape(ellipseShape);
    StyleUtil.applyBGStyle(ellipse, this);
    decorateEllipse(ellipse);

    Shape textShape = peService.createShape(containerShape, false);
    peService.setPropertyValue(textShape, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
    Text text = gaService.createDefaultText(getDiagram(), textShape, e.getName());
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
    gaService.setLocationAndSize(text, 0, EVENT_SIZE, EVENT_SIZE, EVENT_TEXT_AREA);

    peService.createChopboxAnchor(containerShape);
    AnchorUtil.addFixedPointAnchors(containerShape, ellipse);
    hook(containerShape);
    createDIShape(containerShape, e);
    updatePictogramElement(containerShape);
    layoutPictogramElement(containerShape);
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

    return bo != null && bo instanceof Activity && context.getPictogramElement() instanceof ContainerShape;
    }

  @Override
    public IReason updateNeeded(IUpdateContext context) {
    IPeService peService = Graphiti.getPeService();
    PictogramElement element = context.getPictogramElement();
    String property = peService.getPropertyValue(element, getPropertyKey());
    if(property == null) {
      return Reason.createFalseReason();
    }
    Activity activity = (Activity) getBusinessObjectForPictogramElement(context.getPictogramElement());
    boolean changed = isPropertyChanged(activity, property);
View Full Code Here

Examples of org.eclipse.graphiti.services.IPeService

    return changed ? Reason.createTrueReason() : Reason.createFalseReason();
    }

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

    ContainerShape markerContainer = null;
    Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
    while (iterator.hasNext()) {
      Shape shape = (Shape) iterator.next();
      String property = peService.getPropertyValue(shape, GraphicsUtil.ACTIVITY_MARKER_CONTAINER);
      if(property != null && new Boolean(property)) {
        markerContainer = (ContainerShape) shape;
        break;
      }
    }
   
    doUpdate(activity, markerContainer);
    peService.setPropertyValue(container, getPropertyKey(), convertPropertyToString(activity));
    return true;
    }
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.