From 74472c9d22dddcb41383794caf0011043b20f817 Mon Sep 17 00:00:00 2001 From: kimi <kimi42345@gmail.com> Date: 星期二, 31 三月 2020 13:25:47 +0800 Subject: [PATCH] fix 数据权限 --- src/main/java/com/highdatas/mdm/process/canvas/ProcessDiagramGenerator.java | 86 ++++++++++++++++++++++-------------------- 1 files changed, 45 insertions(+), 41 deletions(-) diff --git a/src/main/java/com/highdatas/mdm/process/canvas/ProcessDiagramGenerator.java b/src/main/java/com/highdatas/mdm/process/canvas/ProcessDiagramGenerator.java index ef183d4..c7aea1a 100644 --- a/src/main/java/com/highdatas/mdm/process/canvas/ProcessDiagramGenerator.java +++ b/src/main/java/com/highdatas/mdm/process/canvas/ProcessDiagramGenerator.java @@ -212,59 +212,63 @@ processDiagramCanvas.drawActivityMarkers((int)graphicInfo.getX(), (int)graphicInfo.getY(), (int)graphicInfo.getWidth(), (int)graphicInfo.getHeight(), multiInstanceSequential, multiInstanceParallel, collapsed); } - if (highLightedActivities.contains(flowNode.getId())) { + if (highLightedActivities != null && highLightedActivities.contains(flowNode.getId())) { processDiagramCanvas.drawHighLight((int)graphicInfo.getX(), (int)graphicInfo.getY(), (int)graphicInfo.getWidth(), (int)graphicInfo.getHeight()); } } for (SequenceFlow sequenceFlow : flowNode.getOutgoingFlows()) { - boolean highLighted = highLightedFlows.contains(sequenceFlow.getId()); - String defaultFlow = null; - if (flowNode instanceof Activity) - defaultFlow = ((Activity)flowNode).getDefaultFlow(); - else if (flowNode instanceof Gateway) { - defaultFlow = ((Gateway)flowNode).getDefaultFlow(); - } + boolean highLighted = false; + if (highLightedFlows != null) { + highLighted = highLightedFlows.contains(sequenceFlow.getId()); + } - boolean isDefault = false; - if ((defaultFlow != null) && (defaultFlow.equalsIgnoreCase(sequenceFlow.getId()))) { - isDefault = true; - } - boolean drawConditionalIndicator = (sequenceFlow.getConditionExpression() != null) && (!(flowNode instanceof Gateway)); + String defaultFlow = null; + if (flowNode instanceof Activity) + defaultFlow = ((Activity)flowNode).getDefaultFlow(); + else if (flowNode instanceof Gateway) { + defaultFlow = ((Gateway)flowNode).getDefaultFlow(); + } - String sourceRef = sequenceFlow.getSourceRef(); - String targetRef = sequenceFlow.getTargetRef(); - FlowElement sourceElement = bpmnModel.getFlowElement(sourceRef); - FlowElement targetElement = bpmnModel.getFlowElement(targetRef); - List graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId()); - if ((graphicInfoList != null) && (graphicInfoList.size() > 0)) { - graphicInfoList = connectionPerfectionizer(processDiagramCanvas, bpmnModel, sourceElement, targetElement, graphicInfoList); - int[] xPoints = new int[graphicInfoList.size()]; - int[] yPoints = new int[graphicInfoList.size()]; + boolean isDefault = false; + if ((defaultFlow != null) && (defaultFlow.equalsIgnoreCase(sequenceFlow.getId()))) { + isDefault = true; + } + boolean drawConditionalIndicator = (sequenceFlow.getConditionExpression() != null) && (!(flowNode instanceof Gateway)); - for (int i = 1; i < graphicInfoList.size(); ++i) { - GraphicInfo graphicInfo = (GraphicInfo)graphicInfoList.get(i); - GraphicInfo previousGraphicInfo = (GraphicInfo)graphicInfoList.get(i - 1); + String sourceRef = sequenceFlow.getSourceRef(); + String targetRef = sequenceFlow.getTargetRef(); + FlowElement sourceElement = bpmnModel.getFlowElement(sourceRef); + FlowElement targetElement = bpmnModel.getFlowElement(targetRef); + List graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId()); + if ((graphicInfoList != null) && (graphicInfoList.size() > 0)) { + graphicInfoList = connectionPerfectionizer(processDiagramCanvas, bpmnModel, sourceElement, targetElement, graphicInfoList); + int[] xPoints = new int[graphicInfoList.size()]; + int[] yPoints = new int[graphicInfoList.size()]; - if (i == 1) { - xPoints[0] = (int)previousGraphicInfo.getX(); - yPoints[0] = (int)previousGraphicInfo.getY(); - } - xPoints[i] = (int)graphicInfo.getX(); - yPoints[i] = (int)graphicInfo.getY(); - } + for (int i = 1; i < graphicInfoList.size(); ++i) { + GraphicInfo graphicInfo = (GraphicInfo)graphicInfoList.get(i); + GraphicInfo previousGraphicInfo = (GraphicInfo)graphicInfoList.get(i - 1); - processDiagramCanvas.drawSequenceflow(xPoints, yPoints, drawConditionalIndicator, isDefault, highLighted, scaleFactor); + if (i == 1) { + xPoints[0] = (int)previousGraphicInfo.getX(); + yPoints[0] = (int)previousGraphicInfo.getY(); + } + xPoints[i] = (int)graphicInfo.getX(); + yPoints[i] = (int)graphicInfo.getY(); + } - GraphicInfo labelGraphicInfo = bpmnModel.getLabelGraphicInfo(sequenceFlow.getId()); - if (labelGraphicInfo != null) { - processDiagramCanvas.drawLabel(sequenceFlow.getName(), labelGraphicInfo, false); - } - else { - GraphicInfo lineCenter = getLineCenter(graphicInfoList); - processDiagramCanvas.drawLabel(sequenceFlow.getName(), lineCenter, false); - } + processDiagramCanvas.drawSequenceflow(xPoints, yPoints, drawConditionalIndicator, isDefault, highLighted, scaleFactor); + + GraphicInfo labelGraphicInfo = bpmnModel.getLabelGraphicInfo(sequenceFlow.getId()); + if (labelGraphicInfo != null) { + processDiagramCanvas.drawLabel(sequenceFlow.getName(), labelGraphicInfo, false); + } + else { + GraphicInfo lineCenter = getLineCenter(graphicInfoList); + processDiagramCanvas.drawLabel(sequenceFlow.getName(), lineCenter, false); + } } } -- Gitblit v1.8.0