From 0c07b5851256f174dc464c2e593ebc2831d5fb69 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 1 Nov 2018 16:44:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=85=E5=90=8D=EF=BC=8C?= =?UTF-8?q?=20=E7=A7=BB=E9=99=A4ReportFitAttrProvider=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/reportfit/FitType.java | 4 ++-- .../menupane/BrowserFitAttrPane.java | 19 +++++++++---------- .../menupane/ReportFitAttrAction.java | 10 +++++----- .../reportfit/menupane/ReportFitAttrPane.java | 8 ++++---- .../menupane/TemplateBrowserFitAttrPane.java | 11 +++++------ .../menupane/TemplateFitAttrPane.java | 8 ++++---- .../design/designer/creator/XElementCase.java | 10 +++++----- .../BrowserFitPropertyEditor.java | 8 ++++---- 8 files changed, 38 insertions(+), 40 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/reportfit/FitType.java b/designer-base/src/main/java/com/fr/design/reportfit/FitType.java index 08538956c..6b342240d 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/FitType.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/FitType.java @@ -1,7 +1,7 @@ package com.fr.design.reportfit; import com.fr.design.designer.properties.items.Item; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; import com.fr.stable.StringUtils; /** @@ -45,7 +45,7 @@ public enum FitType { this.state = state; } - public static FitType parse(ReportFitAttrProvider attr) { + public static FitType parse(ReportFitAttr attr) { if (attr == null) { return DEFAULT; diff --git a/designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java index 68669f316..470a2101b 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java @@ -10,9 +10,8 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.log.FineLoggerFactory; -import com.fr.main.ReportFitAttr; -import com.fr.main.ReportFitConfig; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; +import com.fr.reportfit.ReportFitConfig; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; @@ -28,13 +27,13 @@ import java.awt.event.MouseEvent; /** * Created by Administrator on 2016/5/5/0005. */ -public class BrowserFitAttrPane extends BasicBeanPane { +public class BrowserFitAttrPane extends BasicBeanPane { protected FontRadioGroup fontRadioGroup; protected FitRadioGroup fitRadionGroup; protected UICheckBox globalCheck; protected FitPreviewPane fitPreviewPane; - protected ReportFitAttrProvider localFitAttr; + protected ReportFitAttr localFitAttr; protected UIRadioButton defaultRadio; protected UIRadioButton horizonRadio; protected UIRadioButton doubleRadio; @@ -118,14 +117,14 @@ public class BrowserFitAttrPane extends BasicBeanPane { boolean isLocalConfig = !globalCheck.isSelected(); //勾选全局时,采用全局保存的自适应属性更新界面 if (!isLocalConfig) { - ReportFitAttrProvider attr = globalFitAttr; + ReportFitAttr attr = globalFitAttr; fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); fitRadionGroup.selectIndexButton(attr.fitStateInPC()); fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); remove(BrowserFitAttrPane.this.borderPane); initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Global")); } else { - ReportFitAttrProvider attr = localFitAttr; + ReportFitAttr attr = localFitAttr; fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); fitRadionGroup.selectIndexButton(attr.fitStateInPC()); fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); @@ -169,7 +168,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { } @Override - public void populateBean(ReportFitAttrProvider attr) { + public void populateBean(ReportFitAttr attr) { if (attr == null) { //如果为空, 就用全局的 attr = ReportFitConfig.getInstance().getFrmFitAttr(); @@ -178,7 +177,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Local")); } this.localFitAttr = attr; - fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); + fontRadioGroup.selectFontFit((attr).isFitFont()); fitRadionGroup.selectIndexButton(attr.fitStateInPC()); fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); } @@ -207,7 +206,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { } @Override - public ReportFitAttrProvider updateBean() { + public ReportFitAttr updateBean() { ReportFitAttr attr = new ReportFitAttr(); attr.setFitFont(fontRadioGroup.isFontFit()); attr.setFitStateInPC(fitRadionGroup.getSelectRadioIndex()); diff --git a/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java index cb64e4b09..dc4187956 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java @@ -8,8 +8,8 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuKeySet; -import com.fr.report.fun.FitProvider; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.FitProvider; +import com.fr.report.reportfit.ReportFitAttr; import javax.swing.KeyStroke; import java.awt.Dimension; @@ -81,7 +81,7 @@ public class ReportFitAttrAction extends JTemplateAction { return; } final FitProvider wbTpl = (FitProvider) jwb.getTarget(); - ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); + ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); if (jwb.isJWorkBook()) { final TemplateFitAttrPane attrPane = new TemplateFitAttrPane(); showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); @@ -91,12 +91,12 @@ public class ReportFitAttrAction extends JTemplateAction { } } - private void showReportFitDialog(ReportFitAttrProvider fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane attrPane) { + private void showReportFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane attrPane) { attrPane.populateBean(fitAttr); UIDialog dialog = attrPane.showUnsizedWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { - wbTpl.setFitAttr(attrPane.updateBean()); + wbTpl.setReportFitAttr(attrPane.updateBean()); jwb.fireTargetModified(); } }); diff --git a/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java index e0b40215e..983ff21ab 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java @@ -1,7 +1,7 @@ package com.fr.design.reportfit.menupane; import com.fr.design.beans.BasicBeanPane; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; import javax.swing.BorderFactory; import javax.swing.BoxLayout; @@ -9,7 +9,7 @@ import javax.swing.BoxLayout; /** * Created by Administrator on 2015/7/6 0006. */ -public class ReportFitAttrPane extends BasicBeanPane { +public class ReportFitAttrPane extends BasicBeanPane { private BrowserFitAttrPane attrPane; @@ -31,7 +31,7 @@ public class ReportFitAttrPane extends BasicBeanPane { * * @param fitAttr 自适应属性 */ - public void populateBean(ReportFitAttrProvider fitAttr) { + public void populateBean(ReportFitAttr fitAttr) { attrPane.populateBean(fitAttr); } @@ -40,7 +40,7 @@ public class ReportFitAttrPane extends BasicBeanPane { * * @return 界面上的更新数据 */ - public ReportFitAttrProvider updateBean() { + public ReportFitAttr updateBean() { return attrPane.updateBean(); } diff --git a/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java index 3b3903fa6..de8108ace 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java @@ -2,9 +2,8 @@ package com.fr.design.reportfit.menupane; import com.fr.design.gui.ilable.UILabel; import com.fr.log.FineLoggerFactory; -import com.fr.main.ReportFitAttr; -import com.fr.main.ReportFitConfig; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; +import com.fr.reportfit.ReportFitConfig; import java.awt.Component; @@ -28,12 +27,12 @@ public class TemplateBrowserFitAttrPane extends BrowserFitAttrPane { } @Override - public void populateBean(ReportFitAttrProvider attr) { + public void populateBean(ReportFitAttr attr) { //模板界面,自适应选项去掉了默认,这边的判断为了兼容之前的设置 if (attr != null && attr.fitStateInPC() == 0) { attr.setFitStateInPC(3); } - ReportFitAttrProvider fitAttr = ReportFitConfig.getInstance().getCptFitAttr(); + ReportFitAttr fitAttr = ReportFitConfig.getInstance().getCptFitAttr(); if (attr == null) { //如果为空, 就用全局的 attr = fitAttr; @@ -52,7 +51,7 @@ public class TemplateBrowserFitAttrPane extends BrowserFitAttrPane { } @Override - public ReportFitAttrProvider updateBean() { + public ReportFitAttr updateBean() { ReportFitAttr attr = new ReportFitAttr(); attr.setFitFont(fontRadioGroup.isFontFit()); attr.setFitStateInPC(fitRadionGroup.getSelectRadioIndex()); diff --git a/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java index 48238e85c..e78259af6 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java @@ -1,7 +1,7 @@ package com.fr.design.reportfit.menupane; import com.fr.design.beans.BasicBeanPane; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; import javax.swing.BorderFactory; import javax.swing.BoxLayout; @@ -9,7 +9,7 @@ import javax.swing.BoxLayout; /** * Created by 夏翔 on 2016/6/24. */ -public class TemplateFitAttrPane extends BasicBeanPane { +public class TemplateFitAttrPane extends BasicBeanPane { private TemplateBrowserFitAttrPane attrPane; @@ -30,7 +30,7 @@ public class TemplateFitAttrPane extends BasicBeanPane { * * @param fitAttr 自适应属性 */ - public void populateBean(ReportFitAttrProvider fitAttr) { + public void populateBean(ReportFitAttr fitAttr) { attrPane.populateBean(fitAttr); } @@ -40,7 +40,7 @@ public class TemplateFitAttrPane extends BasicBeanPane { * * @return 界面上的更新数据 */ - public ReportFitAttrProvider updateBean() { + public ReportFitAttr updateBean() { return attrPane.updateBean(); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index c6f3bfb02..1b30af771 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -19,11 +19,11 @@ import com.fr.form.FormProvider; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditorProvider; +import com.fr.report.reportfit.ReportFitAttr; import com.fr.stable.ArrayUtils; import com.fr.stable.CoreGraphHelper; import com.fr.stable.core.PropertyChangeAdapter; -import com.fr.report.fun.FitProvider; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.FitProvider; import javax.swing.*; import java.awt.*; @@ -120,17 +120,17 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme private CRPropertyDescriptor getReportFitEditor() { this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FitProvider wbTpl = designer.getTarget(); - ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); + ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); ElementCaseEditor editor = this.toData(); //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) if (editor.getFitStateInPC() == 0) { editor.setReportFitAttr(null); } - ReportFitAttrProvider reportFit = editor.getReportFitAttr(); + ReportFitAttr reportFit = editor.getReportFitAttr(); if(fitAttr != null){ reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; } - ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; + ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); if (editor.getReportFitAttr() == null) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java index 3eee63f9e..cdbc0c1a1 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java @@ -2,8 +2,8 @@ package com.fr.design.mainframe.widget.propertypane; import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.form.util.XCreatorConstants; -import com.fr.main.ReportFitConfig; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; +import com.fr.reportfit.ReportFitConfig; import java.beans.IntrospectionException; @@ -19,7 +19,7 @@ public class BrowserFitPropertyEditor { * @param reportFitAttr 传入的自适应属性 * @return 返回属性表 */ - public CRPropertyDescriptor createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr) { + public CRPropertyDescriptor createPropertyDescriptor(Class temp, ReportFitAttr reportFitAttr) { if (getFitStateInPC(reportFitAttr) == 0) { return null; } @@ -33,7 +33,7 @@ public class BrowserFitPropertyEditor { } } - public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { + public int getFitStateInPC(ReportFitAttr fitAttrProvider) { if (fitAttrProvider != null) { return fitAttrProvider.fitStateInPC(); }