Browse Source

REPORT-891 表单打开时即显示缩略图

master
zhouping 8 years ago
parent
commit
7a848c91dd
  1. 7
      designer/src/com/fr/design/module/DesignerModule.java
  2. 22
      designer_base/src/com/fr/design/mainframe/form/ElementCaseThumbnail.java
  3. 17
      designer_form/src/com/fr/design/designer/creator/XElementCase.java

7
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() {

22
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);
}
}

17
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);
}

Loading…
Cancel
Save