Examples of GraphicInfo


Examples of org.activiti.bpmn.model.GraphicInfo

      if (addFeature == null) {
        System.out.println("Element not supported: " + artifact);
        return;
      }

      final GraphicInfo gi = locationMap.get(artifact.getId());
      if (gi == null) {
        artifactsWithoutDI.add(artifact);
      } else {
        context.setNewObject(artifact);
        context.setSize((int) gi.getWidth(), (int) gi.getHeight());

        ContainerShape parentContainer = null;
        if (parent instanceof Diagram) {
          parentContainer = getParentContainer(artifact.getId(), process, (Diagram) parent);
        } else {
          parentContainer = parent;
        }

        context.setTargetContainer(parentContainer);
        if (parentContainer instanceof Diagram) {
          context.setLocation((int) gi.getX(), (int) gi.getY());
        } else {
          final Point location = getLocation(parentContainer);

          context.setLocation((int) gi.getX() - location.x, (int) gi.getY() - location.y);
        }

        if (addFeature.canAdd(context)) {
          final PictogramElement newContainer = addFeature.add(context);
          featureProvider.link(newContainer, new Object[] { artifact });
View Full Code Here

Examples of org.activiti.bpmn.model.GraphicInfo

   
    String id = xtr.getAttributeValue(null, ATTRIBUTE_DI_BPMNELEMENT);
    while (xtr.hasNext()) {
      xtr.next();
      if (xtr.isStartElement() && ELEMENT_DI_BOUNDS.equalsIgnoreCase(xtr.getLocalName())) {
        GraphicInfo graphicInfo = new GraphicInfo();
        graphicInfo.x = Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_X)).intValue();
        graphicInfo.y = Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_Y)).intValue();
        FlowElement flowElement = model.getMainProcess().getFlowElement(id);
        if (flowElement instanceof Event) {
          graphicInfo.width = 30;
View Full Code Here

Examples of org.activiti.bpmn.model.GraphicInfo

      if (xtr.isStartElement() && "BPMNLabel".equalsIgnoreCase(xtr.getLocalName())) {
       
        while (xtr.hasNext()) {
          xtr.next();
          if (xtr.isStartElement() && ELEMENT_DI_BOUNDS.equalsIgnoreCase(xtr.getLocalName())) {
            GraphicInfo graphicInfo = new GraphicInfo();
            graphicInfo.x = Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_X)).intValue();
            graphicInfo.y = Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_Y)).intValue();
            model.addLabelGraphicInfo(id, graphicInfo);
            break;
          } else if(xtr.isEndElement() && "BPMNLabel".equalsIgnoreCase(xtr.getLocalName())) {
            break;
          }
        }
       
      } else if (xtr.isStartElement() && ELEMENT_DI_WAYPOINT.equalsIgnoreCase(xtr.getLocalName())) {
        GraphicInfo graphicInfo = new GraphicInfo();
        graphicInfo.x = Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_X)).intValue();
        graphicInfo.y = Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_Y)).intValue();
        wayPointList.add(graphicInfo);
       
      } else if(xtr.isEndElement() && ELEMENT_DI_EDGE.equalsIgnoreCase(xtr.getLocalName())) {
View Full Code Here

Examples of org.activiti.bpmn.model.GraphicInfo

    this.model = model;
    this.processor = processor;
    this.subProcessX = subProcessX;
    this.subProcessY = subProcessY;
    this.shapesArrayNode = shapesArrayNode;
    GraphicInfo graphicInfo = model.getGraphicInfo(flowElement.getId());
   
    String stencilId = null;
    if (flowElement instanceof ServiceTask) {
      ServiceTask serviceTask = (ServiceTask) flowElement;
      if ("mail".equalsIgnoreCase(serviceTask.getType())) {
View Full Code Here

Examples of org.activiti.bpmn.model.GraphicInfo

  protected void convertElementToJson(ObjectNode propertiesNode, FlowElement flowElement) {
    SubProcess subProcess = (SubProcess) flowElement;
    propertiesNode.put("activitytype", "Event-Sub-Process");
    propertiesNode.put("subprocesstype", "Embedded");
    ArrayNode subProcessShapesArrayNode = objectMapper.createArrayNode();
    GraphicInfo graphicInfo = model.getGraphicInfo(flowElement.getId());
    processor.processFlowElements(subProcess.getFlowElements(), model, subProcessShapesArrayNode,
        graphicInfo.x + subProcessX, graphicInfo.y + subProcessY);
    flowElementNode.put("childShapes", subProcessShapesArrayNode);
  }
View Full Code Here

Examples of org.activiti.bpmn.model.GraphicInfo

      for (JsonNode jsonChildNode : objectNode.get(EDITOR_CHILD_SHAPES)) {
       
        String stencilId = BpmnJsonConverterUtil.getStencilId(jsonChildNode);
        if (STENCIL_SEQUENCE_FLOW.equals(stencilId) == false) {
         
          GraphicInfo graphicInfo = new GraphicInfo();
         
          JsonNode boundsNode = jsonChildNode.get(EDITOR_BOUNDS);
          ObjectNode upperLeftNode = (ObjectNode) boundsNode.get(EDITOR_BOUNDS_UPPER_LEFT);
          graphicInfo.x = upperLeftNode.get(EDITOR_BOUNDS_X).asDouble() + parentX;
          graphicInfo.y = upperLeftNode.get(EDITOR_BOUNDS_Y).asDouble() + parentY;
View Full Code Here

Examples of org.activiti.bpmn.model.GraphicInfo

     
      JsonNode dockersNode = edgeNode.get(EDITOR_DOCKERS);
      double sourceDockersX = dockersNode.get(0).get(EDITOR_BOUNDS_X).getDoubleValue();
      double sourceDockersY = dockersNode.get(0).get(EDITOR_BOUNDS_Y).getDoubleValue();
     
      GraphicInfo sourceInfo = bpmnModel.getGraphicInfo(BpmnJsonConverterUtil.getElementId(sourceRefNode));
      GraphicInfo targetInfo = bpmnModel.getGraphicInfo(BpmnJsonConverterUtil.getElementId(targetRefNode));
     
      /*JsonNode sourceRefBoundsNode = sourceRefNode.get(EDITOR_BOUNDS);
      BoundsLocation sourceRefUpperLeftLocation = getLocation(EDITOR_BOUNDS_UPPER_LEFT, sourceRefBoundsNode);
      BoundsLocation sourceRefLowerRightLocation = getLocation(EDITOR_BOUNDS_LOWER_RIGHT, sourceRefBoundsNode);
     
View Full Code Here

Examples of org.activiti.bpmn.model.GraphicInfo

   
    return gatewayRectangle;
  }
 
  private GraphicInfo createGraphicInfo(double x, double y) {
    GraphicInfo graphicInfo = new GraphicInfo();
    graphicInfo.x = x;
    graphicInfo.y = y;
    return graphicInfo;
  }
View Full Code Here

Examples of org.activiti.bpmn.model.GraphicInfo

  protected void convertElementToJson(ObjectNode propertiesNode, FlowElement flowElement) {
    SubProcess subProcess = (SubProcess) flowElement;
    propertiesNode.put("activitytype", "Sub-Process");
    propertiesNode.put("subprocesstype", "Embedded");
    ArrayNode subProcessShapesArrayNode = objectMapper.createArrayNode();
    GraphicInfo graphicInfo = model.getGraphicInfo(flowElement.getId());
    processor.processFlowElements(subProcess.getFlowElements(), model, subProcessShapesArrayNode,
        graphicInfo.x + subProcessX, graphicInfo.y + subProcessY);
    flowElementNode.put("childShapes", subProcessShapesArrayNode);
  }
View Full Code Here

Examples of org.geomajas.sld.GraphicInfo

    namedStyleInfo.setLabelStyle(labelStyleInfo);
    return namedStyleInfo;
  }

  private void convertSymbol(FeatureStyleInfo featureStyleInfo, PointSymbolizerInfo pointInfo) {
    GraphicInfo graphic = pointInfo.getGraphic();
    SymbolInfo symbol = new SymbolInfo();

    if (graphic.getChoiceList().size() > 0) {
      ChoiceInfo choice = graphic.getChoiceList().get(0);
      if (choice.ifExternalGraphic()) {
        ExternalGraphicInfo externalGraphic = choice.getExternalGraphic();
        String href = externalGraphic.getOnlineResource().getHref().getHref();
        ImageInfo image = new ImageInfo();
        image.setHref(href);
        // SLD has no selection concept + no default: what to do ?
        image.setSelectionHref(href);
        image.setHeight((int) Float.parseFloat(getParameterValue(graphic.getSize())));
        symbol.setImage(image);
      } else if (choice.ifMark()) {
        MarkInfo mark = choice.getMark();
        String name = mark.getWellKnownName().getWellKnownName();
        if (name.equalsIgnoreCase("square")) {
          RectInfo rect = new RectInfo();
          rect.setH(Float.parseFloat(getParameterValue(graphic.getSize())));
          rect.setW(Float.parseFloat(getParameterValue(graphic.getSize())));
          symbol.setRect(rect);
        } else {
          // should treat everything else as circle ?!
          CircleInfo circle = new CircleInfo();
          circle.setR(0.5F * Float.parseFloat(getParameterValue(graphic.getSize())));
          symbol.setCircle(circle);
        }
        convertFill(featureStyleInfo, mark.getFill());
        convertStroke(featureStyleInfo, mark.getStroke());
      }
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.