diff --git a/designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java b/designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java deleted file mode 100644 index 61fe9fefe..000000000 --- a/designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. - */ -package com.fr.design.actions.cell; - -import com.fr.base.BaseUtils; -import com.fr.design.menu.KeySetUtils; -import com.fr.design.present.ConditionAttributesGroupPane; -import com.fr.design.dialog.BasicPane; -import com.fr.design.mainframe.ElementCasePane; -import com.fr.report.cell.TemplateCellElement; - -/** - * Condition Attributes. - */ -public class ConditionAttributesAction extends AbstractCellElementAction { - public ConditionAttributesAction(ElementCasePane t) { - super(t); - 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 - protected BasicPane populateBasicPane(TemplateCellElement cellElement) { - ConditionAttributesGroupPane pane = new ConditionAttributesGroupPane(); - pane.populate(cellElement.getHighlightGroup()); - - return pane; - } - - @Override - protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) { - cellElement.setHighlightGroup(((ConditionAttributesGroupPane)bp).updateHighlightGroup()); - } -} \ 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 dd28242cd..7cd32d627 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -1,6 +1,16 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.design.fun.MenuHandler; +import com.fr.design.gui.frpane.HyperlinkGroupPane; +import com.fr.design.menu.KeySetUtils; +import com.fr.design.present.ConditionAttributesGroupPane; +import com.fr.general.Inter; +import com.fr.grid.selection.CellSelection; +import com.fr.grid.selection.FloatSelection; +import com.fr.grid.selection.Selection; +import com.fr.page.ReportSettingsProvider; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.DesignState; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.cell.*; @@ -19,6 +29,11 @@ import com.fr.design.mainframe.cell.QuickEditorRegion; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; +import com.fr.report.cell.DefaultTemplateCellElement; +import com.fr.report.cell.TemplateCellElement; +import com.fr.report.core.SheetUtils; +import com.fr.report.elementcase.TemplateElementCase; +import com.fr.report.worksheet.WorkSheet; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; @@ -59,21 +74,26 @@ public class ElementCasePaneDelegate extends ElementCasePane { QuickEditorRegion.getInstance().populate(getCurrentEditor()); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (editingTemplate != null && !editingTemplate.isUpMode()) { + Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection(); // 模板初始化完成后,才能初始化超级链接面板 -// HyperlinkGroupPane hyperlinkGroupPane = ReportHyperlinkGroupPane.getInstance(HyperlinkGroupPaneActionImpl.getInstance()); HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance()); hyperlinkGroupPane.populate(ElementCasePaneDelegate.this); - if (((ElementCasePaneDelegate) e.getSource()).getSelection() instanceof FloatSelection) { + if (editingSelection instanceof FloatSelection) { EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT); JPanel floatPane = new JPanel(new BorderLayout()); floatPane.add(ReportFloatPane.getInstance(), BorderLayout.NORTH); floatPane.add(QuickEditorRegion.getInstance(), BorderLayout.CENTER); EastRegionContainerPane.getInstance().replaceFloatElementPane(floatPane); } else { + // 条件属性 + ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance(); + conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this); + EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT); EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); + EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane); } EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane); EastRegionContainerPane.getInstance().removeParameterPane(); @@ -163,7 +183,6 @@ public class ElementCasePaneDelegate extends ElementCasePane { menuDef.addShortCut(new CellExpandAttrAction()); menuDef.addShortCut(new CellWidgetAttrAction(this)); menuDef.addShortCut(new GlobalStyleMenuDef(this)); - menuDef.addShortCut(new ConditionAttributesAction(this)); // 单元格形态 menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); diff --git a/designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java b/designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java index d1c756e90..a93604dcb 100644 --- a/designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java +++ b/designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java @@ -28,6 +28,7 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; +import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.form.FormElementCaseProvider; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; @@ -222,6 +223,12 @@ public class FormElementCaseDesigner nameObjectList = new ArrayList(); diff --git a/designer/src/com/fr/grid/selection/CellSelection.java b/designer/src/com/fr/grid/selection/CellSelection.java index 6a7adbd9d..a5b139af5 100644 --- a/designer/src/com/fr/grid/selection/CellSelection.java +++ b/designer/src/com/fr/grid/selection/CellSelection.java @@ -458,7 +458,6 @@ public class CellSelection extends Selection { } popup.add(new CellExpandAttrAction().createMenuItem()); popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu()); - popup.add(new ConditionAttributesAction(ePane).createMenuItem()); popup.add(new CellAttributeAction().createMenuItem()); // cut, copy and paste popup.addSeparator(); diff --git a/designer/src/com/fr/poly/creator/ECBlockEditor.java b/designer/src/com/fr/poly/creator/ECBlockEditor.java index ffcb9ae79..eff054dfb 100644 --- a/designer/src/com/fr/poly/creator/ECBlockEditor.java +++ b/designer/src/com/fr/poly/creator/ECBlockEditor.java @@ -12,6 +12,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.mainframe.*; import com.fr.design.mainframe.cell.QuickEditorRegion; +import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.grid.GridUtils; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; @@ -32,7 +33,6 @@ import java.awt.*; * @since 6.5.4 创建于2011-5-5 单元格类型的聚合块编辑器 */ public class ECBlockEditor extends BlockEditor { - private static final int HEIGHT_MORE = 5; public ECBlockEditor(PolyDesigner designer, ECBlockCreator creator) { @@ -159,8 +159,12 @@ public class ECBlockEditor extends BlockEditor { EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); + // 超级链接 HyperlinkGroupPane hyperlinkGroupPane = DesignerContext.getDesignerFrame().getSelectedJTemplate() .getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance()); hyperlinkGroupPane.populate(editComponent); + // 条件属性 + ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance(); + conditionAttributesGroupPane.populate(editComponent); } } \ No newline at end of file diff --git a/designer/src/com/fr/poly/creator/ECBlockPane.java b/designer/src/com/fr/poly/creator/ECBlockPane.java index fbc5e1f8a..f6e8eb9be 100644 --- a/designer/src/com/fr/poly/creator/ECBlockPane.java +++ b/designer/src/com/fr/poly/creator/ECBlockPane.java @@ -142,7 +142,6 @@ public class ECBlockPane extends PolyElementCasePane { menuDef.addShortCut(new CellExpandAttrAction()); menuDef.addShortCut(new CellWidgetAttrAction(this)); menuDef.addShortCut(new GlobalStyleMenuDef(this)); - menuDef.addShortCut(new ConditionAttributesAction(this)); // 单元格形态 menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); diff --git a/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java index 5d48980a9..1968dc635 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java @@ -3,6 +3,7 @@ package com.fr.design.gui.controlpane; import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; +import com.fr.design.actions.core.ActionFactory; import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane; import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane; @@ -26,6 +27,7 @@ import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; +import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; import javax.swing.*; @@ -436,6 +438,43 @@ public abstract class UIListControlPane extends UIControlPane { this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png")); } + /** + * Gets component on toolbar. + * + * @return the created components on toolbar. + */ + @Override + public JComponent createToolBarComponent() { + Object object = this.getValue(UIButton.class.getName()); + if (!(object instanceof AbstractButton)) { + // 直接使用默认UI + UIButton button = new UIButton(); + // 添加一个名字作为自动化测试用 + button.setName(getName()); + + //设置属性. + Integer mnemonicInteger = (Integer) this.getValue(Action.MNEMONIC_KEY); + if (mnemonicInteger != null) { + button.setMnemonic((char) mnemonicInteger.intValue()); + } + + button.setIcon((Icon) this.getValue(Action.SMALL_ICON)); + button.addActionListener(this); + + button.registerKeyboardAction(this, this.getAccelerator(), JComponent.WHEN_IN_FOCUSED_WINDOW); + + this.putValue(UIButton.class.getName(), button); + button.setText(StringUtils.EMPTY); + button.setEnabled(this.isEnabled()); + + //peter:产生tooltip + button.setToolTipText(ActionFactory.createButtonToolTipText(this)); + object = button; + } + + return (JComponent) object; + } + @Override public void actionPerformed(ActionEvent e) { Nameable nameable = creator.createNameable(UIListControlPane.this); diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/authorityedit_disabled.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/authorityedit_disabled.png new file mode 100644 index 000000000..3e1035333 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/authorityedit_disabled.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/authorityedit_normal.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/authorityedit_normal.png new file mode 100644 index 000000000..d2e0a2b43 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/authorityedit_normal.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/authorityedit_selected.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/authorityedit_selected.png new file mode 100644 index 000000000..c4b71b853 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/authorityedit_selected.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellattr_disabled.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellattr_disabled.png new file mode 100644 index 000000000..7ea07bb9a Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellattr_disabled.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellattr_normal.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellattr_normal.png new file mode 100644 index 000000000..73ee5b87a Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellattr_normal.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellattr_selected.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellattr_selected.png new file mode 100644 index 000000000..87c812f79 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellattr_selected.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellelement_disabled.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellelement_disabled.png new file mode 100644 index 000000000..2e450c35b Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellelement_disabled.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellelement_normal.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellelement_normal.png new file mode 100644 index 000000000..22fb4eb68 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellelement_normal.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellelement_selected.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellelement_selected.png new file mode 100644 index 000000000..11e5aefbf Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/cellelement_selected.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/conditionattr_disabled.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/conditionattr_disabled.png new file mode 100644 index 000000000..70b2dbd9b Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/conditionattr_disabled.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/conditionattr_normal.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/conditionattr_normal.png new file mode 100644 index 000000000..14ff765e4 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/conditionattr_normal.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/conditionattr_selected.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/conditionattr_selected.png new file mode 100644 index 000000000..082dce2e8 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/conditionattr_selected.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/configuredroles_disabled.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/configuredroles_disabled.png new file mode 100644 index 000000000..136dc6568 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/configuredroles_disabled.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/configuredroles_normal.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/configuredroles_normal.png new file mode 100644 index 000000000..1cbf98153 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/configuredroles_normal.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/configuredroles_selected.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/configuredroles_selected.png new file mode 100644 index 000000000..f9cea74c9 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/configuredroles_selected.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/floatelement_disabled.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/floatelement_disabled.png new file mode 100644 index 000000000..552597755 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/floatelement_disabled.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/floatelement_normal.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/floatelement_normal.png new file mode 100644 index 000000000..a84c636d3 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/floatelement_normal.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/floatelement_selected.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/floatelement_selected.png new file mode 100644 index 000000000..477e9d448 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/floatelement_selected.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/hyperlink_disabled.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/hyperlink_disabled.png new file mode 100644 index 000000000..cde4d783a Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/hyperlink_disabled.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/hyperlink_normal.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/hyperlink_normal.png new file mode 100644 index 000000000..b81a666d5 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/hyperlink_normal.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/hyperlink_selected.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/hyperlink_selected.png new file mode 100644 index 000000000..80135b046 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/hyperlink_selected.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetlib_disabled.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetlib_disabled.png new file mode 100644 index 000000000..ac9163d6c Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetlib_disabled.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetlib_normal.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetlib_normal.png new file mode 100644 index 000000000..38979ca5f Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetlib_normal.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetlib_selected.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetlib_selected.png new file mode 100644 index 000000000..88315dc20 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetlib_selected.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetsettings_diabled.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetsettings_diabled.png new file mode 100644 index 000000000..3a2cdfed5 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetsettings_diabled.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetsettings_normal.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetsettings_normal.png new file mode 100644 index 000000000..f67375cde Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetsettings_normal.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetsettings_selected.png b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetsettings_selected.png new file mode 100644 index 000000000..c36f293f9 Binary files /dev/null and b/designer_base/src/com/fr/design/images/buttonicon/propertiestab/widgetsettings_selected.png differ diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 74bd5054d..9bee11543 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2092,6 +2092,7 @@ FR-Designer_CellWrite_Show_As_HTML=CellWrite_Show_As_HTML FR-Designer_Datasource_Other_Attributes=Other_Attributes FR-Designer_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing FR-Designer_CellElement_Property_Table=CellElement_Property_Table +FR-Designer_Add_Condition=Add Condition FR-Designer_Use_Params_Template= FR-Designer_Label_Name= FR-Designer_T_Insert_Float=Insert_Float @@ -2103,4 +2104,4 @@ FR-Designer_Insert_Formula=Insert_Formula FR-Designer_Insert_Chart= FR-Designer_Insert_Text= -FR-Designer_Double= \ No newline at end of file +FR-Designer_Double= diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 5f2e1af29..6a96057ed 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2093,6 +2093,7 @@ FR-Designer_CellWrite_Show_As_HTML=CellWrite_Show_As_HTML FR-Designer_Datasource_Other_Attributes=Other_Attributes FR-Designer_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing FR-Designer_CellElement_Property_Table=CellElement_Property_Table +FR-Designer_Add_Condition=Add Condition FR-Designer_Use_Params_Template=use parameter template FR-Designer_Label_Name=label name FR-Designer_T_Insert_Float=Insert_Float @@ -2104,4 +2105,4 @@ FR-Designer_Insert_Formula=Insert_Formula FR-Designer_Insert-Chart= FR-Designer_Insert-Text= -FR-Designer_Double= \ No newline at end of file +FR-Designer_Double= diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 2dc1b8983..991092322 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -2074,6 +2074,7 @@ FR-Designer_CellWrite_Show_As_HTML= FR-Designer_Datasource_Other_Attributes= FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_CellElement_Property_Table= +FR-Designer_Add_Condition= FR-Designer_T_Insert_Float= FR-Designer_Add_FloatElement= FR-Designer_Insert_Image= diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 1baf9c924..521e8e401 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2073,6 +2073,7 @@ FR-Designer_CellWrite_Show_As_HTML= FR-Designer_Datasource_Other_Attributes= FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_CellElement_Property_Table= +FR-Designer_Add_Condition= FR-Designer_T_Insert_Float= FR-Designer_Add_FloatElement= FR-Designer_Insert_Image= @@ -2105,4 +2106,4 @@ FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer_Use_Params_Template= FR-Designer_Label_Name= FR-Designer_Insert-Chart= -FR-Designer_Insert-Text= \ No newline at end of file +FR-Designer_Insert-Text= diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 7d0517cb7..10506bc89 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2092,6 +2092,7 @@ FR-Designer_CellWrite_Show_As_HTML=\u7528HTML\u663E\u793A\u5185\u5BB9 FR-Designer_Datasource_Other_Attributes=\u5176\u4ED6\u5C5E\u6027 FR-Designer_Not_use_a_cell_attribute_table_editing=\u60A8\u4E0D\u53EF\u4EE5\u7528\u5355\u5143\u683C\u5C5E\u6027\u8868\u7F16\u8F91 FR-Designer_CellElement_Property_Table=\u5355\u5143\u683C\u5C5E\u6027\u8868 +FR-Designer_Add_Condition=\u6DFB\u52A0\u6761\u4EF6 FR-Designer_Use_Params_Template=\u4F7F\u7528\u5E38\u7528\u53C2\u6570\u7EC4\u5408 FR-Designer_Label_Name=\u6807\u7B7E\u540D\u79F0 FR-Designer_T_Insert_Float=\u63D2\u5165\u60AC\u6D6E\u5143\u7D20 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 2af8920e0..bfd296c08 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2092,6 +2092,7 @@ FR-Designer_CellWrite_Show_As_HTML= FR-Designer_Datasource_Other_Attributes= FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_CellElement_Property_Table= +FR-Designer_Add_Condition= FR-Designer_T_Insert_Float= FR-Designer_Add_FloatElement= FR-Designer_Insert_Image= @@ -2105,4 +2106,4 @@ FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer_Use_Params_Template= FR-Designer_Label_Name= FR-Designer_Insert-Chart= -FR-Designer_Insert-Text= \ No newline at end of file +FR-Designer_Insert-Text= diff --git a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java index 72be5fb33..b0d87fc85 100644 --- a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java @@ -30,6 +30,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private FixedPopupPane currentPopupPane; private static final int CONTAINER_WIDTH = 290; private static final int TAB_WIDTH = 40; + private static final int TAB_BUTTON_WIDTH = 32; private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH; private static final int POPUP_TOOLPANE_HEIGHT = 25; private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30; @@ -86,39 +87,39 @@ public class EastRegionContainerPane extends UIEastResizableContainer { propertyItemMap = new LinkedHashMap<>(); // 有序map // 单元格元素 PropertyItem cellElement = new PropertyItem(KEY_CELL_ELEMENT, Inter.getLocText("FR-Designer_Cell_Element"), - "/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "cellelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 单元格属性 PropertyItem cellAttr = new PropertyItem(KEY_CELL_ATTR, Inter.getLocText("FR-Designer_Cell_Attributes"), - "/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "cellattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 悬浮元素 PropertyItem floatElement = new PropertyItem(KEY_FLOAT_ELEMENT, Inter.getLocText("FR-Designer_Float_Element"), - "/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "floatelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.POLY_REPORT}); // 控件设置 PropertyItem widgetSettings = new PropertyItem(KEY_WIDGET_SETTINGS, Inter.getLocText("FR-Designer-Widget_Settings"), - "/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY}, + "widgetsettings", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.FORM, PropertyMode.POLY_REPORT, PropertyMode.POLY_CHART}); // 条件属性 PropertyItem conditionAttr = new PropertyItem(KEY_CONDITION_ATTR, Inter.getLocText("FR-Designer_Condition_Attributes"), - "/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "conditionattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 超级链接 PropertyItem hyperlink = new PropertyItem(KEY_HYPERLINK, Inter.getLocText("FR-Designer_Hyperlink"), - "/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, + "hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 组件库 PropertyItem widgetLib = new PropertyItem(KEY_WIDGET_LIB, Inter.getLocText("FR-Designer_Widget_Library"), - "/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.FORM}, + "widgetlib", new PropertyMode[]{PropertyMode.FORM}, new PropertyMode[]{PropertyMode.FORM}); // 权限编辑 PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, Inter.getLocText("FR-Designer_Permissions_Edition"), - "/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}, + "authorityedit", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}, new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}); // 已配置角色 PropertyItem configuredRoles = new PropertyItem(KEY_CONFIGURED_ROLES, Inter.getLocText("FR-Designer_Configured_Roles"), - "/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}, + "configuredroles", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}, new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}); propertyItemMap.put(KEY_CELL_ELEMENT, cellElement); @@ -167,7 +168,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { // 左侧按钮面板 private void initLeftPane() { leftPane = new JPanel(); - leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0)); + leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 4, 4)); for (PropertyItem item : propertyItemMap.values()) { if (item.isPoppedOut() || !item.isVisible()) { continue; @@ -176,7 +177,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } // leftPane.setLayout(new BoxLayout(leftPane, BoxLayout.Y_AXIS)); - leftPane.setBackground(new Color(210, 210, 210)); + leftPane.setBackground(new Color(226, 226, 226)); replaceLeftPane(leftPane); } @@ -268,6 +269,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer { return propertyItemMap.get(KEY_WIDGET_SETTINGS).getContentPane(); } + public void replaceConditionAttrPane(JComponent pane) { + propertyItemMap.get(KEY_CONDITION_ATTR).replaceContentPane(pane); + } + + public JComponent getConditionAttrPane() { + return propertyItemMap.get(KEY_CONDITION_ATTR).getContentPane(); + } + public void replaceHyperlinkPane(JComponent pane) { propertyItemMap.get(KEY_HYPERLINK).replaceContentPane(pane); } @@ -388,6 +397,12 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } } + private void resetPropertyIcons() { + for (PropertyItem item : propertyItemMap.values()) { + item.resetButtonIcon(); + } + } + class PropertyItem { @@ -408,10 +423,21 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private Set enableModes; private static final int MAX_PARA_HEIGHT = 240; - public PropertyItem(String name, String title, String btnUrl, PropertyMode[] visibleModes, PropertyMode[] enableModes) { + // 完整icon路径为 ICON_BASE_DIR + btnIconName + iconSuffix + private static final String ICON_BASE_DIR = "/com/fr/design/images/buttonicon/propertiestab/"; + private static final String ICON_SUFFIX_NORMAL = "_normal.png"; + private static final String ICON_SUFFIX_DISABLED = "_disabled.png"; + private static final String ICON_SUFFIX_SELECTED = "_selected.png"; + private String btnIconName; + private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一 + private final Color selectedBtnBackground = new Color(240, 240, 240); + private Color originBtnBackground; + + public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) { this.name = name; this.title = title; - initButton(btnUrl); + this.btnIconName = btnIconName; + initButton(); initPropertyPanel(); // this.visibleModes = new ArrayList(visibleModes); initModes(visibleModes, enableModes); @@ -458,6 +484,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { contentPane = generateContentPane(); popupToolPane = new PopupToolPane(this, PopupToolPane.DOWN_BUTTON); headerPane = new JPanel(); + headerPane.setPreferredSize(new Dimension(headerPane.getPreferredSize().width, 0)); // 默认隐藏 contentArea = new JPanel(new BorderLayout()); contentArea.add(headerPane, BorderLayout.NORTH); contentArea.add(contentPane, BorderLayout.CENTER); @@ -533,14 +560,31 @@ public class EastRegionContainerPane extends UIEastResizableContainer { // propertyPanel.repaint(); // propertyPanel.revalidate(); // } + private String getBtnIconUrl() { + return ICON_BASE_DIR + btnIconName + iconSuffix; + } - private void initButton(String btnUrl) { - button = new UIButton(BaseUtils.readIcon(btnUrl)) { + public void resetButtonIcon() { + if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) { + iconSuffix = ICON_SUFFIX_NORMAL; + button.setIcon(BaseUtils.readIcon(getBtnIconUrl())); + button.setBackground(originBtnBackground); + button.setOpaque(false); + } + } + + private void initButton() { + button = new UIButton(BaseUtils.readIcon(getBtnIconUrl())) { public Dimension getPreferredSize() { - return new Dimension(TAB_WIDTH, TAB_WIDTH); + return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_WIDTH); + } + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); } }; button.set4LargeToolbarButton(); + originBtnBackground = button.getBackground(); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -549,6 +593,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } else { popupFixedPane(); } + resetPropertyIcons(); + iconSuffix = ICON_SUFFIX_SELECTED; + button.setIcon(BaseUtils.readIcon(getBtnIconUrl())); + button.setBackground(selectedBtnBackground); + button.setOpaque(true); } }); } diff --git a/designer_base/src/com/fr/design/mainframe/form/FormECDesignerProvider.java b/designer_base/src/com/fr/design/mainframe/form/FormECDesignerProvider.java index d3a5374dc..81ac3e7fb 100644 --- a/designer_base/src/com/fr/design/mainframe/form/FormECDesignerProvider.java +++ b/designer_base/src/com/fr/design/mainframe/form/FormECDesignerProvider.java @@ -62,6 +62,12 @@ public interface FormECDesignerProvider { */ public JComponent getEastUpPane(); + /** + * 条件属性面板 + * @return 属性面板 + */ + public JComponent getConditionAttrPane(); + /** * 超级链接面板 * @return 属性面板 diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 56e3c5d87..23299f30b 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -663,6 +663,7 @@ public class JForm extends JTemplate implements BaseJForm { EastRegionContainerPane.getInstance().removeParameterPane(); EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane()); EastRegionContainerPane.getInstance().replaceCellElementPane(elementCaseDesign.getEastUpPane()); + EastRegionContainerPane.getInstance().replaceConditionAttrPane(elementCaseDesign.getConditionAttrPane()); EastRegionContainerPane.getInstance().replaceHyperlinkPane(elementCaseDesign.getHyperlinkPane()); return; }