Browse Source

REPORT-18422 图片控件插件问题 设计器部分漏提交

final/10.0
zack 5 years ago
parent
commit
cfeb76c4ee
  1. 26
      designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java

26
designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java

@ -1,21 +1,18 @@
package com.fr.design.report; package com.fr.design.report;
import com.fr.base.BaseUtils;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.ImgChooseWrapper;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.image.ImageFileChooser; import com.fr.design.style.background.image.ImageFileChooser;
import com.fr.design.style.background.image.ImagePreviewPane; import com.fr.design.style.background.image.ImagePreviewPane;
import com.fr.design.utils.ImageUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ImageWithSuffix;
import com.fr.report.cell.Elem; import com.fr.report.cell.Elem;
import com.fr.report.cell.cellattr.CellImage; import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.cell.painter.CellImagePainter; import com.fr.report.cell.painter.CellImagePainter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
@ -27,7 +24,6 @@ import java.awt.GridLayout;
import java.awt.Image; import java.awt.Image;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
/** /**
@ -44,8 +40,6 @@ public class SelectImagePane extends BasicPane {
private Style imageStyle = null; private Style imageStyle = null;
private Image previewImage = null;
private File imageFile; private File imageFile;
public SelectImagePane() { public SelectImagePane() {
@ -119,21 +113,8 @@ public class SelectImagePane extends BasicPane {
.showOpenDialog(SelectImagePane.this); .showOpenDialog(SelectImagePane.this);
if (returnVal != JFileChooser.CANCEL_OPTION) { if (returnVal != JFileChooser.CANCEL_OPTION) {
File selectedFile = imageFileChooser.getSelectedFile(); File selectedFile = imageFileChooser.getSelectedFile();
imageFile = selectedFile;
if (selectedFile != null && selectedFile.isFile()) { ImgChooseWrapper.getInstance(previewPane, imageFileChooser, imageStyle, null).dealWithImageFile(returnVal);
String filePath = selectedFile.getPath();
BufferedImage image = BaseUtils.readImage(filePath);
CoreGraphHelper.waitForImage(image);
imageFile = selectedFile;
setImageStyle();
previewPane.setImageWithSuffix(ImageWithSuffix.build(image, ImageUtils.getImageType(selectedFile)));
previewPane.setImageStyle(imageStyle);
previewImage = image;
} else {
previewPane.setImage(null);
}
previewPane.repaint();
} }
} }
}; };
@ -202,7 +183,6 @@ public class SelectImagePane extends BasicPane {
public void setImage(Image image) { public void setImage(Image image) {
previewPane.setImage(image); previewPane.setImage(image);
this.previewImage = image;
} }
public CellImage update() { public CellImage update() {

Loading…
Cancel
Save