diff --git a/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java b/designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java index 2906306d04..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,10 @@ package com.fr.design.actions.cell; -import java.awt.event.ActionEvent; - import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.CellElementPropertyPane; +import java.awt.event.ActionEvent; + /** * 所有的CellAttributeTableAction都是指向单元格属性表的,点了就自动跳转到单元格属性表 * 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/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/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/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/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(); } diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index cf63c4448e..c5bd1e9525 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; @@ -169,12 +170,13 @@ 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)); + menuDef.addShortCut(new ConditionAttributesAction()); // 单元格形态 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/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..e8d82c5102 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; @@ -9,7 +10,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; @@ -46,9 +47,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane { private UIComboBox showContent; - private UITextField tooltipTextField; + private UIPropertyTextField tooltipTextField; - private UITextField fileNameTextField; + private UIPropertyTextField fileNameTextField; // 分页 private UICheckBox pageBeforeRowCheckBox; @@ -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); } @@ -204,8 +228,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane { final JPanel fileNamePane = new JPanel(fileNameLayout); JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0)); fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST); - fileNameTextField = new UITextField(); - tooltipTextField = new UITextField(); + fileNameTextField = new UIPropertyTextField(); + tooltipTextField = new UIPropertyTextField(); tooltipTextField.getUI(); fileNamePane.add(new JPanel(), "none"); fileNamePane.add(fileNameCCPane, "content"); @@ -224,8 +248,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane { } } }); - tooltipTextField = new UITextField(); - tooltipTextField.getUI(); return fileNamePane; } 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