import javax.swing.JLabel; //导入方法依赖的package包/类
/**
* Initializes the GUI.
*/
private void initGUI() {
realOuterPanel = new JPanel(new BorderLayout());
outerLayer = new JLayer(realOuterPanel);
savingGlassPane = new TransparentGlassPanePanel(WAITING_ICON,
I18N.getGUILabel("configurable_dialog.saving_configurables"), getBackground(), 0.5f);
outerLayer.setGlassPane(savingGlassPane);
savingGlassPane.setVisible(false);
JPanel pagePanel = new JPanel(new BorderLayout());
// list of configurables
JPanel configPanel = createConfigPanel();
// force size so it does not resize itself depending on entered values
configPanel.setMinimumSize(CONFIG_LIST_SIZE);
configPanel.setMaximumSize(CONFIG_LIST_SIZE);
configPanel.setPreferredSize(CONFIG_LIST_SIZE);
buttonPanel = createConfigurableButtonPanel();
// create middle spacer
JLabel spacer = new JLabel();
spacer.setMinimumSize(DIMENSION_SPACER_MIDDLE);
spacer.setMaximumSize(DIMENSION_SPACER_MIDDLE);
spacer.setPreferredSize(DIMENSION_SPACER_MIDDLE);
// add both to an outer panel for layout reasons
JPanel outerConfigPanel = new JPanel(new BorderLayout());
outerConfigPanel.setBorder(BorderFactory.createMatteBorder(0, 1, 1, 1, Color.LIGHT_GRAY));
outerConfigPanel.add(configPanel, BorderLayout.CENTER);
outerConfigPanel.add(buttonPanel, BorderLayout.SOUTH);
// another panel for layouting
JPanel outermostConfigPanel = new JPanel(new BorderLayout());
outermostConfigPanel.add(outerConfigPanel, BorderLayout.CENTER);
outermostConfigPanel.add(spacer, BorderLayout.EAST);
// glass pane showed if the user is not able to edit connections due to an old version of
// the server
simpleGlassPane = new TransparentGlassPanePanel(null, null, getBackground(), 0.5f);
// panel displaying the selected configurable
JPanel paramPanel = createParameterPanel();
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.BOTH;
c.weightx = 1;
c.weighty = 0.3;
c.gridwidth = GridBagConstraints.REMAINDER;
// add panels to page panel
pagePanel.add(outermostConfigPanel, BorderLayout.WEST);
pagePanel.add(paramPanel, BorderLayout.CENTER);
// add page and button panel to outer panel
realOuterPanel.add(pagePanel, BorderLayout.CENTER);
layoutDefault(outerLayer, makeSaveButton(), makeCancel());
setDefaultSize(ButtonDialog.HUGE);
setLocationRelativeTo(ApplicationFrame.getApplicationFrame());
setModal(true);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
cancelButton.doClick();
}
});
updateButtonState(true);
}