From 1081d29cdc06ad1ba2a45facce8aa08bb9696790 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 14 Jun 2017 20:00:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/preview/FilePreviewPane.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java b/designer/src/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java index 50938d48a5..15b69aab27 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java +++ b/designer/src/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java @@ -1,22 +1,25 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.mainframe.alphafine.AlphaFineConstants; import javax.swing.*; import java.awt.*; +import java.awt.image.BufferedImage; /** * Created by XiaXiang on 2017/5/2. */ public class FilePreviewPane extends JPanel { - public FilePreviewPane(Image image) { + public FilePreviewPane(BufferedImage image) { + setLayout(new BorderLayout()); UILabel label = new UILabel(); - label.setOpaque(true); - label.setBackground(Color.white); - float scale = image.getWidth(null) / 380; - image = image.getScaledInstance(380, (int) (image.getHeight(null) / scale), Image.SCALE_SMOOTH); - label.setIcon(new ImageIcon(image)); + float widthScale = (AlphaFineConstants.RIGHT_WIDTH) / (float) image.getWidth(); + float heightScale = (AlphaFineConstants.CONTENT_HEIGHT) / (float) image.getHeight(); + Image showImage; + showImage = widthScale > heightScale? image.getScaledInstance((int) (image.getWidth() * heightScale), AlphaFineConstants.CONTENT_HEIGHT, Image.SCALE_SMOOTH) : image.getScaledInstance(AlphaFineConstants.RIGHT_WIDTH, (int) (image.getWidth() * widthScale), Image.SCALE_SMOOTH); + label.setIcon(new ImageIcon(showImage)); add(label); } } From 6f72fa5fdb82b488c1be52b33567e5b9ff71dfea Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 15 Jun 2017 09:38:02 +0800 Subject: [PATCH 2/2] bug fix --- .../design/actions/help/alphafine/AlphaFineConfigManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index 5df9691adb..a7d7f1d4b2 100644 --- a/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java +++ b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java @@ -149,7 +149,7 @@ public class AlphaFineConfigManager implements XMLable { * @return */ private String getDefaultShortCuts() { - return OperatingSystem.isMacOS()? "meta + F" : "ctrl + F"; + return OperatingSystem.isMacOS()? "meta + D" : "ctrl + D"; } public void setShortcuts(String shortcuts) {