From dc825bd01ec3c3ae51ae6ef9b7a2d764c6cbf4bb Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Wed, 16 Nov 2016 12:04:48 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=B1=9E=E6=80=A7=E8=8F=9C=E5=8D=95=E9=87=8C=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/ReportMobileAttrAction.java | 4 +- .../mainframe/ElementCasePaneDelegate.java | 1 - .../report/mobile/AppFitBrowserPane.java | 16 ++---- .../report/mobile/MobileToolBarPane.java | 32 +++++++++++ .../report/mobile/ReportMobileAttrPane.java | 25 ++++++--- .../dialog}/mobile/MobileRadioCheckPane.java | 13 +++-- .../dialog/mobile/MobileToolBarBeanPane.java | 56 +++++++++++++++++++ .../design/form/mobile/MobileToolBarPane.java | 32 +++++++++++ .../src/com/fr/design/mainframe/JForm.java | 8 ++- .../actions/FormMobileAttrAction.java | 56 +++++++++++++++++++ 10 files changed, 214 insertions(+), 29 deletions(-) create mode 100644 designer/src/com/fr/design/report/mobile/MobileToolBarPane.java rename {designer/src/com/fr/design/report => designer_base/src/com/fr/design/dialog}/mobile/MobileRadioCheckPane.java (83%) create mode 100644 designer_base/src/com/fr/design/dialog/mobile/MobileToolBarBeanPane.java create mode 100644 designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java create mode 100644 designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java diff --git a/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java index 2bf3856908..f5fd94a321 100644 --- a/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java @@ -57,9 +57,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{ private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { @Override - public char getMnemonic() { - return 'P'; - } + public char getMnemonic() { return 'P'; } @Override public String getMenuName() { diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 79c60d2dc2..67e6975343 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -3,7 +3,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.design.fun.MenuHandler; import com.fr.design.menu.KeySetUtils; -import com.fr.design.parameter.ParameterPropertyPane; import com.fr.general.Inter; import com.fr.page.ReportSettingsProvider; import com.fr.design.file.HistoryTemplateListPane; diff --git a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java index 43471b751d..2b1f44f389 100644 --- a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java +++ b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java @@ -19,8 +19,6 @@ public class AppFitBrowserPane extends BasicBeanPane { private MobileRadioGroupPane horizionPane; //竖屏设置面板 private MobileRadioGroupPane verticalPane; - //缩放选项面板 - private MobileRadioCheckPane radioCheckPane; //效果预览面板 private AppFitPreviewPane appFitPreviewPane; @@ -36,16 +34,13 @@ public class AppFitBrowserPane extends BasicBeanPane { JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); horizionPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Horizontal")); verticalPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Vertical")); - radioCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom")); ActionListener actionListener = getAppPreviewActionListener(); horizionPane.addActionListener(actionListener); verticalPane.addActionListener(actionListener); fitOpsPane.add(horizionPane, BorderLayout.NORTH); - fitOpsPane.add(verticalPane, BorderLayout.CENTER); - fitOpsPane.add(radioCheckPane, BorderLayout.SOUTH); + fitOpsPane.add(verticalPane, BorderLayout.SOUTH); borderPane.add(fitOpsPane); this.add(borderPane); - } public void setAppFitPreviewPane(AppFitPreviewPane appFitPreviewPane) { @@ -54,7 +49,7 @@ public class AppFitBrowserPane extends BasicBeanPane { //纵向和横向独立设置 public int[] getCurrentFitOptions() { - return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex(), radioCheckPane.getCurrentState()}; + return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex()}; } @Override @@ -64,7 +59,7 @@ public class AppFitBrowserPane extends BasicBeanPane { } horizionPane.populateBean(ob.getHorziontalAttr()); verticalPane.populateBean(ob.getVerticalAttr()); - radioCheckPane.populateBean(ob.isZoom()); +// radioCheckPane.populateBean(ob.isZoom()); appFitPreviewPane.refreshPreview(getCurrentFitOptions()); } @@ -73,8 +68,9 @@ public class AppFitBrowserPane extends BasicBeanPane { public ElementCaseMobileAttr updateBean() { MobileFitAttrState horizonState = horizionPane.updateBean(); MobileFitAttrState verticalState = verticalPane.updateBean(); - boolean isZoom = radioCheckPane.updateBean(); - return new ElementCaseMobileAttr(horizonState, verticalState, isZoom); +// boolean isZoom = radioCheckPane.updateBean(); +// return new ElementCaseMobileAttr(horizonState, verticalState, isZoom); + return new ElementCaseMobileAttr(horizonState, verticalState); } @Override diff --git a/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java b/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java new file mode 100644 index 0000000000..2a151c4718 --- /dev/null +++ b/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java @@ -0,0 +1,32 @@ +package com.fr.design.report.mobile; + +import com.fr.design.dialog.mobile.MobileToolBarBeanPane; +import com.fr.report.mobile.ElementCaseMobileAttr; + +/** + * Created by 方磊 on 2016/11/8. + */ +public class MobileToolBarPane extends MobileToolBarBeanPane { + + @Override + public void populateBean(ElementCaseMobileAttr ob) { + if (ob == null) { + ob = new ElementCaseMobileAttr(); + } + super.getZoomCheckPane().populateBean(ob.isZoom()); + super.getRefreshCheckPane().populateBean(ob.isRefresh()); + } + + @Override + public ElementCaseMobileAttr updateBean() { + return null; + } + + @Override + public void updateBean(ElementCaseMobileAttr mobileAttr) { + if(mobileAttr != null) { + mobileAttr.setZoom(super.getZoomCheckPane().updateBean()); + mobileAttr.setRefresh(super.getRefreshCheckPane().updateBean()); + } + } +} diff --git a/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java b/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java index 3c00232194..5b97137102 100644 --- a/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java +++ b/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java @@ -1,6 +1,7 @@ package com.fr.design.report.mobile; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.general.Inter; import com.fr.report.mobile.ElementCaseMobileAttr; @@ -16,22 +17,30 @@ public class ReportMobileAttrPane extends BasicBeanPane{ private MobileUseHtmlGroupPane htmlGroupPane; + //工具栏容器 + private MobileToolBarPane mobileToolBarPane; + public ReportMobileAttrPane() { initComponents(); } private void initComponents() { - this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); - this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); AppFitPreviewPane appFitPreviewPane = new AppFitPreviewPane(); - + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + JPanel jPanel = new JPanel(); + jPanel.setLayout(new BoxLayout(jPanel, BoxLayout.Y_AXIS)); + jPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); appFitBrowserPane = new AppFitBrowserPane(); appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); - this.add(appFitBrowserPane); + jPanel.add(appFitBrowserPane); - this.add(htmlGroupPane = new MobileUseHtmlGroupPane()); + jPanel.add(htmlGroupPane = new MobileUseHtmlGroupPane()); - this.add(appFitPreviewPane); + jPanel.add(mobileToolBarPane = new MobileToolBarPane()); + + jPanel.add(appFitPreviewPane); + UIScrollPane scrollPane = new UIScrollPane(jPanel); + this.add(scrollPane); } @Override @@ -40,7 +49,7 @@ public class ReportMobileAttrPane extends BasicBeanPane{ ob = new ElementCaseMobileAttr(); } appFitBrowserPane.populateBean(ob); - + mobileToolBarPane.populateBean(ob); htmlGroupPane.populateBean(ob); } @@ -48,7 +57,7 @@ public class ReportMobileAttrPane extends BasicBeanPane{ @Override public ElementCaseMobileAttr updateBean() { ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean(); - + mobileToolBarPane.updateBean(caseMobileAttr); htmlGroupPane.updateBean(caseMobileAttr); return caseMobileAttr; diff --git a/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java b/designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java similarity index 83% rename from designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java rename to designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java index 9264619d32..ee38557612 100644 --- a/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java +++ b/designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java @@ -1,4 +1,4 @@ -package com.fr.design.report.mobile; +package com.fr.design.dialog.mobile; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icheckbox.UICheckBox; @@ -13,6 +13,9 @@ import java.awt.*; import java.util.ArrayList; import java.util.List; +/** + * 这个类要被复用,移动到design_base中去 + */ public class MobileRadioCheckPane extends BasicBeanPane { private List checkBoxes = new ArrayList(); @@ -26,16 +29,16 @@ public class MobileRadioCheckPane extends BasicBeanPane { double[] rowSize = {p}; double[] columnSize = {p,p}; - UICheckBox checkBox = new UICheckBox(Inter.getLocText("FR-Designer_Mobile-Open")); - checkBox.setSelected(true); + UICheckBox checkBox = new UICheckBox(title); + checkBox.setSelected(false); checkBoxes.add(checkBox); Component[][] components = new Component[][]{ - new Component[]{new UILabel(title), checkBox} + new Component[]{checkBox} }; JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - fitOpsPane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); + fitOpsPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0)); this.add(fitOpsPane); } diff --git a/designer_base/src/com/fr/design/dialog/mobile/MobileToolBarBeanPane.java b/designer_base/src/com/fr/design/dialog/mobile/MobileToolBarBeanPane.java new file mode 100644 index 0000000000..6ccf73e2c5 --- /dev/null +++ b/designer_base/src/com/fr/design/dialog/mobile/MobileToolBarBeanPane.java @@ -0,0 +1,56 @@ +package com.fr.design.dialog.mobile; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by fanglei on 2016/11/14. + * 这个toolbar类需要被design和design_form两个模块复用,所以为了结构精简,抽出共同方法作为抽象类供它们使用 + */ +public abstract class 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/MobileToolBarPane.java b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java new file mode 100644 index 0000000000..2dd0dee51d --- /dev/null +++ b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java @@ -0,0 +1,32 @@ +package com.fr.design.form.mobile; + +import com.fr.design.dialog.mobile.MobileToolBarBeanPane; +import com.fr.report.mobile.ElementCaseMobileAttr; + +/** + * Created by 方磊 on 2016/11/8. + */ +public class MobileToolBarPane extends MobileToolBarBeanPane { + + @Override + public void populateBean(ElementCaseMobileAttr ob) { + if (ob == null) { + ob = new ElementCaseMobileAttr(); + } + super.getZoomCheckPane().populateBean(ob.isZoom()); + super.getRefreshCheckPane().populateBean(ob.isRefresh()); + } + + @Override + public ElementCaseMobileAttr updateBean() { + return null; + } + + @Override + public void updateBean(ElementCaseMobileAttr mobileAttr) { + if(mobileAttr != null) { + mobileAttr.setZoom(super.getZoomCheckPane().updateBean()); + mobileAttr.setRefresh(super.getRefreshCheckPane().updateBean()); + } + } +} diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index c88ebe012b..2c20fbac18 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.DesignState; import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.file.WebPreviewUtils; +import com.fr.design.mainframe.actions.FormMobileAttrAction; import com.fr.design.cell.FloatElementsProvider; import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.actions.FormDeleteAction; @@ -71,6 +72,7 @@ public class JForm extends JTemplate implements BaseJForm { private JComponent editingComponent; private FormECCompositeProvider reportComposite; + //FORM_TAB代表是否点击编辑,用于点击编辑前后菜单的显示 protected int index = FORM_TAB; public JForm() { @@ -383,11 +385,13 @@ public class JForm extends JTemplate implements BaseJForm { public ShortCut[] shortcut4TemplateMenu() { if (this.index == FORM_TAB) { return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{ - new TemplateParameterAction(this) + new TemplateParameterAction(this), + new FormMobileAttrAction(this) }, new ShortCut[0]); } else { return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{ - new TemplateParameterAction(this) + new TemplateParameterAction(this), + new FormMobileAttrAction(this) }, this.elementCaseDesign.shortcut4TemplateMenu()); } } diff --git a/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java new file mode 100644 index 0000000000..241d4757ea --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java @@ -0,0 +1,56 @@ +package com.fr.design.mainframe.actions; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.JTemplateAction; +import com.fr.design.mainframe.JForm; +import com.fr.design.menu.MenuKeySet; +import com.fr.form.main.Form; +import com.fr.report.mobile.ElementCaseMobileAttr; + +import javax.swing.*; +import java.awt.event.ActionEvent; + +/** + * Created by fanglei on 2016/11/14. + */ +public class FormMobileAttrAction extends JTemplateAction { + + public FormMobileAttrAction(JForm jf) { + super(jf); + this.setMenuKeySet(REPORT_APP_ATTR); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/mobile.png")); + } + + /** + * 执行动作 + * + * @return 是否执行成功 + */ + @Override + public void actionPerformed(ActionEvent e) { + final JForm jf = getEditingComponent(); + if (jf == null) { + return; + } + final Form formTpl = jf.getTarget(); + } + + private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'T'; + } + + @Override + public String getMenuName() { + return "移动端属性"; + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; +} From 151c0edb752b8cc0b1a7610cb4e21a66dae91f5d Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 17 Nov 2016 15:28:00 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=86=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E8=8F=9C=E5=8D=95=E7=9A=84=E6=95=B0=E6=8D=AE=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/mobile/MobileToolBarPane.java | 50 +++++++++++++++-- .../dialog/mobile/MobileToolBarBeanPane.java | 56 ------------------- .../form/mobile/FormMobileAttrPane.java | 53 ++++++++++++++++++ .../design/form/mobile/MobileToolBarPane.java | 44 +++++++++++++-- .../actions/FormMobileAttrAction.java | 19 ++++++- 5 files changed, 153 insertions(+), 69 deletions(-) delete mode 100644 designer_base/src/com/fr/design/dialog/mobile/MobileToolBarBeanPane.java create mode 100644 designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java 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 From 1d306eb56f112f73e2a6a0b198e8b01bd2238847 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 17 Nov 2016 15:49:59 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/ElementCasePaneDelegate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 67e6975343..a3df2ba3e8 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -102,7 +102,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { // 插入菜单 private MenuDef createInsertMenuDef() { - MenuDef menuDef = new MenuDef(Inter.getLocText("M-Insert"), 'I'); + MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Insert"), 'I'); menuDef.setAnchor(MenuHandler.INSERT); // 单元格菜单 menuDef.addShortCut(DeprecatedActionManager.getCellMenu(this)); From b8155e3ca369d4735ed85b2309cf9c8caeb39e7a Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 17 Nov 2016 15:58:52 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=B6=88=E9=99=A4=E9=AD=94=E6=9C=AF?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/form/mobile/FormMobileAttrPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 385608b184..cf626b888c 100644 --- a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java +++ b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -26,7 +26,8 @@ public class FormMobileAttrPane extends BasicBeanPane{ 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)); + final int paddingHeight = 10; + jPanel.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + paddingHeight)); jPanel.add("North", mobileToolBarPane); this.add(jPanel); } From 3036113ec56c5f628b17a49225b91439ac8c0ab7 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 17 Nov 2016 17:31:18 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=94=B1=E4=BA=8Ereport=E7=9A=84elementCas?= =?UTF-8?q?eMobileAttrProvider=E6=B2=A1=E6=9C=89=E6=94=B9=E5=A5=BD?= =?UTF-8?q?=EF=BC=8Cform=E9=87=8C=E9=9D=A2=E8=8F=9C=E5=8D=95=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=85=88=E5=B1=8F=E8=94=BD=E9=98=B2=E6=AD=A2=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/FormMobileAttrAction.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) 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 935c9f858e..c3f220f847 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java @@ -35,23 +35,23 @@ public class FormMobileAttrAction extends JTemplateAction { */ @Override public void actionPerformed(ActionEvent e) { - final JForm jf = getEditingComponent(); - if (jf == null) { - 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); +// final JForm jf = getEditingComponent(); +// if (jf == null) { +// 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() { From f08d615bb3d2d656c72a40a352a864ec67f75d24 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Fri, 18 Nov 2016 11:51:08 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86formMobileAttr?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=A1=A8=E5=8D=95=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/mobile/FormMobileAttrPane.java | 12 +++---- .../design/form/mobile/MobileToolBarPane.java | 12 +++---- .../actions/FormMobileAttrAction.java | 36 +++++++++---------- 3 files changed, 30 insertions(+), 30 deletions(-) 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 cf626b888c..59d57f4a24 100644 --- a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java +++ b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -2,8 +2,8 @@ package com.fr.design.form.mobile; import com.fr.design.beans.BasicBeanPane; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.form.main.mobile.FormMobileAttr; import com.fr.general.Inter; -import com.fr.report.mobile.ElementCaseMobileAttr; import javax.swing.*; import java.awt.*; @@ -11,7 +11,7 @@ import java.awt.*; /** * Created by fanglei on 2016/11/17. */ -public class FormMobileAttrPane extends BasicBeanPane{ +public class FormMobileAttrPane extends BasicBeanPane{ //工具栏容器 private MobileToolBarPane mobileToolBarPane; @@ -33,16 +33,16 @@ public class FormMobileAttrPane extends BasicBeanPane{ } @Override - public void populateBean(ElementCaseMobileAttr ob) { + public void populateBean(FormMobileAttr ob) { if (ob == null) { - ob = new ElementCaseMobileAttr(); + ob = new FormMobileAttr(); } this.mobileToolBarPane.populateBean(ob); } @Override - public ElementCaseMobileAttr updateBean() { - ElementCaseMobileAttr caseMobileAttr = new ElementCaseMobileAttr(); + public FormMobileAttr updateBean() { + FormMobileAttr caseMobileAttr = new FormMobileAttr(); this.mobileToolBarPane.updateBean(caseMobileAttr); return caseMobileAttr; } 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 7430f3a9ee..c46c98ec27 100644 --- a/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java +++ b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java @@ -4,8 +4,8 @@ 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.form.main.mobile.FormMobileAttr; import com.fr.general.Inter; -import com.fr.report.mobile.ElementCaseMobileAttr; import javax.swing.*; import java.awt.*; @@ -13,7 +13,7 @@ import java.awt.*; /** * Created by 方磊 on 2016/11/8. */ -public class MobileToolBarPane extends BasicBeanPane { +public class MobileToolBarPane extends BasicBeanPane { //刷新选项面板 private MobileRadioCheckPane refreshCheckPane; @@ -37,20 +37,20 @@ public class MobileToolBarPane extends BasicBeanPane { } @Override - public void populateBean(ElementCaseMobileAttr ob) { + public void populateBean(FormMobileAttr ob) { if (ob == null) { - ob = new ElementCaseMobileAttr(); + ob = new FormMobileAttr(); } this.refreshCheckPane.populateBean(ob.isRefresh()); } @Override - public ElementCaseMobileAttr updateBean() { + public FormMobileAttr updateBean() { return null; } @Override - public void updateBean(ElementCaseMobileAttr mobileAttr) { + public void updateBean(FormMobileAttr mobileAttr) { if(mobileAttr != null) { mobileAttr.setRefresh(this.refreshCheckPane.updateBean()); } 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 c3f220f847..91b0822d33 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java @@ -9,8 +9,8 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JForm; import com.fr.design.menu.MenuKeySet; import com.fr.form.main.Form; +import com.fr.form.main.mobile.FormMobileAttr; import com.fr.general.Inter; -import com.fr.report.mobile.ElementCaseMobileAttr; import javax.swing.*; import java.awt.event.ActionEvent; @@ -35,23 +35,23 @@ public class FormMobileAttrAction extends JTemplateAction { */ @Override public void actionPerformed(ActionEvent e) { -// final JForm jf = getEditingComponent(); -// if (jf == null) { -// 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); + final JForm jf = getEditingComponent(); + if (jf == null) { + return; + } + final Form formTpl = jf.getTarget(); + FormMobileAttr 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() { From bc446a5405bc36a4c94eff0ecd18071208aeab4c Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Fri, 18 Nov 2016 15:16:13 +0800 Subject: [PATCH 7/7] =?UTF-8?q?static=20final=E4=BF=AE=E9=A5=B0=E5=8F=98?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E6=B6=88=E9=99=A4=E9=AD=94=E6=9C=AF=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/form/mobile/FormMobileAttrPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 59d57f4a24..0aafd8258c 100644 --- a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java +++ b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -15,6 +15,8 @@ public class FormMobileAttrPane extends BasicBeanPane{ //工具栏容器 private MobileToolBarPane mobileToolBarPane; + static final int paddingHeight = 10; + public FormMobileAttrPane() { this.initComponents(); } @@ -26,7 +28,6 @@ public class FormMobileAttrPane extends BasicBeanPane{ jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); this.mobileToolBarPane = new MobileToolBarPane(); //设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中 - final int paddingHeight = 10; jPanel.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + paddingHeight)); jPanel.add("North", mobileToolBarPane); this.add(jPanel);