From 11d33dfd80714f11d9f6838b9e451c35b2ff73a4 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 30 May 2016 16:03:56 +0800 Subject: [PATCH 01/12] rt --- .../report/ReportMobileAttrAction.java | 2 +- .../report/mobile/AppFitBrowserPane.java | 89 +++++++++++++++++++ .../report/mobile/AppFitPreviewPane.java | 71 +++++++++++++++ .../report/mobile/ReportMobileAttrPane.java | 33 +++---- 4 files changed, 172 insertions(+), 23 deletions(-) create mode 100644 designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java create mode 100644 designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java diff --git a/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java index 3248370ef6..2bf3856908 100644 --- a/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java @@ -45,7 +45,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{ final ReportMobileAttrPane mobileAttrPane = new ReportMobileAttrPane(); mobileAttrPane.populateBean(mobileAttr); - BasicDialog dialog = mobileAttrPane.showMediumWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { wbTpl.setReportMobileAttr(mobileAttrPane.updateBean()); diff --git a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java new file mode 100644 index 0000000000..7714a6bac5 --- /dev/null +++ b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java @@ -0,0 +1,89 @@ +package com.fr.design.report.mobile; + +import com.fr.base.mobile.MobileFitAttrState; +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.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Created by 夏翔 on 2016/5/28. + */ +public class AppFitBrowserPane extends BasicBeanPane { + //横屏设置面板 + private MobileRadioGroupPane horizionPane; + //竖屏设置面板 + private MobileRadioGroupPane verticalPane; + //效果预览面板 + private AppFitPreviewPane appFitPreviewPane; + + + public AppFitBrowserPane(){ + initComponents(); + + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); + JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + horizionPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Horizontal")); + verticalPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Vertical")); + fitOpsPane.add(horizionPane, BorderLayout.NORTH); + fitOpsPane.add(verticalPane, BorderLayout.SOUTH); + borderPane.add(fitOpsPane); + this.add(borderPane); + + } + + public void setAppFitPreviewPane(AppFitPreviewPane appFitPreviewPane) { + this.appFitPreviewPane = appFitPreviewPane; + } + + //纵向和横向独立设置 + public int[] getCurrentFitOptions() { + return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex()}; + } + + @Override + public void populateBean(ElementCaseMobileAttr ob) { + if (ob == null) { + ob = new ElementCaseMobileAttr(); + } + ActionListener actionListener = getAppPreviewActionListener(); + horizionPane.addActionListener(actionListener); + verticalPane.addActionListener(actionListener); + horizionPane.populateBean(ob.getHorziontalAttr()); + verticalPane.populateBean(ob.getVerticalAttr()); + appFitPreviewPane.refreshPreview(getCurrentFitOptions()); + + } + + @Override + public ElementCaseMobileAttr updateBean() { + MobileFitAttrState horizonState = horizionPane.updateBean(); + MobileFitAttrState verticalState = verticalPane.updateBean(); + + return new ElementCaseMobileAttr(horizonState, verticalState); + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("FR-Designer_Fit-App"); + } + + private ActionListener getAppPreviewActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + int[] fitOptions = getCurrentFitOptions(); + appFitPreviewPane.refreshPreview(fitOptions); + } + }; + } +} diff --git a/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java b/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java new file mode 100644 index 0000000000..86bcdf6adf --- /dev/null +++ b/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java @@ -0,0 +1,71 @@ +package com.fr.design.report.mobile; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.IOUtils; +import com.fr.general.Inter; + +import javax.swing.*; +import java.util.ArrayList; + +/** + * Created by 夏翔 on 2016/5/28. + */ +public class AppFitPreviewPane extends BasicPane{ + + private UILabel horizontalImageLabel; + + private UILabel verticalImagelabel; + + private ArrayList cachedVerticalPreviewImage = new ArrayList(); + + private ArrayList cachedHorizonPreviewImage = new ArrayList(); + + + public AppFitPreviewPane() { + //初始化缓存图片 + initCacheImage(); + //初始化组件 + initComponents(); + } + + private void initCacheImage() { + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V0.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V1.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V2.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V3.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H0.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H1.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H2.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H3.png"))); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + + JPanel outnorthPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); + this.add(outnorthPane); + + horizontalImageLabel = new UILabel(); + horizontalImageLabel.setIcon(cachedHorizonPreviewImage.get(1)); + outnorthPane.add(horizontalImageLabel); + + verticalImagelabel = new UILabel(); + verticalImagelabel.setIcon(cachedVerticalPreviewImage.get(0)); + outnorthPane.add(verticalImagelabel); + } + + public void refreshPreview(int[] index) { + ImageIcon newHorizonImageIcon = cachedHorizonPreviewImage.get(index[0]) ; + ImageIcon newVerticalImageIcon = cachedVerticalPreviewImage.get(index[1]); + horizontalImageLabel.setIcon(newHorizonImageIcon); + verticalImagelabel.setIcon(newVerticalImageIcon); + + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("FR-Plugin_Preview"); + } +} diff --git a/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java b/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java index 67f0ab825b..1d2d399319 100644 --- a/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java +++ b/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java @@ -1,40 +1,33 @@ package com.fr.design.report.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 com.fr.base.mobile.MobileFitAttrState; import javax.swing.*; -import java.awt.*; /** * Created by Administrator on 2016/5/12/0012. */ public class ReportMobileAttrPane extends BasicBeanPane{ - //横屏设置面板 - private MobileRadioGroupPane horizionPane; - //竖屏设置面板 - private MobileRadioGroupPane verticalPane; + + private AppFitBrowserPane appFitBrowserPane; public ReportMobileAttrPane() { initComponents(); } private void initComponents() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + AppFitPreviewPane appFitPreviewPane = new AppFitPreviewPane(); - JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - horizionPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Horizontal")); - verticalPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Vertical")); - fitOpsPane.add(horizionPane, BorderLayout.NORTH); - fitOpsPane.add(verticalPane, BorderLayout.SOUTH); + appFitBrowserPane = new AppFitBrowserPane(); + appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); + this.add(appFitBrowserPane); - borderPane.add(fitOpsPane); - this.add(borderPane); + this.add(appFitPreviewPane); } @Override @@ -42,17 +35,13 @@ public class ReportMobileAttrPane extends BasicBeanPane{ if (ob == null) { ob = new ElementCaseMobileAttr(); } + appFitBrowserPane.populateBean(ob); - horizionPane.populateBean(ob.getHorziontalAttr()); - verticalPane.populateBean(ob.getVerticalAttr()); } @Override public ElementCaseMobileAttr updateBean() { - MobileFitAttrState horizonState = horizionPane.updateBean(); - MobileFitAttrState verticalState = verticalPane.updateBean(); - - return new ElementCaseMobileAttr(horizonState, verticalState); + return appFitBrowserPane.updateBean(); } @Override From f2b3034ddbeb377a60999972d20185bd385dc3a3 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Mon, 30 May 2016 16:13:51 +0800 Subject: [PATCH 02/12] rt --- .../src/com/fr/design/report/mobile/AppFitBrowserPane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java index 7714a6bac5..8a28187a11 100644 --- a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java +++ b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java @@ -34,6 +34,9 @@ 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")); + ActionListener actionListener = getAppPreviewActionListener(); + horizionPane.addActionListener(actionListener); + verticalPane.addActionListener(actionListener); fitOpsPane.add(horizionPane, BorderLayout.NORTH); fitOpsPane.add(verticalPane, BorderLayout.SOUTH); borderPane.add(fitOpsPane); @@ -55,9 +58,6 @@ public class AppFitBrowserPane extends BasicBeanPane { if (ob == null) { ob = new ElementCaseMobileAttr(); } - ActionListener actionListener = getAppPreviewActionListener(); - horizionPane.addActionListener(actionListener); - verticalPane.addActionListener(actionListener); horizionPane.populateBean(ob.getHorziontalAttr()); verticalPane.populateBean(ob.getVerticalAttr()); appFitPreviewPane.refreshPreview(getCurrentFitOptions()); From 4d5eb1708cdd0dec33f522743d08367b4705b599 Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 31 May 2016 09:46:44 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E4=BF=A1=E6=81=AF=E8=8E=B7=E5=8F=96=E9=97=AE?= =?UTF-8?q?=E9=A2=981/3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 48 +++++++++++++++------ 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index b146e146f8..24ec3a4a30 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -28,6 +28,8 @@ import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.plugin.Plugin; +import com.fr.plugin.PluginLicense; +import com.fr.plugin.PluginLicenseManager; import com.fr.plugin.PluginLoader; import com.fr.stable.*; import com.fr.stable.file.XMLFileManagerProvider; @@ -2044,25 +2046,45 @@ public class RemoteEnv implements Env { } - public InputStream readPluginConfig() throws Exception { + private void readPlugins() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); HashMap para = new HashMap(); para.put("op", "fr_remote_design"); - para.put("cmd", "design_get_plugin_info"); + para.put("cmd", "design_plugins"); + + InputStream inputStream = postBytes2ServerB(out.toByteArray(), para); + String pluginsStr = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8); + if(StringUtils.isNotBlank(pluginsStr) && pluginsStr.startsWith("[")){ + JSONArray jsonArray = new JSONArray(pluginsStr); + for (int i = 0; i < jsonArray.length(); i++) { + Plugin plugin = new Plugin(); + plugin.parseJSON(jsonArray.getJSONObject(i)); + PluginLoader.getLoader().addRemotePlugin(plugin); + } + } + } - return postBytes2ServerB(out.toByteArray(), para); + private void readPluginLicenses() throws Exception { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + HashMap para = new HashMap(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_plugin_licenses"); + + InputStream inputStream = postBytes2ServerB(out.toByteArray(), para); + String pluginsLicensesStr = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8); + if(StringUtils.isNotBlank(pluginsLicensesStr) && pluginsLicensesStr.startsWith("[")) { + JSONArray jsonArray = new JSONArray(pluginsLicensesStr); + for (int i = 0; i < jsonArray.length(); i++) { + PluginLicense pluginLicense = new PluginLicense(); + pluginLicense.parseJSON(jsonArray.getJSONObject(i)); + PluginLicenseManager.getInstance().addRemotePluginLicense(pluginLicense); + } + } } - /** - * 远程设计先不需要检测MD5 - * - * @return 是否正确 - * @throws Exception MD5算法异常 - */ @Override - public boolean isTruePluginMD5(Plugin plugin, File file) throws Exception { - return true; + public void readPluginConfig() throws Exception { + readPlugins(); + readPluginLicenses(); } - - } \ No newline at end of file From 363c8ec7460cc3da3340dc225cb9dad22050a0f5 Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 31 May 2016 09:47:17 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 24ec3a4a30..6f7d1e3b7b 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -2054,7 +2054,7 @@ public class RemoteEnv implements Env { InputStream inputStream = postBytes2ServerB(out.toByteArray(), para); String pluginsStr = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8); - if(StringUtils.isNotBlank(pluginsStr) && pluginsStr.startsWith("[")){ + if (StringUtils.isNotBlank(pluginsStr) && pluginsStr.startsWith("[")) { JSONArray jsonArray = new JSONArray(pluginsStr); for (int i = 0; i < jsonArray.length(); i++) { Plugin plugin = new Plugin(); @@ -2072,7 +2072,7 @@ public class RemoteEnv implements Env { InputStream inputStream = postBytes2ServerB(out.toByteArray(), para); String pluginsLicensesStr = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8); - if(StringUtils.isNotBlank(pluginsLicensesStr) && pluginsLicensesStr.startsWith("[")) { + if (StringUtils.isNotBlank(pluginsLicensesStr) && pluginsLicensesStr.startsWith("[")) { JSONArray jsonArray = new JSONArray(pluginsLicensesStr); for (int i = 0; i < jsonArray.length(); i++) { PluginLicense pluginLicense = new PluginLicense(); From c432e9c29593b16cccbbbbfd565528748e20e145 Mon Sep 17 00:00:00 2001 From: zhouping Date: Wed, 1 Jun 2016 10:15:37 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=9A=84=E6=97=B6=E5=80=99=E9=9C=80=E8=A6=81=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E4=B8=80=E4=B8=8BfireServletStopListener=EF=BC=8C?= =?UTF-8?q?=E5=90=A6=E5=88=99=E6=9C=AC=E5=9C=B0=E7=9A=84=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E8=BF=98=E5=8E=9F=E5=8A=9F=E8=83=BD=E6=B2=A1=E6=B3=95=E4=BD=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/start/Designer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer/src/com/fr/start/Designer.java b/designer/src/com/fr/start/Designer.java index cea1421269..09b7fa76e0 100644 --- a/designer/src/com/fr/start/Designer.java +++ b/designer/src/com/fr/start/Designer.java @@ -35,6 +35,7 @@ import com.fr.general.Inter; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.web.ServletContext; import com.fr.stable.xml.XMLTools; import javax.swing.*; @@ -431,6 +432,7 @@ public class Designer extends BaseDesigner { InformationCollector collector = InformationCollector.getInstance(); collector.collectStopTime(); collector.saveXMLFile(); + ServletContext.fireServletStopListener(); } } \ No newline at end of file From 19efd5e01c4846836086c002abb2505912470837 Mon Sep 17 00:00:00 2001 From: xiaxiang <1438003374@qq.com> Date: Thu, 2 Jun 2016 19:04:47 +0800 Subject: [PATCH 06/12] rt --- .../design/report/mobile/AppFitPreviewPane.java | 16 ++++++++-------- .../com/fr/design/images/dialog/appfit/H0.png | Bin 0 -> 745 bytes .../com/fr/design/images/dialog/appfit/H1.png | Bin 0 -> 810 bytes .../com/fr/design/images/dialog/appfit/H2.png | Bin 0 -> 837 bytes .../com/fr/design/images/dialog/appfit/H3.png | Bin 0 -> 779 bytes .../com/fr/design/images/dialog/appfit/V0.png | Bin 0 -> 815 bytes .../com/fr/design/images/dialog/appfit/V1.png | Bin 0 -> 818 bytes .../com/fr/design/images/dialog/appfit/V2.png | Bin 0 -> 890 bytes .../com/fr/design/images/dialog/appfit/V3.png | Bin 0 -> 842 bytes 9 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/dialog/appfit/H0.png create mode 100644 designer_base/src/com/fr/design/images/dialog/appfit/H1.png create mode 100644 designer_base/src/com/fr/design/images/dialog/appfit/H2.png create mode 100644 designer_base/src/com/fr/design/images/dialog/appfit/H3.png create mode 100644 designer_base/src/com/fr/design/images/dialog/appfit/V0.png create mode 100644 designer_base/src/com/fr/design/images/dialog/appfit/V1.png create mode 100644 designer_base/src/com/fr/design/images/dialog/appfit/V2.png create mode 100644 designer_base/src/com/fr/design/images/dialog/appfit/V3.png diff --git a/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java b/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java index 86bcdf6adf..f399f01400 100644 --- a/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java +++ b/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java @@ -31,14 +31,14 @@ public class AppFitPreviewPane extends BasicPane{ } private void initCacheImage() { - cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V0.png"))); - cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V1.png"))); - cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V2.png"))); - cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "V3.png"))); - cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H0.png"))); - cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H1.png"))); - cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H2.png"))); - cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/base/images/dialog/appfit/" + "H3.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "V0.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "V1.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "V2.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "V3.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "H0.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "H1.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "H2.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "H3.png"))); } private void initComponents() { diff --git a/designer_base/src/com/fr/design/images/dialog/appfit/H0.png b/designer_base/src/com/fr/design/images/dialog/appfit/H0.png new file mode 100644 index 0000000000000000000000000000000000000000..cc90692cca5b0cdcbddf02d95bc0886663d88ff0 GIT binary patch literal 745 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2NRIoyR*y)NO2Z;L>4nJa0`PlBg3pY53*g3ZaI(d5|QnLDbsb`-57xd1 zDwxE4{enV7G%paOhHf@TWpEG?Yqy<;>78Hu%sGmF2qrMFept4; UtBgerm`oWwUHx3vIVCg!01R<7lmGw# literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/dialog/appfit/H1.png b/designer_base/src/com/fr/design/images/dialog/appfit/H1.png new file mode 100644 index 0000000000000000000000000000000000000000..47165240ed080bf2612aac6c4efac51fa1fc3225 GIT binary patch literal 810 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2NRIoyR*y)NO2Z;L>4nJa0`PlBg3pY5~)xto}`%0Z;z z;;jvA;g7Upg#RaaKi0Z4xz$f4Q+Xct%xz^V||Nj+~ zpSsR+d-}qEWmjk4*PS=7IQIJGY{&l`hV^GJOJ0(Z>r=PbC*lA3QF>&_Il-k<{0vQe zi~n22$JqS&x>Tvd_(|n+ncORP=d6B^eKKOZR!dd6cIo7AKjtvs>)YYzuRito@|Oz5 zeU-{)ceP}nzj(B|diTp&hB5x%%fw&%PUv*Emf!Wj@;KM75I&pu+;esj3pJYDz+T{x zf_ed`Z`x*lVLv;A>FA5|+lp75zcgpgmRoajEjP47{EqHnHb-S(z<@)*XymVK4nJa0`PlBg3pY5~)xf__b%0Z$b zaBm^+nj@h*)b1sCA6857-+M>kq)XH~pXDcR6i+gn5%pW#E>TF{qFuo6&xTd2-n7)l z99w_;ZPFTKKv*(mu9d?|kv+Z$-Ah z3i|GZc;1?u5^qslxP71QbpxK|kHRY0(o%WfHjCctS^)I}%;9ivb4WqGjWYz=QvT;j zT`7%?bQU)^*v%GuO*gk|H+%o~`Ks)|u%IaTgqnfDclz_~-Ln5q#uzW(D^wyU2odGoPnt{knh>ey^5>)%}{fmihUt zpELh!TtBen;1n6xlm#s u?s>w2$mV$Xu4PMt{+})24nJa0`PlBg3pY5~)xs&L(+Cik@ z;F+v`>* zY)s4B_u|f#lHXk`~30C2QM$j@4s3V&E98SeBcHnv+%O_zrCltzJI4e)%r*Nll^Djq%HnX z{o?7(xqd$<`qz9olV!K>^AGOA*T0|c-zy&*_gwDy>E9QZXFplyb?DxM`32A3{8Lhl zKWxy#GB>QRexuThyG`E?ak&bbfL-l)fkO)Dfwu5pHTv$?ODlQj-aYU}YD@Se+rM{; z8j$@5Q8|-s?qjv{9n!)6m3g!N*iXupKU*?+`K)d(tK+`&Hm2E~HEVnMY{#WMdEN+z zSy{hdoVvSYTmQfNZx^5DPFZ!kZL0D4_4l`#O{?UW-FDJAS0K?i`u_Y@liTjo%{RSX zddp7gPtKM#h34D(rFLvtuy=z~AWJXU4FVw79)1{c%_Gt=JT&zBR(7WCG71?2Ch%AQ zt3ZhmsMkPoBM4LnjwWTW7Pz70>E>;614cVpcE5RZ=lfpw#-th!1BR8N+ZU(aOWh4j O$PAvYelF{r5}E+I>q!Ox literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/dialog/appfit/V0.png b/designer_base/src/com/fr/design/images/dialog/appfit/V0.png new file mode 100644 index 0000000000000000000000000000000000000000..51b49ea029c5179d7d2c3b2129ec053f9faf659b GIT binary patch literal 815 zcmeAS@N?(olHy`uVBq!ia0vp^3xN0o2NRIwQ2x;iq&N#aB8wRqxP?KOkzv*x380{4 ziEBhjaDG}zd16s2gJVj5QmTSyZen_BP-{iITS5H4zE>vv|`}1jrcVM19&tbp9*UQ#le)&c1 za@_js-zCk?{(fjGXMLc7H3Etlxj+2WubA}b7fLCw`gr;CHEYG+FSYc3Oa8c9ed*Iy z8+rZrp61sb51!1fd2s*7p52eOFP&DsI`Q(JdoMn?wKH&U03(Bh*3A6Rk#BPBxb4=f z-m-{@d%$R?e^9Vrsf;_lA3UyA9S)6=%p#-X2^1`Q0X2y{Ge2Pw(c= zezPsRp#0&fz3msv#P#%>boDlCKR>(veVKW~|CW++-714)W$$;NKO6mBzE5g(*uH0H zY$J|L^A7$O-kWcyZIr)P_0~J5-P})m`546#K!|OP!Oa@6J?{!EWcuCJl~NvCL@m18 zj1;;M*Kc58hNuUV2bgrA2ss{LD!C27CZnsI%S4toxKkhj1r1B6>%|ffW-{@h1}QY) z5$b1d{X|bQvUVz4KT4Yc)I$ztaD0e F0sx1XLl^)6 literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/dialog/appfit/V1.png b/designer_base/src/com/fr/design/images/dialog/appfit/V1.png new file mode 100644 index 0000000000000000000000000000000000000000..82a9e019d074972ea0aa8a8ae7fadd0553a0eec7 GIT binary patch literal 818 zcmeAS@N?(olHy`uVBq!ia0vp^3xN0o2NRIwQ2x;iq&N#aB8wRqxP?KOkzv*x380{4 ziEBhjaDG}zd16s2gJVj5QmTSyZen_BP-uksH3T(-Z}{_wJ<&D*{n ztGvA}R!*FKPQs<{Uv$)0y*&O?<#Y4TknsBGA5W!C^Vj{__rLFTjh(%nAA7j{zn=kt zNBN|!^ZOt$aYr}Go9wCd zkJ>kF`QxXyFJD=4%&|GXT#I{txp-Z)*3Nz@v$L;z`SMFRHZX955!~T-^Yf*b?%LcN z^z?JoqPxwk5e*Q;2vG+lnZ+K6PTij$GV`nO!NCfx$|{?r<|0Qg#;!O56nHK_O~@cWD5$4^UPJhc+W@P|xlCkfg9jX|1T2iPTY&Hql1fl0 u!(0PTNl=wvAISMb*3S0ioT#gPdFA67&waNYTr-tlPEzWB1)t)aFQ>QWMrU0= z`}Y3VsrgvseNn1hMHHV1gi?hz3>|V&vYy072MP z>Ks5(c~7Q7qAljU{jZ>tPiIyBSf%t}*@?K?I#9q(cexJ+Y(2@BcImA~zefUdf zjrq0oC-2JVe@HuJT3p*IVApr$``>?McXm|&xIevW&tm51b1f6!v@{l*`UX#~-MDw} z<@g%b-zU$A>Yl57ckuS&-sKOb`n!BObM@sttNUUT7RNvPdH(m!Z&nf8wtwHeJNw0j zNbld@E;bp9|Jik=a-Kiydx1>J9~W$Iu*=%L5TK%;U%h%So(v4v>ld!_#z^eAa@|bz zb(r}E)hJNNU<*C51XwsDhaRg0ES$LwV6H<}$;4A}+khu>o_)>NmgY02#kW>ZU8}k2 z`fbZsyYhDb{dIL|wSz-bd&OVyn^=wvUWm@Vn#g=~MueJO4%bLHF ztNR{g{r`8YJNr4)&&uvovLD3wUcQnNzv)r+pNZKe)r?c4(&Xn<*4ADxivFqj;hV+u z(wyfaQ*0eGjl+MrAJ)u08ofT;+nW19S!DG8YraGB5b&Q6zEp6Q!oJHHhR zzNCZfC6uHCO=PH^U$e`qU0_b@{dKvwgLeNDNnrRa_UF;wIf1u;`G&#M)z4*}Q$iB} Dq5Ef@ literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/dialog/appfit/V3.png b/designer_base/src/com/fr/design/images/dialog/appfit/V3.png new file mode 100644 index 0000000000000000000000000000000000000000..2a0e75c1666d0130f55ba578c401d715741989f7 GIT binary patch literal 842 zcmeAS@N?(olHy`uVBq!ia0vp^3xN0o2NRIwQ2x;iq&N#aB8wRqxP?KOkzv*x380{4 ziEBhjaDG}zd16s2gJVj5QmTSyZen_BP-z*!-Ar-gY+)ea5WFXP- zFwx?$-yuy4;r|c3ZmYhSTas27DY0nv)L&pK<=g+3$7_PljZj`S@zryHelhpMQS* zSW)o#<@EBef3NZFcr(MeZLZ;ipxE`-Yd;<>t628`qv#v;WWFsH(|5Az*WW7S`uE8t zrQdSSy9;>{4%hb8*L|@C_2$v~7x<9}}(^Pc5K&9k|RoNTF zt@d0{Jiw#_Mm!O-U;f?tV&D5@UaLC|+RV3Wwmn?FSoM}E%vY=u8yL7ZC^5O;Ss7m7 zo+6z4JZ9_NR>AUDri|ZRuic6L;WKG||IV3j3p!O|%F7dvu^o=u&Aor;_Y3b1J$q(T z_fKf9?X#ah_nzf_FkkU*>~T3C$Ge=Tq>C@aOU>FNn!hj3*EWJ-`srJLcF)`JNK~@; zi0Z9(PP@6EPSs%)O8_CZHD^;k-@Mj%d)wNt^*d8KK|&CxgGr>|=LR_xgqR^Z!6eL| zI!F-(@e)|E0oV>Sl}tRSo<~=S Date: Thu, 2 Jun 2016 19:23:54 +0800 Subject: [PATCH 07/12] rt --- .../design/report/mobile/AppFitPreviewPane.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java b/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java index f399f01400..3625e4ba4e 100644 --- a/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java +++ b/designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java @@ -31,14 +31,14 @@ public class AppFitPreviewPane extends BasicPane{ } private void initCacheImage() { - cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "V0.png"))); - cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "V1.png"))); - cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "V2.png"))); - cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "V3.png"))); - cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "H0.png"))); - cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "H1.png"))); - cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "H2.png"))); - cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/" + "H3.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V0.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V1.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V2.png"))); + cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V3.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H0.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H1.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H2.png"))); + cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H3.png"))); } private void initComponents() { From 809dccafaa0753dcadb8d9ad36f4f6abab8567e8 Mon Sep 17 00:00:00 2001 From: Lee Date: Sat, 4 Jun 2016 17:29:22 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=20=E7=A7=BB=E5=8A=A8=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=96=B0=E9=9C=80=E6=B1=82=E6=94=B9=E5=8A=A8=EF=BC=9A=201.=20?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=9C=80=E5=A4=A7=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E9=99=90=E5=88=B6=E5=B1=9E=E6=80=A7=E8=BF=81=E7=A7=BB=E5=88=B0?= =?UTF-8?q?=E2=80=9C=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=B1=9E=E6=80=A7=E2=80=9D?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E4=B8=AD=EF=BC=8C=E5=B9=B6=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E7=9A=84=E6=9B=B4=E6=94=B9=EF=BC=9B=202.=20?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=AB=96=E5=B1=8F=E4=B8=BA=E2=80=9C=E7=BA=B5?= =?UTF-8?q?=E5=90=91=E8=87=AA=E9=80=82=E5=BA=94=E2=80=9D=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E6=89=8B=E6=9C=BA=E6=98=BE=E7=A4=BA=E9=99=90?= =?UTF-8?q?=E5=88=B6=E9=AB=98=E5=BA=A6=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=8B=BE=E9=80=89=EF=BC=8C=E5=88=99=E8=87=AA=E5=8A=A8=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E4=B8=8A=E2=98=91=EF=B8=8F=EF=BC=8C=E5=B9=B6=E4=B8=94?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E4=BB=A5=E7=BC=96=E8=BE=91=EF=BC=88=E7=81=B0?= =?UTF-8?q?=E5=8C=96=E6=95=88=E6=9E=9C=E6=9A=82=E6=97=B6=E8=BF=98=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=81=9A=E5=87=BA=E6=9D=A5=EF=BC=8C=E6=99=9A=E7=82=B9?= =?UTF-8?q?=E7=A0=94=E7=A9=B6=E4=B8=80=E4=B8=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XElementCase.java | 48 +++----------- .../mobile/ElementCasePropertyTable.java | 64 +++++++++++++++---- .../properties/mobile/MobileFitEditor.java | 2 +- 3 files changed, 63 insertions(+), 51 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 022d8de06d..29310ca0c3 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -25,8 +25,6 @@ import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; -import java.util.ArrayList; -import java.util.List; public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ private UILabel imageLable; @@ -56,23 +54,14 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme * @throws IntrospectionException 异常 */ public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { - CRPropertyDescriptor[] crp = ((ElementCaseEditor) data).isHeightRestrict() ? revealHeightLimit() : getDefault(); - FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor(); - if (processor == null) { - return crp; - } - PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass()); - return (CRPropertyDescriptor[]) ArrayUtils.addAll(crp, extraEditor); - } - protected List createNonListenerProperties() throws IntrospectionException { - CRPropertyDescriptor[] propertyTableEditor = { + CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ new CRPropertyDescriptor("widgetName", this.data.getClass()) .setI18NName(Inter.getLocText("Form-Widget_Name")), new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( WLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName( - Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"). - setPropertyChangeListener(new PropertyChangeAdapter() { + Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") + .setPropertyChangeListener(new PropertyChangeAdapter() { @Override public void propertyChange() { @@ -85,34 +74,15 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class) .setI18NName(Inter.getLocText("Form-EC_toolbar")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), - new CRPropertyDescriptor("heightRestrict", this.data.getClass()).setEditorClass(InChangeBooleanEditor.class) - .setI18NName(Inter.getLocText("Form-EC_heightrestrict")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") - }; - List defaultList = new ArrayList<>(); + }; - for (CRPropertyDescriptor propertyDescriptor : propertyTableEditor) { - defaultList.add(propertyDescriptor); + FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getPropertyTableEditor(); + if (processor == null){ + return propertyTableEditor; } - return defaultList; - } - - protected CRPropertyDescriptor[] revealHeightLimit() throws IntrospectionException { - CRPropertyDescriptor heightLimitProperty = new CRPropertyDescriptor("heightPercent", this.data.getClass()) - .setEditorClass(DoubleEditor.class) - .setI18NName(Inter.getLocText("Form-EC_heightpercent")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); - - ArrayList defaultList = (ArrayList) createNonListenerProperties(); - defaultList.add(heightLimitProperty); - - return defaultList.toArray(new CRPropertyDescriptor[defaultList.size()]); - } - - protected CRPropertyDescriptor[] getDefault() throws IntrospectionException { - ArrayList defaultList = (ArrayList) createNonListenerProperties(); - return defaultList.toArray(new CRPropertyDescriptor[defaultList.size()]); + PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass()); + return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } diff --git a/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java b/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java index 7e37fefc3a..9d4a14d5b5 100644 --- a/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java @@ -1,6 +1,7 @@ package com.fr.design.designer.properties.mobile; import com.fr.base.FRContext; +import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.XCreator; import com.fr.design.form.util.XCreatorConstants; @@ -9,11 +10,15 @@ import com.fr.design.gui.itable.PropertyGroup; import com.fr.design.gui.xtable.PropertyGroupModel; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.widget.editors.DoubleEditor; +import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor; +import com.fr.form.ui.ElementCaseEditor; import com.fr.general.Inter; import javax.swing.table.TableModel; import java.beans.IntrospectionException; import java.util.ArrayList; +import java.util.List; /** * Created by Administrator on 2016/5/16/0016. @@ -27,6 +32,52 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{ this.xCreator = xCreator; } + public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { + if (((ElementCaseEditor ) xCreator.toData()).getVerticalAttr().getState() == 2 && !((ElementCaseEditor ) xCreator.toData()).isHeightRestrict()) { + ((ElementCaseEditor ) xCreator.toData()).setHeightRestrict(true); + return revealHeightLimit(); + } + CRPropertyDescriptor[] crp = ((ElementCaseEditor) xCreator.toData()).isHeightRestrict() ? revealHeightLimit() : getDefault(); + return crp; + } + + protected List createNonListenerProperties() throws IntrospectionException { + CRPropertyDescriptor[] propertyTableEditor = { + new CRPropertyDescriptor("horziontalAttr", this.xCreator.toData().getClass()).setEditorClass(MobileFitEditor.class) + .setRendererClass(MobileFitRender.class) + .setI18NName(Inter.getLocText("FR-Designer_Mobile-Horizontal")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")), + new CRPropertyDescriptor("verticalAttr", this.xCreator.toData().getClass()).setEditorClass(MobileFitEditor.class) + .setRendererClass(MobileFitRender.class) + .setI18NName(Inter.getLocText("FR-Designer_Mobile-Vertical")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")), + new CRPropertyDescriptor("heightRestrict", this.xCreator.toData().getClass()).setEditorClass(InChangeBooleanEditor.class) + .setI18NName(Inter.getLocText("Form-EC_heightrestrict")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")) + }; + List defaultList = new ArrayList<>(); + + for (CRPropertyDescriptor propertyDescriptor: propertyTableEditor) { + defaultList.add(propertyDescriptor); + } + return defaultList; + } + + protected CRPropertyDescriptor[] revealHeightLimit() throws IntrospectionException { + CRPropertyDescriptor heightLimitProperty = new CRPropertyDescriptor("heightPercent", this.xCreator.toData().getClass()) + .setEditorClass(DoubleEditor.class) + .setI18NName(Inter.getLocText("Form-EC_heightpercent")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); + ArrayList defaultList = (ArrayList) createNonListenerProperties(); + defaultList.add(heightLimitProperty); + return defaultList.toArray(new CRPropertyDescriptor[defaultList.size()]); + } + + protected CRPropertyDescriptor[] getDefault() throws IntrospectionException { + ArrayList defaultList = (ArrayList) createNonListenerProperties(); + return defaultList.toArray(new CRPropertyDescriptor[defaultList.size()]); + } + @Override public void initPropertyGroups(Object source) { this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); @@ -34,17 +85,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{ groups = new ArrayList(); CRPropertyDescriptor[] propertyTableEditor = null; try { - propertyTableEditor = new CRPropertyDescriptor[]{ - new CRPropertyDescriptor("horziontalAttr", this.xCreator.toData().getClass()).setEditorClass(MobileFitEditor.class) - .setRendererClass(MobileFitRender.class) - .setI18NName(Inter.getLocText("FR-Designer_Mobile-Horizontal")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")), - new CRPropertyDescriptor("verticalAttr", this.xCreator.toData().getClass()).setEditorClass(MobileFitEditor.class) - .setRendererClass(MobileFitRender.class) - .setI18NName(Inter.getLocText("FR-Designer_Mobile-Vertical")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")) - - }; + propertyTableEditor = supportedDescriptor(); } catch (IntrospectionException e) { FRContext.getLogger().error(e.getMessage()); } @@ -59,6 +100,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{ @Override public void firePropertyEdit() { + designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); } public void populate(FormDesigner designer) { diff --git a/designer_form/src/com/fr/design/designer/properties/mobile/MobileFitEditor.java b/designer_form/src/com/fr/design/designer/properties/mobile/MobileFitEditor.java index 6591b90592..0930a8e699 100644 --- a/designer_form/src/com/fr/design/designer/properties/mobile/MobileFitEditor.java +++ b/designer_form/src/com/fr/design/designer/properties/mobile/MobileFitEditor.java @@ -45,6 +45,6 @@ public class MobileFitEditor extends ComboEditor{ */ @Override public boolean refreshInTime() { - return false; + return true; } } From cf48cc3a1e4024057729ced6f6b403fd80612aec Mon Sep 17 00:00:00 2001 From: Lee Date: Tue, 7 Jun 2016 13:52:38 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E7=BC=A9=E6=94=BE=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/mobile/AppFitBrowserPane.java | 13 ++-- .../report/mobile/MobileRadioCheckPane.java | 71 +++++++++++++++++++ 2 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java diff --git a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java index 8a28187a11..5e75639cdb 100644 --- a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java +++ b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java @@ -19,6 +19,8 @@ public class AppFitBrowserPane extends BasicBeanPane { private MobileRadioGroupPane horizionPane; //竖屏设置面板 private MobileRadioGroupPane verticalPane; + //缩放选项面板 + private MobileRadioCheckPane radioCheckPane; //效果预览面板 private AppFitPreviewPane appFitPreviewPane; @@ -34,11 +36,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.SOUTH); + fitOpsPane.add(verticalPane, BorderLayout.CENTER); + fitOpsPane.add(radioCheckPane, BorderLayout.SOUTH); borderPane.add(fitOpsPane); this.add(borderPane); @@ -50,7 +54,7 @@ public class AppFitBrowserPane extends BasicBeanPane { //纵向和横向独立设置 public int[] getCurrentFitOptions() { - return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex()}; + return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex(), radioCheckPane.getCurrentState()}; } @Override @@ -60,6 +64,7 @@ public class AppFitBrowserPane extends BasicBeanPane { } horizionPane.populateBean(ob.getHorziontalAttr()); verticalPane.populateBean(ob.getVerticalAttr()); + radioCheckPane.populateBean(ob.getZoom()); appFitPreviewPane.refreshPreview(getCurrentFitOptions()); } @@ -68,8 +73,8 @@ public class AppFitBrowserPane extends BasicBeanPane { public ElementCaseMobileAttr updateBean() { MobileFitAttrState horizonState = horizionPane.updateBean(); MobileFitAttrState verticalState = verticalPane.updateBean(); - - return new ElementCaseMobileAttr(horizonState, verticalState); + boolean isZoom = radioCheckPane.updateBean(); + return new ElementCaseMobileAttr(horizonState, verticalState, isZoom); } @Override diff --git a/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java b/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java new file mode 100644 index 0000000000..0a6b17155a --- /dev/null +++ b/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java @@ -0,0 +1,71 @@ +package com.fr.design.report.mobile; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.general.Inter; +import com.fr.stable.StringUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; + +public class MobileRadioCheckPane extends BasicBeanPane { + + private List checkBoxes = new ArrayList(); + + public MobileRadioCheckPane(String title) { + initComponents(title); + } + + private void initComponents(String title) { + double p = TableLayout.PREFERRED; + double[] rowSize = {p}; + double[] columnSize = {p,p}; + + UICheckBox checkBox = new UICheckBox(Inter.getLocText("FS-CPT_ZOOM")); + checkBox.setSelected(true); + + checkBoxes.add(checkBox); + + Component[][] components = new Component[][]{ + new Component[]{new UILabel(title), checkBox} + }; + JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + fitOpsPane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); + + this.add(fitOpsPane); + } + + public int getCurrentState() { + return checkBoxes.get(0).isSelected() ? 0 : 1; + } + /** + * 设置按钮状态 + */ + public void setEnabled(boolean enabled) { + for (UICheckBox checkBox : checkBoxes) { + checkBox.setEnabled(enabled); + } + } + + @Override + protected String title4PopupWindow() { + return StringUtils.EMPTY; + } + + @Override + public void populateBean(Boolean ob) { + checkBoxes.get(0).setSelected(ob); + } + + @Override + public Boolean updateBean() { + int state = getCurrentState(); + return state == 0 ? true : false; + } +} \ No newline at end of file From a70fbedd26fd25153c0beb579e908f65e48d1544 Mon Sep 17 00:00:00 2001 From: Lee Date: Tue, 7 Jun 2016 17:21:01 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/report/mobile/AppFitBrowserPane.java | 4 ++-- .../src/com/fr/design/report/mobile/MobileRadioCheckPane.java | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java index 5e75639cdb..43471b751d 100644 --- a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java +++ b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java @@ -36,7 +36,7 @@ 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")); + radioCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom")); ActionListener actionListener = getAppPreviewActionListener(); horizionPane.addActionListener(actionListener); verticalPane.addActionListener(actionListener); @@ -64,7 +64,7 @@ public class AppFitBrowserPane extends BasicBeanPane { } horizionPane.populateBean(ob.getHorziontalAttr()); verticalPane.populateBean(ob.getVerticalAttr()); - radioCheckPane.populateBean(ob.getZoom()); + radioCheckPane.populateBean(ob.isZoom()); appFitPreviewPane.refreshPreview(getCurrentFitOptions()); } diff --git a/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java b/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java index 0a6b17155a..9264619d32 100644 --- a/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java +++ b/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java @@ -10,7 +10,6 @@ import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.*; -import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; @@ -27,7 +26,7 @@ public class MobileRadioCheckPane extends BasicBeanPane { double[] rowSize = {p}; double[] columnSize = {p,p}; - UICheckBox checkBox = new UICheckBox(Inter.getLocText("FS-CPT_ZOOM")); + UICheckBox checkBox = new UICheckBox(Inter.getLocText("FR-Designer_Mobile-Open")); checkBox.setSelected(true); checkBoxes.add(checkBox); From 7b0d7935a3ca93d292908ebd642cd970a5cebb7e Mon Sep 17 00:00:00 2001 From: richie Date: Wed, 8 Jun 2016 10:58:35 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/VerifierListPane.java | 2 +- .../fr/design/ExtraDesignClassManager.java | 19 +++++++++++++++ .../fr/design/fun/VerifyDefineProvider.java | 24 +++++++++++++++++++ .../impl/AbstractVerifyDefineProvider.java | 20 ++++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 designer_base/src/com/fr/design/fun/VerifyDefineProvider.java create mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java diff --git a/designer/src/com/fr/design/report/VerifierListPane.java b/designer/src/com/fr/design/report/VerifierListPane.java index 38187d0a69..e489953244 100644 --- a/designer/src/com/fr/design/report/VerifierListPane.java +++ b/designer/src/com/fr/design/report/VerifierListPane.java @@ -1 +1 @@ -package com.fr.design.report; import com.fr.write.ReportWriteAttrProvider; import com.fr.write.ValueVerifierProvider; import com.fr.write.WClassVerifierProvider; import com.fr.general.NameObject; import com.fr.data.Verifier; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ObjectJControlPane; import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; import com.fr.general.Inter; import com.fr.stable.Nameable; import com.fr.stable.bridge.StableFactory; import javax.swing.*; import java.awt.*; import java.util.*; /** * Author : Shockway * Date: 13-7-29 * Time: 下午5:11 */ public class VerifierListPane extends ObjectJControlPane { public VerifierListPane(ElementCasePane ePane) { super(ePane); } /** * 创建选项 * @return 选项 */ public NameableCreator[] createNameableCreators() { return new NameableCreator[] { new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}), "/com/fr/web/images/reportlet.png", // ValueVerifier.class, // ReportWriteAttr.class, StableFactory.getRegisteredClass(ReportWriteAttrProvider.XML_TAG), BuildInVerifierPane.class), new NameObjectCreator( Inter.getLocText(new String[]{"Custom", "Verify"}), "/com/fr/web/images/reportlet.png", // WClassVerifier.class, StableFactory.getRegisteredClass(WClassVerifierProvider.TAG), CustomVerifierPane.class) }; } @Override protected String title4PopupWindow() { return null; } public void populate(ReportWriteAttrProvider reportWriteAttr) { if (reportWriteAttr == null) { return; } java.util.List nameObjectList = new ArrayList(); int verifierCount = reportWriteAttr.getVerifierCount(); boolean addedVVObject = false; for (int i = 0; i < verifierCount; i++) { Verifier verifier = reportWriteAttr.getVerifier(i); String name = reportWriteAttr.getVerifierNameList(i); // 内置的校验ValueVerifier只要加在一个面板中 if (verifier instanceof ValueVerifierProvider) { if (!addedVVObject) { nameObjectList.add(new NameObject(name, reportWriteAttr)); addedVVObject = true; } } else { nameObjectList.add(new NameObject(name, verifier)); } } this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); } private static String valueVerifyName = Inter.getLocText("Verify-Data_Verify"); /** * 更新报表填报属性 * @param reportWriteAttr 报表填报属性 */ public void updateReportWriteAttr(ReportWriteAttrProvider reportWriteAttr) { JNameEdList nameEdList = VerifierListPane.this.nameableList; DefaultListModel model = (DefaultListModel) nameEdList.getModel(); for (int i=0; i { private ValueVerifierEditPane valueVerifierEditPane; public BuildInVerifierPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); valueVerifierEditPane = new ValueVerifierEditPane(); this.add(valueVerifierEditPane, BorderLayout.CENTER); } @Override public void populateBean(ReportWriteAttrProvider ob) { valueVerifierEditPane.populate(ob); } @Override public ReportWriteAttrProvider updateBean() { ReportWriteAttrProvider ra = StableFactory.getMarkedInstanceObjectFromClass(ReportWriteAttrProvider.XML_TAG, ReportWriteAttrProvider.class); valueVerifierEditPane.update(ra, VerifierListPane.valueVerifyName); return ra; } @Override protected String title4PopupWindow() { return null; } } public static class CustomVerifierPane extends BasicBeanPane { private CustomVerifyJobPane pane; public CustomVerifierPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); pane = new CustomVerifyJobPane(); this.add(pane, BorderLayout.CENTER); } @Override public void populateBean(WClassVerifierProvider ob) { this.pane.populateBean(ob.getClassVerifyJob()); } @Override public WClassVerifierProvider updateBean() { WClassVerifierProvider cs = StableFactory.getMarkedInstanceObjectFromClass(WClassVerifierProvider.TAG, WClassVerifierProvider.class); cs.setClassVerifyJob(this.pane.updateBean()); return cs; } @Override protected String title4PopupWindow() { return "custom"; } } private boolean isBuildInVerifier(Object obj) { return obj instanceof ReportWriteAttrProvider; } } \ No newline at end of file +package com.fr.design.report; import com.fr.data.Verifier; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.fun.VerifyDefineProvider; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ObjectJControlPane; import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.bridge.StableFactory; import com.fr.write.ReportWriteAttrProvider; import com.fr.write.ValueVerifierProvider; import com.fr.write.WClassVerifierProvider; import javax.swing.*; import java.awt.*; import java.util.ArrayList; /** * Author : Shockway * Date: 13-7-29 * Time: 下午5:11 */ public class VerifierListPane extends ObjectJControlPane { public VerifierListPane(ElementCasePane ePane) { super(ePane); } /** * 创建选项 * * @return 选项 */ public NameableCreator[] createNameableCreators() { NameableCreator[] creators = new NameableCreator[]{ new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}), "/com/fr/web/images/reportlet.png", StableFactory.getRegisteredClass(ReportWriteAttrProvider.XML_TAG), BuildInVerifierPane.class) }; for (VerifyDefineProvider provider : ExtraDesignClassManager.getInstance().getVerifyDefineProviders()) { creators = ArrayUtils.add(creators, new NameObjectCreator( provider.nameForVerifier(), provider.iconPath(), provider.classForVerifier(), provider.appearanceForVerifier() ) { }); } creators = ArrayUtils.add(creators, new NameObjectCreator( Inter.getLocText(new String[]{"Custom", "Verify"}), "/com/fr/web/images/reportlet.png", StableFactory.getRegisteredClass(WClassVerifierProvider.TAG), CustomVerifierPane.class)); return creators; } @Override protected String title4PopupWindow() { return null; } public void populate(ReportWriteAttrProvider reportWriteAttr) { if (reportWriteAttr == null) { return; } java.util.List nameObjectList = new ArrayList(); int verifierCount = reportWriteAttr.getVerifierCount(); boolean addedVVObject = false; for (int i = 0; i < verifierCount; i++) { Verifier verifier = reportWriteAttr.getVerifier(i); String name = reportWriteAttr.getVerifierNameList(i); // 内置的校验ValueVerifier只要加在一个面板中 if (verifier instanceof ValueVerifierProvider) { if (!addedVVObject) { nameObjectList.add(new NameObject(name, reportWriteAttr)); addedVVObject = true; } } else { nameObjectList.add(new NameObject(name, verifier)); } } this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); } private static String valueVerifyName = Inter.getLocText("Verify-Data_Verify"); /** * 更新报表填报属性 * * @param reportWriteAttr 报表填报属性 */ public void updateReportWriteAttr(ReportWriteAttrProvider reportWriteAttr) { JNameEdList nameEdList = VerifierListPane.this.nameableList; DefaultListModel model = (DefaultListModel) nameEdList.getModel(); for (int i = 0; i < model.size(); i++) { NameObject no = (NameObject) ((ListModelElement) model.get(i)).wrapper; if (no.getObject() instanceof ReportWriteAttrProvider) { valueVerifyName = no.getName(); break; } } Nameable[] res = this.update(); NameObject[] res_array = new NameObject[res.length]; java.util.Arrays.asList(res).toArray(res_array); reportWriteAttr.clearVerifiers(); for (int i = 0; i < res_array.length; i++) { NameObject nameObject = res_array[i]; if (nameObject.getObject() instanceof Verifier) { reportWriteAttr.addVerifier(nameObject.getName(), (Verifier) nameObject.getObject()); } else if (nameObject.getObject() instanceof ReportWriteAttrProvider) { ReportWriteAttrProvider ra = (ReportWriteAttrProvider) nameObject.getObject(); for (int k = 0; k < ra.getValueVerifierCount(); k++) { reportWriteAttr.addVerifier(nameObject.getName(), ra.getVerifier(k)); } } } } /** * 添加 * * @param nameable 添加的Nameable * @param index 序号 */ public void addNameable(Nameable nameable, int index) { JNameEdList nameEdList = VerifierListPane.this.nameableList; DefaultListModel model = (DefaultListModel) nameEdList.getModel(); // 内置的数据校验大框架只加一个 if (((NameObject) nameable).getObject() instanceof ReportWriteAttrProvider) { setToolbarDefEnable(0, 0, false); for (int i = 0; i < model.size(); i++) { if (isBuildInVerifier(((NameObject) ((ListModelElement) model.get(i)).wrapper).getObject())) { nameableList.setSelectedIndex(i); } } } ListModelElement el = new ListModelElement(nameable); model.add(index, el); nameableList.setSelectedIndex(index); nameableList.ensureIndexIsVisible(index); nameEdList.repaint(); } /** * 检查btn的状态 */ public void checkButtonEnabled() { super.checkButtonEnabled(); if (!hasBuildInVerifier()) { setToolbarDefEnable(0, 0, true); } } private boolean hasBuildInVerifier() { JNameEdList nameEdList = VerifierListPane.this.nameableList; DefaultListModel model = (DefaultListModel) nameEdList.getModel(); for (int i = 0; i < model.size(); i++) { if (isBuildInVerifier(((NameObject) ((ListModelElement) model.get(i)).wrapper).getObject())) { return true; } } return false; } public static class BuildInVerifierPane extends BasicBeanPane { private ValueVerifierEditPane valueVerifierEditPane; public BuildInVerifierPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); valueVerifierEditPane = new ValueVerifierEditPane(); this.add(valueVerifierEditPane, BorderLayout.CENTER); } @Override public void populateBean(ReportWriteAttrProvider ob) { valueVerifierEditPane.populate(ob); } @Override public ReportWriteAttrProvider updateBean() { ReportWriteAttrProvider ra = StableFactory.getMarkedInstanceObjectFromClass(ReportWriteAttrProvider.XML_TAG, ReportWriteAttrProvider.class); valueVerifierEditPane.update(ra, VerifierListPane.valueVerifyName); return ra; } @Override protected String title4PopupWindow() { return null; } } public static class CustomVerifierPane extends BasicBeanPane { private CustomVerifyJobPane pane; public CustomVerifierPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); pane = new CustomVerifyJobPane(); this.add(pane, BorderLayout.CENTER); } @Override public void populateBean(WClassVerifierProvider ob) { this.pane.populateBean(ob.getClassVerifyJob()); } @Override public WClassVerifierProvider updateBean() { WClassVerifierProvider cs = StableFactory.getMarkedInstanceObjectFromClass(WClassVerifierProvider.TAG, WClassVerifierProvider.class); cs.setClassVerifyJob(this.pane.updateBean()); return cs; } @Override protected String title4PopupWindow() { return "custom"; } } private boolean isBuildInVerifier(Object obj) { return obj instanceof ReportWriteAttrProvider; } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/ExtraDesignClassManager.java b/designer_base/src/com/fr/design/ExtraDesignClassManager.java index d676381678..b0a6bb2a79 100644 --- a/designer_base/src/com/fr/design/ExtraDesignClassManager.java +++ b/designer_base/src/com/fr/design/ExtraDesignClassManager.java @@ -138,6 +138,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi private Set backgroundUIProviders; + private Set verifyDefineProviders; + public TableDataPaneProcessor getTableDataPaneProcessor() { return tableDataPaneProcessor; } @@ -804,6 +806,21 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi backgroundUIProviders.add((BackgroundUIProvider) level); } + public VerifyDefineProvider[] getVerifyDefineProviders() { + if (verifyDefineProviders == null) { + return new VerifyDefineProvider[0]; + } + return verifyDefineProviders.toArray(new VerifyDefineProvider[verifyDefineProviders.size()]); + } + + private void addVerifyDefineProvider(Level level, PluginSimplify simplify) throws Exception { + if (verifyDefineProviders == null) { + verifyDefineProviders = new HashSet<>(); + } + validAPILevel(level, VerifyDefineProvider.CURRENT_LEVEL, simplify.getPluginName()); + verifyDefineProviders.add((VerifyDefineProvider) level); + } + /** * 文件名 * @@ -902,6 +919,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi addWidgetAttrProvider(impl, simplify); } else if (tagName.equals(ExportAttrTabProvider.XML_TAG)) { addExportAttrTabProvider(impl, simplify); + } else if (tagName.equals(VerifyDefineProvider.MARK_STRING)) { + addVerifyDefineProvider(impl, simplify); } } catch (PluginInvalidLevelException e) { PluginMessage.remindUpdate(e.getMessage()); diff --git a/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java b/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java new file mode 100644 index 0000000000..4d695db603 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java @@ -0,0 +1,24 @@ +package com.fr.design.fun; + +import com.fr.data.Verifier; +import com.fr.design.beans.BasicBeanPane; +import com.fr.stable.fun.Level; +import com.fr.stable.fun.Provider; + +/** + * Created by richie on 16/6/8. + */ +public interface VerifyDefineProvider extends Level, Provider { + + String MARK_STRING = "VerifyDefineProvider"; + + int CURRENT_LEVEL = 1; + + Class classForVerifier(); + + Class appearanceForVerifier(); + + String nameForVerifier(); + + String iconPath(); +} diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java new file mode 100644 index 0000000000..04c6276104 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java @@ -0,0 +1,20 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.VerifyDefineProvider; +import com.fr.stable.fun.impl.AbstractProvider; + +/** + * Created by richie on 16/6/8. + */ +public abstract class AbstractVerifyDefineProvider extends AbstractProvider implements VerifyDefineProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} From e9a3c2b1d362df67fce13ff56a32f8193c450705 Mon Sep 17 00:00:00 2001 From: richie Date: Wed, 8 Jun 2016 11:02:23 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/fun/VerifyDefineProvider.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java b/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java index 4d695db603..35384bf0a5 100644 --- a/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java +++ b/designer_base/src/com/fr/design/fun/VerifyDefineProvider.java @@ -14,11 +14,27 @@ public interface VerifyDefineProvider extends Level, Provider { int CURRENT_LEVEL = 1; + /** + * 对应的校验类 + * @return 校验类 + */ Class classForVerifier(); + /** + * 校验设置的界面 + * @return 界面 + */ Class appearanceForVerifier(); + /** + * 此种类型的校验的名字 + * @return 名字 + */ String nameForVerifier(); + /** + * 菜单图标 + * @return 图标路径 + */ String iconPath(); }