|
|
@ -8,13 +8,22 @@ import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.*; |
|
|
|
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; |
|
|
|
|
|
|
|
import java.awt.Insets; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class WriteShortCutsPane extends JPanel{ |
|
|
|
public class WriteShortCutsPane extends JPanel{ |
|
|
|
|
|
|
|
private static final int V_GAP = 20; |
|
|
|
|
|
|
|
private static final int MAX_LABEL_WIDTH = 100; |
|
|
|
|
|
|
|
|
|
|
|
private String nextColString = "Tab"; |
|
|
|
private String nextColString = "Tab"; |
|
|
|
private String nextRowString = "Enter"; |
|
|
|
private String nextRowString = "Enter"; |
|
|
@ -24,9 +33,8 @@ public class WriteShortCutsPane extends JPanel{ |
|
|
|
private UILabel preRow; |
|
|
|
private UILabel preRow; |
|
|
|
|
|
|
|
|
|
|
|
public WriteShortCutsPane(){ |
|
|
|
public WriteShortCutsPane(){ |
|
|
|
this.setLayout(null); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.add(getFeatureNamePane()); |
|
|
|
this.add(createContentPane(), BorderLayout.NORTH); |
|
|
|
this.add(getHintsPane()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!ServerPreferenceConfig.getInstance().isWriteShortCuts()){ |
|
|
|
if(!ServerPreferenceConfig.getInstance().isWriteShortCuts()){ |
|
|
|
nextColString = "Enter"; |
|
|
|
nextColString = "Enter"; |
|
|
@ -35,63 +43,90 @@ public class WriteShortCutsPane extends JPanel{ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//todo:布局不要用绝对定位
|
|
|
|
private JPanel createContentPane() { |
|
|
|
public JPanel getFeatureNamePane(){ |
|
|
|
JPanel contentPane = new JPanel(); |
|
|
|
JPanel panel1 = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); |
|
|
|
panel1.setBounds(20, 20, 600, 140); |
|
|
|
|
|
|
|
panel1.setLayout(null); |
|
|
|
// 纵向布局,横向自适应
|
|
|
|
panel1.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Shortcut_Set"))); |
|
|
|
contentPane.setLayout(new GridBagLayout()); |
|
|
|
|
|
|
|
GridBagConstraints cons = new GridBagConstraints(); |
|
|
|
|
|
|
|
cons.fill = GridBagConstraints.HORIZONTAL; |
|
|
|
|
|
|
|
cons.weightx = 1; |
|
|
|
|
|
|
|
cons.gridx = 0; |
|
|
|
|
|
|
|
cons.insets = new Insets(20, 0, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentPane.add(getFeatureNamePane(), cons); |
|
|
|
|
|
|
|
contentPane.add(getHintsPane(), cons); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return contentPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 name = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Feature_Name"), SwingConstants.CENTER); |
|
|
|
name.setBounds(40, 30, 80, 50); |
|
|
|
|
|
|
|
UILabel nextCol = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Column"), SwingConstants.CENTER); |
|
|
|
UILabel nextCol = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Column"), SwingConstants.CENTER); |
|
|
|
nextCol.setBounds(140, 30, 180, 50); |
|
|
|
|
|
|
|
UILabel nextRow = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Row"), SwingConstants.CENTER); |
|
|
|
UILabel nextRow = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Row"), SwingConstants.CENTER); |
|
|
|
nextRow.setBounds(390, 30, 180, 50); |
|
|
|
|
|
|
|
UILabel shortName = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Current_Keys"), SwingConstants.CENTER); |
|
|
|
UILabel shortName = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Current_Keys"), SwingConstants.CENTER); |
|
|
|
shortName.setBounds(40, 80, 80, 50); |
|
|
|
shortName.setLineWrap(MAX_LABEL_WIDTH); |
|
|
|
nextColHK = new UILabel(nextColString, SwingConstants.CENTER); |
|
|
|
nextColHK = new UILabel(nextColString, SwingConstants.CENTER); |
|
|
|
nextColHK.setBounds(140, 80, 180, 50); |
|
|
|
JPanel switchBtnPane = getSwitchBtnPane(); |
|
|
|
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")); |
|
|
|
|
|
|
|
switchbt.setBounds(337, 90, 36, 29); |
|
|
|
|
|
|
|
nextRowHK = new UILabel(nextRowString, SwingConstants.CENTER); |
|
|
|
nextRowHK = new UILabel(nextRowString, SwingConstants.CENTER); |
|
|
|
nextRowHK.setBounds(390, 80, 180, 50); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panel1.add(name); |
|
|
|
JPanel centerPane = new JPanel(new GridLayout(2, 4, 0, 0)); |
|
|
|
panel1.add(nextCol); |
|
|
|
centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
|
|
panel1.add(nextRow); |
|
|
|
centerPane.add(name); |
|
|
|
panel1.add(shortName); |
|
|
|
centerPane.add(nextCol); |
|
|
|
panel1.add(nextColHK); |
|
|
|
centerPane.add(new JPanel()); |
|
|
|
panel1.add(switchbt); |
|
|
|
centerPane.add(nextRow); |
|
|
|
panel1.add(nextRowHK); |
|
|
|
centerPane.add(shortName); |
|
|
|
|
|
|
|
centerPane.add(nextColHK); |
|
|
|
|
|
|
|
centerPane.add(switchBtnPane); |
|
|
|
|
|
|
|
centerPane.add(nextRowHK); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
featureNamePane.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
return panel1; |
|
|
|
return featureNamePane; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public JPanel getHintsPane(){ |
|
|
|
private JPanel getSwitchBtnPane() { |
|
|
|
JPanel panel2 =FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
UIButton switchbt = new UIButton(BaseUtils.readIcon("com/fr/design/images/buttonicon/switchShortCuts.png")) { |
|
|
|
panel2.setBounds(20, 170, 600, 150); |
|
|
|
public Dimension getPreferredSize() { |
|
|
|
panel2.setLayout(null); |
|
|
|
return new Dimension(40, 30); |
|
|
|
panel2.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"))); |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
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 systemDefault = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_System_Default"), SwingConstants.CENTER); |
|
|
|
systemDefault.setBounds(38, 30, 84, 50); |
|
|
|
|
|
|
|
UILabel preColText = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Previous_Column"), SwingConstants.CENTER); |
|
|
|
UILabel preColText = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Previous_Column"), SwingConstants.CENTER); |
|
|
|
preColText.setBounds(140, 30, 190, 50); |
|
|
|
|
|
|
|
UILabel preRowText = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Previous_Row"), SwingConstants.CENTER); |
|
|
|
UILabel preRowText = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Previous_Row"), SwingConstants.CENTER); |
|
|
|
preRowText.setBounds(140, 80, 190, 50); |
|
|
|
|
|
|
|
preCol = new UILabel("Shift+" + nextColString, SwingConstants.CENTER); |
|
|
|
preCol = new UILabel("Shift+" + nextColString, SwingConstants.CENTER); |
|
|
|
preCol.setBounds(370, 30, 100, 50); |
|
|
|
|
|
|
|
preRow = new UILabel("Shift+" + nextRowString, SwingConstants.CENTER); |
|
|
|
preRow = new UILabel("Shift+" + nextRowString, SwingConstants.CENTER); |
|
|
|
preRow.setBounds(370, 80, 100, 50); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panel2.add(systemDefault); |
|
|
|
JPanel centerPane = new JPanel(new GridLayout(2, 3, 0, V_GAP)); |
|
|
|
panel2.add(preColText); |
|
|
|
centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 100)); |
|
|
|
panel2.add(preRowText); |
|
|
|
|
|
|
|
panel2.add(preCol); |
|
|
|
centerPane.add(systemDefault); |
|
|
|
panel2.add(preRow); |
|
|
|
centerPane.add(preColText); |
|
|
|
|
|
|
|
centerPane.add(preCol); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
centerPane.add(new JPanel()); |
|
|
|
|
|
|
|
centerPane.add(preRowText); |
|
|
|
|
|
|
|
centerPane.add(preRow); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hintsPane.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
return panel2; |
|
|
|
return hintsPane; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ActionListener getListener(){ |
|
|
|
public ActionListener getListener(){ |
|
|
|