2009-04-11 13:35:22 +00:00
|
|
|
/*
|
|
|
|
* GeneralConfiguration.java
|
|
|
|
*
|
|
|
|
* Created on 10 april 2009, 19:04
|
|
|
|
*/
|
|
|
|
|
|
|
|
package gui;
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
import router.configuration.SpeedHelper;
|
|
|
|
|
2009-04-11 13:35:22 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author mathias
|
|
|
|
*/
|
|
|
|
public class GeneralConfiguration extends javax.swing.JFrame {
|
|
|
|
|
|
|
|
/** Creates new form GeneralConfiguration */
|
|
|
|
public GeneralConfiguration() {
|
|
|
|
initComponents();
|
2009-05-06 16:17:58 +00:00
|
|
|
extraInitComponents();
|
2009-04-13 15:02:46 +00:00
|
|
|
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
|
|
|
this.setVisible(true);
|
2009-04-11 13:35:22 +00:00
|
|
|
}
|
2009-05-06 16:17:58 +00:00
|
|
|
|
|
|
|
private void extraInitComponents() {
|
|
|
|
downloadspeed.setText(SpeedHelper.getInboundBandwidth());
|
|
|
|
}
|
2009-04-11 13:35:22 +00:00
|
|
|
|
|
|
|
/** This method is called from within the constructor to
|
|
|
|
* initialize the form.
|
|
|
|
* WARNING: Do NOT modify this code. The content of this method is
|
|
|
|
* always regenerated by the Form Editor.
|
|
|
|
*/
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
|
|
|
private void initComponents() {
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
buttonGroup1 = new javax.swing.ButtonGroup();
|
|
|
|
applyPanel = new javax.swing.JPanel();
|
2009-04-13 15:02:46 +00:00
|
|
|
cancel = new javax.swing.JToggleButton();
|
|
|
|
ok = new javax.swing.JToggleButton();
|
2009-05-06 16:17:58 +00:00
|
|
|
settingsPanel = new javax.swing.JTabbedPane();
|
|
|
|
speedPanel = new javax.swing.JPanel();
|
|
|
|
uploadSpeedLabel = new javax.swing.JLabel();
|
|
|
|
downloadSpeedLabel = new javax.swing.JLabel();
|
|
|
|
uploadspeed = new javax.swing.JTextField();
|
|
|
|
downloadspeed = new javax.swing.JTextField();
|
|
|
|
uploadkbps = new javax.swing.JComboBox();
|
|
|
|
downloadkbps = new javax.swing.JComboBox();
|
2009-04-13 15:02:46 +00:00
|
|
|
jLabel3 = new javax.swing.JLabel();
|
|
|
|
jLabel4 = new javax.swing.JLabel();
|
2009-05-06 16:17:58 +00:00
|
|
|
uploadgb = new javax.swing.JTextField();
|
|
|
|
downloadgb = new javax.swing.JTextField();
|
2009-04-13 15:02:46 +00:00
|
|
|
jLabel5 = new javax.swing.JLabel();
|
|
|
|
jLabel6 = new javax.swing.JLabel();
|
|
|
|
jLabel7 = new javax.swing.JLabel();
|
2009-05-06 16:17:58 +00:00
|
|
|
updatesPanel = new javax.swing.JPanel();
|
2009-04-13 15:02:46 +00:00
|
|
|
jLabel8 = new javax.swing.JLabel();
|
|
|
|
jRadioButton1 = new javax.swing.JRadioButton();
|
|
|
|
jRadioButton2 = new javax.swing.JRadioButton();
|
|
|
|
jRadioButton3 = new javax.swing.JRadioButton();
|
|
|
|
jToggleButton1 = new javax.swing.JToggleButton();
|
|
|
|
jToggleButton2 = new javax.swing.JToggleButton();
|
|
|
|
jToggleButton3 = new javax.swing.JToggleButton();
|
2009-05-06 16:17:58 +00:00
|
|
|
tunnelPanel = new javax.swing.JPanel();
|
2009-04-13 17:27:35 +00:00
|
|
|
jScrollPane1 = new javax.swing.JScrollPane();
|
|
|
|
jScrollPane2 = new javax.swing.JScrollPane();
|
|
|
|
jLabel9 = new javax.swing.JLabel();
|
|
|
|
jLabel10 = new javax.swing.JLabel();
|
|
|
|
jLabel11 = new javax.swing.JLabel();
|
2009-05-06 16:17:58 +00:00
|
|
|
networkPanel = new javax.swing.JPanel();
|
|
|
|
advancedPanel = new javax.swing.JPanel();
|
2009-04-11 13:35:22 +00:00
|
|
|
|
|
|
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
2009-05-06 16:17:58 +00:00
|
|
|
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(desktopgui.Main.class).getContext().getResourceMap(GeneralConfiguration.class);
|
|
|
|
setTitle(resourceMap.getString("Form.title")); // NOI18N
|
2009-04-11 13:35:22 +00:00
|
|
|
setName("Form"); // NOI18N
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
applyPanel.setName("applyPanel"); // NOI18N
|
2009-04-11 13:35:22 +00:00
|
|
|
|
2009-04-13 15:02:46 +00:00
|
|
|
cancel.setText(resourceMap.getString("cancel.text")); // NOI18N
|
|
|
|
cancel.setName("cancel"); // NOI18N
|
|
|
|
|
|
|
|
ok.setText(resourceMap.getString("ok.text")); // NOI18N
|
|
|
|
ok.setName("ok"); // NOI18N
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
javax.swing.GroupLayout applyPanelLayout = new javax.swing.GroupLayout(applyPanel);
|
|
|
|
applyPanel.setLayout(applyPanelLayout);
|
|
|
|
applyPanelLayout.setHorizontalGroup(
|
|
|
|
applyPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, applyPanelLayout.createSequentialGroup()
|
2009-04-13 17:27:35 +00:00
|
|
|
.addContainerGap(475, Short.MAX_VALUE)
|
2009-04-13 15:02:46 +00:00
|
|
|
.addComponent(ok)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
|
.addComponent(cancel)
|
|
|
|
.addContainerGap())
|
2009-04-11 13:35:22 +00:00
|
|
|
);
|
2009-05-06 16:17:58 +00:00
|
|
|
applyPanelLayout.setVerticalGroup(
|
|
|
|
applyPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(applyPanelLayout.createSequentialGroup()
|
|
|
|
.addGroup(applyPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
2009-04-13 15:02:46 +00:00
|
|
|
.addComponent(cancel)
|
|
|
|
.addComponent(ok))
|
|
|
|
.addContainerGap(14, Short.MAX_VALUE))
|
2009-04-11 13:35:22 +00:00
|
|
|
);
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
settingsPanel.setName("settingsPanel"); // NOI18N
|
|
|
|
|
|
|
|
speedPanel.setName("speedPanel"); // NOI18N
|
|
|
|
speedPanel.setLayout(null);
|
|
|
|
|
|
|
|
uploadSpeedLabel.setText(resourceMap.getString("uploadSpeedLabel.text")); // NOI18N
|
|
|
|
uploadSpeedLabel.setName("uploadSpeedLabel"); // NOI18N
|
|
|
|
speedPanel.add(uploadSpeedLabel);
|
|
|
|
uploadSpeedLabel.setBounds(20, 20, 140, 30);
|
|
|
|
|
|
|
|
downloadSpeedLabel.setText(resourceMap.getString("downloadSpeedLabel.text")); // NOI18N
|
|
|
|
downloadSpeedLabel.setName("downloadSpeedLabel"); // NOI18N
|
|
|
|
speedPanel.add(downloadSpeedLabel);
|
|
|
|
downloadSpeedLabel.setBounds(20, 60, 140, 30);
|
|
|
|
|
|
|
|
uploadspeed.setText(resourceMap.getString("uploadspeed.text")); // NOI18N
|
|
|
|
uploadspeed.setName("uploadspeed"); // NOI18N
|
|
|
|
uploadspeed.addKeyListener(new java.awt.event.KeyAdapter() {
|
|
|
|
public void keyTyped(java.awt.event.KeyEvent evt) {
|
|
|
|
speedKeyTyped(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
speedPanel.add(uploadspeed);
|
|
|
|
uploadspeed.setBounds(160, 20, 77, 27);
|
|
|
|
|
|
|
|
downloadspeed.setText(resourceMap.getString("downloadspeed.text")); // NOI18N
|
|
|
|
downloadspeed.setName("downloadspeed"); // NOI18N
|
|
|
|
downloadspeed.addKeyListener(new java.awt.event.KeyAdapter() {
|
|
|
|
public void keyTyped(java.awt.event.KeyEvent evt) {
|
|
|
|
speedKeyTyped(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
speedPanel.add(downloadspeed);
|
|
|
|
downloadspeed.setBounds(160, 60, 77, 27);
|
|
|
|
|
|
|
|
uploadkbps.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "kbps", "kBps" }));
|
|
|
|
uploadkbps.setName("uploadkbps"); // NOI18N
|
|
|
|
uploadkbps.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
uploadkbpsActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
speedPanel.add(uploadkbps);
|
|
|
|
uploadkbps.setBounds(240, 20, 68, 27);
|
|
|
|
|
|
|
|
downloadkbps.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "kbps", "kBps" }));
|
|
|
|
downloadkbps.setName("downloadkbps"); // NOI18N
|
|
|
|
downloadkbps.addActionListener(new java.awt.event.ActionListener() {
|
|
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
downloadkbpsActionPerformed(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
speedPanel.add(downloadkbps);
|
|
|
|
downloadkbps.setBounds(240, 60, 68, 27);
|
2009-04-13 15:02:46 +00:00
|
|
|
|
|
|
|
jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
|
|
|
|
jLabel3.setName("jLabel3"); // NOI18N
|
2009-05-06 16:17:58 +00:00
|
|
|
speedPanel.add(jLabel3);
|
2009-04-13 15:02:46 +00:00
|
|
|
jLabel3.setBounds(330, 20, 97, 30);
|
|
|
|
|
|
|
|
jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
|
|
|
|
jLabel4.setName("jLabel4"); // NOI18N
|
2009-05-06 16:17:58 +00:00
|
|
|
speedPanel.add(jLabel4);
|
2009-04-13 15:02:46 +00:00
|
|
|
jLabel4.setBounds(330, 60, 97, 30);
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
uploadgb.setText(resourceMap.getString("uploadgb.text")); // NOI18N
|
|
|
|
uploadgb.setName("uploadgb"); // NOI18N
|
|
|
|
uploadgb.addKeyListener(new java.awt.event.KeyAdapter() {
|
|
|
|
public void keyTyped(java.awt.event.KeyEvent evt) {
|
|
|
|
uploadgbKeyTyped(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
speedPanel.add(uploadgb);
|
|
|
|
uploadgb.setBounds(440, 20, 60, 27);
|
|
|
|
|
|
|
|
downloadgb.setText(resourceMap.getString("downloadgb.text")); // NOI18N
|
|
|
|
downloadgb.setName("downloadgb"); // NOI18N
|
|
|
|
downloadgb.addKeyListener(new java.awt.event.KeyAdapter() {
|
|
|
|
public void keyTyped(java.awt.event.KeyEvent evt) {
|
|
|
|
downloadgbKeyTyped(evt);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
speedPanel.add(downloadgb);
|
|
|
|
downloadgb.setBounds(440, 60, 60, 27);
|
2009-04-13 15:02:46 +00:00
|
|
|
|
|
|
|
jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
|
|
|
|
jLabel5.setName("jLabel5"); // NOI18N
|
2009-05-06 16:17:58 +00:00
|
|
|
speedPanel.add(jLabel5);
|
2009-04-13 15:02:46 +00:00
|
|
|
jLabel5.setBounds(510, 20, 19, 30);
|
|
|
|
|
|
|
|
jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
|
|
|
|
jLabel6.setName("jLabel6"); // NOI18N
|
2009-05-06 16:17:58 +00:00
|
|
|
speedPanel.add(jLabel6);
|
2009-04-13 15:02:46 +00:00
|
|
|
jLabel6.setBounds(510, 60, 19, 30);
|
|
|
|
|
|
|
|
jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
|
|
|
|
jLabel7.setName("jLabel7"); // NOI18N
|
2009-05-06 16:17:58 +00:00
|
|
|
speedPanel.add(jLabel7);
|
2009-04-13 15:02:46 +00:00
|
|
|
jLabel7.setBounds(20, 100, 520, 70);
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
settingsPanel.addTab(resourceMap.getString("speedPanel.TabConstraints.tabTitle"), speedPanel); // NOI18N
|
2009-04-13 15:02:46 +00:00
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
updatesPanel.setName("updatesPanel"); // NOI18N
|
2009-04-13 15:02:46 +00:00
|
|
|
|
|
|
|
jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
|
|
|
|
jLabel8.setName("jLabel8"); // NOI18N
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
buttonGroup1.add(jRadioButton1);
|
2009-04-13 15:02:46 +00:00
|
|
|
jRadioButton1.setText(resourceMap.getString("jRadioButton1.text")); // NOI18N
|
|
|
|
jRadioButton1.setName("jRadioButton1"); // NOI18N
|
2009-04-11 13:35:22 +00:00
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
buttonGroup1.add(jRadioButton2);
|
2009-04-13 15:02:46 +00:00
|
|
|
jRadioButton2.setText(resourceMap.getString("jRadioButton2.text")); // NOI18N
|
|
|
|
jRadioButton2.setName("jRadioButton2"); // NOI18N
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
buttonGroup1.add(jRadioButton3);
|
2009-04-13 15:02:46 +00:00
|
|
|
jRadioButton3.setText(resourceMap.getString("jRadioButton3.text")); // NOI18N
|
|
|
|
jRadioButton3.setName("jRadioButton3"); // NOI18N
|
|
|
|
|
|
|
|
jToggleButton1.setText(resourceMap.getString("jToggleButton1.text")); // NOI18N
|
|
|
|
jToggleButton1.setName("jToggleButton1"); // NOI18N
|
|
|
|
|
|
|
|
jToggleButton2.setText(resourceMap.getString("jToggleButton2.text")); // NOI18N
|
|
|
|
jToggleButton2.setName("jToggleButton2"); // NOI18N
|
|
|
|
|
|
|
|
jToggleButton3.setText(resourceMap.getString("jToggleButton3.text")); // NOI18N
|
|
|
|
jToggleButton3.setName("jToggleButton3"); // NOI18N
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
javax.swing.GroupLayout updatesPanelLayout = new javax.swing.GroupLayout(updatesPanel);
|
|
|
|
updatesPanel.setLayout(updatesPanelLayout);
|
|
|
|
updatesPanelLayout.setHorizontalGroup(
|
|
|
|
updatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(updatesPanelLayout.createSequentialGroup()
|
|
|
|
.addGroup(updatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(updatesPanelLayout.createSequentialGroup()
|
2009-04-13 15:02:46 +00:00
|
|
|
.addGap(20, 20, 20)
|
2009-05-06 16:17:58 +00:00
|
|
|
.addGroup(updatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2009-04-13 17:27:35 +00:00
|
|
|
.addComponent(jLabel8)
|
2009-05-06 16:17:58 +00:00
|
|
|
.addGroup(updatesPanelLayout.createSequentialGroup()
|
2009-04-13 17:27:35 +00:00
|
|
|
.addComponent(jToggleButton1)
|
|
|
|
.addGap(18, 18, 18)
|
|
|
|
.addComponent(jToggleButton2))))
|
2009-05-06 16:17:58 +00:00
|
|
|
.addGroup(updatesPanelLayout.createSequentialGroup()
|
2009-04-13 15:02:46 +00:00
|
|
|
.addGap(40, 40, 40)
|
2009-05-06 16:17:58 +00:00
|
|
|
.addGroup(updatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2009-04-13 15:02:46 +00:00
|
|
|
.addComponent(jRadioButton2)
|
|
|
|
.addComponent(jRadioButton1)
|
|
|
|
.addComponent(jRadioButton3))))
|
|
|
|
.addGap(9, 9, 9))
|
2009-05-06 16:17:58 +00:00
|
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, updatesPanelLayout.createSequentialGroup()
|
2009-04-13 17:27:35 +00:00
|
|
|
.addContainerGap(339, Short.MAX_VALUE)
|
2009-04-13 15:02:46 +00:00
|
|
|
.addComponent(jToggleButton3)
|
|
|
|
.addContainerGap())
|
|
|
|
);
|
2009-05-06 16:17:58 +00:00
|
|
|
updatesPanelLayout.setVerticalGroup(
|
|
|
|
updatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(updatesPanelLayout.createSequentialGroup()
|
2009-04-13 17:27:35 +00:00
|
|
|
.addContainerGap()
|
2009-04-13 15:02:46 +00:00
|
|
|
.addComponent(jLabel8)
|
2009-04-13 17:27:35 +00:00
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
2009-04-13 15:02:46 +00:00
|
|
|
.addComponent(jRadioButton1)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
|
.addComponent(jRadioButton2)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
|
.addComponent(jRadioButton3)
|
2009-04-13 17:27:35 +00:00
|
|
|
.addGap(18, 18, 18)
|
2009-05-06 16:17:58 +00:00
|
|
|
.addGroup(updatesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
2009-04-13 15:02:46 +00:00
|
|
|
.addComponent(jToggleButton1)
|
|
|
|
.addComponent(jToggleButton2))
|
2009-04-13 17:27:35 +00:00
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 181, Short.MAX_VALUE)
|
2009-04-13 15:02:46 +00:00
|
|
|
.addComponent(jToggleButton3)
|
|
|
|
.addContainerGap())
|
2009-04-11 13:35:22 +00:00
|
|
|
);
|
2009-04-13 15:02:46 +00:00
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
settingsPanel.addTab(resourceMap.getString("updatesPanel.TabConstraints.tabTitle"), updatesPanel); // NOI18N
|
2009-04-13 15:02:46 +00:00
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
tunnelPanel.setName("tunnelPanel"); // NOI18N
|
2009-04-13 15:02:46 +00:00
|
|
|
|
2009-04-13 17:27:35 +00:00
|
|
|
jScrollPane1.setName("jScrollPane1"); // NOI18N
|
|
|
|
|
|
|
|
jScrollPane2.setName("jScrollPane2"); // NOI18N
|
|
|
|
|
|
|
|
jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
|
|
|
|
jLabel9.setName("jLabel9"); // NOI18N
|
|
|
|
|
|
|
|
jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
|
|
|
|
jLabel10.setName("jLabel10"); // NOI18N
|
|
|
|
|
|
|
|
jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
|
|
|
|
jLabel11.setName("jLabel11"); // NOI18N
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
javax.swing.GroupLayout tunnelPanelLayout = new javax.swing.GroupLayout(tunnelPanel);
|
|
|
|
tunnelPanel.setLayout(tunnelPanelLayout);
|
|
|
|
tunnelPanelLayout.setHorizontalGroup(
|
|
|
|
tunnelPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(tunnelPanelLayout.createSequentialGroup()
|
2009-04-13 17:27:35 +00:00
|
|
|
.addContainerGap()
|
2009-05-06 16:17:58 +00:00
|
|
|
.addGroup(tunnelPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2009-04-13 17:27:35 +00:00
|
|
|
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE)
|
|
|
|
.addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE)
|
|
|
|
.addComponent(jLabel10)
|
|
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE)
|
|
|
|
.addComponent(jLabel11))
|
|
|
|
.addContainerGap())
|
2009-04-13 15:02:46 +00:00
|
|
|
);
|
2009-05-06 16:17:58 +00:00
|
|
|
tunnelPanelLayout.setVerticalGroup(
|
|
|
|
tunnelPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(tunnelPanelLayout.createSequentialGroup()
|
2009-04-13 17:27:35 +00:00
|
|
|
.addContainerGap()
|
|
|
|
.addComponent(jLabel10)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
|
.addComponent(jLabel11)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
|
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)
|
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
|
|
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
|
|
.addContainerGap())
|
2009-04-11 13:35:22 +00:00
|
|
|
);
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
settingsPanel.addTab(resourceMap.getString("tunnelPanel.TabConstraints.tabTitle"), tunnelPanel); // NOI18N
|
2009-04-13 15:02:46 +00:00
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
networkPanel.setName("networkPanel"); // NOI18N
|
2009-04-13 15:02:46 +00:00
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
javax.swing.GroupLayout networkPanelLayout = new javax.swing.GroupLayout(networkPanel);
|
|
|
|
networkPanel.setLayout(networkPanelLayout);
|
|
|
|
networkPanelLayout.setHorizontalGroup(
|
|
|
|
networkPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2009-04-13 17:27:35 +00:00
|
|
|
.addGap(0, 562, Short.MAX_VALUE)
|
2009-04-13 15:02:46 +00:00
|
|
|
);
|
2009-05-06 16:17:58 +00:00
|
|
|
networkPanelLayout.setVerticalGroup(
|
|
|
|
networkPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2009-04-13 17:27:35 +00:00
|
|
|
.addGap(0, 388, Short.MAX_VALUE)
|
2009-04-13 15:02:46 +00:00
|
|
|
);
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
settingsPanel.addTab(resourceMap.getString("networkPanel.TabConstraints.tabTitle"), networkPanel); // NOI18N
|
2009-04-13 15:02:46 +00:00
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
advancedPanel.setName("advancedPanel"); // NOI18N
|
2009-04-13 15:02:46 +00:00
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
javax.swing.GroupLayout advancedPanelLayout = new javax.swing.GroupLayout(advancedPanel);
|
|
|
|
advancedPanel.setLayout(advancedPanelLayout);
|
|
|
|
advancedPanelLayout.setHorizontalGroup(
|
|
|
|
advancedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2009-04-13 17:27:35 +00:00
|
|
|
.addGap(0, 562, Short.MAX_VALUE)
|
2009-04-13 15:02:46 +00:00
|
|
|
);
|
2009-05-06 16:17:58 +00:00
|
|
|
advancedPanelLayout.setVerticalGroup(
|
|
|
|
advancedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2009-04-13 17:27:35 +00:00
|
|
|
.addGap(0, 388, Short.MAX_VALUE)
|
2009-04-13 15:02:46 +00:00
|
|
|
);
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
settingsPanel.addTab(resourceMap.getString("advancedPanel.TabConstraints.tabTitle"), advancedPanel); // NOI18N
|
2009-04-11 13:35:22 +00:00
|
|
|
|
|
|
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
|
|
|
getContentPane().setLayout(layout);
|
|
|
|
layout.setHorizontalGroup(
|
|
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
2009-05-06 16:17:58 +00:00
|
|
|
.addComponent(applyPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
2009-04-13 17:27:35 +00:00
|
|
|
.addGroup(layout.createSequentialGroup()
|
|
|
|
.addGap(12, 12, 12)
|
2009-05-06 16:17:58 +00:00
|
|
|
.addComponent(settingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 566, Short.MAX_VALUE))
|
2009-04-11 13:35:22 +00:00
|
|
|
);
|
|
|
|
layout.setVerticalGroup(
|
|
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
2009-05-06 16:17:58 +00:00
|
|
|
.addComponent(settingsPanel)
|
2009-04-13 15:02:46 +00:00
|
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
2009-05-06 16:17:58 +00:00
|
|
|
.addComponent(applyPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
2009-04-11 13:35:22 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
pack();
|
|
|
|
}// </editor-fold>//GEN-END:initComponents
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
private void speedKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_speedKeyTyped
|
|
|
|
try {
|
|
|
|
String upload = "";
|
|
|
|
if(uploadkbps.getSelectedIndex() == KILOBIT)
|
|
|
|
upload = "" + Integer.parseInt(uploadspeed.getText())/8;
|
|
|
|
else
|
|
|
|
upload = uploadspeed.getText();
|
|
|
|
String download = "";
|
|
|
|
if(downloadkbps.getSelectedIndex() == KILOBIT)
|
|
|
|
download = "" + Integer.parseInt(downloadspeed.getText())/8;
|
|
|
|
else
|
|
|
|
download = downloadspeed.getText();
|
|
|
|
initUsage(upload, download);
|
|
|
|
}
|
|
|
|
catch(NumberFormatException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}//GEN-LAST:event_speedKeyTyped
|
|
|
|
|
|
|
|
private void uploadkbpsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uploadkbpsActionPerformed
|
|
|
|
// TODO add your handling code here:
|
|
|
|
}//GEN-LAST:event_uploadkbpsActionPerformed
|
|
|
|
|
|
|
|
private void downloadkbpsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downloadkbpsActionPerformed
|
|
|
|
// TODO add your handling code here:
|
|
|
|
}//GEN-LAST:event_downloadkbpsActionPerformed
|
|
|
|
|
|
|
|
private void uploadgbKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_uploadgbKeyTyped
|
|
|
|
// TODO add your handling code here:
|
|
|
|
}//GEN-LAST:event_uploadgbKeyTyped
|
|
|
|
|
|
|
|
private void downloadgbKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_downloadgbKeyTyped
|
|
|
|
// TODO add your handling code here:
|
|
|
|
}//GEN-LAST:event_downloadgbKeyTyped
|
|
|
|
|
|
|
|
protected void initUsage(String upload, String download) {
|
|
|
|
uploadgb.setText("" + SpeedHelper.calculateMonthlyUsage(Integer.parseInt(upload)));
|
|
|
|
downloadgb.setText("" + SpeedHelper.calculateMonthlyUsage(Integer.parseInt(download)));
|
|
|
|
}
|
2009-04-11 13:35:22 +00:00
|
|
|
|
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
2009-05-06 16:17:58 +00:00
|
|
|
private javax.swing.JPanel advancedPanel;
|
|
|
|
private javax.swing.JPanel applyPanel;
|
|
|
|
private javax.swing.ButtonGroup buttonGroup1;
|
2009-04-13 15:02:46 +00:00
|
|
|
private javax.swing.JToggleButton cancel;
|
2009-05-06 16:17:58 +00:00
|
|
|
private javax.swing.JLabel downloadSpeedLabel;
|
|
|
|
private javax.swing.JTextField downloadgb;
|
|
|
|
private javax.swing.JComboBox downloadkbps;
|
|
|
|
private javax.swing.JTextField downloadspeed;
|
2009-04-13 17:27:35 +00:00
|
|
|
private javax.swing.JLabel jLabel10;
|
|
|
|
private javax.swing.JLabel jLabel11;
|
2009-04-13 15:02:46 +00:00
|
|
|
private javax.swing.JLabel jLabel3;
|
|
|
|
private javax.swing.JLabel jLabel4;
|
|
|
|
private javax.swing.JLabel jLabel5;
|
|
|
|
private javax.swing.JLabel jLabel6;
|
|
|
|
private javax.swing.JLabel jLabel7;
|
|
|
|
private javax.swing.JLabel jLabel8;
|
2009-04-13 17:27:35 +00:00
|
|
|
private javax.swing.JLabel jLabel9;
|
2009-04-13 15:02:46 +00:00
|
|
|
private javax.swing.JRadioButton jRadioButton1;
|
|
|
|
private javax.swing.JRadioButton jRadioButton2;
|
|
|
|
private javax.swing.JRadioButton jRadioButton3;
|
2009-04-13 17:27:35 +00:00
|
|
|
private javax.swing.JScrollPane jScrollPane1;
|
|
|
|
private javax.swing.JScrollPane jScrollPane2;
|
2009-04-13 15:02:46 +00:00
|
|
|
private javax.swing.JToggleButton jToggleButton1;
|
|
|
|
private javax.swing.JToggleButton jToggleButton2;
|
|
|
|
private javax.swing.JToggleButton jToggleButton3;
|
2009-05-06 16:17:58 +00:00
|
|
|
private javax.swing.JPanel networkPanel;
|
2009-04-13 15:02:46 +00:00
|
|
|
private javax.swing.JToggleButton ok;
|
2009-05-06 16:17:58 +00:00
|
|
|
private javax.swing.JTabbedPane settingsPanel;
|
|
|
|
private javax.swing.JPanel speedPanel;
|
|
|
|
private javax.swing.JPanel tunnelPanel;
|
|
|
|
private javax.swing.JPanel updatesPanel;
|
|
|
|
private javax.swing.JLabel uploadSpeedLabel;
|
|
|
|
private javax.swing.JTextField uploadgb;
|
|
|
|
private javax.swing.JComboBox uploadkbps;
|
|
|
|
private javax.swing.JTextField uploadspeed;
|
2009-04-11 13:35:22 +00:00
|
|
|
// End of variables declaration//GEN-END:variables
|
|
|
|
|
2009-05-06 16:17:58 +00:00
|
|
|
public static final int KILOBIT = 0;
|
|
|
|
public static final int KILOBYTE = 1;
|
2009-04-11 13:35:22 +00:00
|
|
|
}
|