1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.gui.wizard;
21
22 import javax.swing.Icon;
23 import javax.swing.JCheckBox;
24 import javax.swing.JComboBox;
25
26 import java.awt.GridBagLayout;
27
28 import org.xnap.XNap;
29 import org.xnap.gui.AbstractSettingsPanel;
30 import org.xnap.gui.Messages;
31 import org.xnap.gui.component.MultiLineLabel;
32 import org.xnap.gui.util.GUIHelper;
33 import org.xnap.gui.util.GridBagHelper;
34 import org.xnap.gui.util.IconHelper;
35 import org.xnap.util.LinkType;
36
37 public class NetworkWizardPanel extends AbstractSettingsPanel {
38
39
40
41 private JCheckBox jcFirewalled;
42 private JComboBox jcLinkSpeed;
43
44
45
46 public NetworkWizardPanel()
47 {
48 setLayout(new GridBagLayout());
49
50
51 GridBagHelper.add(this, GUIHelper.createHeader(XNap.tr("Link Type")));
52
53 GridBagHelper.add
54 (this, new MultiLineLabel(Messages.LINK_TYPE));
55
56 jcLinkSpeed = new JComboBox(LinkType.COMMON_TYPES);
57 jcLinkSpeed.setSelectedIndex
58 (LinkType.getIndexOfType(LinkType.COMMON_TYPES,
59 prefs.getLinkSpeed()));
60 GridBagHelper.add(this, jcLinkSpeed, false);
61
62 GridBagHelper.addVerticalSpacer(this);
63 }
64
65 public void apply()
66 {
67 prefs.setLinkSpeed
68 (((LinkType)jcLinkSpeed.getSelectedItem()).getSpeed());
69 }
70
71 public String getDescription()
72 {
73 return XNap.tr("Setup your network properties.");
74 }
75
76 public Icon getIcon()
77 {
78 return IconHelper.getWizardIcon("world.png");
79 }
80
81 public String getTitle()
82 {
83 return XNap.tr("Network settings");
84 }
85
86 }