From bcbc311cbdd313a34e57367fd4b4e97d039b4393 Mon Sep 17 00:00:00 2001 From: frharry Date: Fri, 10 Mar 2017 16:55:30 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-1344=20=E8=A1=A8=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E7=BF=BB=E9=A1=B5=E6=94=B9=E8=BF=9B=E5=B9=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B1=80=E9=83=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/FormEditToolBar.java | 14 +++---- .../design/mainframe/FormSettingToolBar.java | 6 +-- .../com/fr/design/mainframe/FormToolBar.java | 6 +-- .../design/mainframe/FormToolBarButton.java | 37 ++++++++----------- .../mainframe/FormWebWidgetConstants.java | 18 ++++----- .../editors/ElementCaseToolBarPane.java | 6 +-- 6 files changed, 40 insertions(+), 47 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormEditToolBar.java b/designer_form/src/com/fr/design/mainframe/FormEditToolBar.java index d0e217f277..c2c487ef54 100644 --- a/designer_form/src/com/fr/design/mainframe/FormEditToolBar.java +++ b/designer_form/src/com/fr/design/mainframe/FormEditToolBar.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; @@ -22,6 +21,7 @@ import com.fr.form.ui.*; import com.fr.form.ui.Button; import com.fr.form.web.button.Export; import com.fr.general.Background; +import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.StringUtils; @@ -125,12 +125,12 @@ public class FormEditToolBar extends BasicPane { this.add(splitPane); list.addListSelectionListener(listSelectionListener); JPanel backgroundPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - UIButton bgButton = new UIButton(Inter.getLocText(new String[]{"Background", "Set"})); - defaultCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Default", "Background"})); + UIButton bgButton = new UIButton(Inter.getLocText("FR-Designer-Output_Background_Set")); + defaultCheckBox = new UICheckBox(Inter.getLocText("FR-Designer-Output_Default_Background")); bgButton.addActionListener(actioner); backgroundPane.add(defaultCheckBox); backgroundPane.add(bgButton); - backgroundPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText(new String[]{"Background", "Set"}))); + backgroundPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer-Output_Background_Set"))); this.add(backgroundPane, BorderLayout.SOUTH); } @@ -210,7 +210,7 @@ public class FormEditToolBar extends BasicPane { public MoveUpItemAction() { this.setName(Inter.getLocText("Utils-Move_Up")); this.setMnemonic('U'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/up.png")); } /** @@ -241,7 +241,7 @@ public class FormEditToolBar extends BasicPane { public MoveDownItemAction() { this.setName(Inter.getLocText("Utils-Move_Down")); this.setMnemonic('D'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/down.png")); } /** @@ -275,7 +275,7 @@ public class FormEditToolBar extends BasicPane { public class RemoveAction extends UpdateAction { public RemoveAction() { this.setName(Inter.getLocText("FR-Designer_Delete")); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); } /** diff --git a/designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java b/designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java index 2ed8a69842..c84776789d 100644 --- a/designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java +++ b/designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java @@ -1,11 +1,11 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.IOUtils; import com.fr.general.Inter; import javax.swing.*; @@ -17,8 +17,8 @@ import java.awt.event.ActionListener; * Created by harry on 2017-3-2. */ public class FormSettingToolBar extends JPanel { - private Icon setIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png"); - private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png"); + private Icon setIcon = IOUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png"); + private Icon delIcon = IOUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png"); private UIButton setButton; private UIButton delButton; private FormToolBarPane toolBarPane; diff --git a/designer_form/src/com/fr/design/mainframe/FormToolBar.java b/designer_form/src/com/fr/design/mainframe/FormToolBar.java index 5a172e5d41..860144dc85 100644 --- a/designer_form/src/com/fr/design/mainframe/FormToolBar.java +++ b/designer_form/src/com/fr/design/mainframe/FormToolBar.java @@ -56,11 +56,11 @@ public class FormToolBar { } public ToolBar getToolBar() { - Widget[] n = new Widget[this.getButtonlist().size()]; + Widget[] widgets = new Widget[this.getButtonlist().size()]; for (int j = 0; j < this.getButtonlist().size(); j++) { - n[j] = this.getButtonlist().get(j).getWidget(); + widgets[j] = this.getButtonlist().get(j).getWidget(); } - ToolBar toolBar = new ToolBar(n); + ToolBar toolBar = new ToolBar(widgets); toolBar.setBackground(this.background); toolBar.setDefault(this.isDefault); return toolBar; diff --git a/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java b/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java index a26b8d18f4..0e08197d37 100644 --- a/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java +++ b/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java @@ -21,7 +21,7 @@ import java.awt.event.MouseListener; */ public class FormToolBarButton extends JButton implements MouseListener { private Widget widget; - private WidgetOption no; + private WidgetOption widgetOption; public FormToolBarButton(Icon icon, Widget widget) { this(null, icon, widget); @@ -29,7 +29,8 @@ public class FormToolBarButton extends JButton implements MouseListener { public FormToolBarButton(String text, Icon icon, Widget widget) { super(text, icon); - init(); + setBackground(null); + setRolloverEnabled(true); this.widget = widget; if (widget instanceof com.fr.form.ui.Button) { com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget; @@ -45,12 +46,6 @@ public class FormToolBarButton extends JButton implements MouseListener { setMargin(new Insets(0, 0, 0, 0)); } - private void init() { - setBackground(null); - setRolloverEnabled(true); - } - - /** * 改变按钮的权限细粒度状态 * @@ -81,11 +76,11 @@ public class FormToolBarButton extends JButton implements MouseListener { } public WidgetOption getNameOption() { - return this.no; + return this.widgetOption; } - public void setNameOption(WidgetOption no) { - this.no = no; + public void setNameOption(WidgetOption widgetOption) { + this.widgetOption = widgetOption; } @@ -109,18 +104,16 @@ public class FormToolBarButton extends JButton implements MouseListener { return; } if (e.getClickCount() >= 2) { - if (this.getParent() instanceof FormToolBarPane) { - final FormToolBarPane tb = (FormToolBarPane) this.getParent(); - final FormEditToolBar etb = new FormEditToolBar(); - etb.populate(tb.getFToolBar(), this); - BasicDialog dialog = etb.showWindow(DesignerContext.getDesignerFrame()); - dialog.addDialogActionListener(new DialogActionAdapter() { - public void doOk() { - tb.setFToolBar(etb.update()); + final FormToolBarPane toolBarPane = (FormToolBarPane) this.getParent(); + final FormEditToolBar editToolBar = new FormEditToolBar(); + editToolBar.populate(toolBarPane.getFToolBar(), this); + BasicDialog dialog = editToolBar.showWindow(DesignerContext.getDesignerFrame()); + dialog.addDialogActionListener(new DialogActionAdapter() { + public void doOk() { + toolBarPane.setFToolBar(editToolBar.update()); } - }); - dialog.setVisible(true); - } + }); + dialog.setVisible(true); } } diff --git a/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java b/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java index a84b7523dc..4bf970234f 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java +++ b/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOptionFactory; import com.fr.form.ui.CustomToolBarButton; @@ -8,6 +7,7 @@ import com.fr.form.web.button.ExcelO; import com.fr.form.web.button.ExcelP; import com.fr.form.web.button.Export; import com.fr.form.web.button.page.*; +import com.fr.general.IOUtils; import com.fr.general.Inter; /** @@ -24,29 +24,29 @@ public class FormWebWidgetConstants { // 当前页/总页数 public static final WidgetOption PAGENAVI = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"HJS-Current_Page", "HF-Number_of_Page"}, new String[]{"/", ""}), - BaseUtils.readIcon("/com/fr/web/images/pageNumber.png"), PageNavi.class); + IOUtils.readIcon("/com/fr/web/images/pageNumber.png"), PageNavi.class); // 首页 - public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-First"), BaseUtils.readIcon("/com/fr/web/images/first.png"), + public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-First"), IOUtils.readIcon("/com/fr/web/images/first.png"), First.class); // 末页 - public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Last"), BaseUtils.readIcon("/com/fr/web/images/last.png"), + public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Last"), IOUtils.readIcon("/com/fr/web/images/last.png"), Last.class); // 前一页 public static final WidgetOption PREVIOUS = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Previous"), - BaseUtils.readIcon("/com/fr/web/images/previous.png"), Previous.class); + IOUtils.readIcon("/com/fr/web/images/previous.png"), Previous.class); // 后一页 - public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Next"), BaseUtils.readIcon("/com/fr/web/images/next.png"), + public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Next"), IOUtils.readIcon("/com/fr/web/images/next.png"), Next.class); // 导出成Excel 分页导出 public static final WidgetOption EXCELP = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Page"}, new String[]{"(", ")"}), - BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelP.class); + IOUtils.readIcon("/com/fr/web/images/excel.png"), ExcelP.class); // 导出成Excel 原样导出 public static final WidgetOption EXCELO = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Simple"}, new String[]{"(", ")"}), - BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelO.class); + IOUtils.readIcon("/com/fr/web/images/excel.png"), ExcelO.class); // 导出 public static final WidgetOption EXPORT = WidgetOptionFactory - .createByWidgetClass(Inter.getLocText("FR-Engine_Export"), BaseUtils.readIcon("/com/fr/web/images/export.png"), Export.class); + .createByWidgetClass(Inter.getLocText("FR-Engine_Export"), IOUtils.readIcon("/com/fr/web/images/export.png"), Export.class); public static final WidgetOption CUSTOM_BUTTON = WidgetOptionFactory .createByWidgetClass(Inter.getLocText(new String[]{"Custom", "Form-Button"}), CustomToolBarButton.class); diff --git a/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java b/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java index 9e6a904451..624dc956ab 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.widget.editors; -import com.fr.base.BaseUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.ibutton.UIButton; @@ -14,6 +13,7 @@ import com.fr.design.mainframe.FormToolBarPane; import com.fr.form.ui.Widget; import com.fr.form.web.FormToolBarManager; import com.fr.form.web.Location; +import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; @@ -79,7 +79,7 @@ public class ElementCaseToolBarPane extends BasicBeanPane northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26)); northToolBar.setBackground(Color.lightGray); - UIButton topButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_up.png")); + UIButton topButton = new UIButton(IOUtils.readIcon("com/fr/design/images/arrow/arrow_up.png")); topButton.setBorder(null); topButton.setOpaque(false); topButton.setContentAreaFilled(false); @@ -103,7 +103,7 @@ public class ElementCaseToolBarPane extends BasicBeanPane } }); - UIButton downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_down.png")); + UIButton downButton = new UIButton(IOUtils.readIcon("com/fr/design/images/arrow/arrow_down.png")); downButton.setBorder(null); downButton.setMargin(null); downButton.setOpaque(false);