From d4a3c005b5c2ef2003c677caf83b5c03e5a8bfad Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 8 Jun 2018 15:32:59 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-8355=209.0=E4=B9=8B=E5=89=8D=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E7=9A=84=E5=8A=9F=E8=83=BD=E4=B8=8Ebug=20patch?= =?UTF-8?q?=E5=88=B010.0=EF=BC=88feature=E9=83=A8=E5=88=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/mobile/FormMobileAttrPane.java | 24 ++++--- .../form/mobile/FormMobileOthersPane.java | 65 +++++++++++++++++++ .../actions/FormMobileAttrAction.java | 1 + .../report/mobile/MobileOthersPane.java | 60 +++++++++++++++++ .../report/mobile/ReportMobileAttrPane.java | 5 ++ 5 files changed, 145 insertions(+), 10 deletions(-) create mode 100644 designer-form/src/com/fr/design/form/mobile/FormMobileOthersPane.java create mode 100644 designer-realize/src/com/fr/design/report/mobile/MobileOthersPane.java diff --git a/designer-form/src/com/fr/design/form/mobile/FormMobileAttrPane.java b/designer-form/src/com/fr/design/form/mobile/FormMobileAttrPane.java index a2650d8069..227962e382 100644 --- a/designer-form/src/com/fr/design/form/mobile/FormMobileAttrPane.java +++ b/designer-form/src/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -17,6 +17,8 @@ public class FormMobileAttrPane extends BasicBeanPane{ private MobileToolBarPane mobileToolBarPane; // 模版设置面板 private FormMobileTemplateSettingsPane formMobileTemplateSettingsPane; + // 其他 + private FormMobileOthersPane formMobileOthersPane; private static final int PADDING = 10; @@ -26,18 +28,18 @@ public class FormMobileAttrPane extends BasicBeanPane{ private void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - JPanel mobileToolBarPaneWrapper = new JPanel(new BorderLayout()); - mobileToolBarPaneWrapper.setBorder(BorderFactory.createEmptyBorder(PADDING, PADDING, 0, PADDING)); - this.mobileToolBarPane = new MobileToolBarPane(); - mobileToolBarPaneWrapper.add(this.mobileToolBarPane, BorderLayout.NORTH); + JPanel panel = new JPanel(); + panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); + panel.setBorder(BorderFactory.createEmptyBorder(PADDING, PADDING, PADDING, PADDING)); - JPanel formMobileTemplateSettingsPaneWrapper = new JPanel(new BorderLayout()); - formMobileTemplateSettingsPaneWrapper.setBorder(BorderFactory.createEmptyBorder(PADDING, PADDING, PADDING, PADDING)); - this.formMobileTemplateSettingsPane = new FormMobileTemplateSettingsPane(); - formMobileTemplateSettingsPaneWrapper.add(this.formMobileTemplateSettingsPane, BorderLayout.NORTH); + panel.add(formMobileTemplateSettingsPane = new FormMobileTemplateSettingsPane()); + panel.add(mobileToolBarPane = new MobileToolBarPane()); + panel.add(formMobileOthersPane = new FormMobileOthersPane()); - this.add(formMobileTemplateSettingsPaneWrapper, BorderLayout.NORTH); - this.add(mobileToolBarPaneWrapper, BorderLayout.CENTER); + JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panelWrapper.add(panel, BorderLayout.NORTH); + UIScrollPane scrollPane = new UIScrollPane(panelWrapper); + this.add(scrollPane); } @Override @@ -47,6 +49,7 @@ public class FormMobileAttrPane extends BasicBeanPane{ } this.mobileToolBarPane.populateBean(ob); this.formMobileTemplateSettingsPane.populateBean(ob); + this.formMobileOthersPane.populateBean(ob); } @Override @@ -54,6 +57,7 @@ public class FormMobileAttrPane extends BasicBeanPane{ FormMobileAttr formMobileAttr = new FormMobileAttr(); this.mobileToolBarPane.updateBean(formMobileAttr); this.formMobileTemplateSettingsPane.updateBean(formMobileAttr); + this.formMobileOthersPane.updateBean(formMobileAttr); return formMobileAttr; } diff --git a/designer-form/src/com/fr/design/form/mobile/FormMobileOthersPane.java b/designer-form/src/com/fr/design/form/mobile/FormMobileOthersPane.java new file mode 100644 index 0000000000..960ffa4a64 --- /dev/null +++ b/designer-form/src/com/fr/design/form/mobile/FormMobileOthersPane.java @@ -0,0 +1,65 @@ +package com.fr.design.form.mobile; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.dialog.mobile.MobileRadioCheckPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.form.main.mobile.FormMobileAttr; +import com.fr.general.Inter; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; + +/** + * Created by plough on 2018/5/31. + */ +public class FormMobileOthersPane extends BasicBeanPane { + + private MobileRadioCheckPane appearRefreshCheckPane; // 页面再现时刷新 + private MobileRadioCheckPane promptWhenLeaveWithoutSubmitCheckPane; // 数据未提交离开提示 + + public FormMobileOthersPane() { + this.initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); + JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + contentPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L1, 0, 0)); + appearRefreshCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Appear_Refresh")); + contentPane.add(appearRefreshCheckPane, BorderLayout.WEST); + promptWhenLeaveWithoutSubmitCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Prompt_When_Leave_Without_Submit")); + contentPane.add(promptWhenLeaveWithoutSubmitCheckPane, BorderLayout.CENTER); + borderPane.add(contentPane); + this.add(borderPane); + } + + @Override + public void populateBean(FormMobileAttr ob) { + if (ob == null) { + ob = new FormMobileAttr(); + } + this.appearRefreshCheckPane.populateBean(ob.isAppearRefresh()); + this.promptWhenLeaveWithoutSubmitCheckPane.populateBean(ob.isPromptWhenLeaveWithoutSubmit()); + } + + @Override + public FormMobileAttr updateBean() { + return null; + } + + @Override + public void updateBean(FormMobileAttr mobileAttr) { + if(mobileAttr != null) { + mobileAttr.setAppearRefresh(this.appearRefreshCheckPane.updateBean()); + mobileAttr.setPromptWhenLeaveWithoutSubmit(this.promptWhenLeaveWithoutSubmitCheckPane.updateBean()); + } + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("FR-Designer_Other"); + } +} diff --git a/designer-form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java b/designer-form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java index 4d7394620d..0287438fc8 100644 --- a/designer-form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java +++ b/designer-form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java @@ -76,6 +76,7 @@ public class FormMobileAttrAction extends JTemplateAction { formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); WidgetPropertyPane.getInstance().refreshDockingView(); + jf.fireTargetModified(); } }); dialog.setVisible(true); diff --git a/designer-realize/src/com/fr/design/report/mobile/MobileOthersPane.java b/designer-realize/src/com/fr/design/report/mobile/MobileOthersPane.java new file mode 100644 index 0000000000..a92c1ffb10 --- /dev/null +++ b/designer-realize/src/com/fr/design/report/mobile/MobileOthersPane.java @@ -0,0 +1,60 @@ +package com.fr.design.report.mobile; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.dialog.mobile.MobileRadioCheckPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; +import com.fr.report.mobile.ElementCaseMobileAttr; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; + +/** + * Created by plough on 2018/5/31. + */ +public class MobileOthersPane extends BasicBeanPane { + + private MobileRadioCheckPane appearRefreshCheckPane; // 页面再现时刷新 + + public MobileOthersPane() { + this.initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); + JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + contentPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L1, 0, 0)); + appearRefreshCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Appear_Refresh")); + contentPane.add(appearRefreshCheckPane, BorderLayout.WEST); + borderPane.add(contentPane); + this.add(borderPane); + } + + @Override + public void populateBean(ElementCaseMobileAttr ob) { + if (ob == null) { + ob = new ElementCaseMobileAttr(); + } + this.appearRefreshCheckPane.populateBean(ob.isAppearRefresh()); + } + + @Override + public ElementCaseMobileAttr updateBean() { + return null; + } + + @Override + public void updateBean(ElementCaseMobileAttr mobileAttr) { + if(mobileAttr != null) { + mobileAttr.setAppearRefresh(this.appearRefreshCheckPane.updateBean()); + } + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("FR-Designer_Other"); + } +} diff --git a/designer-realize/src/com/fr/design/report/mobile/ReportMobileAttrPane.java b/designer-realize/src/com/fr/design/report/mobile/ReportMobileAttrPane.java index eaebb6e51d..f18cba343b 100644 --- a/designer-realize/src/com/fr/design/report/mobile/ReportMobileAttrPane.java +++ b/designer-realize/src/com/fr/design/report/mobile/ReportMobileAttrPane.java @@ -17,6 +17,8 @@ public class ReportMobileAttrPane extends BasicBeanPane{ private AppFitBrowserPane appFitBrowserPane; //工具栏容器 private MobileToolBarPane mobileToolBarPane; + // 其他 + private MobileOthersPane mobileOthersPane; public ReportMobileAttrPane() { initComponents(); @@ -37,6 +39,7 @@ public class ReportMobileAttrPane extends BasicBeanPane{ jPanel.add(appFitBrowserPane); jPanel.add(mobileToolBarPane = new MobileToolBarPane()); + jPanel.add(mobileOthersPane = new MobileOthersPane()); jPanel.add(appFitPreviewPane); UIScrollPane scrollPane = new UIScrollPane(jPanel); @@ -50,6 +53,7 @@ public class ReportMobileAttrPane extends BasicBeanPane{ } appFitBrowserPane.populateBean(ob); mobileToolBarPane.populateBean(ob); + mobileOthersPane.populateBean(ob); reportMobileTemplateSettingsPane.populateBean(ob); } @@ -57,6 +61,7 @@ public class ReportMobileAttrPane extends BasicBeanPane{ public ElementCaseMobileAttr updateBean() { ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean(); mobileToolBarPane.updateBean(caseMobileAttr); + mobileOthersPane.updateBean(caseMobileAttr); reportMobileTemplateSettingsPane.updateBean(caseMobileAttr); return caseMobileAttr;