1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
package com.buckosoft.fibs.BuckoFIBS.gui; |
82 | |
|
83 | |
import java.awt.Color; |
84 | |
import java.awt.Dimension; |
85 | |
import java.awt.Font; |
86 | |
import java.awt.GridBagConstraints; |
87 | |
import java.awt.GridBagLayout; |
88 | |
import java.awt.Insets; |
89 | |
|
90 | |
import javax.swing.BorderFactory; |
91 | |
import javax.swing.ButtonGroup; |
92 | |
import javax.swing.JButton; |
93 | |
import javax.swing.JCheckBox; |
94 | |
import javax.swing.JDialog; |
95 | |
import javax.swing.JFrame; |
96 | |
import javax.swing.JLabel; |
97 | |
import javax.swing.JPanel; |
98 | |
import javax.swing.JRadioButton; |
99 | |
import javax.swing.border.BevelBorder; |
100 | |
|
101 | |
import com.buckosoft.fibs.BuckoFIBS.BFProperties; |
102 | |
import com.buckosoft.fibs.BuckoFIBS.CommandDispatcher; |
103 | |
import javax.swing.JTextField; |
104 | |
|
105 | |
|
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
|
111 | 0 | public class PreferencesDialog extends JDialog { |
112 | |
private static final long serialVersionUID = 1L; |
113 | |
|
114 | |
private CommandDispatcher commandDispatcher; |
115 | |
private BFProperties properties; |
116 | |
|
117 | 0 | private JPanel jContentPane = null; |
118 | 0 | private JButton jButtonOK = null; |
119 | 0 | private JButton jButtonCancel = null; |
120 | 0 | private JPanel jPanelOkCancel = null; |
121 | 0 | private JPanel jPanelPrefs = null; |
122 | 0 | private JLabel jLabelAutoConnect = null; |
123 | 0 | private JCheckBox jCheckBoxAutoConnectOnStartup = null; |
124 | 0 | private JLabel jLabelSettingsLabel = null; |
125 | 0 | private JLabel jLabelMultiplePersonalities = null; |
126 | 0 | private JCheckBox jCheckBoxAllowMultiplePersonalities = null; |
127 | 0 | private JLabel jLabel1 = null; |
128 | 0 | private JCheckBox jCheckBoxShowPointNumbers = null; |
129 | 0 | private JLabel jLabel = null; |
130 | 0 | private JCheckBox jCheckBoxHoverHelpers = null; |
131 | 0 | private JLabel jLabel2 = null; |
132 | 0 | private JCheckBox jCheckBoxAudioCues = null; |
133 | 0 | private JLabel jLabelAutoGreedyBearoff = null; |
134 | 0 | private JCheckBox jCheckBoxAutoGreedyBearoff = null; |
135 | 0 | private JPanel jPanelDice = null; |
136 | 0 | private JLabel jLabelDice = null; |
137 | 0 | private JLabel jLabelSwapDice = null; |
138 | 0 | private JCheckBox jCheckBoxHighDieLeft = null; |
139 | 0 | private JLabel jLabelRightClickSwapDice = null; |
140 | 0 | private JLabel jLabelRightClickPlaysRightDie = null; |
141 | 0 | private JRadioButton jRadioButtonRightClickPlaysRightDie = null; |
142 | 0 | private JRadioButton jRadioButtonRightClickSwapsDice = null; |
143 | 0 | private ButtonGroup rightDieButtonGroup = null; |
144 | 0 | private JPanel jPanelSpacer = null; |
145 | 0 | private JPanel jPanelSpacer1 = null; |
146 | 0 | private JLabel jLabelAnimateMoves = null; |
147 | 0 | private JCheckBox jCheckBoxAnimateMoves = null; |
148 | 0 | private JLabel jLabelAnimate = null; |
149 | 0 | private JLabel jLabelAnimateFlashing = null; |
150 | 0 | private JRadioButton jRadioButtonAnimateFlashing = null; |
151 | 0 | private JLabel jLabelAnimateSpline2D = null; |
152 | 0 | private JRadioButton jRadioButtonAnimateSpline2D = null; |
153 | 0 | private ButtonGroup animateTypeButtonGroup = null; |
154 | 0 | private JPanel jPanelAnimateSpeed = null; |
155 | 0 | private JLabel jLabelSecondsPerMove = null; |
156 | 0 | private JTextField jTextFieldSecondsPerMove = null; |
157 | 0 | private JLabel jLabelSwitchChatOnMessages = null; |
158 | 0 | private JCheckBox jCheckBoxSwitchTabOnNewChatMessage = null; |
159 | 0 | private JLabel jLabelDontSwitchOnShouts = null; |
160 | 0 | private JCheckBox jCheckBoxDontChangeTabOnNewShouts = null; |
161 | |
|
162 | |
|
163 | |
protected PreferencesDialog() { |
164 | 0 | super(); |
165 | 0 | initialize(); |
166 | 0 | } |
167 | |
|
168 | |
|
169 | |
|
170 | |
|
171 | |
|
172 | |
|
173 | |
public PreferencesDialog(JFrame owner, CommandDispatcher commandDispatcher) { |
174 | 0 | super(owner, true); |
175 | 0 | this.commandDispatcher = commandDispatcher; |
176 | 0 | this.properties = commandDispatcher.getProperties(); |
177 | 0 | initialize(); |
178 | 0 | this.setLocationRelativeTo(owner); |
179 | 0 | rightDieButtonGroup = new ButtonGroup(); |
180 | 0 | rightDieButtonGroup.add(jRadioButtonRightClickPlaysRightDie); |
181 | 0 | rightDieButtonGroup.add(jRadioButtonRightClickSwapsDice); |
182 | 0 | animateTypeButtonGroup = new ButtonGroup(); |
183 | 0 | animateTypeButtonGroup.add(jRadioButtonAnimateSpline2D); |
184 | 0 | animateTypeButtonGroup.add(jRadioButtonAnimateFlashing); |
185 | |
|
186 | |
|
187 | 0 | BFProperties props = this.commandDispatcher.getProperties(); |
188 | 0 | this.jCheckBoxAutoConnectOnStartup.getModel().setSelected(props.isAutoConnect()); |
189 | 0 | this.jCheckBoxShowPointNumbers.getModel().setSelected(props.isShowPointNumbers()); |
190 | 0 | this.jCheckBoxAllowMultiplePersonalities.getModel().setSelected(props.isAllowMultiplePersonalities()); |
191 | 0 | this.jCheckBoxHoverHelpers.getModel().setSelected(props.isHoverHelpers()); |
192 | 0 | this.jCheckBoxAudioCues.getModel().setSelected(props.isAudioCues()); |
193 | 0 | this.jCheckBoxAutoGreedyBearoff.getModel().setSelected(props.isAutoGreedyBearOff()); |
194 | 0 | this.jCheckBoxAnimateMoves.getModel().setSelected(props.isAnimateMoves()); |
195 | 0 | this.jCheckBoxHighDieLeft.getModel().setSelected(props.isHighDieLeft()); |
196 | 0 | this.jCheckBoxSwitchTabOnNewChatMessage.getModel().setSelected(props.isChangeTabOnNewMsg()); |
197 | 0 | this.jCheckBoxDontChangeTabOnNewShouts.getModel().setSelected(props.isDontChangeTabOnShout()); |
198 | 0 | this.rightDieStateChanged(props.getRightDieType()); |
199 | 0 | this.enableAnimationChanged(); |
200 | 0 | switch (props.getAnimateType()) { |
201 | |
case 0: |
202 | 0 | this.jRadioButtonAnimateFlashing.getModel().setSelected(true); |
203 | 0 | break; |
204 | |
case 1: |
205 | 0 | this.jRadioButtonAnimateSpline2D.getModel().setSelected(true); |
206 | |
break; |
207 | |
} |
208 | 0 | this.jTextFieldSecondsPerMove.setText(new Double(props.getAnimateSpeed()).toString()); |
209 | 0 | } |
210 | |
|
211 | |
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) { |
212 | 0 | setVisible(false); |
213 | 0 | this.properties.setAutoConnect(this.jCheckBoxAutoConnectOnStartup.getModel().isSelected()); |
214 | 0 | this.properties.setShowPointNumbers(this.jCheckBoxShowPointNumbers.getModel().isSelected()); |
215 | 0 | this.properties.setAllowMultiplePersonalities(this.jCheckBoxAllowMultiplePersonalities.getModel().isSelected()); |
216 | 0 | this.properties.setHoverHelpers(this.jCheckBoxHoverHelpers.getModel().isSelected()); |
217 | 0 | this.properties.setAudioCues(this.jCheckBoxAudioCues.getModel().isSelected()); |
218 | 0 | this.properties.setAutoGreedyBearOff(this.jCheckBoxAutoGreedyBearoff.getModel().isSelected()); |
219 | 0 | this.properties.setAnimateMoves(this.jCheckBoxAnimateMoves.getModel().isSelected()); |
220 | 0 | this.properties.setHighDieLeft(this.jCheckBoxHighDieLeft.getModel().isSelected()); |
221 | 0 | this.properties.setRightDieType(this.getRightDieState()); |
222 | 0 | this.properties.setAnimateMoves(this.jCheckBoxAnimateMoves.getModel().isSelected()); |
223 | 0 | this.properties.setChangeTabOnNewMsg(this.jCheckBoxSwitchTabOnNewChatMessage.getModel().isSelected()); |
224 | 0 | this.properties.setDontChangeTabOnShout(this.jCheckBoxDontChangeTabOnNewShouts.getModel().isSelected()); |
225 | 0 | int i = -1; |
226 | 0 | if (this.jRadioButtonAnimateFlashing.getModel().isSelected()) |
227 | 0 | i = 0; |
228 | 0 | if (this.jRadioButtonAnimateSpline2D.getModel().isSelected()) |
229 | 0 | i = 1; |
230 | 0 | this.properties.setAnimateType(i); |
231 | |
try { |
232 | 0 | this.properties.setAnimateSpeed(Double.parseDouble(this.jTextFieldSecondsPerMove.getText())); |
233 | 0 | } catch (NumberFormatException e) { |
234 | 0 | this.properties.setAnimateSpeed(1.0); |
235 | 0 | } |
236 | 0 | dispose(); |
237 | 0 | } |
238 | |
|
239 | |
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) { |
240 | 0 | setVisible(false); |
241 | 0 | dispose(); |
242 | 0 | } |
243 | |
|
244 | |
|
245 | |
|
246 | |
|
247 | |
|
248 | |
private void initialize() { |
249 | 0 | this.setSize(new Dimension(623, 300)); |
250 | 0 | this.setContentPane(getJContentPane()); |
251 | 0 | this.setTitle("Preferences"); |
252 | |
|
253 | 0 | } |
254 | |
|
255 | |
|
256 | |
|
257 | |
|
258 | |
|
259 | |
|
260 | |
private JPanel getJContentPane() { |
261 | 0 | if (jContentPane == null) { |
262 | 0 | jLabelDice = new JLabel(); |
263 | 0 | jLabelDice.setFont(new Font("Dialog", Font.BOLD, 14)); |
264 | 0 | jLabelDice.setText("Dice"); |
265 | 0 | jLabelDice.setForeground(new Color(102, 102, 0)); |
266 | 0 | GridBagConstraints gridBagConstraints13 = new GridBagConstraints(); |
267 | 0 | gridBagConstraints13.gridx = 1; |
268 | 0 | gridBagConstraints13.fill = GridBagConstraints.VERTICAL; |
269 | 0 | gridBagConstraints13.weighty = 0.3; |
270 | 0 | gridBagConstraints13.insets = new Insets(10, 10, 10, 0); |
271 | 0 | gridBagConstraints13.gridy = 0; |
272 | 0 | GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); |
273 | 0 | gridBagConstraints6.gridx = 0; |
274 | 0 | gridBagConstraints6.weighty = 0.3; |
275 | 0 | gridBagConstraints6.fill = GridBagConstraints.VERTICAL; |
276 | 0 | gridBagConstraints6.insets = new Insets(10, 0, 10, 0); |
277 | 0 | gridBagConstraints6.gridheight = 2; |
278 | 0 | gridBagConstraints6.gridy = 0; |
279 | 0 | GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); |
280 | 0 | gridBagConstraints2.gridx = 0; |
281 | 0 | gridBagConstraints2.anchor = GridBagConstraints.SOUTH; |
282 | 0 | gridBagConstraints2.weighty = 0.2; |
283 | 0 | gridBagConstraints2.gridwidth = 2; |
284 | 0 | gridBagConstraints2.insets = new Insets(0, 0, 5, 0); |
285 | 0 | gridBagConstraints2.gridy = 2; |
286 | 0 | jContentPane = new JPanel(); |
287 | 0 | jContentPane.setLayout(new GridBagLayout()); |
288 | 0 | jContentPane.add(getJPanelOkCancel(), gridBagConstraints2); |
289 | 0 | jContentPane.add(getJPanelPrefs(), gridBagConstraints6); |
290 | 0 | jContentPane.add(getJPanelDice(), gridBagConstraints13); |
291 | |
} |
292 | 0 | return jContentPane; |
293 | |
} |
294 | |
|
295 | |
|
296 | |
|
297 | |
|
298 | |
|
299 | |
|
300 | |
private JButton getJButtonOK() { |
301 | 0 | if (jButtonOK == null) { |
302 | 0 | jButtonOK = new JButton(); |
303 | 0 | jButtonOK.setText("OK"); |
304 | 0 | jButtonOK.addActionListener(new java.awt.event.ActionListener() { |
305 | |
public void actionPerformed(java.awt.event.ActionEvent e) { |
306 | 0 | okButtonActionPerformed(e); |
307 | 0 | } |
308 | |
}); |
309 | |
} |
310 | 0 | return jButtonOK; |
311 | |
} |
312 | |
|
313 | |
|
314 | |
|
315 | |
|
316 | |
|
317 | |
|
318 | |
private JButton getJButtonCancel() { |
319 | 0 | if (jButtonCancel == null) { |
320 | 0 | jButtonCancel = new JButton(); |
321 | 0 | jButtonCancel.setText("Cancel"); |
322 | 0 | jButtonCancel.addActionListener(new java.awt.event.ActionListener() { |
323 | |
public void actionPerformed(java.awt.event.ActionEvent e) { |
324 | 0 | cancelButtonActionPerformed(e); |
325 | 0 | } |
326 | |
}); |
327 | |
} |
328 | 0 | return jButtonCancel; |
329 | |
} |
330 | |
|
331 | |
|
332 | |
|
333 | |
|
334 | |
|
335 | |
|
336 | |
private JPanel getJPanelOkCancel() { |
337 | 0 | if (jPanelOkCancel == null) { |
338 | 0 | GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
339 | 0 | gridBagConstraints1.gridx = -1; |
340 | 0 | gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL; |
341 | 0 | gridBagConstraints1.insets = new Insets(0, 15, 0, 0); |
342 | 0 | gridBagConstraints1.gridy = -1; |
343 | 0 | GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
344 | 0 | gridBagConstraints.gridx = -1; |
345 | 0 | gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
346 | 0 | gridBagConstraints.anchor = GridBagConstraints.EAST; |
347 | 0 | gridBagConstraints.weightx = 0.1; |
348 | 0 | gridBagConstraints.insets = new Insets(0, 0, 0, 15); |
349 | 0 | gridBagConstraints.gridy = -1; |
350 | 0 | jPanelOkCancel = new JPanel(); |
351 | 0 | jPanelOkCancel.setLayout(new GridBagLayout()); |
352 | 0 | jPanelOkCancel.add(getJButtonOK(), gridBagConstraints); |
353 | 0 | jPanelOkCancel.add(getJButtonCancel(), gridBagConstraints1); |
354 | |
} |
355 | 0 | return jPanelOkCancel; |
356 | |
} |
357 | |
|
358 | |
|
359 | |
|
360 | |
|
361 | |
|
362 | |
|
363 | |
private JPanel getJPanelPrefs() { |
364 | 0 | if (jPanelPrefs == null) { |
365 | 0 | GridBagConstraints gridBagConstraints41 = new GridBagConstraints(); |
366 | 0 | gridBagConstraints41.gridx = 1; |
367 | 0 | gridBagConstraints41.gridy = 8; |
368 | 0 | GridBagConstraints gridBagConstraints40 = new GridBagConstraints(); |
369 | 0 | gridBagConstraints40.gridx = 0; |
370 | 0 | gridBagConstraints40.anchor = GridBagConstraints.WEST; |
371 | 0 | gridBagConstraints40.insets = new Insets(0, 15, 0, 0); |
372 | 0 | gridBagConstraints40.gridy = 8; |
373 | 0 | jLabelDontSwitchOnShouts = new JLabel(); |
374 | 0 | jLabelDontSwitchOnShouts.setText("Don't switch on new shouts:"); |
375 | 0 | GridBagConstraints gridBagConstraints39 = new GridBagConstraints(); |
376 | 0 | gridBagConstraints39.gridx = 1; |
377 | 0 | gridBagConstraints39.gridy = 7; |
378 | 0 | GridBagConstraints gridBagConstraints38 = new GridBagConstraints(); |
379 | 0 | gridBagConstraints38.gridx = 0; |
380 | 0 | gridBagConstraints38.anchor = GridBagConstraints.WEST; |
381 | 0 | gridBagConstraints38.gridy = 7; |
382 | 0 | jLabelSwitchChatOnMessages = new JLabel(); |
383 | 0 | jLabelSwitchChatOnMessages.setText("Switch tabs on new chat messages:"); |
384 | 0 | jLabelAnimateMoves = new JLabel(); |
385 | 0 | jLabelAnimateMoves.setText("Enable Checker Animation"); |
386 | 0 | GridBagConstraints gridBagConstraints27 = new GridBagConstraints(); |
387 | 0 | gridBagConstraints27.gridx = 0; |
388 | 0 | gridBagConstraints27.fill = GridBagConstraints.VERTICAL; |
389 | 0 | gridBagConstraints27.weighty = 0.1; |
390 | 0 | gridBagConstraints27.gridy = 9; |
391 | 0 | GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); |
392 | 0 | gridBagConstraints9.gridx = 1; |
393 | 0 | gridBagConstraints9.gridy = 6; |
394 | 0 | GridBagConstraints gridBagConstraints8 = new GridBagConstraints(); |
395 | 0 | gridBagConstraints8.gridx = 0; |
396 | 0 | gridBagConstraints8.gridy = 6; |
397 | 0 | jLabelAutoGreedyBearoff = new JLabel(); |
398 | 0 | jLabelAutoGreedyBearoff.setText("Turn on Greedy Bear off when game is a race:"); |
399 | 0 | GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); |
400 | 0 | gridBagConstraints7.gridx = 1; |
401 | 0 | gridBagConstraints7.gridy = 2; |
402 | 0 | GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); |
403 | 0 | gridBagConstraints5.gridx = 0; |
404 | 0 | gridBagConstraints5.anchor = GridBagConstraints.WEST; |
405 | 0 | gridBagConstraints5.gridy = 2; |
406 | 0 | jLabel2 = new JLabel(); |
407 | 0 | jLabel2.setText("Make Noise:"); |
408 | 0 | GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); |
409 | 0 | gridBagConstraints4.gridx = 1; |
410 | 0 | gridBagConstraints4.gridy = 5; |
411 | 0 | GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); |
412 | 0 | gridBagConstraints3.gridx = 0; |
413 | 0 | gridBagConstraints3.anchor = GridBagConstraints.WEST; |
414 | 0 | gridBagConstraints3.gridy = 5; |
415 | 0 | jLabel = new JLabel(); |
416 | 0 | jLabel.setText("Hover Helpers on the board:"); |
417 | 0 | GridBagConstraints gridBagConstraints22 = new GridBagConstraints(); |
418 | 0 | gridBagConstraints22.gridx = 1; |
419 | 0 | gridBagConstraints22.gridy = 4; |
420 | 0 | GridBagConstraints gridBagConstraints21 = new GridBagConstraints(); |
421 | 0 | gridBagConstraints21.gridx = 0; |
422 | 0 | gridBagConstraints21.anchor = GridBagConstraints.WEST; |
423 | 0 | gridBagConstraints21.insets = new Insets(0, 0, 0, 8); |
424 | 0 | gridBagConstraints21.gridy = 4; |
425 | 0 | jLabel1 = new JLabel(); |
426 | 0 | jLabel1.setText("Show Numbers on the points:"); |
427 | 0 | GridBagConstraints gridBagConstraints18 = new GridBagConstraints(); |
428 | 0 | gridBagConstraints18.gridx = 1; |
429 | 0 | gridBagConstraints18.gridy = 3; |
430 | 0 | GridBagConstraints gridBagConstraints17 = new GridBagConstraints(); |
431 | 0 | gridBagConstraints17.gridx = 0; |
432 | 0 | gridBagConstraints17.anchor = GridBagConstraints.WEST; |
433 | 0 | gridBagConstraints17.gridy = 3; |
434 | 0 | jLabelMultiplePersonalities = new JLabel(); |
435 | 0 | jLabelMultiplePersonalities.setText("Allow Multiple Personalities:"); |
436 | 0 | GridBagConstraints gridBagConstraints12 = new GridBagConstraints(); |
437 | 0 | gridBagConstraints12.gridy = 1; |
438 | 0 | GridBagConstraints gridBagConstraints11 = new GridBagConstraints(); |
439 | 0 | gridBagConstraints11.gridx = 0; |
440 | 0 | gridBagConstraints11.anchor = GridBagConstraints.NORTHWEST; |
441 | 0 | gridBagConstraints11.gridy = 0; |
442 | 0 | jLabelSettingsLabel = new JLabel(); |
443 | 0 | jLabelSettingsLabel.setText("Settings:"); |
444 | 0 | jLabelSettingsLabel.setForeground(new Color(102, 102, 0)); |
445 | 0 | jLabelSettingsLabel.setFont(new Font("Dialog", Font.BOLD, 14)); |
446 | 0 | GridBagConstraints gridBagConstraints10 = new GridBagConstraints(); |
447 | 0 | gridBagConstraints10.anchor = GridBagConstraints.WEST; |
448 | 0 | gridBagConstraints10.gridy = 1; |
449 | 0 | gridBagConstraints10.weightx = 0.2; |
450 | 0 | jLabelAutoConnect = new JLabel(); |
451 | 0 | jLabelAutoConnect.setText("Auto Connect on Startup:"); |
452 | 0 | jPanelPrefs = new JPanel(); |
453 | 0 | jPanelPrefs.setLayout(new GridBagLayout()); |
454 | 0 | jPanelPrefs.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); |
455 | 0 | jPanelPrefs.add(jLabelAutoConnect, gridBagConstraints10); |
456 | 0 | jPanelPrefs.add(getJCheckBoxAutoConnectOnStartup(), gridBagConstraints12); |
457 | 0 | jPanelPrefs.add(jLabelSettingsLabel, gridBagConstraints11); |
458 | 0 | jPanelPrefs.add(jLabelMultiplePersonalities, gridBagConstraints17); |
459 | 0 | jPanelPrefs.add(getJCheckBoxAllowMultiplePersonalities(), gridBagConstraints18); |
460 | 0 | jPanelPrefs.add(jLabel1, gridBagConstraints21); |
461 | 0 | jPanelPrefs.add(getJCheckBoxShowPointNumbers(), gridBagConstraints22); |
462 | 0 | jPanelPrefs.add(jLabel, gridBagConstraints3); |
463 | 0 | jPanelPrefs.add(getJCheckBoxHoverHelpers(), gridBagConstraints4); |
464 | 0 | jPanelPrefs.add(jLabel2, gridBagConstraints5); |
465 | 0 | jPanelPrefs.add(getJCheckBoxAudioCues(), gridBagConstraints7); |
466 | 0 | jPanelPrefs.add(jLabelAutoGreedyBearoff, gridBagConstraints8); |
467 | 0 | jPanelPrefs.add(getJCheckBoxAutoGreedyBearoff(), gridBagConstraints9); |
468 | 0 | jPanelPrefs.add(getJPanelSpacer1(), gridBagConstraints27); |
469 | 0 | jPanelPrefs.add(jLabelSwitchChatOnMessages, gridBagConstraints38); |
470 | 0 | jPanelPrefs.add(getJCheckBoxSwitchTabOnNewChatMessage(), gridBagConstraints39); |
471 | 0 | jPanelPrefs.add(jLabelDontSwitchOnShouts, gridBagConstraints40); |
472 | 0 | jPanelPrefs.add(getJCheckBoxDontChangeTabOnNewShouts(), gridBagConstraints41); |
473 | |
} |
474 | 0 | return jPanelPrefs; |
475 | |
} |
476 | |
|
477 | |
|
478 | |
|
479 | |
|
480 | |
|
481 | |
|
482 | |
private JCheckBox getJCheckBoxAutoConnectOnStartup() { |
483 | 0 | if (jCheckBoxAutoConnectOnStartup == null) { |
484 | 0 | jCheckBoxAutoConnectOnStartup = new JCheckBox(); |
485 | |
} |
486 | 0 | return jCheckBoxAutoConnectOnStartup; |
487 | |
} |
488 | |
|
489 | |
|
490 | |
|
491 | |
|
492 | |
|
493 | |
|
494 | |
private JCheckBox getJCheckBoxAllowMultiplePersonalities() { |
495 | 0 | if (jCheckBoxAllowMultiplePersonalities == null) { |
496 | 0 | jCheckBoxAllowMultiplePersonalities = new JCheckBox(); |
497 | |
} |
498 | 0 | return jCheckBoxAllowMultiplePersonalities; |
499 | |
} |
500 | |
|
501 | |
|
502 | |
|
503 | |
|
504 | |
|
505 | |
|
506 | |
private JCheckBox getJCheckBoxShowPointNumbers() { |
507 | 0 | if (jCheckBoxShowPointNumbers == null) { |
508 | 0 | jCheckBoxShowPointNumbers = new JCheckBox(); |
509 | |
} |
510 | 0 | return jCheckBoxShowPointNumbers; |
511 | |
} |
512 | |
|
513 | |
|
514 | |
|
515 | |
|
516 | |
|
517 | |
|
518 | |
private JCheckBox getJCheckBoxHoverHelpers() { |
519 | 0 | if (jCheckBoxHoverHelpers == null) { |
520 | 0 | jCheckBoxHoverHelpers = new JCheckBox(); |
521 | |
} |
522 | 0 | return jCheckBoxHoverHelpers; |
523 | |
} |
524 | |
|
525 | |
|
526 | |
|
527 | |
|
528 | |
|
529 | |
|
530 | |
private JCheckBox getJCheckBoxAudioCues() { |
531 | 0 | if (jCheckBoxAudioCues == null) { |
532 | 0 | jCheckBoxAudioCues = new JCheckBox(); |
533 | |
} |
534 | 0 | return jCheckBoxAudioCues; |
535 | |
} |
536 | |
|
537 | |
|
538 | |
|
539 | |
|
540 | |
|
541 | |
|
542 | |
private JCheckBox getJCheckBoxAutoGreedyBearoff() { |
543 | 0 | if (jCheckBoxAutoGreedyBearoff == null) { |
544 | 0 | jCheckBoxAutoGreedyBearoff = new JCheckBox(); |
545 | |
} |
546 | 0 | return jCheckBoxAutoGreedyBearoff; |
547 | |
} |
548 | |
|
549 | |
|
550 | |
|
551 | |
|
552 | |
|
553 | |
|
554 | |
private JPanel getJPanelDice() { |
555 | 0 | if (jPanelDice == null) { |
556 | 0 | GridBagConstraints gridBagConstraints35 = new GridBagConstraints(); |
557 | 0 | gridBagConstraints35.gridx = 0; |
558 | 0 | gridBagConstraints35.fill = GridBagConstraints.HORIZONTAL; |
559 | 0 | gridBagConstraints35.gridwidth = 2; |
560 | 0 | gridBagConstraints35.anchor = GridBagConstraints.WEST; |
561 | 0 | gridBagConstraints35.gridy = 8; |
562 | 0 | GridBagConstraints gridBagConstraints34 = new GridBagConstraints(); |
563 | 0 | gridBagConstraints34.gridx = 1; |
564 | 0 | gridBagConstraints34.gridy = 7; |
565 | 0 | GridBagConstraints gridBagConstraints33 = new GridBagConstraints(); |
566 | 0 | gridBagConstraints33.gridx = 0; |
567 | 0 | gridBagConstraints33.anchor = GridBagConstraints.WEST; |
568 | 0 | gridBagConstraints33.fill = GridBagConstraints.HORIZONTAL; |
569 | 0 | gridBagConstraints33.insets = new Insets(0, 10, 0, 0); |
570 | 0 | gridBagConstraints33.gridy = 7; |
571 | 0 | jLabelAnimateSpline2D = new JLabel(); |
572 | 0 | jLabelAnimateSpline2D.setText("Spline2D"); |
573 | 0 | GridBagConstraints gridBagConstraints32 = new GridBagConstraints(); |
574 | 0 | gridBagConstraints32.gridx = 1; |
575 | 0 | gridBagConstraints32.gridy = 6; |
576 | 0 | GridBagConstraints gridBagConstraints31 = new GridBagConstraints(); |
577 | 0 | gridBagConstraints31.gridx = 0; |
578 | 0 | gridBagConstraints31.anchor = GridBagConstraints.WEST; |
579 | 0 | gridBagConstraints31.fill = GridBagConstraints.HORIZONTAL; |
580 | 0 | gridBagConstraints31.insets = new Insets(0, 10, 0, 0); |
581 | 0 | gridBagConstraints31.gridy = 6; |
582 | 0 | jLabelAnimateFlashing = new JLabel(); |
583 | 0 | jLabelAnimateFlashing.setText("Flashing:"); |
584 | 0 | GridBagConstraints gridBagConstraints29 = new GridBagConstraints(); |
585 | 0 | gridBagConstraints29.gridx = 1; |
586 | 0 | gridBagConstraints29.gridy = 5; |
587 | 0 | GridBagConstraints gridBagConstraints28 = new GridBagConstraints(); |
588 | 0 | gridBagConstraints28.anchor = GridBagConstraints.WEST; |
589 | 0 | gridBagConstraints28.gridx = 0; |
590 | 0 | gridBagConstraints28.gridy = 5; |
591 | 0 | gridBagConstraints28.fill = GridBagConstraints.NONE; |
592 | 0 | GridBagConstraints gridBagConstraints30 = new GridBagConstraints(); |
593 | 0 | gridBagConstraints30.gridx = 0; |
594 | 0 | gridBagConstraints30.anchor = GridBagConstraints.WEST; |
595 | 0 | gridBagConstraints30.insets = new Insets(3, 0, 0, 0); |
596 | 0 | gridBagConstraints30.gridy = 4; |
597 | 0 | jLabelAnimate = new JLabel(); |
598 | 0 | jLabelAnimate.setText("Animation:"); |
599 | 0 | jLabelAnimate.setForeground(new Color(102, 102, 0)); |
600 | 0 | jLabelAnimate.setFont(new Font("Dialog", Font.BOLD, 14)); |
601 | 0 | GridBagConstraints gridBagConstraints26 = new GridBagConstraints(); |
602 | 0 | gridBagConstraints26.gridx = 0; |
603 | 0 | gridBagConstraints26.fill = GridBagConstraints.VERTICAL; |
604 | 0 | gridBagConstraints26.weighty = 0.1; |
605 | 0 | gridBagConstraints26.gridy = 9; |
606 | 0 | GridBagConstraints gridBagConstraints25 = new GridBagConstraints(); |
607 | 0 | gridBagConstraints25.gridx = 1; |
608 | 0 | gridBagConstraints25.gridy = 3; |
609 | 0 | GridBagConstraints gridBagConstraints24 = new GridBagConstraints(); |
610 | 0 | gridBagConstraints24.gridx = 1; |
611 | 0 | gridBagConstraints24.gridy = 2; |
612 | 0 | GridBagConstraints gridBagConstraints23 = new GridBagConstraints(); |
613 | 0 | gridBagConstraints23.gridx = 0; |
614 | 0 | gridBagConstraints23.anchor = GridBagConstraints.WEST; |
615 | 0 | gridBagConstraints23.fill = GridBagConstraints.HORIZONTAL; |
616 | 0 | gridBagConstraints23.gridy = 2; |
617 | 0 | jLabelRightClickPlaysRightDie = new JLabel(); |
618 | 0 | jLabelRightClickPlaysRightDie.setText("Right click plays right die:"); |
619 | 0 | GridBagConstraints gridBagConstraints20 = new GridBagConstraints(); |
620 | 0 | gridBagConstraints20.gridx = 0; |
621 | 0 | gridBagConstraints20.anchor = GridBagConstraints.WEST; |
622 | 0 | gridBagConstraints20.fill = GridBagConstraints.HORIZONTAL; |
623 | 0 | gridBagConstraints20.gridy = 3; |
624 | 0 | jLabelRightClickSwapDice = new JLabel(); |
625 | 0 | jLabelRightClickSwapDice.setText("Right click swaps dice:"); |
626 | 0 | GridBagConstraints gridBagConstraints19 = new GridBagConstraints(); |
627 | 0 | gridBagConstraints19.gridx = 1; |
628 | 0 | gridBagConstraints19.gridy = 1; |
629 | 0 | GridBagConstraints gridBagConstraints16 = new GridBagConstraints(); |
630 | 0 | gridBagConstraints16.gridx = 0; |
631 | 0 | gridBagConstraints16.weighty = 0.0; |
632 | 0 | gridBagConstraints16.anchor = GridBagConstraints.WEST; |
633 | 0 | gridBagConstraints16.fill = GridBagConstraints.HORIZONTAL; |
634 | 0 | gridBagConstraints16.gridy = 1; |
635 | 0 | jLabelSwapDice = new JLabel(); |
636 | 0 | jLabelSwapDice.setText("Put the high die on the left:"); |
637 | 0 | jLabelSwapDice.setToolTipText("Always "); |
638 | 0 | GridBagConstraints gridBagConstraints15 = new GridBagConstraints(); |
639 | 0 | gridBagConstraints15.insets = new Insets(0, 0, 0, 0); |
640 | 0 | gridBagConstraints15.gridy = 0; |
641 | 0 | gridBagConstraints15.anchor = GridBagConstraints.NORTHWEST; |
642 | 0 | gridBagConstraints15.weighty = 0.0; |
643 | 0 | gridBagConstraints15.gridx = 0; |
644 | 0 | GridBagConstraints gridBagConstraints14 = new GridBagConstraints(); |
645 | 0 | gridBagConstraints14.gridx = -1; |
646 | 0 | gridBagConstraints14.anchor = GridBagConstraints.NORTHWEST; |
647 | 0 | gridBagConstraints14.gridy = -1; |
648 | 0 | jPanelDice = new JPanel(); |
649 | 0 | jPanelDice.setLayout(new GridBagLayout()); |
650 | 0 | jPanelDice.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); |
651 | 0 | jPanelDice.add(jLabelDice, gridBagConstraints15); |
652 | 0 | jPanelDice.add(jLabelSwapDice, gridBagConstraints16); |
653 | 0 | jPanelDice.add(getJCheckBoxHighDieLeft(), gridBagConstraints19); |
654 | 0 | jPanelDice.add(jLabelRightClickSwapDice, gridBagConstraints20); |
655 | 0 | jPanelDice.add(jLabelRightClickPlaysRightDie, gridBagConstraints23); |
656 | 0 | jPanelDice.add(getJRadioButtonRightClickPlaysRightDie(), gridBagConstraints24); |
657 | 0 | jPanelDice.add(getJRadioButtonRightClickSwapsDice(), gridBagConstraints25); |
658 | 0 | jPanelDice.add(getJPanelSpacer(), gridBagConstraints26); |
659 | 0 | jPanelDice.add(jLabelAnimate, gridBagConstraints30); |
660 | 0 | jPanelDice.add(jLabelAnimateMoves, gridBagConstraints28); |
661 | 0 | jPanelDice.add(getJCheckBoxAnimateMoves(), gridBagConstraints29); |
662 | 0 | jPanelDice.add(jLabelAnimateFlashing, gridBagConstraints31); |
663 | 0 | jPanelDice.add(getJRadioButtonAnimateFlashing(), gridBagConstraints32); |
664 | 0 | jPanelDice.add(jLabelAnimateSpline2D, gridBagConstraints33); |
665 | 0 | jPanelDice.add(getJRadioButtonAnimateSpline2D(), gridBagConstraints34); |
666 | 0 | jPanelDice.add(getJPanelAnimateSpeed(), gridBagConstraints35); |
667 | |
} |
668 | 0 | return jPanelDice; |
669 | |
} |
670 | |
|
671 | |
|
672 | |
|
673 | |
|
674 | |
|
675 | |
|
676 | |
private JCheckBox getJCheckBoxHighDieLeft() { |
677 | 0 | if (jCheckBoxHighDieLeft == null) { |
678 | 0 | jCheckBoxHighDieLeft = new JCheckBox(); |
679 | |
} |
680 | 0 | return jCheckBoxHighDieLeft; |
681 | |
} |
682 | |
|
683 | |
|
684 | |
|
685 | |
|
686 | |
|
687 | |
|
688 | |
private JRadioButton getJRadioButtonRightClickPlaysRightDie() { |
689 | 0 | if (jRadioButtonRightClickPlaysRightDie == null) { |
690 | 0 | jRadioButtonRightClickPlaysRightDie = new JRadioButton(); |
691 | |
} |
692 | 0 | return jRadioButtonRightClickPlaysRightDie; |
693 | |
} |
694 | |
|
695 | |
|
696 | |
|
697 | |
|
698 | |
|
699 | |
|
700 | |
private JRadioButton getJRadioButtonRightClickSwapsDice() { |
701 | 0 | if (jRadioButtonRightClickSwapsDice == null) { |
702 | 0 | jRadioButtonRightClickSwapsDice = new JRadioButton(); |
703 | |
} |
704 | 0 | return jRadioButtonRightClickSwapsDice; |
705 | |
} |
706 | |
|
707 | |
private void rightDieStateChanged(int rightDieType) { |
708 | 0 | if (rightDieType == BFProperties.RIGHT_DIE_SWAPS) |
709 | 0 | jRadioButtonRightClickSwapsDice.setSelected(true); |
710 | |
else |
711 | 0 | jRadioButtonRightClickPlaysRightDie.setSelected(true); |
712 | 0 | } |
713 | |
|
714 | |
private int getRightDieState() { |
715 | 0 | if (jRadioButtonRightClickPlaysRightDie.isSelected()) |
716 | 0 | return(BFProperties.RIGHT_DIE_PLAYS); |
717 | |
else |
718 | 0 | return(BFProperties.RIGHT_DIE_SWAPS); |
719 | |
} |
720 | |
|
721 | |
|
722 | |
|
723 | |
|
724 | |
|
725 | |
|
726 | |
private JPanel getJPanelSpacer() { |
727 | 0 | if (jPanelSpacer == null) { |
728 | 0 | jPanelSpacer = new JPanel(); |
729 | 0 | jPanelSpacer.setLayout(new GridBagLayout()); |
730 | |
} |
731 | 0 | return jPanelSpacer; |
732 | |
} |
733 | |
|
734 | |
|
735 | |
|
736 | |
|
737 | |
|
738 | |
|
739 | |
private JPanel getJPanelSpacer1() { |
740 | 0 | if (jPanelSpacer1 == null) { |
741 | 0 | jPanelSpacer1 = new JPanel(); |
742 | 0 | jPanelSpacer1.setLayout(new GridBagLayout()); |
743 | |
} |
744 | 0 | return jPanelSpacer1; |
745 | |
} |
746 | |
|
747 | |
|
748 | |
|
749 | |
|
750 | |
|
751 | |
|
752 | |
private JCheckBox getJCheckBoxAnimateMoves() { |
753 | 0 | if (jCheckBoxAnimateMoves == null) { |
754 | 0 | jCheckBoxAnimateMoves = new JCheckBox(); |
755 | 0 | jCheckBoxAnimateMoves.addItemListener(new java.awt.event.ItemListener() { |
756 | |
public void itemStateChanged(java.awt.event.ItemEvent e) { |
757 | 0 | enableAnimationChanged(); |
758 | 0 | } |
759 | |
}); |
760 | |
} |
761 | 0 | return jCheckBoxAnimateMoves; |
762 | |
} |
763 | |
|
764 | |
private void enableAnimationChanged() { |
765 | 0 | boolean b = jCheckBoxAnimateMoves.getModel().isSelected(); |
766 | 0 | this.jLabelAnimateFlashing.setEnabled(b); |
767 | 0 | this.jRadioButtonAnimateFlashing.setEnabled(b); |
768 | 0 | this.jLabelAnimateSpline2D.setEnabled(b); |
769 | 0 | this.jRadioButtonAnimateSpline2D.setEnabled(b); |
770 | 0 | this.jLabelSecondsPerMove.setEnabled(b); |
771 | 0 | this.jTextFieldSecondsPerMove.setEnabled(b); |
772 | 0 | } |
773 | |
|
774 | |
|
775 | |
|
776 | |
|
777 | |
|
778 | |
private JRadioButton getJRadioButtonAnimateFlashing() { |
779 | 0 | if (jRadioButtonAnimateFlashing == null) { |
780 | 0 | jRadioButtonAnimateFlashing = new JRadioButton(); |
781 | |
} |
782 | 0 | return jRadioButtonAnimateFlashing; |
783 | |
} |
784 | |
|
785 | |
|
786 | |
|
787 | |
|
788 | |
|
789 | |
|
790 | |
private JRadioButton getJRadioButtonAnimateSpline2D() { |
791 | 0 | if (jRadioButtonAnimateSpline2D == null) { |
792 | 0 | jRadioButtonAnimateSpline2D = new JRadioButton(); |
793 | |
} |
794 | 0 | return jRadioButtonAnimateSpline2D; |
795 | |
} |
796 | |
|
797 | |
|
798 | |
|
799 | |
|
800 | |
|
801 | |
|
802 | |
private JPanel getJPanelAnimateSpeed() { |
803 | 0 | if (jPanelAnimateSpeed == null) { |
804 | 0 | GridBagConstraints gridBagConstraints37 = new GridBagConstraints(); |
805 | 0 | gridBagConstraints37.fill = GridBagConstraints.BOTH; |
806 | 0 | gridBagConstraints37.gridy = 0; |
807 | 0 | gridBagConstraints37.weightx = 1.0; |
808 | 0 | gridBagConstraints37.gridx = 1; |
809 | 0 | GridBagConstraints gridBagConstraints36 = new GridBagConstraints(); |
810 | 0 | gridBagConstraints36.anchor = GridBagConstraints.WEST; |
811 | 0 | gridBagConstraints36.insets = new Insets(0, 0, 0, 16); |
812 | 0 | jLabelSecondsPerMove = new JLabel(); |
813 | 0 | jLabelSecondsPerMove.setText("Seconds per move:"); |
814 | 0 | jPanelAnimateSpeed = new JPanel(); |
815 | 0 | jPanelAnimateSpeed.setLayout(new GridBagLayout()); |
816 | 0 | jPanelAnimateSpeed.add(jLabelSecondsPerMove, gridBagConstraints36); |
817 | 0 | jPanelAnimateSpeed.add(getJTextFieldSecondsPerMove(), gridBagConstraints37); |
818 | |
} |
819 | 0 | return jPanelAnimateSpeed; |
820 | |
} |
821 | |
|
822 | |
|
823 | |
|
824 | |
|
825 | |
|
826 | |
|
827 | |
private JTextField getJTextFieldSecondsPerMove() { |
828 | 0 | if (jTextFieldSecondsPerMove == null) { |
829 | 0 | jTextFieldSecondsPerMove = new JTextField(); |
830 | 0 | jTextFieldSecondsPerMove.setText("2.0"); |
831 | |
} |
832 | 0 | return jTextFieldSecondsPerMove; |
833 | |
} |
834 | |
|
835 | |
|
836 | |
|
837 | |
|
838 | |
|
839 | |
|
840 | |
private JCheckBox getJCheckBoxSwitchTabOnNewChatMessage() { |
841 | 0 | if (jCheckBoxSwitchTabOnNewChatMessage == null) { |
842 | 0 | jCheckBoxSwitchTabOnNewChatMessage = new JCheckBox(); |
843 | |
} |
844 | 0 | return jCheckBoxSwitchTabOnNewChatMessage; |
845 | |
} |
846 | |
|
847 | |
|
848 | |
|
849 | |
|
850 | |
|
851 | |
|
852 | |
private JCheckBox getJCheckBoxDontChangeTabOnNewShouts() { |
853 | 0 | if (jCheckBoxDontChangeTabOnNewShouts == null) { |
854 | 0 | jCheckBoxDontChangeTabOnNewShouts = new JCheckBox(); |
855 | |
} |
856 | 0 | return jCheckBoxDontChangeTabOnNewShouts; |
857 | |
} |
858 | |
|
859 | |
} |