當前位置: 首頁>>代碼示例>>Java>>正文


Java Bounds.setX方法代碼示例

本文整理匯總了Java中org.eclipse.dd.dc.Bounds.setX方法的典型用法代碼示例。如果您正苦於以下問題:Java Bounds.setX方法的具體用法?Java Bounds.setX怎麽用?Java Bounds.setX使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.dd.dc.Bounds的用法示例。


在下文中一共展示了Bounds.setX方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateShapeBoundsInSubprocessInLanes

import org.eclipse.dd.dc.Bounds; //導入方法依賴的package包/類
public void updateShapeBoundsInSubprocessInLanes(BPMNPlane plane,
                                                 BaseElement ele,
                                                 SubProcess sub,
                                                 float parentX,
                                                 float parentY) {
    for (FlowElement subEle : sub.getFlowElements()) {
        Bounds subEleBounds = getBoundsForElement(subEle,
                                                  plane);
        if (subEleBounds != null) {
            subEleBounds.setX(subEleBounds.getX() + parentX);
            subEleBounds.setY(subEleBounds.getY() + parentY);
        }
        if (subEle instanceof SubProcess) {
            updateShapeBoundsInSubprocessInLanes(plane,
                                                 ele,
                                                 (SubProcess) subEle,
                                                 subEleBounds.getX(),
                                                 subEleBounds.getY());
        }
    }
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:22,代碼來源:Bpmn2JsonUnmarshaller.java

示例2: updateShapeBoundsInLanes

import org.eclipse.dd.dc.Bounds; //導入方法依賴的package包/類
public void updateShapeBoundsInLanes(BPMNPlane plane,
                                     BaseElement ele,
                                     Lane lane,
                                     float parentX,
                                     float parentY) {
    for (FlowNode fn : lane.getFlowNodeRefs()) {
        Bounds fnBounds = getBoundsForElement(fn,
                                              plane);
        if (fnBounds != null) {
            fnBounds.setX(fnBounds.getX() + parentX);
            fnBounds.setY(fnBounds.getY() + parentY);
            // if flownode is a subprocess update it too
            if (fn instanceof SubProcess) {
                updateShapeBoundsInSubprocessInLanes(plane,
                                                     ele,
                                                     (SubProcess) fn,
                                                     fnBounds.getX(),
                                                     fnBounds.getY());
            } else if (fn instanceof Lane) {
                updateShapeBoundsInLanes(plane,
                                         ele,
                                         (Lane) fn,
                                         fnBounds.getX(),
                                         fnBounds.getY());
            }
        }
    }
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:29,代碼來源:Bpmn2JsonUnmarshaller.java

示例3: readShapeDI

import org.eclipse.dd.dc.Bounds; //導入方法依賴的package包/類
/**
 * 處理圖形元素
 * @param objectNode
 * @param parentX
 * @param parentY
 * @param shapeMap
 * @param sourceRefMap
 * @param bpmnModel
 */
private void readShapeDI(JsonNode objectNode, double parentX, double parentY, 
    Map<String, JsonNode> shapeMap, Map<String, JsonNode> sourceRefMap, Definitions bpmnModel) {
  
  if (objectNode.get(EDITOR_CHILD_SHAPES) != null) {
    for (JsonNode jsonChildNode : objectNode.get(EDITOR_CHILD_SHAPES)) {
      
      String stencilId = BpmnJsonConverterUtil.getStencilId(jsonChildNode);
      if (STENCIL_SEQUENCE_FLOW.equals(stencilId) == false) {
        
      	String elementId = BpmnJsonConverterUtil.getElementId(jsonChildNode);
   	Bounds graphicInfo=DcFactory.eINSTANCE.createBounds();
   	BPMNShape bpmnShape=BpmnDiFactory.eINSTANCE.createBPMNShape();
   	bpmnShape.setBounds(graphicInfo);
   	bpmnShape.setId(BpmnJsonConverterUtil.getFormatShapeId(elementId));
        JsonNode boundsNode = jsonChildNode.get(EDITOR_BOUNDS);
        ObjectNode upperLeftNode = (ObjectNode) boundsNode.get(EDITOR_BOUNDS_UPPER_LEFT);
        double upLeftX = upperLeftNode.get(EDITOR_BOUNDS_X).asDouble();
        double upLeftY = upperLeftNode.get(EDITOR_BOUNDS_Y).asDouble();
        //坐標修正
        if(DI_CIRCLES.contains(stencilId)){
      	  upLeftX -= REVERSION_X;
      	  upLeftY -= REVERSION_Y;
        }
        graphicInfo.setX((float)(upLeftX + parentX ));
        graphicInfo.setY((float)(upLeftY + parentY ));
        
        ObjectNode lowerRightNode = (ObjectNode) boundsNode.get(EDITOR_BOUNDS_LOWER_RIGHT);
        graphicInfo.setWidth((float)(lowerRightNode.get(EDITOR_BOUNDS_X).asDouble() - graphicInfo.getX() + parentX));
        graphicInfo.setHeight((float)(lowerRightNode.get(EDITOR_BOUNDS_Y).asDouble() - graphicInfo.getY() + parentY));
        
        String childShapeId = jsonChildNode.get(EDITOR_SHAPE_ID).asText();
        
        //bpmnShape.setBpmnElement(BpmnModelUtil.getBaseElement(bpmnModel, BpmnJsonConverterUtil.getElementId(jsonChildNode)));
        //這裏注釋掉的以後需要實現 bpmnModel.addGraphicInfo(BpmnJsonConverterUtil.getElementId(jsonChildNode), graphicInfo);
        bpmnModel.getDiagrams().get(0).getPlane().getPlaneElement().add(bpmnShape);
        shapeMap.put(childShapeId, jsonChildNode);
        
        ArrayNode outgoingNode = (ArrayNode) jsonChildNode.get("outgoing");
        if (outgoingNode != null && outgoingNode.size() > 0) {
          for (JsonNode outgoingChildNode : outgoingNode) {
            JsonNode resourceNode = outgoingChildNode.get(EDITOR_SHAPE_ID);
            if (resourceNode != null) {
              sourceRefMap.put(resourceNode.asText(), jsonChildNode);
            }
          }
        }
        
        readShapeDI(jsonChildNode, graphicInfo.getX(), graphicInfo.getY(), shapeMap, sourceRefMap, bpmnModel);
      }
    }
  }
}
 
開發者ID:fixteam,項目名稱:fixflow,代碼行數:62,代碼來源:BpmnJsonConverter.java


注:本文中的org.eclipse.dd.dc.Bounds.setX方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。