From 0946ba516cfc91f1b3d1a73fde1c6e47fdd38fec Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 17 Aug 2017 11:00:05 +0800 Subject: [PATCH 01/14] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E9=A1=B9=E8=B7=B3=E8=BD=AC=E5=88=B0tab=3D>=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/cell/CellWidgetAttrAction.java | 62 +++---------------- .../mainframe/ElementCasePaneDelegate.java | 2 +- .../src/com/fr/grid/GridMouseAdapter.java | 4 +- .../com/fr/grid/selection/CellSelection.java | 2 +- .../src/com/fr/poly/creator/ECBlockPane.java | 2 +- .../mainframe/EastRegionContainerPane.java | 33 ++++++---- 6 files changed, 35 insertions(+), 70 deletions(-) diff --git a/designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java b/designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java index f5307b2aca..2a231a21f6 100644 --- a/designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java +++ b/designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java @@ -1,24 +1,18 @@ package com.fr.design.actions.cell; import com.fr.base.BaseUtils; -import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.actions.UpdateAction; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.menu.KeySetUtils; -import com.fr.design.present.CellWriteAttrPane; -import com.fr.design.dialog.BasicPane; -import com.fr.form.ui.Widget; -import com.fr.general.FRLogger; -import com.fr.grid.selection.CellSelection; -import com.fr.grid.selection.Selection; -import com.fr.privilege.finegrain.WidgetPrivilegeControl; -import com.fr.report.cell.TemplateCellElement; + +import java.awt.event.ActionEvent; /** * Cell Widget Attribute. */ -public class CellWidgetAttrAction extends AbstractCellElementAction { +public class CellWidgetAttrAction extends UpdateAction { - public CellWidgetAttrAction(ElementCasePane t) { - super(t); + public CellWidgetAttrAction() { this.setMenuKeySet(KeySetUtils.CELL_WIDGET_ATTR); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); @@ -26,47 +20,7 @@ public class CellWidgetAttrAction extends AbstractCellElementAction { } @Override - protected BasicPane populateBasicPane(TemplateCellElement cellElement) { - CellWriteAttrPane pane = new CellWriteAttrPane(this.getEditingComponent()); - //got simple cell element from column and row. - pane.populate(cellElement); - - return pane; - } - - @Override - protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) { - CellWriteAttrPane pane = (CellWriteAttrPane) bp; - if (cellElement.getWidget() == null) { - pane.update(cellElement); - return; - } - try { - Widget oldWidget = (Widget) cellElement.getWidget().clone(); - pane.update(cellElement); - //这边需要重新设置权限细粒度的hashset是因为Update是直接生成一个新的来update的,所以以前里面的hashset都没有了 - Widget newWidget = cellElement.getWidget(); - if (newWidget.getClass() == oldWidget.getClass()) { - newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone()); - } - } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); - } - } - - @Override - protected boolean isNeedShinkToFit() { - return true; - } - - @Override - public void update() { - ElementCasePane ePane = this.getEditingComponent(); - Selection sel = ePane.getSelection(); - if (sel instanceof CellSelection) { - this.setEnabled(true); - } else { - this.setEnabled(false); - } + public void actionPerformed(ActionEvent e) { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); } } \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index cf63c4448e..283425f6bc 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -169,7 +169,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic()); menuDef.addShortCut(new CellExpandAttrAction()); - menuDef.addShortCut(new CellWidgetAttrAction(this)); + menuDef.addShortCut(new CellWidgetAttrAction()); menuDef.addShortCut(new GlobalStyleMenuDef(this)); // 单元格形态 diff --git a/designer/src/com/fr/grid/GridMouseAdapter.java b/designer/src/com/fr/grid/GridMouseAdapter.java index fc88714adc..90b302d8d1 100644 --- a/designer/src/com/fr/grid/GridMouseAdapter.java +++ b/designer/src/com/fr/grid/GridMouseAdapter.java @@ -6,6 +6,7 @@ import com.fr.base.ScreenResolution; import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.JSliderPane; import com.fr.design.present.CellWriteAttrPane; @@ -204,7 +205,6 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous */ private void showWidetWindow(TemplateCellElement cellElement, TemplateElementCase report) { -// int resolution = ScreenResolution.getScreenResolution(); DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report); DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report); double fixed_pos_x = this.oldEvtX - columnWidthList.getRangeValue(grid.getHorizontalValue(), cellElement.getColumn()).toPixD(resolution); @@ -212,7 +212,7 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous double cell_width = columnWidthList.getRangeValue(cellElement.getColumn(), cellElement.getColumn() + cellElement.getColumnSpan()).toPixD(resolution); double cell_height = rowHeightList.getRangeValue(cellElement.getRow(), cellElement.getRow() + cellElement.getRowSpan()).toPixD(resolution); if (fitSizeToShow(cell_width, cell_height, fixed_pos_x, fixed_pos_y)) { - CellWriteAttrPane.showWidgetWindow(grid.getElementCasePane()); + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); } } diff --git a/designer/src/com/fr/grid/selection/CellSelection.java b/designer/src/com/fr/grid/selection/CellSelection.java index d3778d72a0..634dab7041 100644 --- a/designer/src/com/fr/grid/selection/CellSelection.java +++ b/designer/src/com/fr/grid/selection/CellSelection.java @@ -456,7 +456,7 @@ public class CellSelection extends Selection { } JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (jTemplate.isJWorkBook()){ //表单中报表块编辑屏蔽掉 控件设置 - popup.add(new CellWidgetAttrAction(ePane).createMenuItem()); + popup.add(new CellWidgetAttrAction().createMenuItem()); } popup.add(new CellExpandAttrAction().createMenuItem()); popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu()); diff --git a/designer/src/com/fr/poly/creator/ECBlockPane.java b/designer/src/com/fr/poly/creator/ECBlockPane.java index 61ad308b9c..78f9b31995 100644 --- a/designer/src/com/fr/poly/creator/ECBlockPane.java +++ b/designer/src/com/fr/poly/creator/ECBlockPane.java @@ -142,7 +142,7 @@ public class ECBlockPane extends PolyElementCasePane { MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic()); menuDef.addShortCut(new CellExpandAttrAction()); - menuDef.addShortCut(new CellWidgetAttrAction(this)); + menuDef.addShortCut(new CellWidgetAttrAction()); menuDef.addShortCut(new GlobalStyleMenuDef(this)); // 单元格形态 diff --git a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java index ab2dff8b2b..3aec09d459 100644 --- a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java @@ -39,17 +39,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private static final int POPUP_MIN_HEIGHT = 145; private static final int POPUP_MAX_HEIGHT = 480; private static final int POPUP_DEFAULT_HEIGHT = 360; - private static final String KEY_CELL_ELEMENT = "cellElement"; - private static final String KEY_CELL_ATTR = "cellAttr"; - private static final String KEY_FLOAT_ELEMENT = "floatElement"; - private static final String KEY_WIDGET_SETTINGS = "widgetSettings"; - private static final String KEY_CONDITION_ATTR = "conditionAttr"; - private static final String KEY_HYPERLINK = "hyperlink"; - private static final String KEY_WIDGET_LIB = "widgetLib"; - private static final String KEY_AUTHORITY_EDITION = "authorityEdition"; - private static final String KEY_CONFIGURED_ROLES = "editedRoles"; - private static final String DEFAULT_PANE = "defaultPane"; - private static final String DEFAULT_AUTHORITY_PANE = "defaultAuthorityPane"; + public static final String KEY_CELL_ELEMENT = "cellElement"; + public static final String KEY_CELL_ATTR = "cellAttr"; + public static final String KEY_FLOAT_ELEMENT = "floatElement"; + public static final String KEY_WIDGET_SETTINGS = "widgetSettings"; + public static final String KEY_CONDITION_ATTR = "conditionAttr"; + public static final String KEY_HYPERLINK = "hyperlink"; + public static final String KEY_WIDGET_LIB = "widgetLib"; + public static final String KEY_AUTHORITY_EDITION = "authorityEdition"; + public static final String KEY_CONFIGURED_ROLES = "editedRoles"; + public static final String DEFAULT_PANE = "defaultPane"; + public static final String DEFAULT_AUTHORITY_PANE = "defaultAuthorityPane"; private JPanel defaultPane; // "无可用配置项"面板 private JPanel defaultAuthorityPane; // "该元素不支持权限编辑" @@ -359,6 +359,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer { propertyItemMap.get(KEY_WIDGET_SETTINGS).removeHeaderPane(); } + public void switchTabTo(String tabName) { + PropertyItem propertyItem = propertyItemMap.get(tabName); + if (propertyItem == null) { + return; + } + if (propertyItem.isVisible() && propertyItem.isEnabled() && !propertyItem.isPoppedOut()) { + propertyCard.show(rightPane, tabName); + propertyItem.setTabButtonSelected(); + } + } + /** * 刷新右面板 */ From b07d610c66248eb73f0b60ea9509cb41160e4c8f Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 17 Aug 2017 14:05:05 +0800 Subject: [PATCH 02/14] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=3D>=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/edit/HyperlinkAction.java | 29 +++++++++++++++++++ .../cell/editor/AbstractCellEditor.java | 2 ++ .../mainframe/ElementCasePaneDelegate.java | 3 +- .../com/fr/grid/selection/CellSelection.java | 2 ++ .../com/fr/grid/selection/FloatSelection.java | 7 ++--- .../src/com/fr/poly/creator/ECBlockPane.java | 2 ++ 6 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 designer/src/com/fr/design/actions/edit/HyperlinkAction.java diff --git a/designer/src/com/fr/design/actions/edit/HyperlinkAction.java b/designer/src/com/fr/design/actions/edit/HyperlinkAction.java new file mode 100644 index 0000000000..2fcc46901f --- /dev/null +++ b/designer/src/com/fr/design/actions/edit/HyperlinkAction.java @@ -0,0 +1,29 @@ +/* + * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. + */ +package com.fr.design.actions.edit; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.menu.KeySetUtils; + +import java.awt.event.ActionEvent; + +/** + * HyperlinkAction. + */ +public class HyperlinkAction extends UpdateAction { + + public HyperlinkAction() { + this.setMenuKeySet(KeySetUtils.HYPER_LINK); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/hyperLink.png")); + } + + @Override + public void actionPerformed(ActionEvent e) { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_HYPERLINK); + } +} \ No newline at end of file diff --git a/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java b/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java index cc9c43564a..33e29c1f65 100644 --- a/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java +++ b/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java @@ -7,6 +7,7 @@ import java.awt.Point; import javax.swing.event.EventListenerList; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.grid.event.CellEditorEvent; import com.fr.grid.event.CellEditorListener; @@ -114,6 +115,7 @@ public abstract class AbstractCellEditor implements CellEditor { } if(ePane != null) { ePane.fireSelectionChangeListener(); + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ELEMENT); } } diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 283425f6bc..b50505c987 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.design.actions.edit.HyperlinkAction; import com.fr.design.fun.MenuHandler; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.menu.KeySetUtils; @@ -174,7 +175,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { // 单元格形态 menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); - + menuDef.addShortCut(new HyperlinkAction()); menuDef.addShortCut(SeparatorDef.DEFAULT); menuDef.addShortCut(new MergeCellAction(this)); menuDef.addShortCut(new UnmergeCellAction(this)); diff --git a/designer/src/com/fr/grid/selection/CellSelection.java b/designer/src/com/fr/grid/selection/CellSelection.java index 634dab7041..02c40e11fc 100644 --- a/designer/src/com/fr/grid/selection/CellSelection.java +++ b/designer/src/com/fr/grid/selection/CellSelection.java @@ -8,6 +8,7 @@ import com.fr.design.actions.cell.GlobalStyleMenuDef.GlobalStyleSelection; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.edit.CopyAction; import com.fr.design.actions.edit.CutAction; +import com.fr.design.actions.edit.HyperlinkAction; import com.fr.design.actions.edit.PasteAction; import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.cell.clipboard.CellElementsClip; @@ -461,6 +462,7 @@ public class CellSelection extends Selection { popup.add(new CellExpandAttrAction().createMenuItem()); popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu()); popup.add(new CellAttributeAction().createMenuItem()); + popup.add(new HyperlinkAction().createMenuItem()); // cut, copy and paste popup.addSeparator(); popup.add(new CutAction(ePane).createMenuItem()); diff --git a/designer/src/com/fr/grid/selection/FloatSelection.java b/designer/src/com/fr/grid/selection/FloatSelection.java index 214e82e09f..de44152f77 100644 --- a/designer/src/com/fr/grid/selection/FloatSelection.java +++ b/designer/src/com/fr/grid/selection/FloatSelection.java @@ -9,11 +9,7 @@ import com.fr.base.FRContext; import com.fr.design.actions.cell.CleanAuthorityAction; import com.fr.design.actions.cell.FloatStyleAction; import com.fr.design.actions.core.ActionFactory; -import com.fr.design.actions.edit.CopyAction; -import com.fr.design.actions.edit.CutAction; -import com.fr.design.actions.edit.DeleteAction; -import com.fr.design.actions.edit.EditFloatElementNameAction; -import com.fr.design.actions.edit.PasteAction; +import com.fr.design.actions.edit.*; import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.cell.clipboard.CellElementsClip; import com.fr.design.cell.clipboard.ElementsTransferable; @@ -125,6 +121,7 @@ public class FloatSelection extends Selection { } popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu()); popup.add(new FloatStyleAction(ePane).createMenuItem()); + popup.add(new HyperlinkAction().createMenuItem()); // cut, copy and paste popup.addSeparator(); diff --git a/designer/src/com/fr/poly/creator/ECBlockPane.java b/designer/src/com/fr/poly/creator/ECBlockPane.java index 78f9b31995..65e7d01343 100644 --- a/designer/src/com/fr/poly/creator/ECBlockPane.java +++ b/designer/src/com/fr/poly/creator/ECBlockPane.java @@ -4,6 +4,7 @@ package com.fr.poly.creator; import com.fr.base.BaseUtils; +import com.fr.design.actions.edit.HyperlinkAction; import com.fr.design.menu.KeySetUtils; import com.fr.general.Inter; import com.fr.page.ReportSettingsProvider; @@ -148,6 +149,7 @@ public class ECBlockPane extends PolyElementCasePane { // 单元格形态 menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); + menuDef.addShortCut(new HyperlinkAction()); menuDef.addShortCut(SeparatorDef.DEFAULT); menuDef.addShortCut(new MergeCellAction(this)); menuDef.addShortCut(new UnmergeCellAction(this)); From 77743d62e55c8ea381b3c7d0aaea11f42a3bf98d Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 17 Aug 2017 15:02:34 +0800 Subject: [PATCH 03/14] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=3D>=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/cell/CellAttributeTableAction.java | 2 ++ designer/src/com/fr/design/actions/cell/NewPresentAction.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java b/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java index 2906306d04..bfb01268ce 100644 --- a/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java +++ b/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java @@ -4,6 +4,7 @@ import java.awt.event.ActionEvent; import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.CellElementPropertyPane; +import com.fr.design.mainframe.EastRegionContainerPane; /** * 所有的CellAttributeTableAction都是指向单元格属性表的,点了就自动跳转到单元格属性表 @@ -17,6 +18,7 @@ public abstract class CellAttributeTableAction extends UpdateAction { @Override public void actionPerformed(ActionEvent e) { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ATTR); CellElementPropertyPane.getInstance().GoToPane(getID()); } diff --git a/designer/src/com/fr/design/actions/cell/NewPresentAction.java b/designer/src/com/fr/design/actions/cell/NewPresentAction.java index ac9fef4721..ee7b8a859b 100644 --- a/designer/src/com/fr/design/actions/cell/NewPresentAction.java +++ b/designer/src/com/fr/design/actions/cell/NewPresentAction.java @@ -3,6 +3,7 @@ package com.fr.design.actions.cell; import com.fr.base.present.Present; import com.fr.design.actions.PresentCheckBoxAction; import com.fr.design.mainframe.CellElementPropertyPane; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; @@ -25,6 +26,7 @@ public class NewPresentAction extends PresentCheckBoxAction { @Override public boolean executeActionReturnUndoRecordNeeded() { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ATTR); if (!ComparatorUtils.equals(this.itemName, "NOPRESENT")) { CellElementPropertyPane.getInstance().GoToPane(Inter.getLocText("FR-Designer_Present"), this.itemName); } else { From a35b4f089b75d939a7df2ffabc79bc512c04f5ce Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 17 Aug 2017 16:10:24 +0800 Subject: [PATCH 04/14] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=3D>=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/cell/CellAttributeTableAction.java | 6 ++---- .../src/com/fr/design/actions/cell/GlobalStyleMenuDef.java | 1 + .../src/com/fr/design/actions/cell/NewPresentAction.java | 2 -- .../com/fr/design/mainframe/CellElementPropertyPane.java | 1 + 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java b/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java index bfb01268ce..7c554ff045 100644 --- a/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java +++ b/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java @@ -1,10 +1,9 @@ package com.fr.design.actions.cell; -import java.awt.event.ActionEvent; - import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.CellElementPropertyPane; -import com.fr.design.mainframe.EastRegionContainerPane; + +import java.awt.event.ActionEvent; /** * 所有的CellAttributeTableAction都是指向单元格属性表的,点了就自动跳转到单元格属性表 @@ -18,7 +17,6 @@ public abstract class CellAttributeTableAction extends UpdateAction { @Override public void actionPerformed(ActionEvent e) { - EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ATTR); CellElementPropertyPane.getInstance().GoToPane(getID()); } diff --git a/designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java b/designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java index 27adef643a..63c38a042f 100644 --- a/designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java +++ b/designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java @@ -186,6 +186,7 @@ public class GlobalStyleMenuDef extends MenuDef { } stylePane.updateGlobalStyle(getEditingComponent()); + CellElementPropertyPane.getInstance().GoToPane(Inter.getLocText("FR-Designer-Widget_Style")); return true; } diff --git a/designer/src/com/fr/design/actions/cell/NewPresentAction.java b/designer/src/com/fr/design/actions/cell/NewPresentAction.java index ee7b8a859b..ac9fef4721 100644 --- a/designer/src/com/fr/design/actions/cell/NewPresentAction.java +++ b/designer/src/com/fr/design/actions/cell/NewPresentAction.java @@ -3,7 +3,6 @@ package com.fr.design.actions.cell; import com.fr.base.present.Present; import com.fr.design.actions.PresentCheckBoxAction; import com.fr.design.mainframe.CellElementPropertyPane; -import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; @@ -26,7 +25,6 @@ public class NewPresentAction extends PresentCheckBoxAction { @Override public boolean executeActionReturnUndoRecordNeeded() { - EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ATTR); if (!ComparatorUtils.equals(this.itemName, "NOPRESENT")) { CellElementPropertyPane.getInstance().GoToPane(Inter.getLocText("FR-Designer_Present"), this.itemName); } else { diff --git a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java index 1e79ee5ad0..a607538d62 100644 --- a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java @@ -176,6 +176,7 @@ public class CellElementPropertyPane extends DockingView { */ public void GoToPane(String... id) { cellElementEditPane.setSelectedIndex(id); + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ATTR); EastRegionContainerPane.getInstance().setWindow2PreferWidth(); } From e6710b4033df3275f938ee9355f696a057bb46a3 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 17 Aug 2017 16:38:59 +0800 Subject: [PATCH 05/14] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=3D>=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/ConditionAttributesAction.java | 28 +++++++++++++++++++ .../mainframe/ElementCasePaneDelegate.java | 1 + .../com/fr/grid/selection/CellSelection.java | 1 + .../src/com/fr/poly/creator/ECBlockPane.java | 1 + 4 files changed, 31 insertions(+) create mode 100644 designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java diff --git a/designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java b/designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java new file mode 100644 index 0000000000..15acd796cb --- /dev/null +++ b/designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java @@ -0,0 +1,28 @@ +/* + * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. + */ +package com.fr.design.actions.cell; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.menu.KeySetUtils; + +import java.awt.event.ActionEvent; + +/** + * Condition Attributes. + */ +public class ConditionAttributesAction extends UpdateAction { + public ConditionAttributesAction() { + this.setMenuKeySet(KeySetUtils.CONDITION_ATTR); + this.setName(getMenuKeySet().getMenuKeySetName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/highlight.png")); + } + + @Override + public void actionPerformed(ActionEvent e) { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CONDITION_ATTR); + } +} \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index b50505c987..c5bd1e9525 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -172,6 +172,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { menuDef.addShortCut(new CellExpandAttrAction()); menuDef.addShortCut(new CellWidgetAttrAction()); menuDef.addShortCut(new GlobalStyleMenuDef(this)); + menuDef.addShortCut(new ConditionAttributesAction()); // 单元格形态 menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); diff --git a/designer/src/com/fr/grid/selection/CellSelection.java b/designer/src/com/fr/grid/selection/CellSelection.java index 02c40e11fc..890affae32 100644 --- a/designer/src/com/fr/grid/selection/CellSelection.java +++ b/designer/src/com/fr/grid/selection/CellSelection.java @@ -462,6 +462,7 @@ public class CellSelection extends Selection { popup.add(new CellExpandAttrAction().createMenuItem()); popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu()); popup.add(new CellAttributeAction().createMenuItem()); + popup.add(new ConditionAttributesAction().createMenuItem()); popup.add(new HyperlinkAction().createMenuItem()); // cut, copy and paste popup.addSeparator(); diff --git a/designer/src/com/fr/poly/creator/ECBlockPane.java b/designer/src/com/fr/poly/creator/ECBlockPane.java index 65e7d01343..edd93ce9ac 100644 --- a/designer/src/com/fr/poly/creator/ECBlockPane.java +++ b/designer/src/com/fr/poly/creator/ECBlockPane.java @@ -145,6 +145,7 @@ public class ECBlockPane extends PolyElementCasePane { menuDef.addShortCut(new CellExpandAttrAction()); menuDef.addShortCut(new CellWidgetAttrAction()); menuDef.addShortCut(new GlobalStyleMenuDef(this)); + menuDef.addShortCut(new ConditionAttributesAction()); // 单元格形态 menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); From 4face0de220920ab655239c64fc9b252e1960473 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 17 Aug 2017 16:40:55 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=B1=9E=E6=80=A7-?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E6=96=B9=E5=BC=8F=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E8=A7=84=E5=88=99=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/mobile/MobileRadioGroupPane.java | 8 +- .../report/mobile/MobileUseHtmlGroupPane.java | 32 ----- .../report/mobile/ReportMobileAttrPane.java | 6 - .../mobile/MobileUseHtmlGroupBeanPane.java | 112 ------------------ .../form/mobile/FormMobileAttrPane.java | 14 +-- .../form/mobile/MobileUseHtmlGroupPane.java | 33 ------ 6 files changed, 4 insertions(+), 201 deletions(-) delete mode 100644 designer/src/com/fr/design/report/mobile/MobileUseHtmlGroupPane.java delete mode 100644 designer_base/src/com/fr/design/dialog/mobile/MobileUseHtmlGroupBeanPane.java delete mode 100644 designer_form/src/com/fr/design/form/mobile/MobileUseHtmlGroupPane.java diff --git a/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java b/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java index 68446abc97..072b34b6c3 100644 --- a/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java +++ b/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java @@ -29,21 +29,19 @@ public class MobileRadioGroupPane extends BasicBeanPane{ private void initComponents(String title) { double p = TableLayout.PREFERRED; double[] rowSize = {p}; - double[] columnSize = {p, p, p, p, p, p}; + double[] columnSize = {p, p, p, p, p}; - IndexRadioButton defaultRadio = new IndexRadioButton(MobileFitAttrState.DEFAULT.description(), MobileFitAttrState.DEFAULT); - defaultRadio.setSelected(true); IndexRadioButton horizonRadio = new IndexRadioButton(MobileFitAttrState.HORIZONTAL.description(), MobileFitAttrState.HORIZONTAL); + horizonRadio.setSelected(true); IndexRadioButton verticalRadio = new IndexRadioButton(MobileFitAttrState.VERTICAL.description(), MobileFitAttrState.VERTICAL); IndexRadioButton bidirectionalRadio = new IndexRadioButton(MobileFitAttrState.BIDIRECTIONAL.description(), MobileFitAttrState.BIDIRECTIONAL); IndexRadioButton notFitRadio = new IndexRadioButton(MobileFitAttrState.NONE.description(), MobileFitAttrState.NONE); - addToButtonGroup(defaultRadio, horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); + addToButtonGroup(horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); Component[][] components = new Component[][]{ new Component[] { new UILabel(title), - defaultRadio, horizonRadio, verticalRadio, bidirectionalRadio, diff --git a/designer/src/com/fr/design/report/mobile/MobileUseHtmlGroupPane.java b/designer/src/com/fr/design/report/mobile/MobileUseHtmlGroupPane.java deleted file mode 100644 index ee3c51fec7..0000000000 --- a/designer/src/com/fr/design/report/mobile/MobileUseHtmlGroupPane.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.fr.design.report.mobile; - -import com.fr.design.dialog.mobile.MobileUseHtmlGroupBeanPane; -import com.fr.report.mobile.ElementCaseMobileAttr; - -/** - * Created by kunsnat on 2016/8/3. - */ -public class MobileUseHtmlGroupPane extends MobileUseHtmlGroupBeanPane { - public MobileUseHtmlGroupPane(String annotation) { - super(annotation); - } - - @Override - public void populateBean(ElementCaseMobileAttr mobileAttr) { - if(mobileAttr != null) { - selectIndexButton(mobileAttr.isUseHTML() ? 1 : 0); - } - } - - @Override - public ElementCaseMobileAttr updateBean() { - return null; - } - - @Override - public void updateBean(ElementCaseMobileAttr mobileAttr) { - if(mobileAttr != null) { - mobileAttr.setUseHTML(getSelectRadioIndex() == 1); - } - } -} diff --git a/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java b/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java index e91d1d3b84..5c97dae8c7 100644 --- a/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java +++ b/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java @@ -15,8 +15,6 @@ public class ReportMobileAttrPane extends BasicBeanPane{ private AppFitBrowserPane appFitBrowserPane; - private MobileUseHtmlGroupPane htmlGroupPane; - //工具栏容器 private MobileToolBarPane mobileToolBarPane; @@ -34,8 +32,6 @@ public class ReportMobileAttrPane extends BasicBeanPane{ appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); jPanel.add(appFitBrowserPane); - jPanel.add(htmlGroupPane = new MobileUseHtmlGroupPane(Inter.getLocText("FR-Designer_Mobile_Report_Analysis_Annotation"))); - jPanel.add(mobileToolBarPane = new MobileToolBarPane()); jPanel.add(appFitPreviewPane); @@ -50,7 +46,6 @@ public class ReportMobileAttrPane extends BasicBeanPane{ } appFitBrowserPane.populateBean(ob); mobileToolBarPane.populateBean(ob); - htmlGroupPane.populateBean(ob); } @@ -58,7 +53,6 @@ public class ReportMobileAttrPane extends BasicBeanPane{ public ElementCaseMobileAttr updateBean() { ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean(); mobileToolBarPane.updateBean(caseMobileAttr); - htmlGroupPane.updateBean(caseMobileAttr); return caseMobileAttr; } diff --git a/designer_base/src/com/fr/design/dialog/mobile/MobileUseHtmlGroupBeanPane.java b/designer_base/src/com/fr/design/dialog/mobile/MobileUseHtmlGroupBeanPane.java deleted file mode 100644 index 06666ee579..0000000000 --- a/designer_base/src/com/fr/design/dialog/mobile/MobileUseHtmlGroupBeanPane.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.fr.design.dialog.mobile; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.border.UITitledBorder; -import com.fr.design.gui.ibutton.UIRadioButton; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.Inter; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; - -/** - * 由于MobileUserHtmlGroupPane 现在在report和form中均会用到,会出现重复代码,故放入base中 - * Created by fanglei on 2016/12/28. - */ -public abstract class MobileUseHtmlGroupBeanPane extends BasicBeanPane { - - private List radioButtons = new ArrayList(); - - public MobileUseHtmlGroupBeanPane(String annotation) { - initComponents(annotation); - } - - private void initComponents(String annotation) { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(UITitledBorder.createBorderWithTitle(this.title4PopupWindow())); - - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p}; - double[] columnSize = {p, p, p}; - - UIRadioButton useApp = new UIRadioButton(Inter.getLocText("FR-mobile_native_analysis")); - useApp.setSelected(true); - UIRadioButton useHTML5 = new UIRadioButton(Inter.getLocText("FR-mobile_html_analysis")); - - addToButtonGroup(useApp, useHTML5); - - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-mobile_analysis_style")), useApp, useHTML5}, - new Component[]{new UILabel(annotation), null, null} - }; - JPanel usePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - usePane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); - - this.add(usePane); - } - - private void addToButtonGroup(UIRadioButton... radios) { - ButtonGroup buttonGroup = new ButtonGroup(); - for (UIRadioButton radio : radios) { - radioButtons.add(radio); - buttonGroup.add(radio); - } - } - - /** - * 设置按钮状态 - */ - public void setEnabled(boolean enabled) { - for (UIRadioButton radioButton : radioButtons) { - radioButton.setEnabled(enabled); - } - } - - /** - * 获取当前选中的按钮index - * - * @return 按钮index - */ - public int getSelectRadioIndex() { - for (int i = 0, len = radioButtons.size(); i < len; i++) { - if (radioButtons.get(i).isSelected()) { - return i; - } - } - - return 0; - } - - /** - * 选中指定index的按钮 - */ - public void selectIndexButton(int index) { - if (index < 0 || index > radioButtons.size() - 1) { - return; - } - - UIRadioButton button = radioButtons.get(index); - button.setSelected(true); - } - - /** - * 给所有的按钮加上监听 - */ - public void addActionListener(ActionListener actionListener) { - for (UIRadioButton radioButton : radioButtons) { - radioButton.addActionListener(actionListener); - } - } - - @Override - protected String title4PopupWindow() { - return Inter.getLocText("FR-mobile_report_analysis"); - } -} - diff --git a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java index 6dc1f20efd..a4d657e117 100644 --- a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java +++ b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -16,9 +16,6 @@ public class FormMobileAttrPane extends BasicBeanPane{ //工具栏容器 private MobileToolBarPane mobileToolBarPane; - //h5解析容器 - private MobileUseHtmlGroupPane mobileUseHtmlGroupPane; - static final int PADDINGHEIGHT = 10; public FormMobileAttrPane() { @@ -29,21 +26,14 @@ public class FormMobileAttrPane extends BasicBeanPane{ //拉长两个Panel的高度去填满整个对话框。 private void initComponents() { JPanel jPanel1 = new JPanel(); - JPanel jPanel2 = new JPanel(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); jPanel1.setLayout(FRGUIPaneFactory.createBorderLayout()); jPanel1.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - jPanel2.setLayout(FRGUIPaneFactory.createBorderLayout()); - jPanel2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); this.mobileToolBarPane = new MobileToolBarPane(); - this.mobileUseHtmlGroupPane = new MobileUseHtmlGroupPane(Inter.getLocText("FR-Designer_Mobile_Form_Analysis_Annotation")); //设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中 jPanel1.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + PADDINGHEIGHT)); - jPanel2.setPreferredSize(new Dimension(0, (int)this.mobileUseHtmlGroupPane.getPreferredSize().getHeight() + PADDINGHEIGHT)); - jPanel1.add("North", this.mobileUseHtmlGroupPane); - jPanel2.add("North", this.mobileToolBarPane); + jPanel1.add("North", this.mobileToolBarPane); this.add("North", jPanel1); - this.add("Center", jPanel2); } @Override @@ -52,14 +42,12 @@ public class FormMobileAttrPane extends BasicBeanPane{ ob = new FormMobileAttr(); } this.mobileToolBarPane.populateBean(ob); - this.mobileUseHtmlGroupPane.populateBean(ob); } @Override public FormMobileAttr updateBean() { FormMobileAttr formMobileAttr = new FormMobileAttr(); this.mobileToolBarPane.updateBean(formMobileAttr); - this.mobileUseHtmlGroupPane.updateBean(formMobileAttr); return formMobileAttr; } diff --git a/designer_form/src/com/fr/design/form/mobile/MobileUseHtmlGroupPane.java b/designer_form/src/com/fr/design/form/mobile/MobileUseHtmlGroupPane.java deleted file mode 100644 index ab400d4a30..0000000000 --- a/designer_form/src/com/fr/design/form/mobile/MobileUseHtmlGroupPane.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.fr.design.form.mobile; - -import com.fr.design.dialog.mobile.MobileUseHtmlGroupBeanPane; -import com.fr.form.main.mobile.FormMobileAttr; - -/** - * 直接copyreport中的MobileUseHtmlGroupPane - * Created by fanglei on 2016/12/28. - */ -public class MobileUseHtmlGroupPane extends MobileUseHtmlGroupBeanPane { - public MobileUseHtmlGroupPane(String annotation) { - super(annotation); - } - - @Override - public void populateBean(FormMobileAttr mobileAttr) { - if(mobileAttr != null) { - selectIndexButton(mobileAttr.isUseHTML() ? 1 : 0); - } - } - - @Override - public FormMobileAttr updateBean() { - return null; - } - - @Override - public void updateBean(FormMobileAttr mobileAttr) { - if(mobileAttr != null) { - mobileAttr.setUseHTML(getSelectRadioIndex() == 1); - } - } -} From 4707ce4702f9e9a8ca98dbe2f0802e54b23047a3 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 17 Aug 2017 17:31:50 +0800 Subject: [PATCH 07/14] =?UTF-8?q?REPORT-3706=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=8F=82=E6=95=B0=E7=95=8C=E9=9D=A2=E6=97=A0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8F=82=E6=95=B0=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/form/parameter/FormParaDesigner.java | 2 +- .../src/com/fr/design/parameter/ParameterPropertyPane.java | 7 ++++++- .../src/com/fr/design/parameter/ParameterToolBarPane.java | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java index 280a12067d..e84259fd86 100644 --- a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java @@ -114,7 +114,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP FormWidgetDetailPane.getInstance(this)); if (!BaseUtils.isAuthorityEditing()) { ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(this); - parameterPropertyPane.setAddParaPaneVisible(true); + parameterPropertyPane.refreshState(); EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane); EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height); EastRegionContainerPane.getInstance().replaceWidgetSettingsPane( diff --git a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java index 28c912c368..9404964a63 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java @@ -45,7 +45,7 @@ public class ParameterPropertyPane extends JPanel{ revalidate(); } - public ParameterPropertyPane() { + private ParameterPropertyPane() { toolbarPane = new ParameterToolBarPane(); BasicScrollPane basicScrollPane = new BasicScrollPane() { @Override @@ -77,6 +77,11 @@ public class ParameterPropertyPane extends JPanel{ this.add(addParaPane, BorderLayout.CENTER); } + // 显示或隐藏添加参数面板 + public void refreshState() { + setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem()); + } + public void setAddParaPaneVisible(boolean isVisible) { if (isVisible == addParaPane.isVisible()) { return; diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index daac4c2db8..16fc6ce041 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -82,6 +82,7 @@ public class ParameterToolBarPane extends BasicBeanPane { this.add(label); if (parameterArray.length == 0) { + ParameterPropertyPane.getInstance().refreshState(); this.setVisible(false); this.repaint(); return; @@ -102,6 +103,7 @@ public class ParameterToolBarPane extends BasicBeanPane { this.add(addAll); this.doLayout(); + ParameterPropertyPane.getInstance().refreshState(); this.repaint(); } From 324618dee32d56923b357afbd4a337617215f14a Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 17 Aug 2017 17:57:43 +0800 Subject: [PATCH 08/14] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=201.=E4=BF=AE=E6=94=B9UIExpandableP?= =?UTF-8?q?ane=E8=87=AA=E9=80=82=E5=BA=94=E5=AE=BD=E5=BA=A6=EF=BC=8C?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E6=A0=B9=E6=8D=AE=E8=A7=86=E8=A7=89=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=A0=B7=E5=BC=8F=202.=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF=E6=A0=B9=E6=8D=AE=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E6=96=B0=E5=87=BA=E7=9A=84=E5=9B=BE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/cell/CellElementEditPane.java | 2 +- .../cell/settingpane/CellExpandAttrPane.java | 7 +- .../cell/settingpane/CellOtherSetPane.java | 42 ++- .../cell/settingpane/CellPresentPane.java | 62 ++-- .../cell/settingpane/CellStylePane.java | 3 +- .../settingpane/style/CustomStylePane.java | 1 + .../style/PredefinedStylePane.java | 2 +- .../com/fr/design/present/PresentPane.java | 4 - .../com/fr/design/constants/UIConstants.java | 9 +- .../fr/design/foldablepane/HeaderPane.java | 33 +- .../design/foldablepane/UIExpandablePane.java | 58 ++-- .../fr/design/gui/frpane/UIComboBoxPane.java | 288 +++++++++--------- .../com/fr/design/gui/ibutton/UITabGroup.java | 15 +- .../fr/design/gui/itextfield/UITextField.java | 12 +- .../fr/design/gui/style/AlignmentPane.java | 2 +- .../com/fr/design/gui/style/FormatPane.java | 1 - 16 files changed, 281 insertions(+), 260 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java b/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java index f0ee3937c6..e56374a4ee 100644 --- a/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java +++ b/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java @@ -89,7 +89,7 @@ public class CellElementEditPane extends BasicPane { downTitle = new JPanel(); downTitle.setLayout(new BorderLayout()); downTitle.add(tabsHeaderIconPane, BorderLayout.NORTH); - center.setBorder(BorderFactory.createEmptyBorder(0, -10, 0, -10)); + center.setBorder(BorderFactory.createEmptyBorder(0, -5, 0, 5)); downTitle.add(center, BorderLayout.CENTER); this.add(downTitle, BorderLayout.CENTER); diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java index 2f0398701b..79c224ea32 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.base.BaseUtils; import com.fr.design.constants.LayoutConstants; +import com.fr.design.constants.UIConstants; import com.fr.design.expand.ExpandLeftFatherPane; import com.fr.design.expand.ExpandUpFatherPane; import com.fr.design.expand.SortExpandAttrPane; @@ -85,8 +86,8 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { layoutPane = new JPanel(new BorderLayout()); basicPane = new JPanel(); seniorPane = new JPanel(); - basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 290, 24, basicPane()); - seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 290, 24, seniorPane()); + basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 223, 24, basicPane()); + seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 223, 24, seniorPane()); layoutPane.add(basicPane, BorderLayout.NORTH); layoutPane.add(seniorPane, BorderLayout.CENTER); return layoutPane; @@ -122,6 +123,8 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { UILabel expendSort = new UILabel(Inter.getLocText("FR-Designer_ExpendSort"), SwingConstants.LEFT); JPanel expendSortPane = new JPanel(new BorderLayout()); expendSortPane.add(expendSort, BorderLayout.NORTH); + horizontalExpandableCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); + verticalExpandableCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); Component[][] components = new Component[][]{ new Component[]{null, null}, new Component[]{horizontalExpandableCheckBox, null}, diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 4ace2d6201..411ef87a92 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.design.constants.LayoutConstants; +import com.fr.design.constants.UIConstants; import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.file.HistoryTemplateListPane; @@ -88,18 +89,18 @@ public class CellOtherSetPane extends AbstractCellAttrPane { private JPanel basicPane() { autoHeightCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Auto_Adjust_Height")); autoWidthCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Auto_Adjust_Wdith")); + autoHeightCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); + autoWidthCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p, p, p}; + double[] rowSize = {p, p, p}; double[] columnSize = {p}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{null}, new Component[]{autoHeightCheckBox}, - new Component[]{null}, new Component[]{autoWidthCheckBox}, - new Component[]{null}, }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); } @@ -146,22 +147,38 @@ public class CellOtherSetPane extends AbstractCellAttrPane { private JPanel seniorUpPane() { JPanel fileNamePane = createNormal(); + previewCellContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); + printAndExportContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); + printAndExportBackground.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p, p, p, p, p, p, p}; + double[] rowSize = {p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{null, null}, new Component[]{previewCellContent, null}, new Component[]{printAndExportContent, null}, new Component[]{printAndExportBackground, null}, + }; + JPanel upPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); + + double[] downRowSize = {p, p, p, p, p, p}; + double[] downColumnSize = {p, f}; + int[][] downRowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; + Component[][] downComponent = new Component[][]{ + new Component[]{null, null}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Show_Content"), SwingConstants.LEFT), showContent}, new Component[]{null, fileNamePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_CellWrite_ToolTip"), SwingConstants.RIGHT), tooltipTextField}, new Component[]{null, null}, + new Component[]{null, null}, }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); + JPanel downPane = TableLayoutHelper.createGapTableLayoutPane(downComponent, downRowSize, downColumnSize, downRowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); + JPanel pane = new JPanel(new BorderLayout()); + pane.add(upPane, BorderLayout.NORTH); + pane.add(downPane, BorderLayout.CENTER); + return pane; } private JPanel pagePane() { @@ -175,6 +192,13 @@ public class CellOtherSetPane extends AbstractCellAttrPane { canBreakOnPaginateCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_CellPage_Can_Break_On_Paginate")); repeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_CellPage_Repeat_Content_When_Paging")); + pageBeforeRowCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); + pageAfterRowCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); + pageBeforeColumnCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); + pageAfterColumnCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); + canBreakOnPaginateCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); + repeatCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); + double p = TableLayout.PREFERRED; double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p}; double[] columnSize = {p}; @@ -190,7 +214,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { new Component[]{canBreakOnPaginateCheckBox}, new Component[]{repeatCheckBox}, }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); } diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java index 8d29ff1335..07688134f3 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.base.present.Present; +import com.fr.design.constants.UIConstants; import com.fr.design.present.PresentPane; import com.fr.general.Inter; import com.fr.report.cell.DefaultTemplateCellElement; @@ -17,16 +18,18 @@ import java.awt.event.ItemListener; * @since 2012-5-11下午5:24:35 */ public class CellPresentPane extends AbstractCellAttrPane { - private PresentPane presentPane; + private PresentPane presentPane; /** * 初始化面板 - * @return 面板 + * + * @return 面板 */ - public JPanel createContentPane() { - presentPane = new PresentPane(); + public JPanel createContentPane() { + presentPane = new PresentPane(); JPanel content = new JPanel(new BorderLayout()); content.add(presentPane, BorderLayout.CENTER); + presentPane.setBorder(UIConstants.CELL_ATTR_PRESENTBORDER); presentPane.addTabChangeListener(new ItemListener() { @Override @@ -35,23 +38,23 @@ public class CellPresentPane extends AbstractCellAttrPane { } }); return content; - } + } - @Override - public String getIconPath() { + @Override + public String getIconPath() { // return "com/fr/design/images/data/source/dataDictionary.png"; return Inter.getLocText("FR-Designer_Present"); - } + } - @Override - public void updateBean(TemplateCellElement cellElement) { - cellElement.setPresent(presentPane.updateBean()); - } + @Override + public void updateBean(TemplateCellElement cellElement) { + cellElement.setPresent(presentPane.updateBean()); + } /** * 保存 */ - public void updateBeans() { + public void updateBeans() { Present present = presentPane.updateBean(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); int cellRectangleCount = cs.getCellRectangleCount(); @@ -71,21 +74,21 @@ public class CellPresentPane extends AbstractCellAttrPane { } } } - } + } - @Override - protected void populateBean() { + @Override + protected void populateBean() { //选中的所有单元格都有形态,属性表才会有内容,否则是初始值 //主要是解决37664 - Present present = getSelectCellPresent(); + Present present = getSelectCellPresent(); presentPane.populateBean(present); - } + } - private Present getSelectCellPresent(){ + private Present getSelectCellPresent() { TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); //按住ctrl选中多个cell块 int cellRectangleCount = cs.getCellRectangleCount(); - + for (int rect = 0; rect < cellRectangleCount; rect++) { Rectangle cellRectangle = cs.getCellRectangle(rect); for (int j = 0; j < cellRectangle.height; j++) { @@ -93,8 +96,8 @@ public class CellPresentPane extends AbstractCellAttrPane { int column = i + cellRectangle.x; int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); - if(cellElement == null || cellElement.getPresent() == null){ - return null; + if (cellElement == null || cellElement.getPresent() == null) { + return null; } } } @@ -104,15 +107,16 @@ public class CellPresentPane extends AbstractCellAttrPane { /** * 对话框标题 - * @return 标题 + * + * @return 标题 */ - public String title4PopupWindow() { - return Inter.getLocText("FR-Chart-Style_Present"); - } + public String title4PopupWindow() { + return Inter.getLocText("FR-Chart-Style_Present"); + } - public void setSelectedByIds(int level, String... id) { - presentPane.setSelectedByName(id[level]); - } + public void setSelectedByIds(int level, String... id) { + presentPane.setSelectedByName(id[level]); + } } \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellStylePane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index be997ae0b5..dc42b82d2e 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellStylePane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellStylePane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.base.Style; +import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.cell.settingpane.style.StylePane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; @@ -25,6 +26,7 @@ public class CellStylePane extends AbstractCellAttrPane { JPanel content = new JPanel(new BorderLayout()); stylePane = new StylePane(); content.add(stylePane, BorderLayout.CENTER); + stylePane.setBorder(UIConstants.CELL_ATTR_PRESENTBORDER); stylePane.addPredefinedChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { attributeChanged(); @@ -37,7 +39,6 @@ public class CellStylePane extends AbstractCellAttrPane { adjustValues();// 里面的Tab切换后要及时调整滚动条,因为一些界面可能不需要滚动条 } }); -// content.setBorder(UIConstants.CELL_ATTR_NORMALBORDER); return content; } diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java index ecc22aae72..b899071d6a 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java @@ -40,6 +40,7 @@ public class CustomStylePane extends MultiTabPane