private GraphicInfo createGraphicInfo(double x, double y) { GraphicInfo graphicInfo = new GraphicInfo(); graphicInfo.setX(x); graphicInfo.setY(y); return graphicInfo; }
GraphicInfo graphicInfo = new GraphicInfo(); BpmnXMLUtil.addXMLLocation(graphicInfo, xtr); graphicInfo.setX(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_X)).intValue()); graphicInfo.setY(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_Y)).intValue()); graphicInfo.setWidth(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_WIDTH)).intValue()); GraphicInfo graphicInfo = new GraphicInfo(); BpmnXMLUtil.addXMLLocation(graphicInfo, xtr); graphicInfo.setX(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_X)).intValue()); graphicInfo.setY(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_Y)).intValue()); wayPointList.add(graphicInfo);
public void parse(XMLStreamReader xtr, BpmnModel model) throws Exception { String id = xtr.getAttributeValue(null, ATTRIBUTE_DI_BPMNELEMENT); GraphicInfo graphicInfo = new GraphicInfo(); String strIsExpanded = xtr.getAttributeValue(null, ATTRIBUTE_DI_IS_EXPANDED); if ("true".equalsIgnoreCase(strIsExpanded)) { graphicInfo.setExpanded(true); } else if ("false".equalsIgnoreCase(strIsExpanded)) { graphicInfo.setExpanded(false); } BpmnXMLUtil.addXMLLocation(graphicInfo, xtr); while (xtr.hasNext()) { xtr.next(); if (xtr.isStartElement() && ELEMENT_DI_BOUNDS.equalsIgnoreCase(xtr.getLocalName())) { graphicInfo.setX(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_X))); graphicInfo.setY(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_Y))); graphicInfo.setWidth(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_WIDTH))); graphicInfo.setHeight(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_HEIGHT))); model.addGraphicInfo(id, graphicInfo); break; } else if (xtr.isEndElement() && ELEMENT_DI_SHAPE.equalsIgnoreCase(xtr.getLocalName())) { break; } } }
ObjectNode lowerRightNode = (ObjectNode) boundsNode.get(EDITOR_BOUNDS_LOWER_RIGHT); graphicInfo.setX(upperLeftNode.get(EDITOR_BOUNDS_X).asDouble() + parentX); graphicInfo.setY(upperLeftNode.get(EDITOR_BOUNDS_Y).asDouble() + parentY); graphicInfo.setWidth(lowerRightNode.get(EDITOR_BOUNDS_X).asDouble() - graphicInfo.getX() + parentX);
protected void createDiagramInterchangeInformation(BaseElement element, List<mxPoint> waypoints) { List<GraphicInfo> graphicInfoForWaypoints = new ArrayList<>(); for (mxPoint waypoint : waypoints) { GraphicInfo graphicInfo = new GraphicInfo(); graphicInfo.setElement(element); graphicInfo.setX(waypoint.getX()); graphicInfo.setY(waypoint.getY()); graphicInfoForWaypoints.add(graphicInfo); } bpmnModel.addFlowGraphicInfoList(element.getId(), graphicInfoForWaypoints); }
protected void translateNestedSubprocessElements(SubProcess subProcess) { GraphicInfo subProcessGraphicInfo = bpmnModel.getLocationMap().get(subProcess.getId()); double subProcessX = subProcessGraphicInfo.getX(); double subProcessY = subProcessGraphicInfo.getY(); List<SubProcess> nestedSubProcesses = new ArrayList<>(); for (FlowElement flowElement : subProcess.getFlowElements()) { if (flowElement instanceof SequenceFlow) { List<GraphicInfo> graphicInfos = bpmnModel.getFlowLocationMap().get(flowElement.getId()); for (GraphicInfo graphicInfo : graphicInfos) { graphicInfo.setX(graphicInfo.getX() + subProcessX + subProcessMargin); graphicInfo.setY(graphicInfo.getY() + subProcessY + subProcessMargin); } } else if (!(flowElement instanceof DataObject)) { // Regular element GraphicInfo graphicInfo = bpmnModel.getLocationMap().get(flowElement.getId()); graphicInfo.setX(graphicInfo.getX() + subProcessX + subProcessMargin); graphicInfo.setY(graphicInfo.getY() + subProcessY + subProcessMargin); } if (flowElement instanceof SubProcess) { nestedSubProcesses.add((SubProcess) flowElement); } } // Continue for next level of nested subprocesses for (SubProcess nestedSubProcess : nestedSubProcesses) { translateNestedSubprocessElements(nestedSubProcess); } }
protected GraphicInfo createDiagramInterchangeInformation(FlowElement flowElement, int x, int y, int width, int height) { GraphicInfo graphicInfo = new GraphicInfo(); graphicInfo.setX(x); graphicInfo.setY(y); graphicInfo.setWidth(width); graphicInfo.setHeight(height); graphicInfo.setElement(flowElement); bpmnModel.addGraphicInfo(flowElement.getId(), graphicInfo); return graphicInfo; }
protected void fillDiagramInfo(GraphicInfo graphicInfo, GraphicInfo diagramInfo) { double rightX = graphicInfo.getX() + graphicInfo.getWidth(); double bottomY = graphicInfo.getY() + graphicInfo.getHeight(); double middleX = graphicInfo.getX() + (graphicInfo.getWidth() / 2); if (middleX < diagramInfo.getX()) { diagramInfo.setX(middleX); } if (graphicInfo.getY() < diagramInfo.getY()) { diagramInfo.setY(graphicInfo.getY()); } if (rightX > diagramInfo.getWidth()) { diagramInfo.setWidth(rightX); } if (bottomY > diagramInfo.getHeight()) { diagramInfo.setHeight(bottomY); } }
protected void fillDiagramInfo(GraphicInfo graphicInfo, GraphicInfo diagramInfo) { double rightX = graphicInfo.getX() + graphicInfo.getWidth(); double bottomY = graphicInfo.getY() + graphicInfo.getHeight(); double middleX = graphicInfo.getX() + (graphicInfo.getWidth() / 2); if (middleX < diagramInfo.getX()) { diagramInfo.setX(middleX); } if (graphicInfo.getY() < diagramInfo.getY()) { diagramInfo.setY(graphicInfo.getY()); } if (rightX > diagramInfo.getWidth()) { diagramInfo.setWidth(rightX); } if (bottomY > diagramInfo.getHeight()) { diagramInfo.setHeight(bottomY); } } }