From 19ba11f8a4195a96bce01a8f52a3c1c1b8321136 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Wed, 19 Oct 2016 02:10:20 +0800 Subject: [PATCH 1/7] =?UTF-8?q?REPORT-364=20=E6=8A=A5=E8=A1=A8=E5=9D=97?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=8E=A5=E5=8F=A3=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...FormElementRefreshCaseEditorProcessor.java | 18 ++++++++++++ ...FormElementRefreshCaseEditorProcessor.java | 28 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 designer_base/src/com/fr/design/fun/FormElementRefreshCaseEditorProcessor.java create mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractFormElementRefreshCaseEditorProcessor.java diff --git a/designer_base/src/com/fr/design/fun/FormElementRefreshCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/FormElementRefreshCaseEditorProcessor.java new file mode 100644 index 000000000..ceb1881a2 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/FormElementRefreshCaseEditorProcessor.java @@ -0,0 +1,18 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.ReportRefreshAttrProvider; +import com.fr.stable.fun.mark.Immutable; + +import java.beans.PropertyDescriptor; + +/** + * Created by Slpire on 16/10/12. + */ +public interface FormElementRefreshCaseEditorProcessor extends Immutable { + + String MARK_STRING = "PropertyEditor"; + + int CURRENT_LEVEL = 1; + + PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportRefreshAttrProvider reportefreshAttr); +} diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementRefreshCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementRefreshCaseEditorProcessor.java new file mode 100644 index 000000000..5bbf34bc7 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementRefreshCaseEditorProcessor.java @@ -0,0 +1,28 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.FormElementRefreshCaseEditorProcessor; +import com.fr.stable.fun.RefreshProvider; +import com.fr.stable.fun.ReportRefreshAttrProvider; +import com.fr.stable.fun.mark.API; + +import java.beans.PropertyDescriptor; + +/** + * Created by Slpire on 16/10/12. + */ +@API(level = FormElementRefreshCaseEditorProcessor.CURRENT_LEVEL) +public abstract class AbstractFormElementRefreshCaseEditorProcessor implements FormElementRefreshCaseEditorProcessor { + + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + + @Override + public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportRefreshAttrProvider refreshAttrProvider) { + return new PropertyDescriptor[0]; + } +} From ccc9c645af7b7f5d8a437e4ff0af8fa2e3712927 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Thu, 20 Oct 2016 19:43:58 +0800 Subject: [PATCH 2/7] =?UTF-8?q?REPORT-364=20=E5=92=8C=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E7=9A=84=E5=90=8C=E4=B8=80=E4=B8=AA=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ava => FormElementCaseEditorProvider.java} | 70 +++++++------- ...bstractFormElementCaseEditorProvider.java} | 93 ++++++++++--------- .../design/designer/creator/XElementCase.java | 34 +++---- 3 files changed, 101 insertions(+), 96 deletions(-) rename designer_base/src/com/fr/design/fun/{FormElementCaseEditorProcessor.java => FormElementCaseEditorProvider.java} (67%) rename designer_base/src/com/fr/design/fun/impl/{AbstractFormElementCaseEditorProcessor.java => AbstractFormElementCaseEditorProvider.java} (61%) diff --git a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java similarity index 67% rename from designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java rename to designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java index e887d389b..5b7bd6fa2 100644 --- a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java @@ -1,34 +1,38 @@ -package com.fr.design.fun; - -import com.fr.stable.fun.ReportFitAttrProvider; -import com.fr.stable.fun.mark.Immutable; - -import java.beans.PropertyDescriptor; - -/** - * Created by zhouping on 2015/9/10. - */ -public interface FormElementCaseEditorProcessor extends Immutable { - - String MARK_STRING = "PropertyEditor"; - - int CURRENT_LEVEL = 1; - - - /** - * 生成属性表 - * @param temp 传入当前操作的class - * @param reportFitAttr 传入的自适应属性 - * @return 返回属性表 - */ - PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr); - - /** - * 返回pc自适应属性值 - * @param fitAttrProvider 传入的自适应属性 - * @return 返回pc自适应属性值 - */ - int getFitStateInPC(ReportFitAttrProvider fitAttrProvider); - - +package com.fr.design.fun; + +import com.fr.form.ui.ElementCaseEditor; +import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.form.main.Form; +import com.fr.stable.fun.mark.Mutable; + +import java.beans.PropertyDescriptor; + +/** + * Created by zhouping on 2015/9/10. + */ +public interface FormElementCaseEditorProvider extends Mutable { + + String MARK_STRING = "PropertyEditor"; + + int CURRENT_LEVEL = 1; + + + //加个provider返回tab的接口 + //design_base依赖了form + PropertyDescriptor[] createPropertyDescriptor (Class temp, Form reportAttr, ElementCaseEditor editor); + + /** + * 生成属性表 + * @param temp 传入当前操作的class + * @param reportFitAttr 传入的自适应属性 + * @return 返回属性表 + */ + PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr); + + /** + * 返回pc自适应属性值 + * @param fitAttrProvider 传入的自适应属性 + * @return 返回pc自适应属性值 + */ + int getFitStateInPC(ReportFitAttrProvider fitAttrProvider); } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java similarity index 61% rename from designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java rename to designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java index caafda0b8..f65107e2e 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java @@ -1,44 +1,51 @@ -package com.fr.design.fun.impl; - -import com.fr.design.fun.FormElementCaseEditorProcessor; -import com.fr.stable.fun.ReportFitAttrProvider; -import com.fr.stable.fun.mark.API; - -import java.beans.PropertyDescriptor; - -/** - * Created by zhouping on 2015/9/10. - */ -@API(level = FormElementCaseEditorProcessor.CURRENT_LEVEL) -public abstract class AbstractFormElementCaseEditorProcessor implements FormElementCaseEditorProcessor { - - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - public int layerIndex() { - return DEFAULT_LAYER_INDEX; - } - - - /** - * 生成属性表 - * @param temp 传入当前操作的class - * @param reportFitAttr 传入的自适应属性 - * @return 返回属性表 - */ - @Override - public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr) { - return new PropertyDescriptor[0]; - } - - /** - * 返回pc自适应属性值 - * @param fitAttrProvider 传入的自适应属性 - * @return 返回pc自适应属性值 - */ - @Override - public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { - return 0; - } +package com.fr.design.fun.impl; + +import com.fr.design.fun.FormElementCaseEditorProvider; +import com.fr.form.main.Form; +import com.fr.form.ui.ElementCaseEditor; +import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.stable.fun.mark.API; + +import java.beans.PropertyDescriptor; + +/** + * Created by zhouping on 2015/9/10. + */ +@API(level = FormElementCaseEditorProvider.CURRENT_LEVEL) +public abstract class AbstractFormElementCaseEditorProvider implements FormElementCaseEditorProvider { + + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return this.getClass().getName(); + } + + @Override + public PropertyDescriptor[] createPropertyDescriptor(Class temp, Form reportAttr, ElementCaseEditor editor) { + return new PropertyDescriptor[0]; + } + + /** + * 生成属性表 + * @param temp 传入当前操作的class + * @param reportFitAttr 传入的自适应属性 + * @return 返回属性表 + */ + @Override + public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr) { + return new PropertyDescriptor[0]; + } + + /** + * 返回pc自适应属性值 + * @param fitAttrProvider 传入的自适应属性 + * @return 返回pc自适应属性值 + */ + @Override + public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { + return 0; + } } \ No newline at end of file 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 252ec35c7..f2f369595 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -4,8 +4,9 @@ import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.properties.mobile.ElementCasePropertyUI; import com.fr.design.form.util.XCreatorConstants; -import com.fr.design.fun.FormElementCaseEditorProcessor; +import com.fr.design.fun.FormElementCaseEditorProvider; import com.fr.design.fun.WidgetPropertyUIProvider; +import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.EditingMouseListener; @@ -23,8 +24,7 @@ import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.CoreGraphHelper; import com.fr.stable.core.PropertyChangeAdapter; -import com.fr.stable.fun.FitProvider; -import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.form.main.Form; import javax.swing.*; import java.awt.*; @@ -32,6 +32,7 @@ import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; +import java.util.Set; public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ private UILabel imageLable; @@ -100,25 +101,18 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme }; - FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(FormElementCaseEditorProcessor.MARK_STRING); - if (processor == null) { - return propertyTableEditor; - } - this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - FitProvider wbTpl = (FitProvider) designer.getTarget(); - ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); - ElementCaseEditor editor = this.toData(); - //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) - if (editor.getFitStateInPC() == 0) { - editor.setReportFitAttr(null); - } - ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr(); - PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); + Set set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); + for (FormElementCaseEditorProvider processor : set) { + if (processor == null) { + return propertyTableEditor; + } + this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + Form attr = designer.getTarget(); - if (editor.getReportFitAttr() == null) { - editor.setReportFitInPc(processor.getFitStateInPC(fitAttr)); + PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), attr, this.toData()); + propertyTableEditor = (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } - return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); + return propertyTableEditor; } @Override From a87cb4544dd754ed0575d24b128b89e61771731f Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Fri, 21 Oct 2016 10:38:36 +0800 Subject: [PATCH 3/7] =?UTF-8?q?REPORT-364=20=E6=9C=80=E5=88=9D=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E5=BF=98=E4=BA=86=E5=88=A0=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...FormElementRefreshCaseEditorProcessor.java | 18 ------------ ...FormElementRefreshCaseEditorProcessor.java | 28 ------------------- 2 files changed, 46 deletions(-) delete mode 100644 designer_base/src/com/fr/design/fun/FormElementRefreshCaseEditorProcessor.java delete mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractFormElementRefreshCaseEditorProcessor.java diff --git a/designer_base/src/com/fr/design/fun/FormElementRefreshCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/FormElementRefreshCaseEditorProcessor.java deleted file mode 100644 index ceb1881a2..000000000 --- a/designer_base/src/com/fr/design/fun/FormElementRefreshCaseEditorProcessor.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fr.design.fun; - -import com.fr.stable.fun.ReportRefreshAttrProvider; -import com.fr.stable.fun.mark.Immutable; - -import java.beans.PropertyDescriptor; - -/** - * Created by Slpire on 16/10/12. - */ -public interface FormElementRefreshCaseEditorProcessor extends Immutable { - - String MARK_STRING = "PropertyEditor"; - - int CURRENT_LEVEL = 1; - - PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportRefreshAttrProvider reportefreshAttr); -} diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementRefreshCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementRefreshCaseEditorProcessor.java deleted file mode 100644 index 5bbf34bc7..000000000 --- a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementRefreshCaseEditorProcessor.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.fr.design.fun.impl; - -import com.fr.design.fun.FormElementRefreshCaseEditorProcessor; -import com.fr.stable.fun.RefreshProvider; -import com.fr.stable.fun.ReportRefreshAttrProvider; -import com.fr.stable.fun.mark.API; - -import java.beans.PropertyDescriptor; - -/** - * Created by Slpire on 16/10/12. - */ -@API(level = FormElementRefreshCaseEditorProcessor.CURRENT_LEVEL) -public abstract class AbstractFormElementRefreshCaseEditorProcessor implements FormElementRefreshCaseEditorProcessor { - - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - public int layerIndex() { - return DEFAULT_LAYER_INDEX; - } - - @Override - public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportRefreshAttrProvider refreshAttrProvider) { - return new PropertyDescriptor[0]; - } -} From ad5d27457af1d83dc016cf14ad1d1a30739f07b2 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Thu, 27 Oct 2016 17:23:34 +0800 Subject: [PATCH 4/7] =?UTF-8?q?REPORT-364=20=E6=A0=BC=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/designer/creator/XElementCase.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 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 f2f369595..cef415fa2 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -98,18 +98,17 @@ 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"), - }; + //这边有个插件兼容问题,之后还是要改回process才行 Set set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); - for (FormElementCaseEditorProvider processor : set) { - if (processor == null) { + for (FormElementCaseEditorProvider provider : set) { + if (provider == null) { return propertyTableEditor; } this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); Form attr = designer.getTarget(); - - PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), attr, this.toData()); + PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), attr, this.toData()); propertyTableEditor = (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } return propertyTableEditor; From 1d91186058ba60d539da53ed3b17929a0b9a1bf5 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Fri, 28 Oct 2016 15:22:30 +0800 Subject: [PATCH 5/7] =?UTF-8?q?REPORT-364=20=E4=B9=8B=E5=89=8D=E7=9A=84pro?= =?UTF-8?q?cess=E5=8A=A0=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/FormElementCaseEditorProcessor.java | 31 +++++++++++++++++++ .../design/designer/creator/XElementCase.java | 6 ++-- 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java diff --git a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java new file mode 100644 index 000000000..21866a2c3 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java @@ -0,0 +1,31 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.stable.fun.mark.Immutable; + +import java.beans.PropertyDescriptor; + +/** + * Created by Slpire on 2016/10/28. + */ +public interface FormElementCaseEditorProcessor extends Immutable { + String MARK_STRING = "PropertyEditor"; + + int CURRENT_LEVEL = 1; + + + /** + * 生成属性表 + * @param temp 传入当前操作的class + * @param reportFitAttr 传入的自适应属性 + * @return 返回属性表 + */ + PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr); + + /** + * 返回pc自适应属性值 + * @param fitAttrProvider 传入的自适应属性 + * @return 返回pc自适应属性值 + */ + int getFitStateInPC(ReportFitAttrProvider fitAttrProvider); +} 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 cef415fa2..f5412107a 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -104,11 +104,11 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme Set set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); for (FormElementCaseEditorProvider provider : set) { if (provider == null) { - return propertyTableEditor; + continue; } this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - Form attr = designer.getTarget(); - PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), attr, this.toData()); + Form formAttr = designer.getTarget(); + PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formAttr, this.toData()); propertyTableEditor = (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } return propertyTableEditor; From 77272c368780b5a985d589d5b3eb6107f88391c0 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Sat, 29 Oct 2016 21:12:55 +0800 Subject: [PATCH 6/7] =?UTF-8?q?REPORT-364=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/FormElementCaseEditorProvider.java | 2 +- ...bstractFormElementCaseEditorProcessor.java | 44 +++++++++++++++++++ .../design/designer/creator/XElementCase.java | 25 +++++++++-- 3 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java diff --git a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java index 5b7bd6fa2..191f7fa99 100644 --- a/designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java +++ b/designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java @@ -19,7 +19,7 @@ public interface FormElementCaseEditorProvider extends Mutable { //加个provider返回tab的接口 //design_base依赖了form - PropertyDescriptor[] createPropertyDescriptor (Class temp, Form reportAttr, ElementCaseEditor editor); + PropertyDescriptor[] createPropertyDescriptor (Class temp, Form form, ElementCaseEditor editor); /** * 生成属性表 diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java new file mode 100644 index 000000000..08a5a1606 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java @@ -0,0 +1,44 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.FormElementCaseEditorProcessor; +import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.stable.fun.mark.API; + +import java.beans.PropertyDescriptor; + +/** + * Created by zhouping on 2015/9/10. + */ +@API(level = FormElementCaseEditorProcessor.CURRENT_LEVEL) +public abstract class AbstractFormElementCaseEditorProcessor implements FormElementCaseEditorProcessor { + + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + + + /** + * 生成属性表 + * @param temp 传入当前操作的class + * @param reportFitAttr 传入的自适应属性 + * @return 返回属性表 + */ + @Override + public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr) { + return new PropertyDescriptor[0]; + } + + /** + * 返回pc自适应属性值 + * @param fitAttrProvider 传入的自适应属性 + * @return 返回pc自适应属性值 + */ + @Override + public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { + return 0; + } +} \ No newline at end of file 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 f5412107a..f60ffaa0d 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.properties.mobile.ElementCasePropertyUI; import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.fun.FormElementCaseEditorProcessor; import com.fr.design.fun.FormElementCaseEditorProvider; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider; @@ -25,6 +26,8 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.CoreGraphHelper; import com.fr.stable.core.PropertyChangeAdapter; import com.fr.form.main.Form; +import com.fr.stable.fun.FitProvider; +import com.fr.stable.fun.ReportFitAttrProvider; import javax.swing.*; import java.awt.*; @@ -107,11 +110,27 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme continue; } this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - Form formAttr = designer.getTarget(); - PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formAttr, this.toData()); + Form form = designer.getTarget(); + PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), form, this.toData()); propertyTableEditor = (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } - return propertyTableEditor; + + FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(FormElementCaseEditorProcessor.MARK_STRING); + if (processor == null) { + return propertyTableEditor; + } + this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + FitProvider wbTpl = (FitProvider) designer.getTarget(); + ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); + ElementCaseEditor editor = this.toData(); + //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) + if (editor.getFitStateInPC() == 0) { + editor.setReportFitAttr(null); + } + ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr(); + PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); + + return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); } @Override From 74ce95640a9781b1c20cbb2b4c0ceb049a77ff07 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Sat, 29 Oct 2016 21:21:28 +0800 Subject: [PATCH 7/7] 1 1 --- .../src/com/fr/design/designer/creator/XElementCase.java | 3 +++ 1 file changed, 3 insertions(+) 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 f60ffaa0d..9f05e49fa 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -129,6 +129,9 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : editor.getReportFitAttr(); PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); + if (editor.getReportFitAttr() == null) { + editor.setReportFitInPc(processor.getFitStateInPC(fitAttr)); + } return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); }