Browse Source

REPORT-65369 设计器内对macOS12的处理-按钮图标设置-在点击 选择图片时回到了父弹窗界面,没有实时显示出来,而需要再次单机设计器界面

zheng-1641779399395
hades 3 years ago
parent
commit
d1321ea081
  1. 7
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

7
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -40,6 +40,7 @@ import java.awt.FlowLayout;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.Window;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -425,7 +426,7 @@ public class CustomIconPane extends BasicPane {
browseButton.addActionListener(new ActionListener() { browseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
onBrowseButtonClicked(); onBrowseButtonClicked(SwingUtilities.getWindowAncestor(EditIconDialog.this));
} }
}); });
@ -460,11 +461,11 @@ public class CustomIconPane extends BasicPane {
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
private void onBrowseButtonClicked() { private void onBrowseButtonClicked(Window parent) {
// carl:不知道是否只要png格式,反正导出时全部都转成png了 // carl:不知道是否只要png格式,反正导出时全部都转成png了
FileChooserProvider fileChooserProvider = FileChooserFactory.createFileChooser(FileChooserArgs.newBuilder(). FileChooserProvider fileChooserProvider = FileChooserFactory.createFileChooser(FileChooserArgs.newBuilder().
setFilter("Icon Image File", "*.jpg", "*.jpeg", "*.png", "*.gif").build()); setFilter("Icon Image File", "*.jpg", "*.jpeg", "*.png", "*.gif").build());
if (JFileChooser.APPROVE_OPTION == fileChooserProvider.showDialog(DesignerContext.getDesignerFrame())) { if (JFileChooser.APPROVE_OPTION == fileChooserProvider.showDialog(parent)) {
String path = fileChooserProvider.getSelectedFile().getAbsolutePath(); String path = fileChooserProvider.getSelectedFile().getAbsolutePath();
// 图片存储有最大值48*48限制,没有超过最大值时,按原图大小存储,超过最大值后,压缩至最大值存储 // 图片存储有最大值48*48限制,没有超过最大值时,按原图大小存储,超过最大值后,压缩至最大值存储
Image image = BaseUtils.readImage(path); Image image = BaseUtils.readImage(path);

Loading…
Cancel
Save