From 36655594494ba82996959c2b16538c0b72f8ac98 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 8 Jan 2019 15:13:49 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-14057=2010.0=E6=97=A5=E6=96=87=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86=3D>?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E9=87=8D=E6=9E=84=EF=BC=9B=E9=97=AE=E9=A2=98?= =?UTF-8?q?14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/WriteShortCutsPane.java | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/WriteShortCutsPane.java b/designer-realize/src/main/java/com/fr/design/report/WriteShortCutsPane.java index c3105b211..fa1948e9d 100644 --- a/designer-realize/src/main/java/com/fr/design/report/WriteShortCutsPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/WriteShortCutsPane.java @@ -12,6 +12,7 @@ import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; +import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; @@ -21,8 +22,8 @@ import java.awt.event.ActionListener; public class WriteShortCutsPane extends JPanel{ - private static final int H_GAP = 60; private static final int V_GAP = 20; + private static final int MAX_LABEL_WIDTH = 100; private String nextColString = "Tab"; private String nextRowString = "Enter"; @@ -62,34 +63,49 @@ public class WriteShortCutsPane extends JPanel{ private JPanel getFeatureNamePane(){ JPanel featureNamePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Shortcut_Set")); + featureNamePane.setLayout(new BorderLayout()); UILabel name = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Feature_Name"), SwingConstants.CENTER); UILabel nextCol = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Column"), SwingConstants.CENTER); UILabel nextRow = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Row"), SwingConstants.CENTER); UILabel shortName = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Current_Keys"), SwingConstants.CENTER); + shortName.setLineWrap(MAX_LABEL_WIDTH); nextColHK = new UILabel(nextColString, SwingConstants.CENTER); - UIButton switchbt = new UIButton(BaseUtils.readIcon("com/fr/design/images/buttonicon/switchShortCuts.png")); - switchbt.addActionListener(getListener()); - switchbt.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Exchange_Key")); + JPanel switchBtnPane = getSwitchBtnPane(); nextRowHK = new UILabel(nextRowString, SwingConstants.CENTER); - JPanel centerPane = new JPanel(new GridLayout(2, 4, H_GAP, V_GAP)); + JPanel centerPane = new JPanel(new GridLayout(2, 4, 0, 0)); + centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); centerPane.add(name); centerPane.add(nextCol); centerPane.add(new JPanel()); centerPane.add(nextRow); centerPane.add(shortName); centerPane.add(nextColHK); - centerPane.add(switchbt); + centerPane.add(switchBtnPane); centerPane.add(nextRowHK); - featureNamePane.add(centerPane); + featureNamePane.add(centerPane, BorderLayout.CENTER); return featureNamePane; } - + + private JPanel getSwitchBtnPane() { + UIButton switchbt = new UIButton(BaseUtils.readIcon("com/fr/design/images/buttonicon/switchShortCuts.png")) { + public Dimension getPreferredSize() { + return new Dimension(40, 30); + } + }; + switchbt.addActionListener(getListener()); + switchbt.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Exchange_Key")); + JPanel switchBtnPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); + switchBtnPane.add(switchbt); + return switchBtnPane; + } + private JPanel getHintsPane(){ JPanel hintsPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")); + hintsPane.setLayout(new BorderLayout()); UILabel systemDefault = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_System_Default"), SwingConstants.CENTER); UILabel preColText = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Previous_Column"), SwingConstants.CENTER); @@ -97,7 +113,8 @@ public class WriteShortCutsPane extends JPanel{ preCol = new UILabel("Shift+" + nextColString, SwingConstants.CENTER); preRow = new UILabel("Shift+" + nextRowString, SwingConstants.CENTER); - JPanel centerPane = new JPanel(new GridLayout(2, 3, H_GAP, V_GAP)); + JPanel centerPane = new JPanel(new GridLayout(2, 3, 0, V_GAP)); + centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 100)); centerPane.add(systemDefault); centerPane.add(preColText); @@ -107,7 +124,7 @@ public class WriteShortCutsPane extends JPanel{ centerPane.add(preRowText); centerPane.add(preRow); - hintsPane.add(centerPane); + hintsPane.add(centerPane, BorderLayout.CENTER); return hintsPane; }