Browse Source

Merge pull request #729 in BA/design from ~ZHOUPING/design:9.0 to 9.0

* commit 'c604d42924f37ace7cde463b8c058c2647ff345c':
  REPORT-891 表单打开时即显示缩略图
  REPORT-891 表单打开时即显示缩略图
master
superman 8 years ago
parent
commit
a4c8a7efd3
  1. 19
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  2. 22
      designer_form/src/com/fr/design/mainframe/ElementCaseThumbnail.java
  3. 7
      designer_form/src/com/fr/design/module/FormDesignerModule.java

19
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;
@ -39,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{
@ -176,7 +172,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 +258,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);
}

22
designer_form/src/com/fr/design/mainframe/ElementCaseThumbnail.java

@ -0,0 +1,22 @@
package com.fr.design.mainframe;
import com.fr.form.stable.fun.AbstractECThumbnailProcessor;
import com.fr.general.xml.GeneralXMLTools;
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);
}
}

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

Loading…
Cancel
Save