Package org.eclipse.graphiti.mm.algorithms

Examples of org.eclipse.graphiti.mm.algorithms.RoundedRectangle


   */
  private void createBox(IAddContext context, LocalVariableStatement lvs,
      ContainerShape containerShape, int height) {

    // create and set graphics algorithm
    RoundedRectangle roundedRectangle =
        Graphiti.getGaService().createRoundedRectangle(
            containerShape, 5, 5);
    roundedRectangle.setStyle(StyleUtil.getStyleForPE(getDiagram()));
    Graphiti.getGaService().setLocationAndSize(roundedRectangle,
        context.getX(), context.getY(), BOX_WIDTH, height);
  }
View Full Code Here


    IGaService gaService = Graphiti.getGaService();

    {
      // create and set graphics algorithm
      RoundedRectangle roundedRectangle =
          gaService.createRoundedRectangle(containerShape, 5, 5);
      roundedRectangle.setStyle(StyleUtil.getStyleForCI(getDiagram()));
      gaService.setLocationAndSize(roundedRectangle,
          context.getX(), context.getY(), width, height);

      //Don't think this should happen, but want to be sure
      if (addedVar.eResource() == null) {
View Full Code Here

    IGaService gaService = Graphiti.getGaService();

    {
      // create and set graphics algorithm
      RoundedRectangle roundedRectangle =
          gaService.createRoundedRectangle(containerShape, 5, 5);
      roundedRectangle.setStyle(StyleUtil.getStyleForLiteral(getDiagram()));
      gaService.setLocationAndSize(roundedRectangle,
          context.getX() + 10, context.getY() + 10, width, height);

      //Don't think this should happen, but want to check
      if (addedObj.eResource() == null) {
View Full Code Here

    org.eclipse.swt.graphics.Rectangle contentRect = new org.eclipse.swt.graphics.Rectangle(0 + BASE_RECT_SPACE_X, 0 + BASE_RECT_SPACE_Y, content_width, image_height + label_height + IMAGE_LABEL_SPACE + TOP_BOTTOM_SPACE + TOP_BOTTOM_SPACE);
    org.eclipse.swt.graphics.Rectangle imageRect = new org.eclipse.swt.graphics.Rectangle(0 + BASE_RECT_SPACE_X, 0 + BASE_RECT_SPACE_Y + TOP_BOTTOM_SPACE, content_width, image_height);
    org.eclipse.swt.graphics.Rectangle labelRect = new org.eclipse.swt.graphics.Rectangle(0 + BASE_RECT_SPACE_X, 0 + BASE_RECT_SPACE_Y + image_height + IMAGE_LABEL_SPACE, content_width, label_height + TOP_BOTTOM_SPACE);
   
    final IGaService gaService = Graphiti.getGaService();
    final RoundedRectangle baseRectangle = gaService.createRoundedRectangle(containerShape, ROUNDED_RECTANGLE_WIDTH, ROUNDED_RECTANGLE_HEIGHT);

    // create invisible outer rectangle expanded by
    // the width needed for the anchor
    gaService.setLocationAndSize(baseRectangle, baseRect.x, baseRect.y, baseRect.width, baseRect.height);
    baseRectangle.setFilled(false);
    baseRectangle.setLineVisible(false);
   
    // shadow
    RoundedRectangle shadowRectangle; // need to access it later
    {
      // create and set visible rectangle inside invisible rectangle
      shadowRectangle = gaService.createRoundedRectangle(baseRectangle, ROUNDED_RECTANGLE_WIDTH, ROUNDED_RECTANGLE_HEIGHT);
      shadowRectangle.setParentGraphicsAlgorithm(baseRectangle);
      shadowRectangle.setStyle(StyleUtil.getShadowStyleForCamelClass(getDiagram()));
      shadowRectangle.setLineVisible(false);
      shadowRectangle.setFilled(true);
      gaService.setLocationAndSize(shadowRectangle, shadowRect.x, shadowRect.y, shadowRect.width, shadowRect.height);
    }

    // the real figure
    RoundedRectangle roundedRectangle; // need to access it later
    {
      // create and set visible rectangle inside invisible rectangle
      roundedRectangle = gaService.createRoundedRectangle(baseRectangle, ROUNDED_RECTANGLE_WIDTH, ROUNDED_RECTANGLE_HEIGHT);
      roundedRectangle.setParentGraphicsAlgorithm(baseRectangle);
      roundedRectangle.setStyle(StyleUtil.getStyleForCamelClass(getDiagram()));
      gaService.setLocationAndSize(roundedRectangle, contentRect.x, contentRect.y, contentRect.width, contentRect.height);
    }
   
    // image
    {
View Full Code Here

    return new AddExpandedSubProcessFeature(fp) {

      @Override
      protected void decorateActivityRectangle(RoundedRectangle rect) {
        IGaService gaService = Graphiti.getGaService();
        RoundedRectangle innerRect = gaService.createRoundedRectangle(rect, 5, 5);
        innerRect.setFilled(false);
        innerRect.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
        gaService.setLocationAndSize(innerRect, offset, offset, rect.getWidth() - (2 * offset),
            rect.getHeight() - (2 * offset));
      }

      @Override
 
View Full Code Here

  public ILayoutFeature getLayoutFeature(IFeatureProvider fp) {
    return new SubProcessLayoutFeature(fp) {
      @Override
      protected void layoutInRectangle(RoundedRectangle rect) {
        IGaService gaService = Graphiti.getGaService();
        RoundedRectangle innerRect = (RoundedRectangle) rect.getGraphicsAlgorithmChildren().get(0);
        gaService.setSize(innerRect, rect.getWidth() - 6, rect.getHeight() - 6);
      }

      @Override
      protected int getMarkerContainerOffset() {
View Full Code Here

    Bounds bounds = bpmnShape.getBounds();
    int w = (int) bounds.getWidth();
    int h = (int) bounds.getHeight();

    Diagram diagram = peService.getDiagramForPictogramElement(parent);
    RoundedRectangle band = gaService.createRoundedRectangle(bandShape, R, R);
    band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
    band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
        diagram, IColorConstant.LIGHT_GRAY));
    gaService.setLocationAndSize(band, 0, 0, w, h);

    Participant p = (Participant) bpmnShape.getBpmnElement();
    if (showNames) {
View Full Code Here

    ILocation parentLoc = peService.getLocationRelativeToDiagram(parent);
    int y = (int) bounds.getY() - parentLoc.getY();

    Diagram diagram = peService.getDiagramForPictogramElement(parent);
    RoundedRectangle band = gaService.createRoundedRectangle(bandShape, R, R);
    band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
    band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
        diagram, IColorConstant.LIGHT_GRAY));
    gaService.setLocationAndSize(band, 0, y, w, h);

    Participant p = (Participant) bpmnShape.getBpmnElement();
    if (showNames) {
View Full Code Here

    ContainerShape containerShape = peService.createContainerShape(context.getTargetContainer(), true);
    Rectangle invisibleRect = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(invisibleRect, context.getX(), context.getY(), width, height);

    Shape rectShape = peService.createShape(containerShape, false);
    RoundedRectangle rect = gaService.createRoundedRectangle(rectShape, 5, 5);
    StyleUtil.applyBGStyle(rect, this);
    gaService.setLocationAndSize(rect, 0, 0, width, height);
    link(rectShape, activity);
    decorateActivityRectangle(rect);
    peService.setPropertyValue(rectShape, "activity", Boolean.toString(true));
View Full Code Here

    SubProcess process = (SubProcess) getBusinessObjectForPictogramElement(context.getPictogramElement());

    Graphiti.getPeService().setPropertyValue(context.getPictogramElement(), TRIGGERED_BY_EVENT,
            Boolean.toString(process.isTriggeredByEvent()));

    RoundedRectangle rectangle = (RoundedRectangle) Graphiti.getPeService()
            .getAllContainedPictogramElements(context.getPictogramElement()).iterator().next()
            .getGraphicsAlgorithm();
    LineStyle lineStyle = process.isTriggeredByEvent() ? LineStyle.DOT : LineStyle.SOLID;
    rectangle.setLineStyle(lineStyle);

    return true;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.mm.algorithms.RoundedRectangle

Copyright © 2018 www.massapicom. 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.