diff --git a/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java b/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java index 2a151c4718..bea0745cb5 100644 --- a/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java +++ b/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java @@ -1,20 +1,53 @@ package com.fr.design.report.mobile; -import com.fr.design.dialog.mobile.MobileToolBarBeanPane; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.mobile.MobileRadioCheckPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; import com.fr.report.mobile.ElementCaseMobileAttr; +import javax.swing.*; +import java.awt.*; + /** * Created by 方磊 on 2016/11/8. */ -public class MobileToolBarPane extends MobileToolBarBeanPane { +public class MobileToolBarPane extends BasicBeanPane { + //缩放选项面板 + private MobileRadioCheckPane zoomCheckPane; + + //刷新选项面板 + private MobileRadioCheckPane refreshCheckPane; + + public MobileToolBarPane() { + this.initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); + JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + UILabel uiLabel = new UILabel("html5"); + uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15)); + zoomCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom")); + refreshCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Refresh")); + + toobarsPane.add(uiLabel, BorderLayout.WEST); + toobarsPane.add(zoomCheckPane, BorderLayout.CENTER); + toobarsPane.add(refreshCheckPane, BorderLayout.EAST); + borderPane.add(toobarsPane); + this.add(borderPane); + } @Override public void populateBean(ElementCaseMobileAttr ob) { if (ob == null) { ob = new ElementCaseMobileAttr(); } - super.getZoomCheckPane().populateBean(ob.isZoom()); - super.getRefreshCheckPane().populateBean(ob.isRefresh()); + this.zoomCheckPane.populateBean(ob.isZoom()); + this.refreshCheckPane.populateBean(ob.isRefresh()); } @Override @@ -25,8 +58,13 @@ public class MobileToolBarPane extends MobileToolBarBeanPane extends BasicBeanPane { - //缩放选项面板 - private MobileRadioCheckPane zoomCheckPane; - - //刷新选项面板 - private MobileRadioCheckPane refreshCheckPane; - - public MobileRadioCheckPane getZoomCheckPane() { - return zoomCheckPane; - } - - public MobileRadioCheckPane getRefreshCheckPane() { - return refreshCheckPane; - } - - public MobileToolBarBeanPane() { - initComponents(); - } - - private void initComponents() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); - JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - - UILabel uiLabel = new UILabel("html5"); - uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15)); - zoomCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom")); - refreshCheckPane = new MobileRadioCheckPane("刷新"); - - toobarsPane.add(uiLabel, BorderLayout.WEST); - toobarsPane.add(zoomCheckPane, BorderLayout.CENTER); - toobarsPane.add(refreshCheckPane, BorderLayout.EAST); - borderPane.add(toobarsPane); - this.add(borderPane); - } - - @Override - protected String title4PopupWindow() { - return "工具栏"; - } - -} diff --git a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java new file mode 100644 index 0000000000..385608b184 --- /dev/null +++ b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -0,0 +1,53 @@ +package com.fr.design.form.mobile; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; +import com.fr.report.mobile.ElementCaseMobileAttr; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by fanglei on 2016/11/17. + */ +public class FormMobileAttrPane extends BasicBeanPane{ + //工具栏容器 + private MobileToolBarPane mobileToolBarPane; + + public FormMobileAttrPane() { + this.initComponents(); + } + + private void initComponents() { + JPanel jPanel = new JPanel(); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.mobileToolBarPane = new MobileToolBarPane(); + //设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中 + jPanel.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + 10)); + jPanel.add("North", mobileToolBarPane); + this.add(jPanel); + } + + @Override + public void populateBean(ElementCaseMobileAttr ob) { + if (ob == null) { + ob = new ElementCaseMobileAttr(); + } + this.mobileToolBarPane.populateBean(ob); + } + + @Override + public ElementCaseMobileAttr updateBean() { + ElementCaseMobileAttr caseMobileAttr = new ElementCaseMobileAttr(); + this.mobileToolBarPane.updateBean(caseMobileAttr); + return caseMobileAttr; + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("FR-Designer_Mobile-Attr"); + } +} diff --git a/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java index 2dd0dee51d..7430f3a9ee 100644 --- a/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java +++ b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java @@ -1,20 +1,47 @@ package com.fr.design.form.mobile; -import com.fr.design.dialog.mobile.MobileToolBarBeanPane; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.mobile.MobileRadioCheckPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; import com.fr.report.mobile.ElementCaseMobileAttr; +import javax.swing.*; +import java.awt.*; + /** * Created by 方磊 on 2016/11/8. */ -public class MobileToolBarPane extends MobileToolBarBeanPane { +public class MobileToolBarPane extends BasicBeanPane { + //刷新选项面板 + private MobileRadioCheckPane refreshCheckPane; + + public MobileToolBarPane() { + this.initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); + JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + UILabel uiLabel = new UILabel("html5"); + uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15)); + this.refreshCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Refresh")); + + toobarsPane.add(uiLabel, BorderLayout.WEST); + toobarsPane.add(refreshCheckPane, BorderLayout.EAST); + borderPane.add(toobarsPane); + this.add(borderPane); + } @Override public void populateBean(ElementCaseMobileAttr ob) { if (ob == null) { ob = new ElementCaseMobileAttr(); } - super.getZoomCheckPane().populateBean(ob.isZoom()); - super.getRefreshCheckPane().populateBean(ob.isRefresh()); + this.refreshCheckPane.populateBean(ob.isRefresh()); } @Override @@ -25,8 +52,13 @@ public class MobileToolBarPane extends MobileToolBarBeanPane { return; } final Form formTpl = jf.getTarget(); + ElementCaseMobileAttr mobileAttr = formTpl.getReportMobileAttr(); + + final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); + mobileAttrPane.populateBean(mobileAttr); + BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + formTpl.setReportMobileAttr(mobileAttrPane.updateBean()); + jf.fireTargetModified(); + } + }); + dialog.setVisible(true); } private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { @@ -45,7 +62,7 @@ public class FormMobileAttrAction extends JTemplateAction { @Override public String getMenuName() { - return "移动端属性"; + return Inter.getLocText("FR-Designer_Mobile-Attr"); } @Override