From 6d0998169fddec85038bb934b37ea9a859931c11 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 25 Aug 2017 15:34:44 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3993=20-=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E9=80=89=E4=B8=AD=E4=B8=80=E7=89=87?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E8=AE=BE=E7=BD=AE=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E3=80=81=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E7=AC=AC=E4=B8=80=E4=B8=AA=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=9C=89=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/CellWidgetPropertyPane.java | 31 ++++++++++++------- .../present/ConditionAttributesGroupPane.java | 24 +++++++++++++- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java index 5637a68ca6..60f45450c7 100644 --- a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.FRContext; +import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; @@ -15,6 +16,7 @@ import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.privilege.finegrain.WidgetPrivilegeControl; +import com.fr.report.cell.CellElement; import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -30,6 +32,7 @@ public class CellWidgetPropertyPane extends BasicPane { private TemplateCellElement cellElement; private WidgetPane cellEditorDefPane; + private ElementCasePane ePane; public static CellWidgetPropertyPane getInstance(){ if (singleton == null) { @@ -84,6 +87,7 @@ public class CellWidgetPropertyPane extends BasicPane { public void reInit(ElementCasePane ePane){ + this.ePane = ePane; cellEditorDefPane = new WidgetPane(ePane); this.removeAll(); this.add(cellEditorDefPane, BorderLayout.CENTER); @@ -108,18 +112,23 @@ public class CellWidgetPropertyPane extends BasicPane { if (cellElement == null) {// 利用默认的CellElement. return; } - - Widget cellWidget = this.cellEditorDefPane.update(); - // p:最后把这个cellEditorDef设置到CellGUIAttr. - if (cellWidget instanceof NoneWidget) { - cellElement.setWidget(null); - } else { - if (cellElement.getWidget() != null) { - cellWidget = upDateWidgetAuthority(cellElement, cellWidget); + final CellSelection finalCS = (CellSelection) ePane.getSelection(); + final TemplateElementCase tplEC = ePane.getEditingElementCase(); + ReportActionUtils.actionIterateWithCellSelection(finalCS, tplEC, new ReportActionUtils.IterAction() { + public void dealWith(CellElement editCellElement) { + Widget cellWidget = cellEditorDefPane.update(); + // p:最后把这个cellEditorDef设置到CellGUIAttr. + TemplateCellElement cellElement = (TemplateCellElement) editCellElement; + if (cellWidget instanceof NoneWidget) { + cellElement.setWidget(null); + } else { + if (cellElement.getWidget() != null) { + cellWidget = upDateWidgetAuthority(cellElement, cellWidget); + } + cellElement.setWidget(cellWidget); + } } - cellElement.setWidget(cellWidget); - } - + }); } diff --git a/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java b/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java index 5cc05777da..6479653642 100644 --- a/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java +++ b/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import com.fr.base.FRContext; +import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; @@ -15,6 +16,7 @@ import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; +import com.fr.report.cell.CellElement; import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.highlight.DefaultHighlight; @@ -27,6 +29,7 @@ import com.fr.stable.Nameable; public class ConditionAttributesGroupPane extends UIListControlPane { private static ConditionAttributesGroupPane singleton; private TemplateCellElement editCellElement; // 当前单元格对象 + private ElementCasePane ePane; private ConditionAttributesGroupPane() { super(); @@ -49,7 +52,25 @@ public class ConditionAttributesGroupPane extends UIListControlPane { if (isPopulating) { return; } - editCellElement.setHighlightGroup(updateHighlightGroup()); + final CellSelection finalCS = (CellSelection) ePane.getSelection(); + final TemplateElementCase tplEC = ePane.getEditingElementCase(); +// for (int i = 0; i < finalCS.getRowSpan(); i++) { +// for (int j = 0; j < finalCS.getColumnSpan(); j++) { +// int row = i + finalCS.getRow(); +// int column = j + finalCS.getColumn(); +// TemplateCellElement editCellElement = tplEC.getTemplateCellElement(column, row); +// // alex:不加这一句话会导致跨行跨列的格子被多次update +// if (editCellElement.getColumn() != column || editCellElement.getRow() != row) { +// continue; +// } +// } +// } + + ReportActionUtils.actionIterateWithCellSelection(finalCS, tplEC, new ReportActionUtils.IterAction() { + public void dealWith(CellElement editCellElement) { + ((TemplateCellElement)editCellElement).setHighlightGroup(updateHighlightGroup()); + } + }); DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); } @@ -64,6 +85,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane { } public void populate(ElementCasePane ePane) { + this.ePane = ePane; CellSelection cs = (CellSelection) ePane.getSelection(); final TemplateElementCase tplEC = ePane.getEditingElementCase(); editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());