import org.activiti.bpmn.model.GraphicInfo; //导入方法依赖的package包/类
private void readShapeDI(JsonNode objectNode, double parentX,
double parentY, Map shapeMap,
Map sourceRefMap, BpmnModel 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) {
GraphicInfo graphicInfo = new GraphicInfo();
JsonNode boundsNode = jsonChildNode.get(EDITOR_BOUNDS);
ObjectNode upperLeftNode = (ObjectNode) boundsNode
.get(EDITOR_BOUNDS_UPPER_LEFT);
graphicInfo.setX(upperLeftNode.get(EDITOR_BOUNDS_X)
.asDouble() + parentX);
graphicInfo.setY(upperLeftNode.get(EDITOR_BOUNDS_Y)
.asDouble() + parentY);
ObjectNode lowerRightNode = (ObjectNode) boundsNode
.get(EDITOR_BOUNDS_LOWER_RIGHT);
graphicInfo.setWidth(lowerRightNode.get(EDITOR_BOUNDS_X)
.asDouble() - graphicInfo.getX() + parentX);
graphicInfo.setHeight(lowerRightNode.get(EDITOR_BOUNDS_Y)
.asDouble() - graphicInfo.getY() + parentY);
String childShapeId = jsonChildNode.get(EDITOR_SHAPE_ID)
.asText();
bpmnModel.addGraphicInfo(
BpmnJsonConverterUtil.getElementId(jsonChildNode),
graphicInfo);
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);
}
}
}
}