From 3847e66b0ba581505ac1a823f749c94e2bc73b97 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 18 Sep 2018 17:27:55 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-11403=20@Sung=EF=BC=9A=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=87=BA=E6=9D=A5=E7=9A=84=E6=A8=AA=E5=90=91?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E4=BD=8D=E7=BD=AE=E5=81=8F=E4=B8=8A?= =?UTF-8?q?=E4=BA=86=20=E8=B0=83=E6=95=B4=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineDialog.java | 2 +- .../alphafine/preview/RobotPreviewPane.java | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index e8b7747049..5137d56f13 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -735,7 +735,7 @@ public class AlphaFineDialog extends UIDialog { if (!isCancelled() && rightSearchResultPane != null) { rightSearchResultPane.removeAll(); try { - rightSearchResultPane.add(new RobotPreviewPane((selectedValue).getName(), get())); + rightSearchResultPane.add(new RobotPreviewPane(selectedValue, get())); } catch (InterruptedException e) { FineLoggerFactory.getLogger().error("get hot item content error: " + e.getMessage()); } catch (ExecutionException e) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index 120d15f2b0..bd13d6aae8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -4,6 +4,8 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; +import com.fr.design.mainframe.alphafine.cell.model.RobotModel; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -28,13 +30,14 @@ import java.net.URL; */ public class RobotPreviewPane extends JPanel { - private static final int TITLE_AREA_HEIGHT = 30; + private static final int TITLE_AREA_HEIGHT = 15; + private static final int HOT_TITLE_AREA_HEIGHT = 30; - public RobotPreviewPane(String title, String content) { + public RobotPreviewPane(AlphaCellModel model, String content) { this.setLayout(new BorderLayout()); this.setBackground(Color.WHITE); this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT)); - UITextArea titleArea = new UITextArea(title); + UITextArea titleArea = new UITextArea(model.getName()); titleArea.setBorder(null); titleArea.setEditable(false); titleArea.setForeground(AlphaFineConstants.BLUE); @@ -74,9 +77,13 @@ public class RobotPreviewPane extends JPanel { }); editorPane.setEditable(false); UIScrollPane jScrollPane = new UIScrollPane(editorPane); - jScrollPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); + jScrollPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 30, 0)); jScrollPane.setBorder(BorderFactory.createMatteBorder(5, 10, 0, 10, Color.white)); - this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - TITLE_AREA_HEIGHT)); + if (((RobotModel) model).isHotItemModel()) { + this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - HOT_TITLE_AREA_HEIGHT)); + } else { + this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - TITLE_AREA_HEIGHT)); + } add(jScrollPane, BorderLayout.CENTER); } }