From 41a09a060ed5dc0e0a3a86cfc1d986fbcd6eb2ea Mon Sep 17 00:00:00 2001 From: zhouping Date: Thu, 13 Oct 2016 14:20:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-437=20=E8=A1=A8=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E7=BC=A9=E7=95=A5=E5=9B=BE,=20=E4=B8=8D?= =?UTF-8?q?=E5=AD=98xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XElementCase.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 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 474acfbb91..252ec35c78 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -1,5 +1,6 @@ package com.fr.design.designer.creator; +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; @@ -20,6 +21,7 @@ import com.fr.form.FormElementCaseProvider; import com.fr.form.ui.ElementCaseEditor; 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; @@ -35,6 +37,18 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme private UILabel imageLable; private JPanel coverPanel; private FormDesigner designer; + //缩略图 + private BufferedImage thumbnailImage; + private static BufferedImage DEFAULT_BACKGROUND; + + static{ + try{ + DEFAULT_BACKGROUND = BaseUtils.readImageWithCache("com/fr/base/images/report/elementcase.png"); + }catch (Throwable e) { + //IBM jdk 1.5.0_22 并发下读取图片有时会异常(EOFException), 这个图片反正只有设计器用到, 捕获住 + DEFAULT_BACKGROUND = CoreGraphHelper.createBufferedImage(0, 0); + } + } public XElementCase(ElementCaseEditor widget, Dimension initSize) { super(widget, initSize); @@ -145,7 +159,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme */ private UILabel initImageBackground(){ UILabel imageLable = new UILabel(); - BufferedImage image = toData().getECImage(); + BufferedImage image = getThumbnailImage(); setLabelBackground(image, imageLable); return imageLable; @@ -222,10 +236,18 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } public void setBackground(BufferedImage image){ - toData().setECImage(image); + setThumbnailImage(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 d8022b8ad31e20f655de9e60b144e5fba7e0b274 Mon Sep 17 00:00:00 2001 From: zhouping Date: Thu, 13 Oct 2016 15:29:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B8=83=E5=B1=80=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E9=80=A0=E6=88=90=E7=9A=84npe=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_form/src/com/fr/design/mainframe/ComponentTree.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_form/src/com/fr/design/mainframe/ComponentTree.java b/designer_form/src/com/fr/design/mainframe/ComponentTree.java index 4cf0d2528c..2b490e8bef 100644 --- a/designer_form/src/com/fr/design/mainframe/ComponentTree.java +++ b/designer_form/src/com/fr/design/mainframe/ComponentTree.java @@ -281,6 +281,7 @@ public class ComponentTree extends JTree { } //绝对布局作为body的时候不显示自适应布局父层 if (((XCreator) parent).acceptType(XWAbsoluteLayout.class) + && (parent.getParent() != null) && ((XCreator)parent.getParent()).acceptType(XWFitLayout.class) && ((XWAbsoluteLayout)parent).toData().isAbsoluteLayoutAsBody()){ parent = parent.getParent().getParent();