diff --git a/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java b/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java index f0ee3937c6..5467ede28a 100644 --- a/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java +++ b/designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java @@ -32,35 +32,22 @@ import java.util.List; * @since 2012-5-8下午12:18:53 */ public class CellElementEditPane extends BasicPane { - private static int TIME_GAP = 80; + private static final int LEFT_BORDER = -5; + private static final int RIGHT_BORDER = 5; private List paneList; private TemplateCellElement cellelement; private ElementCasePane ePane; private UIHeadGroup tabsHeaderIconPane; private boolean isEditing; - private int PaneListIndex; private CardLayout card; private JPanel center; private JPanel downTitle; - private JPanel title; - private UILabel titlename; private TitleChangeListener titleChangeListener = null; private CellAttributeProvider cellAttributeProvider = null; - public static void main(String[] args){ - JFrame jf = new JFrame("test"); - jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - JPanel content = (JPanel) jf.getContentPane(); - content.setLayout(new BorderLayout()); - content.add(new CellElementEditPane(), BorderLayout.CENTER); - GUICoreUtils.centerWindow(jf); - jf.setSize(290, 400); - jf.setVisible(true); - } - public CellElementEditPane() { setLayout(new BorderLayout()); initPaneList(); @@ -89,7 +76,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, LEFT_BORDER, 0, RIGHT_BORDER)); 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..2e5fcb3c0f 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; @@ -61,18 +62,6 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { return layoutPane(); } - - public static void main(String[] args) { - JFrame jf = new JFrame("test"); - jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - JPanel content = (JPanel) jf.getContentPane(); - content.setLayout(new BorderLayout()); - content.add(new CellExpandAttrPane().layoutPane(), BorderLayout.CENTER); - GUICoreUtils.centerWindow(jf); - jf.setSize(290, 400); - jf.setVisible(true); - } - private void initAllNames() { expandDirectionButton.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Expand_Direction")); leftFatherPane.setGlobalName(Inter.getLocText("FR-Designer_LeftParent")); @@ -85,8 +74,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 +111,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}, @@ -163,6 +154,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { default: { horizontalExpandableCheckBox.setSelected(false); verticalExpandableCheckBox.setSelected(false); + break; } } 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