Examples of IGaService


Examples of org.eclipse.graphiti.services.IGaService

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

    SubProcess subprocess = (SubProcess) context.getNewObject();

    IGaService gaService = Graphiti.getGaService();
    IPeService peService = Graphiti.getPeService();

    ContainerShape containerShape = peService.createContainerShape(context.getTargetContainer(), true);
    Rectangle invisibleRect = gaService.createInvisibleRectangle(containerShape);

    gaService.setLocationAndSize(invisibleRect, context.getX(), context.getY(), width, height + 18);

    Shape rectShape = peService.createShape(containerShape, false);
    RoundedRectangle rect = gaService.createRoundedRectangle(rectShape, 5, 5);
       
    StyleUtil.applyBGStyle(rect, this);   

    gaService.setLocationAndSize(rect, 0, 0, width, height);
    decorateRect(rect);
    link(rectShape, subprocess);

    Rectangle box = gaService.createRectangle(rect);
    gaService.setLocationAndSize(box, 40, 80, 20, 20);
    box.setFilled(false);
    box.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
    decorateBox(box);

    Shape textShape = peService.createShape(containerShape, false);
    MultiText text = gaService.createDefaultMultiText(getDiagram(), textShape, subprocess.getName());
    gaService.setLocationAndSize(text, 10, 10, 80, 80);
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
    text.getFont().setBold(true);
    link(textShape, subprocess);

    Polyline lineHorizontal = gaService.createPolyline(box, new int[] { 2, 10, 18, 10 });
    lineHorizontal.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));

    Polyline lineVertical = gaService.createPolyline(box, new int[] { 10, 2, 10, 18 });
    lineVertical.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));

    ChopboxAnchor anchor = peService.createChopboxAnchor(containerShape);
    anchor.setReferencedGraphicsAlgorithm(rect);
View Full Code Here

Examples of org.eclipse.graphiti.services.IGaService

  @Override
  public IAddFeature getAddFeature(IFeatureProvider fp) {
    return new AddTaskFeature(fp) {
      @Override
      protected void decorateActivityRectangle(RoundedRectangle rect) {
        IGaService service = Graphiti.getGaService();
        Image img = service.createImage(rect, ImageProvider.IMG_16_SCRIPT_TASK);
        service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
      }
    };
  }
View Full Code Here

