From 324618dee32d56923b357afbd4a337617215f14a Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 17 Aug 2017 17:57:43 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=201.=E4=BF=AE=E6=94=B9UIExpandablePane?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E5=AE=BD=E5=BA=A6=EF=BC=8C=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E6=A0=B9=E6=8D=AE=E8=A7=86=E8=A7=89=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=202.=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=9D=A2=E6=9D=BF=E6=A0=B9=E6=8D=AE=E8=A7=86=E8=A7=89?= =?UTF-8?q?=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