From 7a848c91ddb6b3dafed7ddc00061b0308fbae1b5 Mon Sep 17 00:00:00 2001 From: zhouping Date: Thu, 23 Feb 2017 11:18:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-891=20=E8=A1=A8=E5=8D=95=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=97=B6=E5=8D=B3=E6=98=BE=E7=A4=BA=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/module/DesignerModule.java | 7 +++--- .../mainframe/form/ElementCaseThumbnail.java | 22 +++++++++++++++++++ .../design/designer/creator/XElementCase.java | 17 +++++--------- 3 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 designer_base/src/com/fr/design/mainframe/form/ElementCaseThumbnail.java diff --git a/designer/src/com/fr/design/module/DesignerModule.java b/designer/src/com/fr/design/module/DesignerModule.java index 9e0837ac0..91a327d37 100644 --- a/designer/src/com/fr/design/module/DesignerModule.java +++ b/designer/src/com/fr/design/module/DesignerModule.java @@ -19,10 +19,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.javascript.ProcessTransitionAdapter; import com.fr.design.mainframe.*; import com.fr.design.mainframe.bbs.BBSGuestPane; -import com.fr.design.mainframe.form.FormECCompositeProvider; -import com.fr.design.mainframe.form.FormECDesignerProvider; -import com.fr.design.mainframe.form.FormElementCaseDesigner; -import com.fr.design.mainframe.form.FormReportComponentComposite; +import com.fr.design.mainframe.form.*; import com.fr.design.mainframe.loghandler.DesignerLogImpl; import com.fr.design.parameter.WorkBookParameterReader; import com.fr.design.utils.gui.GUICoreUtils; @@ -46,6 +43,7 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; +import com.fr.stable.fun.ElementCaseThumbnailProcessor; import com.fr.stable.fun.LogProvider; import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.script.CalculatorProviderContext; @@ -100,6 +98,7 @@ public class DesignerModule extends DesignModule { ExtraDesignClassManager.getInstance().getFeedback().didFeedback(); ExtraClassManager.getInstance().addMutable(LogProvider.MARK_STRING, DesignerLogImpl.getInstance(), PluginSimplify.NULL); + ExtraClassManager.getInstance().setImmutable(ElementCaseThumbnailProcessor.MARK_STRING, new ElementCaseThumbnail(), PluginSimplify.NULL); } private void registerOtherPane() { diff --git a/designer_base/src/com/fr/design/mainframe/form/ElementCaseThumbnail.java b/designer_base/src/com/fr/design/mainframe/form/ElementCaseThumbnail.java new file mode 100644 index 000000000..a9aac72a8 --- /dev/null +++ b/designer_base/src/com/fr/design/mainframe/form/ElementCaseThumbnail.java @@ -0,0 +1,22 @@ +package com.fr.design.mainframe.form; + +import com.fr.general.xml.GeneralXMLTools; +import com.fr.stable.fun.impl.AbstractECThumbnailProcessor; +import com.fr.stable.xml.XMLableReader; + +import java.awt.*; + +/** + * 报表块缩略图处理 + * 从xml中读取缩略图 + * Created by zhouping on 2017/2/22. + */ +public class ElementCaseThumbnail extends AbstractECThumbnailProcessor { + public ElementCaseThumbnail(){ + } + + @Override + public Image readThumbnail(XMLableReader reader) { + return GeneralXMLTools.readImage(reader); + } +} 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 a932548cc..a0218481b 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -13,8 +13,6 @@ import com.fr.design.mainframe.*; import com.fr.design.mainframe.widget.editors.BooleanEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; -import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; -import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.FormProvider; @@ -176,7 +174,10 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme */ private UILabel initImageBackground(){ UILabel imageLable = new UILabel(); - BufferedImage image = getThumbnailImage(); + BufferedImage image = toData().getECImage(); + if (image == null) { + image = DEFAULT_BACKGROUND; + } setLabelBackground(image, imageLable); return imageLable; @@ -259,18 +260,10 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } public void setBackground(BufferedImage image){ - setThumbnailImage(image); + toData().setECImage(image); setEditorIcon(image); } - private void setThumbnailImage(BufferedImage image) { - this.thumbnailImage = image; - } - - private BufferedImage getThumbnailImage(){ - return thumbnailImage == null ? DEFAULT_BACKGROUND : thumbnailImage; - } - private void setEditorIcon(BufferedImage image){ setLabelBackground(image, imageLable); } From c604d42924f37ace7cde463b8c058c2647ff345c Mon Sep 17 00:00:00 2001 From: zhouping Date: Thu, 23 Feb 2017 15:12:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-891=20=E8=A1=A8=E5=8D=95=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=97=B6=E5=8D=B3=E6=98=BE=E7=A4=BA=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/design/module/DesignerModule.java | 7 ++++--- .../src/com/fr/design/designer/creator/XElementCase.java | 2 -- .../src/com/fr/design/mainframe}/ElementCaseThumbnail.java | 4 ++-- .../src/com/fr/design/module/FormDesignerModule.java | 7 +++++-- 4 files changed, 11 insertions(+), 9 deletions(-) rename {designer_base/src/com/fr/design/mainframe/form => designer_form/src/com/fr/design/mainframe}/ElementCaseThumbnail.java (82%) diff --git a/designer/src/com/fr/design/module/DesignerModule.java b/designer/src/com/fr/design/module/DesignerModule.java index 91a327d37..9e0837ac0 100644 --- a/designer/src/com/fr/design/module/DesignerModule.java +++ b/designer/src/com/fr/design/module/DesignerModule.java @@ -19,7 +19,10 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.javascript.ProcessTransitionAdapter; import com.fr.design.mainframe.*; import com.fr.design.mainframe.bbs.BBSGuestPane; -import com.fr.design.mainframe.form.*; +import com.fr.design.mainframe.form.FormECCompositeProvider; +import com.fr.design.mainframe.form.FormECDesignerProvider; +import com.fr.design.mainframe.form.FormElementCaseDesigner; +import com.fr.design.mainframe.form.FormReportComponentComposite; import com.fr.design.mainframe.loghandler.DesignerLogImpl; import com.fr.design.parameter.WorkBookParameterReader; import com.fr.design.utils.gui.GUICoreUtils; @@ -43,7 +46,6 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; -import com.fr.stable.fun.ElementCaseThumbnailProcessor; import com.fr.stable.fun.LogProvider; import com.fr.stable.plugin.PluginSimplify; import com.fr.stable.script.CalculatorProviderContext; @@ -98,7 +100,6 @@ public class DesignerModule extends DesignModule { ExtraDesignClassManager.getInstance().getFeedback().didFeedback(); ExtraClassManager.getInstance().addMutable(LogProvider.MARK_STRING, DesignerLogImpl.getInstance(), PluginSimplify.NULL); - ExtraClassManager.getInstance().setImmutable(ElementCaseThumbnailProcessor.MARK_STRING, new ElementCaseThumbnail(), PluginSimplify.NULL); } private void registerOtherPane() { 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 a0218481b..aba6e9e3a 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -37,8 +37,6 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme private UILabel imageLable; private CoverReportPane coverPanel; private FormDesigner designer; - //缩略图 - private BufferedImage thumbnailImage; private static BufferedImage DEFAULT_BACKGROUND; static{ diff --git a/designer_base/src/com/fr/design/mainframe/form/ElementCaseThumbnail.java b/designer_form/src/com/fr/design/mainframe/ElementCaseThumbnail.java similarity index 82% rename from designer_base/src/com/fr/design/mainframe/form/ElementCaseThumbnail.java rename to designer_form/src/com/fr/design/mainframe/ElementCaseThumbnail.java index a9aac72a8..2bd68cb23 100644 --- a/designer_base/src/com/fr/design/mainframe/form/ElementCaseThumbnail.java +++ b/designer_form/src/com/fr/design/mainframe/ElementCaseThumbnail.java @@ -1,7 +1,7 @@ -package com.fr.design.mainframe.form; +package com.fr.design.mainframe; +import com.fr.form.stable.fun.AbstractECThumbnailProcessor; import com.fr.general.xml.GeneralXMLTools; -import com.fr.stable.fun.impl.AbstractECThumbnailProcessor; import com.fr.stable.xml.XMLableReader; import java.awt.*; diff --git a/designer_form/src/com/fr/design/module/FormDesignerModule.java b/designer_form/src/com/fr/design/module/FormDesignerModule.java index d40ac75fb..1d5c1017a 100644 --- a/designer_form/src/com/fr/design/module/FormDesignerModule.java +++ b/designer_form/src/com/fr/design/module/FormDesignerModule.java @@ -1,7 +1,6 @@ package com.fr.design.module; import com.fr.base.FRContext; -import com.fr.general.ModuleContext; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.bridge.DesignToolbarProvider; @@ -10,12 +9,14 @@ import com.fr.design.mainframe.*; import com.fr.design.mainframe.actions.NewFormAction; import com.fr.design.parameter.FormParameterReader; import com.fr.design.parameter.ParameterPropertyPane; +import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane; import com.fr.file.FILE; import com.fr.form.main.Form; +import com.fr.form.stable.ElementCaseThumbnailProcessor; import com.fr.general.Inter; +import com.fr.general.ModuleContext; import com.fr.stable.Constants; import com.fr.stable.bridge.StableFactory; -import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane; import java.util.HashMap; @@ -40,6 +41,8 @@ public class FormDesignerModule extends DesignModule { DesignModuleFactory.registerParameterReader(new FormParameterReader()); registerData4Designer(); + + StableFactory.registerMarkedObject(ElementCaseThumbnailProcessor.MARK_STRING, new ElementCaseThumbnail()); } private void registerData4Designer(){