Examples of org.eclipse.graphiti.services.IGaService

  @Override
  public IAddFeature getAddFeature(IFeatureProvider fp) {
    return new AddTaskFeature(fp) {
      @Override
      protected void decorateActivityRectangle(RoundedRectangle rect) {
        IGaService service = Graphiti.getGaService();
        Image img = service.createImage(rect, ImageProvider.IMG_16_BUSINESS_RULE_TASK);
        service.setLocationAndSize(img, 2, 2, 16, 16);
      }

      @Override
      protected int getWidth() {
        return GraphicsUtil.TASK_DEFAULT_WIDTH + 50;
View Full Code Here

Examples of org.eclipse.graphiti.services.IGaService

  @Override
  public IAddFeature getAddFeature(IFeatureProvider fp) {
    return new AddTaskFeature(fp) {
      @Override
      protected void decorateActivityRectangle(RoundedRectangle rect) {
        IGaService service = Graphiti.getGaService();
        Image img = service.createImage(rect, ImageProvider.IMG_16_USER_TASK);
        service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
      }
    };
  }
View Full Code Here

Examples of org.eclipse.graphiti.services.IGaService

  @Override
  public IAddFeature getAddFeature(IFeatureProvider fp) {
    return new AddTaskFeature(fp) {
      @Override
      protected void decorateActivityRectangle(RoundedRectangle rect) {
        IGaService service = Graphiti.getGaService();
        Image img = service.createImage(rect, ImageProvider.IMG_16_SEND_TASK);
        service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
      }
    };
  }
View Full Code Here

Examples of org.eclipse.graphiti.services.IGaService

  @Override
  public IAddFeature getAddFeature(IFeatureProvider fp) {
    return new AddTaskFeature(fp) {
      @Override
      protected void decorateActivityRectangle(RoundedRectangle rect) {
        IGaService service = Graphiti.getGaService();
        Image img = service.createImage(rect, ImageProvider.IMG_16_SERVICE_TASK);
        service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
      }
    };
  }
View Full Code Here

Examples of org.eclipse.graphiti.services.IGaService

  @Override
  public IAddFeature getAddFeature(IFeatureProvider fp) {
    return new AddTaskFeature(fp) {
      @Override
      protected void decorateActivityRectangle(RoundedRectangle rect) {
        IGaService service = Graphiti.getGaService();
        Image img = service.createImage(rect, ImageProvider.IMG_16_RECEIVE_TASK);
        service.setLocationAndSize(img, 2, 2, GraphicsUtil.TASK_IMAGE_SIZE, GraphicsUtil.TASK_IMAGE_SIZE);
      }
    };
  }
View Full Code Here

Examples of org.eclipse.graphiti.services.IGaService

  }

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

    Diagram targetDiagram = (Diagram) context.getTargetContainer();
    IPeCreateService peCreateService = Graphiti.getPeCreateService();
    ContainerShape containerShape = peCreateService.createContainerShape(targetDiagram, true);

    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);
    gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);

    Shape lineShape = peCreateService.createShape(containerShape, false);
    Polyline line = gaService.createPolyline(lineShape, new int[] { 15, 0, 15, height });
    line.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));

    Shape textShape = peCreateService.createShape(containerShape, false);
    Text text = gaService.createText(textShape, p.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);
    peService.setPropertyValue(containerShape, MULTIPLICITY, Boolean.toString(false));

    createDIShape(containerShape, p);
    link(textShape, p);
    peCreateService.createChopboxAnchor(containerShape);
View Full Code Here

Examples of org.eclipse.graphiti.services.IGaService

        return true;
      }

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

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

        ContainerShape container = peService.createContainerShape(context.getTargetContainer(), true);
        RoundedRectangle rect = gaService.createRoundedRectangle(container, 5, 5);
        rect.setFilled(false);
        rect.setLineWidth(2);
        rect.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
        rect.setLineStyle(LineStyle.DASHDOT);
        gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);

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

        link(container, group);
View Full Code Here

Examples of org.eclipse.graphiti.services.IGaService

  }

  @Override
  public boolean update(IUpdateContext context) {
    IPeService peService = Graphiti.getPeService();
    IGaService gaService = Graphiti.getGaService();

    Participant participant = (Participant) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
        Participant.class);
    ContainerShape containerShape = (ContainerShape) context.getPictogramElement();

    if (participant.getParticipantMultiplicity() != null) {
      Shape shape = peService.createShape(containerShape, false);
      peService.setPropertyValue(shape, MULTIPLICITY_MARKER, Boolean.toString(true));
      Rectangle invisibleRectangle = gaService.createInvisibleRectangle(shape);
      GraphicsAlgorithm parentGa = containerShape.getGraphicsAlgorithm();
      int x = (parentGa.getWidth() / 2) - 10;
      int y = parentGa.getHeight() - 20;
      gaService.setLocationAndSize(invisibleRectangle, x, y, 20, 20);

      Polyline line1 = gaService.createPolyline(invisibleRectangle, new int[] { 0, 0, 0, 20 });
      line1.setLineWidth(2);
      line1.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
      Polyline line2 = gaService.createPolyline(invisibleRectangle, new int[] { 9, 0, 9, 20 });
      line2.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
      line2.setLineWidth(2);
      Polyline line3 = gaService.createPolyline(invisibleRectangle, new int[] { 18, 0, 18, 20 });
      line3.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
      line3.setLineWidth(2);
    } else {
      Shape shape = FeatureSupport.getShape(containerShape, MULTIPLICITY_MARKER, Boolean.toString(true));
      if (shape != null) {
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.