83 |
/** |
/** |
84 |
* A dialog to select one of the available languages. If only one language |
* A dialog to select one of the available languages. If only one language |
85 |
* is available, select it directly. Creating this object automatically |
* is available, select it directly. Creating this object automatically |
86 |
* makes it visible. |
* makes it visible, unless there is only one language to choose from.. it |
87 |
* |
* that case it disposes itself autmatically. |
|
* @param owner |
|
|
* @param atlasConfig |
|
88 |
*/ |
*/ |
89 |
public SwitchLanguageDialog(final Component owner, |
public SwitchLanguageDialog(final Component owner, |
90 |
final List<String> languages) { |
final List<String> languages) { |
96 |
if (languages.size() == 1) { |
if (languages.size() == 1) { |
97 |
LOGGER.debug("Only language '" + languages.get(0) |
LOGGER.debug("Only language '" + languages.get(0) |
98 |
+ "' is available. It has been selected automatically."); |
+ "' is available. It has been selected automatically."); |
99 |
|
// dispose(); |
100 |
|
setModal(false); |
101 |
return; |
return; |
102 |
} |
} |
103 |
|
|
111 |
*/ |
*/ |
112 |
private void initialize() { |
private void initialize() { |
113 |
this.setContentPane(getJContentPane()); |
this.setContentPane(getJContentPane()); |
|
setModal(true); |
|
|
SwingUtil.centerFrameOnScreenRandom(this); |
|
114 |
|
|
115 |
setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); |
setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); |
116 |
|
|
117 |
pack(); |
pack(); |
118 |
|
|
119 |
|
SwingUtil.centerFrameOnScreenRandom(this); |
120 |
|
setModal(true); |
121 |
|
setVisible(true); |
122 |
} |
} |
123 |
|
|
124 |
/** |
/** |
215 |
gridBagConstraints.gridy = 0; |
gridBagConstraints.gridy = 0; |
216 |
jLabel = new JLabel(); |
jLabel = new JLabel(); |
217 |
jLabel.setText("Select language: "); // i8n!?! Maybe replace with an |
jLabel.setText("Select language: "); // i8n!?! Maybe replace with an |
218 |
// icon of an index finger |
// icon of an index finger |
219 |
jPanel1 = new JPanel(); |
jPanel1 = new JPanel(); |
220 |
jPanel1.setLayout(new GridBagLayout()); |
jPanel1.setLayout(new GridBagLayout()); |
221 |
jPanel1.add(jLabel, gridBagConstraints); |
jPanel1.add(jLabel, gridBagConstraints); |
288 |
return jComboBox; |
return jComboBox; |
289 |
} |
} |
290 |
|
|
291 |
} |
} |