mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
"Connetion" tab in PreferencesDialog (in progress).
This commit is contained in:
parent
e708c2b74a
commit
e642a6aff6
4 changed files with 791 additions and 532 deletions
|
|
@ -30,7 +30,6 @@
|
|||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="lblProxyType" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblPort" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblServer" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblUserName" min="-2" max="-2" attributes="0"/>
|
||||
|
|
@ -48,7 +47,7 @@
|
|||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="cbProxyType" alignment="0" min="-2" pref="126" max="-2" attributes="0"/>
|
||||
<Component id="jProxySettingsButton" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
|
|
@ -56,7 +55,7 @@
|
|||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="pnlProxySettings" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="lblStatus" alignment="0" min="-2" pref="195" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
|
@ -81,21 +80,25 @@
|
|||
<Component id="txtUserName" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblUserName" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="chkAutoConnect" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="cbProxyType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jProxySettingsButton" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace pref="24" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="btnConnect" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
|
||||
<Component id="lblStatus" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="pnlProxySettings" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="btnConnect" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
|
@ -168,174 +171,15 @@
|
|||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="findPublicServerActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbProxyType">
|
||||
<Component class="javax.swing.JButton" name="jProxySettingsButton">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Proxy Settings..."/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbProxyTypeActionPerformed"/>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jProxySettingsButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblProxyType">
|
||||
<Properties>
|
||||
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||
<ComponentRef name="cbProxyType"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Proxy:"/>
|
||||
</Properties>
|
||||
<Component class="javax.swing.JLabel" name="lblStatus">
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="pnlProxySettings">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[0, 0]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="pnlProxy" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="pnlProxyAuth" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="pnlProxy" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="34" max="32767" attributes="0"/>
|
||||
<Component id="pnlProxyAuth" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="pnlProxy">
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace pref="28" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="lblProxyPort" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyServer" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="txtProxyPort" min="-2" pref="71" max="-2" attributes="0"/>
|
||||
<Component id="txtProxyServer" pref="360" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="txtProxyServer" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyServer" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblProxyPort" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="txtProxyPort" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblProxyServer">
|
||||
<Properties>
|
||||
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||
<ComponentRef name="txtProxyServer"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Server:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtProxyServer">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblProxyPort">
|
||||
<Properties>
|
||||
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||
<ComponentRef name="txtProxyPort"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Port:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtProxyPort">
|
||||
<Events>
|
||||
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtProxyPortkeyTyped"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="pnlProxyAuth">
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="lblProxyPassword" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyUserName" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Component id="txtPasswordField" max="32767" attributes="1"/>
|
||||
<Component id="txtProxyUserName" alignment="1" pref="358" max="32767" attributes="1"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="txtProxyUserName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyUserName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="8" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="txtPasswordField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyPassword" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblProxyUserName">
|
||||
<Properties>
|
||||
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||
<ComponentRef name="txtProxyUserName"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="User Name:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtProxyUserName">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblProxyPassword">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Password:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JPasswordField" name="txtPasswordField">
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPasswordFieldActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ public class ConnectDialog extends MageDialog {
|
|||
/** Creates new form ConnectDialog */
|
||||
public ConnectDialog() {
|
||||
initComponents();
|
||||
cbProxyType.setModel(new DefaultComboBoxModel(Connection.ProxyType.values()));
|
||||
}
|
||||
|
||||
public void showDialog() {
|
||||
|
|
@ -76,50 +75,16 @@ public class ConnectDialog extends MageDialog {
|
|||
this.txtPort.setText(MageFrame.getPreferences().get("serverPort", Integer.toString(Config.port)));
|
||||
this.txtUserName.setText(MageFrame.getPreferences().get("userName", ""));
|
||||
this.chkAutoConnect.setSelected(Boolean.parseBoolean(MageFrame.getPreferences().get("autoConnect", "false")));
|
||||
this.txtProxyServer.setText(MageFrame.getPreferences().get("proxyAddress", Config.serverName));
|
||||
this.txtProxyPort.setText(MageFrame.getPreferences().get("proxyPort", Integer.toString(Config.port)));
|
||||
this.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(MageFrame.getPreferences().get("proxyType", "NONE").toUpperCase()));
|
||||
this.txtProxyUserName.setText(MageFrame.getPreferences().get("proxyUsername", ""));
|
||||
this.txtPasswordField.setText(MageFrame.getPreferences().get("proxyPassword", ""));
|
||||
this.showProxySettings();
|
||||
this.setModal(true);
|
||||
this.setLocation(50, 50);
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
private void showProxySettings() {
|
||||
if (cbProxyType.getSelectedItem() == Connection.ProxyType.SOCKS) {
|
||||
this.pnlProxy.setVisible(true);
|
||||
this.pnlProxyAuth.setVisible(false);
|
||||
this.pnlProxySettings.setVisible(true);
|
||||
}
|
||||
else if (cbProxyType.getSelectedItem() == Connection.ProxyType.HTTP) {
|
||||
this.pnlProxy.setVisible(true);
|
||||
this.pnlProxyAuth.setVisible(true);
|
||||
this.pnlProxySettings.setVisible(true);
|
||||
}
|
||||
else if (cbProxyType.getSelectedItem() == Connection.ProxyType.NONE) {
|
||||
this.pnlProxy.setVisible(false);
|
||||
this.pnlProxyAuth.setVisible(false);
|
||||
this.pnlProxySettings.setVisible(false);
|
||||
}
|
||||
this.pack();
|
||||
this.revalidate();
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
private void saveSettings() {
|
||||
MageFrame.getPreferences().put("serverAddress", txtServer.getText().trim());
|
||||
MageFrame.getPreferences().put("serverPort", txtPort.getText().trim());
|
||||
MageFrame.getPreferences().put("userName", txtUserName.getText().trim());
|
||||
MageFrame.getPreferences().put("autoConnect", Boolean.toString(chkAutoConnect.isSelected()));
|
||||
MageFrame.getPreferences().put("proxyAddress", txtProxyServer.getText().trim());
|
||||
MageFrame.getPreferences().put("proxyPort", txtProxyPort.getText().trim());
|
||||
MageFrame.getPreferences().put("proxyType", cbProxyType.getSelectedItem().toString());
|
||||
MageFrame.getPreferences().put("proxyUsername", txtProxyUserName.getText().trim());
|
||||
char[] input = txtPasswordField.getPassword();
|
||||
MageFrame.getPreferences().put("proxyPassword", new String(input));
|
||||
Arrays.fill(input, '0');
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
|
|
@ -141,19 +106,7 @@ public class ConnectDialog extends MageDialog {
|
|||
btnCancel = new javax.swing.JButton();
|
||||
chkAutoConnect = new javax.swing.JCheckBox();
|
||||
jButton1 = new javax.swing.JButton();
|
||||
cbProxyType = new javax.swing.JComboBox();
|
||||
lblProxyType = new javax.swing.JLabel();
|
||||
pnlProxySettings = new javax.swing.JPanel();
|
||||
pnlProxy = new javax.swing.JPanel();
|
||||
lblProxyServer = new javax.swing.JLabel();
|
||||
txtProxyServer = new javax.swing.JTextField();
|
||||
lblProxyPort = new javax.swing.JLabel();
|
||||
txtProxyPort = new javax.swing.JTextField();
|
||||
pnlProxyAuth = new javax.swing.JPanel();
|
||||
lblProxyUserName = new javax.swing.JLabel();
|
||||
txtProxyUserName = new javax.swing.JTextField();
|
||||
lblProxyPassword = new javax.swing.JLabel();
|
||||
txtPasswordField = new javax.swing.JPasswordField();
|
||||
jProxySettingsButton = new javax.swing.JButton();
|
||||
lblStatus = new javax.swing.JLabel();
|
||||
|
||||
setTitle("Connect");
|
||||
|
|
@ -204,113 +157,13 @@ public class ConnectDialog extends MageDialog {
|
|||
}
|
||||
});
|
||||
|
||||
cbProxyType.addActionListener(new java.awt.event.ActionListener() {
|
||||
jProxySettingsButton.setText("Proxy Settings...");
|
||||
jProxySettingsButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cbProxyTypeActionPerformed(evt);
|
||||
jProxySettingsButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
lblProxyType.setLabelFor(cbProxyType);
|
||||
lblProxyType.setText("Proxy:");
|
||||
|
||||
pnlProxySettings.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
pnlProxySettings.setMinimumSize(new java.awt.Dimension(0, 0));
|
||||
|
||||
lblProxyServer.setLabelFor(txtProxyServer);
|
||||
lblProxyServer.setText("Server:");
|
||||
|
||||
lblProxyPort.setLabelFor(txtProxyPort);
|
||||
lblProxyPort.setText("Port:");
|
||||
|
||||
txtProxyPort.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||
public void keyTyped(java.awt.event.KeyEvent evt) {
|
||||
txtProxyPortkeyTyped(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout pnlProxyLayout = new javax.swing.GroupLayout(pnlProxy);
|
||||
pnlProxy.setLayout(pnlProxyLayout);
|
||||
pnlProxyLayout.setHorizontalGroup(
|
||||
pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(pnlProxyLayout.createSequentialGroup()
|
||||
.addContainerGap(28, Short.MAX_VALUE)
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(lblProxyPort)
|
||||
.addComponent(lblProxyServer))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(txtProxyPort, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(txtProxyServer, javax.swing.GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
pnlProxyLayout.setVerticalGroup(
|
||||
pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(pnlProxyLayout.createSequentialGroup()
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(txtProxyServer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblProxyServer))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(lblProxyPort)
|
||||
.addComponent(txtProxyPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
lblProxyUserName.setLabelFor(txtProxyUserName);
|
||||
lblProxyUserName.setText("User Name:");
|
||||
|
||||
lblProxyPassword.setText("Password:");
|
||||
|
||||
txtPasswordField.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
txtPasswordFieldActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout pnlProxyAuthLayout = new javax.swing.GroupLayout(pnlProxyAuth);
|
||||
pnlProxyAuth.setLayout(pnlProxyAuthLayout);
|
||||
pnlProxyAuthLayout.setHorizontalGroup(
|
||||
pnlProxyAuthLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlProxyAuthLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(pnlProxyAuthLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(lblProxyPassword)
|
||||
.addComponent(lblProxyUserName))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(pnlProxyAuthLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(txtPasswordField)
|
||||
.addComponent(txtProxyUserName, javax.swing.GroupLayout.DEFAULT_SIZE, 358, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
pnlProxyAuthLayout.setVerticalGroup(
|
||||
pnlProxyAuthLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlProxyAuthLayout.createSequentialGroup()
|
||||
.addGroup(pnlProxyAuthLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(txtProxyUserName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblProxyUserName))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
|
||||
.addGroup(pnlProxyAuthLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(txtPasswordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblProxyPassword))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout pnlProxySettingsLayout = new javax.swing.GroupLayout(pnlProxySettings);
|
||||
pnlProxySettings.setLayout(pnlProxySettingsLayout);
|
||||
pnlProxySettingsLayout.setHorizontalGroup(
|
||||
pnlProxySettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(pnlProxy, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(pnlProxyAuth, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
pnlProxySettingsLayout.setVerticalGroup(
|
||||
pnlProxySettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(pnlProxySettingsLayout.createSequentialGroup()
|
||||
.addComponent(pnlProxy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
|
||||
.addComponent(pnlProxyAuth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
|
|
@ -320,7 +173,6 @@ public class ConnectDialog extends MageDialog {
|
|||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(lblProxyType)
|
||||
.addComponent(lblPort)
|
||||
.addComponent(lblServer)
|
||||
.addComponent(lblUserName))
|
||||
|
|
@ -335,14 +187,12 @@ public class ConnectDialog extends MageDialog {
|
|||
.addComponent(txtServer, javax.swing.GroupLayout.DEFAULT_SIZE, 311, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jButton1))
|
||||
.addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(jProxySettingsButton)))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(lblStatus, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnConnect)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnCancel))
|
||||
.addComponent(pnlProxySettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addComponent(lblStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
|
|
@ -363,18 +213,19 @@ public class ConnectDialog extends MageDialog {
|
|||
.addComponent(lblUserName))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(chkAutoConnect)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblProxyType))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(pnlProxySettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(btnCancel)
|
||||
.addComponent(btnConnect)
|
||||
.addComponent(lblStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap())
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jProxySettingsButton)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(btnCancel)
|
||||
.addComponent(btnConnect))
|
||||
.addContainerGap())
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(8, 8, 8)
|
||||
.addComponent(lblStatus)
|
||||
.addContainerGap())))
|
||||
);
|
||||
|
||||
pack();
|
||||
|
|
@ -415,12 +266,37 @@ public class ConnectDialog extends MageDialog {
|
|||
connection.setHost(this.txtServer.getText().trim());
|
||||
connection.setPort(Integer.valueOf(this.txtPort.getText().trim()));
|
||||
connection.setUsername(this.txtUserName.getText().trim());
|
||||
connection.setProxyType((ProxyType) this.cbProxyType.getSelectedItem());
|
||||
connection.setProxyHost(this.txtProxyServer.getText().trim());
|
||||
connection.setProxyPort(Integer.valueOf(this.txtProxyPort.getText().trim()));
|
||||
connection.setProxyUsername(this.txtProxyUserName.getText().trim());
|
||||
input = txtPasswordField.getPassword();
|
||||
connection.setProxyPassword(new String(input));
|
||||
|
||||
String proxyType = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_TYPE, "None");
|
||||
ProxyType configProxyType = null;
|
||||
for (ProxyType pt : Connection.ProxyType.values()) {
|
||||
if (pt.toString().equals(proxyType)) {
|
||||
configProxyType = pt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (configProxyType != null) {
|
||||
connection.setProxyType(configProxyType);
|
||||
if (!proxyType.equals("None")) {
|
||||
String host = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_ADDRESS, "");
|
||||
String port = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_PORT, "");
|
||||
if (!host.isEmpty() && !port.isEmpty()) {
|
||||
connection.setProxyHost(host);
|
||||
connection.setProxyPort(Integer.valueOf(port));
|
||||
String username = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_USERNAME, "");
|
||||
connection.setProxyUsername(username);
|
||||
if (PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_REMEMBER, "false").equals("true")) {
|
||||
String password = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_PSWD, "");
|
||||
connection.setProxyPassword(password);
|
||||
}
|
||||
} else {
|
||||
logger.warn("host or\\and port are empty: host=" + host + ", port=" + port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
logger.debug("connecting: " + connection.getProxyType() + " " + connection.getProxyHost() + " " + connection.getProxyPort());
|
||||
task = new ConnectTask();
|
||||
task.execute();
|
||||
|
|
@ -481,10 +357,6 @@ public class ConnectDialog extends MageDialog {
|
|||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_chkAutoConnectActionPerformed
|
||||
|
||||
private void txtProxyPortkeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtProxyPortkeyTyped
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_txtProxyPortkeyTyped
|
||||
|
||||
private void findPublicServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
||||
BufferedReader in = null;
|
||||
try {
|
||||
|
|
@ -525,38 +397,22 @@ public class ConnectDialog extends MageDialog {
|
|||
}
|
||||
}//GEN-LAST:event_jButton1ActionPerformed
|
||||
|
||||
private void cbProxyTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbProxyTypeActionPerformed
|
||||
this.showProxySettings();
|
||||
}//GEN-LAST:event_cbProxyTypeActionPerformed
|
||||
|
||||
private void txtPasswordFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPasswordFieldActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_txtPasswordFieldActionPerformed
|
||||
private void jProxySettingsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jProxySettingsButtonActionPerformed
|
||||
PreferencesDialog.main(new String[]{PreferencesDialog.OPEN_CONNECTION_TAB});
|
||||
}//GEN-LAST:event_jProxySettingsButtonActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btnCancel;
|
||||
private javax.swing.JButton btnConnect;
|
||||
private javax.swing.JComboBox cbProxyType;
|
||||
private javax.swing.JCheckBox chkAutoConnect;
|
||||
private javax.swing.JButton jButton1;
|
||||
private javax.swing.JButton jProxySettingsButton;
|
||||
private javax.swing.JLabel lblPort;
|
||||
private javax.swing.JLabel lblProxyPassword;
|
||||
private javax.swing.JLabel lblProxyPort;
|
||||
private javax.swing.JLabel lblProxyServer;
|
||||
private javax.swing.JLabel lblProxyType;
|
||||
private javax.swing.JLabel lblProxyUserName;
|
||||
private javax.swing.JLabel lblServer;
|
||||
private javax.swing.JLabel lblStatus;
|
||||
private javax.swing.JLabel lblUserName;
|
||||
private javax.swing.JPanel pnlProxy;
|
||||
private javax.swing.JPanel pnlProxyAuth;
|
||||
private javax.swing.JPanel pnlProxySettings;
|
||||
private javax.swing.JPasswordField txtPasswordField;
|
||||
private javax.swing.JTextField txtPort;
|
||||
private javax.swing.JTextField txtProxyPort;
|
||||
private javax.swing.JTextField txtProxyServer;
|
||||
private javax.swing.JTextField txtProxyUserName;
|
||||
private javax.swing.JTextField txtServer;
|
||||
private javax.swing.JTextField txtUserName;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@
|
|||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jTabbedPane1" alignment="0" pref="448" max="32767" attributes="0"/>
|
||||
<Component id="jTabbedPane1" alignment="0" pref="439" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace pref="320" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="311" max="32767" attributes="0"/>
|
||||
<Component id="saveButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="exitButton" min="-2" pref="55" max="-2" attributes="0"/>
|
||||
|
|
@ -64,9 +64,12 @@
|
|||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel3" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jPanel7" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="jPanel3" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
|
|
@ -76,7 +79,9 @@
|
|||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="173" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jPanel7" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="84" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
|
@ -86,7 +91,11 @@
|
|||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Hand"/>
|
||||
<TitledBorder title="Hand">
|
||||
<Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
</TitledBorder>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
|
@ -100,7 +109,7 @@
|
|||
<Component id="showToolTipsInHand" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="displayBigCardsInHand" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="170" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="161" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
|
@ -135,6 +144,56 @@
|
|||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel7">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Battlefield">
|
||||
<Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
</TitledBorder>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AccessibilityProperties>
|
||||
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Battlefield"/>
|
||||
</AccessibilityProperties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="nonLandPermanentsInOnePile" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="199" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="nonLandPermanentsInOnePile" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="30" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JCheckBox" name="nonLandPermanentsInOnePile">
|
||||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="label" type="java.lang.String" value="Put non-land permanents in one pile"/>
|
||||
</Properties>
|
||||
<AccessibilityProperties>
|
||||
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="nonLandPermanentsInOnePile"/>
|
||||
</AccessibilityProperties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="nonLandPermanentsInOnePileActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||||
|
|
@ -205,7 +264,7 @@
|
|||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="109" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="100" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
|
@ -387,7 +446,7 @@
|
|||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel5" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="91" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="92" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
|
@ -397,7 +456,11 @@
|
|||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Card images location:"/>
|
||||
<TitledBorder title="Card images location:">
|
||||
<Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
</TitledBorder>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
|
@ -422,7 +485,7 @@
|
|||
<Component id="checkForNewImages" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="19" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
|
@ -471,6 +534,216 @@
|
|||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel6">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||
<JTabbedPaneConstraints tabName="Connection">
|
||||
<Property name="tabTitle" type="java.lang.String" value="Connection"/>
|
||||
</JTabbedPaneConstraints>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyType" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="cbProxyType" min="-2" pref="126" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="pnlProxySettings" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblProxyType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cbProxyType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="pnlProxySettings" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="40" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblProxyType">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Proxy:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbProxyType">
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbProxyTypeActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="pnlProxySettings">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AccessibilityProperties>
|
||||
<Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value=""/>
|
||||
</AccessibilityProperties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="pnlProxy" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="pnlProxy" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="pnlProxy">
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
|
||||
<Component id="rememberPswd" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="jLabel11" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="34" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="lblProxyPort" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyPassword" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyServer" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyUserName" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="txtProxyPort" alignment="0" min="-2" pref="58" max="-2" attributes="1"/>
|
||||
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
|
||||
<Component id="txtPasswordField" alignment="0" max="32767" attributes="1"/>
|
||||
<Component id="txtProxyUserName" alignment="0" min="-2" pref="148" max="-2" attributes="1"/>
|
||||
</Group>
|
||||
<Component id="txtProxyServer" alignment="0" pref="295" max="32767" attributes="1"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="txtProxyServer" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyServer" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblProxyPort" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="txtProxyPort" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="txtProxyUserName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyUserName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="txtPasswordField" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblProxyPassword" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="rememberPswd" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="25" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="lblProxyServer">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Server:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtProxyServer">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblProxyPort">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Port:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtProxyPort">
|
||||
<Events>
|
||||
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtProxyPortkeyTyped"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblProxyUserName">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="User Name:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtProxyUserName">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblProxyPassword">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Password:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JPasswordField" name="txtPasswordField">
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPasswordFieldActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="rememberPswd">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Remember Password"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rememberPswdActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel11">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Tahoma" size="10" style="2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Note: password won't be encrypted!"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="saveButton">
|
||||
|
|
|
|||
|
|
@ -33,18 +33,18 @@
|
|||
*/
|
||||
package mage.client.dialog;
|
||||
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.util.Config;
|
||||
import mage.remote.Connection;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.prefs.BackingStoreException;
|
||||
|
||||
import mage.client.MageFrame;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
import static mage.client.util.PhaseManager.*;
|
||||
import static mage.client.util.PhaseManager.END_OF_TURN_OTHERS;
|
||||
|
||||
/**
|
||||
* Preferences dialog.
|
||||
|
|
@ -60,10 +60,19 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
public static final String KEY_CARD_IMAGES_PATH = "cardImagesPath";
|
||||
public static final String KEY_CARD_IMAGES_CHECK = "cardImagesCheck";
|
||||
|
||||
public static final String KEY_PROXY_ADDRESS = "proxyAddress";
|
||||
public static final String KEY_PROXY_PORT = "proxyPort";
|
||||
public static final String KEY_PROXY_USERNAME = "proxyUsername";
|
||||
public static final String KEY_PROXY_REMEMBER = "proxyRemember";
|
||||
public static final String KEY_PROXY_TYPE = "proxyType";
|
||||
public static final String KEY_PROXY_PSWD = "proxyPassword";
|
||||
|
||||
private static Map<String, String> cache = new HashMap<String, String>();
|
||||
private static final Boolean UPDATE_CACHE_POLICY = Boolean.TRUE;
|
||||
|
||||
private final JFileChooser fc = new JFileChooser();
|
||||
public static final String OPEN_CONNECTION_TAB = "Open-Connection-Tab";
|
||||
|
||||
private final JFileChooser fc = new JFileChooser();
|
||||
|
||||
{
|
||||
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
|
||||
|
|
@ -74,6 +83,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
super(parent, modal);
|
||||
initComponents();
|
||||
imageFolderPath.setEditable(false);
|
||||
cbProxyType.setModel(new DefaultComboBoxModel(Connection.ProxyType.values()));
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
|
|
@ -88,10 +98,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
jTabbedPane1 = new javax.swing.JTabbedPane();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jPanel3 = new javax.swing.JPanel();
|
||||
jPanel6 = new javax.swing.JPanel();
|
||||
showToolTipsInHand = new javax.swing.JCheckBox();
|
||||
nonLandPermanentsInOnePile = new javax.swing.JCheckBox();
|
||||
displayBigCardsInHand = new javax.swing.JCheckBox();
|
||||
jPanel7 = new javax.swing.JPanel();
|
||||
nonLandPermanentsInOnePile = new javax.swing.JCheckBox();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
|
|
@ -123,13 +133,28 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
imageFolderPath = new javax.swing.JTextField();
|
||||
browseButton = new javax.swing.JButton();
|
||||
checkForNewImages = new javax.swing.JCheckBox();
|
||||
jPanel6 = new javax.swing.JPanel();
|
||||
lblProxyType = new javax.swing.JLabel();
|
||||
cbProxyType = new javax.swing.JComboBox();
|
||||
pnlProxySettings = new javax.swing.JPanel();
|
||||
pnlProxy = new javax.swing.JPanel();
|
||||
lblProxyServer = new javax.swing.JLabel();
|
||||
txtProxyServer = new javax.swing.JTextField();
|
||||
lblProxyPort = new javax.swing.JLabel();
|
||||
txtProxyPort = new javax.swing.JTextField();
|
||||
lblProxyUserName = new javax.swing.JLabel();
|
||||
txtProxyUserName = new javax.swing.JTextField();
|
||||
lblProxyPassword = new javax.swing.JLabel();
|
||||
txtPasswordField = new javax.swing.JPasswordField();
|
||||
rememberPswd = new javax.swing.JCheckBox();
|
||||
jLabel11 = new javax.swing.JLabel();
|
||||
saveButton = new javax.swing.JButton();
|
||||
exitButton = new javax.swing.JButton();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setTitle("Preferences");
|
||||
|
||||
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Hand"));
|
||||
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Hand"));
|
||||
|
||||
showToolTipsInHand.setSelected(true);
|
||||
showToolTipsInHand.setText("Show tooltips");
|
||||
|
|
@ -146,11 +171,6 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}
|
||||
});
|
||||
|
||||
jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Battlefield"));
|
||||
|
||||
nonLandPermanentsInOnePile.setSelected(false);
|
||||
nonLandPermanentsInOnePile.setText("Put non-land permanents in one pile.");
|
||||
|
||||
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
|
||||
jPanel3.setLayout(jPanel3Layout);
|
||||
jPanel3Layout.setHorizontalGroup(
|
||||
|
|
@ -160,7 +180,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(showToolTipsInHand)
|
||||
.addComponent(displayBigCardsInHand))
|
||||
.addContainerGap(170, Short.MAX_VALUE))
|
||||
.addContainerGap(161, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel3Layout.setVerticalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
|
@ -171,40 +191,56 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Battlefield"));
|
||||
|
||||
nonLandPermanentsInOnePile.setSelected(true);
|
||||
nonLandPermanentsInOnePile.setLabel("Put non-land permanents in one pile");
|
||||
nonLandPermanentsInOnePile.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
nonLandPermanentsInOnePileActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
|
||||
jPanel7.setLayout(jPanel7Layout);
|
||||
jPanel7Layout.setHorizontalGroup(
|
||||
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel7Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(nonLandPermanentsInOnePile)
|
||||
.addContainerGap(199, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel7Layout.setVerticalGroup(
|
||||
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel7Layout.createSequentialGroup()
|
||||
.addComponent(nonLandPermanentsInOnePile)
|
||||
.addContainerGap(30, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile");
|
||||
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jPanel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap()
|
||||
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(173, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(84, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
|
||||
jPanel6.setLayout(jPanel6Layout);
|
||||
jPanel6Layout.setHorizontalGroup(
|
||||
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel6Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(nonLandPermanentsInOnePile)
|
||||
)
|
||||
.addContainerGap(170, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel6Layout.setVerticalGroup(
|
||||
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel6Layout.createSequentialGroup()
|
||||
.addComponent(nonLandPermanentsInOnePile)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel7.getAccessibleContext().setAccessibleName("Battlefield");
|
||||
|
||||
jTabbedPane1.addTab("Main", jPanel1);
|
||||
|
||||
|
|
@ -235,48 +271,48 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGap(20, 20, 20)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(jLabel6)
|
||||
.addComponent(jLabel7)
|
||||
.addComponent(jLabel8))
|
||||
.addGap(77, 77, 77)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(jLabel9)
|
||||
.addGap(32, 32, 32)
|
||||
.addComponent(jLabel10))
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGap(13, 13, 13)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(checkBoxDrawYou)
|
||||
.addComponent(checkBoxUpkeepYou)
|
||||
.addComponent(checkBoxMainYou)
|
||||
.addComponent(checkBoxBeforeCYou)
|
||||
.addComponent(checkBoxEndOfCYou)
|
||||
.addComponent(checkBoxMain2You)
|
||||
.addComponent(checkBoxEndTurnYou))
|
||||
.addGap(78, 78, 78)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(checkBoxUpkeepOthers)
|
||||
.addComponent(checkBoxBeforeCOthers)
|
||||
.addComponent(checkBoxMainOthers)
|
||||
.addComponent(checkBoxEndOfCOthers)
|
||||
.addComponent(checkBoxDrawOthers)
|
||||
.addComponent(checkBoxMain2Others)
|
||||
.addComponent(checkBoxEndTurnOthers)))))
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||
.addGap(20, 20, 20)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(jLabel6)
|
||||
.addComponent(jLabel7)
|
||||
.addComponent(jLabel8))
|
||||
.addGap(77, 77, 77)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(jLabel9)
|
||||
.addGap(32, 32, 32)
|
||||
.addComponent(jLabel10))
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGap(13, 13, 13)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(checkBoxDrawYou)
|
||||
.addComponent(checkBoxUpkeepYou)
|
||||
.addComponent(checkBoxMainYou)
|
||||
.addComponent(checkBoxBeforeCYou)
|
||||
.addComponent(checkBoxEndOfCYou)
|
||||
.addComponent(checkBoxMain2You)
|
||||
.addComponent(checkBoxEndTurnYou))
|
||||
.addGap(78, 78, 78)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(checkBoxUpkeepOthers)
|
||||
.addComponent(checkBoxBeforeCOthers)
|
||||
.addComponent(checkBoxMainOthers)
|
||||
.addComponent(checkBoxEndOfCOthers)
|
||||
.addComponent(checkBoxDrawOthers)
|
||||
.addComponent(checkBoxMain2Others)
|
||||
.addComponent(checkBoxEndTurnOthers)))))
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jLabel1)))
|
||||
.addContainerGap(109, Short.MAX_VALUE))
|
||||
.addContainerGap()
|
||||
.addComponent(jLabel1)))
|
||||
.addContainerGap(100, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
|
@ -284,19 +320,19 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(jLabel10)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(checkBoxUpkeepOthers))
|
||||
.addComponent(jLabel10)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(checkBoxUpkeepOthers))
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addGap(20, 20, 20))
|
||||
.addComponent(jLabel9))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(checkBoxUpkeepYou)
|
||||
.addComponent(jLabel2))))
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addGap(20, 20, 20))
|
||||
.addComponent(jLabel9))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(checkBoxUpkeepYou)
|
||||
.addComponent(jLabel2))))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel3)
|
||||
|
|
@ -309,13 +345,13 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addComponent(checkBoxMainOthers))
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(checkBoxBeforeCYou, javax.swing.GroupLayout.Alignment.TRAILING)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(checkBoxBeforeCYou, javax.swing.GroupLayout.Alignment.TRAILING)))
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGap(6, 6, 6)
|
||||
.addComponent(checkBoxBeforeCOthers)))
|
||||
.addGap(6, 6, 6)
|
||||
.addComponent(checkBoxBeforeCOthers)))
|
||||
.addGap(7, 7, 7)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel6)
|
||||
|
|
@ -336,7 +372,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
jTabbedPane1.addTab("Phases", jPanel2);
|
||||
|
||||
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Card images location:"));
|
||||
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Card images location:"));
|
||||
|
||||
useDefaultImageFolder.setText("use default");
|
||||
useDefaultImageFolder.addActionListener(new java.awt.event.ActionListener() {
|
||||
|
|
@ -361,17 +397,17 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addGroup(jPanel5Layout.createSequentialGroup()
|
||||
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel5Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(useDefaultImageFolder))
|
||||
.addContainerGap()
|
||||
.addComponent(useDefaultImageFolder))
|
||||
.addGroup(jPanel5Layout.createSequentialGroup()
|
||||
.addGap(19, 19, 19)
|
||||
.addComponent(imageFolderPath, javax.swing.GroupLayout.PREFERRED_SIZE, 284, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(browseButton))
|
||||
.addGap(19, 19, 19)
|
||||
.addComponent(imageFolderPath, javax.swing.GroupLayout.PREFERRED_SIZE, 284, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(browseButton))
|
||||
.addGroup(jPanel5Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(checkForNewImages)))
|
||||
.addContainerGap(19, Short.MAX_VALUE))
|
||||
.addContainerGap()
|
||||
.addComponent(checkForNewImages)))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel5Layout.setVerticalGroup(
|
||||
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
|
@ -384,7 +420,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addComponent(browseButton))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(checkForNewImages)
|
||||
.addContainerGap(75, Short.MAX_VALUE))
|
||||
.addContainerGap(45, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
|
||||
|
|
@ -401,11 +437,151 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(91, Short.MAX_VALUE))
|
||||
.addContainerGap(92, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jTabbedPane1.addTab("Images", jPanel4);
|
||||
|
||||
lblProxyType.setText("Proxy:");
|
||||
|
||||
cbProxyType.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
cbProxyTypeActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
pnlProxySettings.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
|
||||
lblProxyServer.setText("Server:");
|
||||
|
||||
lblProxyPort.setText("Port:");
|
||||
|
||||
txtProxyPort.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||
public void keyTyped(java.awt.event.KeyEvent evt) {
|
||||
txtProxyPortkeyTyped(evt);
|
||||
}
|
||||
});
|
||||
|
||||
lblProxyUserName.setText("User Name:");
|
||||
|
||||
lblProxyPassword.setText("Password:");
|
||||
|
||||
txtPasswordField.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
txtPasswordFieldActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
rememberPswd.setText("Remember Password");
|
||||
rememberPswd.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
rememberPswdActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jLabel11.setFont(new java.awt.Font("Tahoma", 2, 10));
|
||||
jLabel11.setText("Note: password won't be encrypted!");
|
||||
|
||||
javax.swing.GroupLayout pnlProxyLayout = new javax.swing.GroupLayout(pnlProxy);
|
||||
pnlProxy.setLayout(pnlProxyLayout);
|
||||
pnlProxyLayout.setHorizontalGroup(
|
||||
pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(pnlProxyLayout.createSequentialGroup()
|
||||
.addGap(29, 29, 29)
|
||||
.addComponent(rememberPswd)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jLabel11)
|
||||
.addGap(34, 34, 34))
|
||||
.addGroup(pnlProxyLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(lblProxyPort)
|
||||
.addComponent(lblProxyPassword)
|
||||
.addComponent(lblProxyServer)
|
||||
.addComponent(lblProxyUserName))
|
||||
.addGap(19, 19, 19)
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(txtProxyPort, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(txtPasswordField, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(txtProxyUserName, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(txtProxyServer, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
pnlProxyLayout.setVerticalGroup(
|
||||
pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(pnlProxyLayout.createSequentialGroup()
|
||||
.addGap(6, 6, 6)
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(txtProxyServer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblProxyServer))
|
||||
.addGap(8, 8, 8)
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(lblProxyPort)
|
||||
.addComponent(txtProxyPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(txtProxyUserName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblProxyUserName))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(txtPasswordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblProxyPassword))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(rememberPswd)
|
||||
.addComponent(jLabel11))
|
||||
.addContainerGap(25, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout pnlProxySettingsLayout = new javax.swing.GroupLayout(pnlProxySettings);
|
||||
pnlProxySettings.setLayout(pnlProxySettingsLayout);
|
||||
pnlProxySettingsLayout.setHorizontalGroup(
|
||||
pnlProxySettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(pnlProxySettingsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(pnlProxy, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
pnlProxySettingsLayout.setVerticalGroup(
|
||||
pnlProxySettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(pnlProxySettingsLayout.createSequentialGroup()
|
||||
.addComponent(pnlProxy, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
|
||||
jPanel6.setLayout(jPanel6Layout);
|
||||
jPanel6Layout.setHorizontalGroup(
|
||||
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel6Layout.createSequentialGroup()
|
||||
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel6Layout.createSequentialGroup()
|
||||
.addGap(40, 40, 40)
|
||||
.addComponent(lblProxyType)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPanel6Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(pnlProxySettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel6Layout.setVerticalGroup(
|
||||
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel6Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(lblProxyType)
|
||||
.addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(pnlProxySettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(40, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pnlProxySettings.getAccessibleContext().setAccessibleDescription("");
|
||||
|
||||
jTabbedPane1.addTab("Connection", jPanel6);
|
||||
|
||||
saveButton.setLabel("Save");
|
||||
saveButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
|
|
@ -424,9 +600,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 448, Short.MAX_VALUE)
|
||||
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 439, Short.MAX_VALUE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap(320, Short.MAX_VALUE)
|
||||
.addContainerGap(311, Short.MAX_VALUE)
|
||||
.addComponent(saveButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
|
|
@ -466,7 +642,29 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
save(prefs, dialog.displayBigCardsInHand, KEY_HAND_USE_BIG_CARDS, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.showToolTipsInHand, KEY_HAND_SHOW_TOOLTIPS, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.nonLandPermanentsInOnePile, KEY_PERMANENTS_IN_ONE_PILE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
saveImagesPath(prefs);
|
||||
|
||||
// connection
|
||||
//MageFrame.getPreferences().put("proxyAddress", txtProxyServer.getText().trim());
|
||||
//MageFrame.getPreferences().put("proxyPort", txtProxyPort.getText().trim());
|
||||
//MageFrame.getPreferences().put("proxyType", cbProxyType.getSelectedItem().toString());
|
||||
//MageFrame.getPreferences().put("proxyUsername", txtProxyUserName.getText().trim());
|
||||
//char[] input = txtPasswordField.getPassword();
|
||||
//MageFrame.getPreferences().put("proxyPassword", new String(input));
|
||||
//Arrays.fill(input, '0');
|
||||
|
||||
//TODO: !!!!!!!!!!!!!
|
||||
// connection
|
||||
/*dialog.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(MageFrame.getPreferences().get(KEY_PROXY_TYPE, "NONE").toUpperCase()));
|
||||
load(prefs, dialog.txtProxyServer, KEY_PROXY_ADDRESS, Config.serverName);
|
||||
load(prefs, dialog.txtProxyPort, KEY_PROXY_PORT, Integer.toString(Config.port));
|
||||
load(prefs, dialog.txtProxyUserName, KEY_PROXY_USERNAME, "");
|
||||
load(prefs, dialog.rememberPswd, KEY_PROXY_REMEMBER, "true", "false");
|
||||
if (dialog.rememberPswd.isSelected()) {
|
||||
load(prefs, dialog.txtPasswordField, KEY_PROXY_PSWD, "");
|
||||
}*/
|
||||
|
||||
// images
|
||||
saveImagesPath(prefs);
|
||||
try {
|
||||
prefs.flush();
|
||||
} catch (BackingStoreException ex) {
|
||||
|
|
@ -518,41 +716,104 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}
|
||||
}//GEN-LAST:event_browseButtonActionPerformed
|
||||
|
||||
private void cbProxyTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbProxyTypeActionPerformed
|
||||
this.showProxySettings();
|
||||
}//GEN-LAST:event_cbProxyTypeActionPerformed
|
||||
|
||||
private void txtPasswordFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPasswordFieldActionPerformed
|
||||
}//GEN-LAST:event_txtPasswordFieldActionPerformed
|
||||
|
||||
private void txtProxyPortkeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtProxyPortkeyTyped
|
||||
}//GEN-LAST:event_txtProxyPortkeyTyped
|
||||
|
||||
private void nonLandPermanentsInOnePileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nonLandPermanentsInOnePileActionPerformed
|
||||
}//GEN-LAST:event_nonLandPermanentsInOnePileActionPerformed
|
||||
|
||||
private void rememberPswdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rememberPswdActionPerformed
|
||||
}//GEN-LAST:event_rememberPswdActionPerformed
|
||||
|
||||
private void showProxySettings() {
|
||||
if (cbProxyType.getSelectedItem() == Connection.ProxyType.SOCKS) {
|
||||
this.pnlProxy.setVisible(true);
|
||||
this.pnlProxySettings.setVisible(true);
|
||||
}
|
||||
else if (cbProxyType.getSelectedItem() == Connection.ProxyType.HTTP) {
|
||||
this.pnlProxy.setVisible(true);
|
||||
this.pnlProxySettings.setVisible(true);
|
||||
}
|
||||
else if (cbProxyType.getSelectedItem() == Connection.ProxyType.NONE) {
|
||||
this.pnlProxy.setVisible(false);
|
||||
this.pnlProxySettings.setVisible(false);
|
||||
}
|
||||
this.pack();
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String args[]) {
|
||||
int param = 0;
|
||||
if (args.length > 0) {
|
||||
String param1 = args[0];
|
||||
if (param1.equals(OPEN_CONNECTION_TAB)) {
|
||||
param = 3;
|
||||
}
|
||||
}
|
||||
final int openedTab = param;
|
||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
if (!dialog.isVisible()) {
|
||||
Preferences prefs = MageFrame.getPreferences();
|
||||
load(prefs, dialog.checkBoxUpkeepYou, UPKEEP_YOU);
|
||||
load(prefs, dialog.checkBoxDrawYou, DRAW_YOU);
|
||||
load(prefs, dialog.checkBoxMainYou, MAIN_YOU);
|
||||
load(prefs, dialog.checkBoxBeforeCYou, BEFORE_COMBAT_YOU);
|
||||
load(prefs, dialog.checkBoxEndOfCYou, END_OF_COMBAT_YOU);
|
||||
load(prefs, dialog.checkBoxMain2You, MAIN_2_YOU);
|
||||
load(prefs, dialog.checkBoxEndTurnYou, END_OF_TURN_YOU);
|
||||
public void run() {
|
||||
if (!dialog.isVisible()) {
|
||||
Preferences prefs = MageFrame.getPreferences();
|
||||
load(prefs, dialog.checkBoxUpkeepYou, UPKEEP_YOU);
|
||||
load(prefs, dialog.checkBoxDrawYou, DRAW_YOU);
|
||||
load(prefs, dialog.checkBoxMainYou, MAIN_YOU);
|
||||
load(prefs, dialog.checkBoxBeforeCYou, BEFORE_COMBAT_YOU);
|
||||
load(prefs, dialog.checkBoxEndOfCYou, END_OF_COMBAT_YOU);
|
||||
load(prefs, dialog.checkBoxMain2You, MAIN_2_YOU);
|
||||
load(prefs, dialog.checkBoxEndTurnYou, END_OF_TURN_YOU);
|
||||
|
||||
load(prefs, dialog.checkBoxUpkeepOthers, UPKEEP_OTHERS);
|
||||
load(prefs, dialog.checkBoxDrawOthers, DRAW_OTHERS);
|
||||
load(prefs, dialog.checkBoxMainOthers, MAIN_OTHERS);
|
||||
load(prefs, dialog.checkBoxBeforeCOthers, BEFORE_COMBAT_OTHERS);
|
||||
load(prefs, dialog.checkBoxEndOfCOthers, END_OF_COMBAT_OTHERS);
|
||||
load(prefs, dialog.checkBoxMain2Others, MAIN_2_OTHERS);
|
||||
load(prefs, dialog.checkBoxEndTurnOthers, END_OF_TURN_OTHERS);
|
||||
load(prefs, dialog.displayBigCardsInHand, KEY_HAND_USE_BIG_CARDS, "true");
|
||||
load(prefs, dialog.showToolTipsInHand, KEY_HAND_SHOW_TOOLTIPS, "true");
|
||||
load(prefs, dialog.checkBoxUpkeepOthers, UPKEEP_OTHERS);
|
||||
load(prefs, dialog.checkBoxDrawOthers, DRAW_OTHERS);
|
||||
load(prefs, dialog.checkBoxMainOthers, MAIN_OTHERS);
|
||||
load(prefs, dialog.checkBoxBeforeCOthers, BEFORE_COMBAT_OTHERS);
|
||||
load(prefs, dialog.checkBoxEndOfCOthers, END_OF_COMBAT_OTHERS);
|
||||
load(prefs, dialog.checkBoxMain2Others, MAIN_2_OTHERS);
|
||||
load(prefs, dialog.checkBoxEndTurnOthers, END_OF_TURN_OTHERS);
|
||||
load(prefs, dialog.displayBigCardsInHand, KEY_HAND_USE_BIG_CARDS, "true");
|
||||
load(prefs, dialog.showToolTipsInHand, KEY_HAND_SHOW_TOOLTIPS, "true");
|
||||
load(prefs, dialog.nonLandPermanentsInOnePile, KEY_PERMANENTS_IN_ONE_PILE, "true");
|
||||
loadImagesPath(prefs);
|
||||
dialog.setLocation(300, 200);
|
||||
dialog.reset();
|
||||
dialog.setVisible(true);
|
||||
} else {
|
||||
dialog.requestFocus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// connection
|
||||
dialog.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(MageFrame.getPreferences().get(KEY_PROXY_TYPE, "NONE").toUpperCase()));
|
||||
load(prefs, dialog.txtProxyServer, KEY_PROXY_ADDRESS, Config.serverName);
|
||||
load(prefs, dialog.txtProxyPort, KEY_PROXY_PORT, Integer.toString(Config.port));
|
||||
load(prefs, dialog.txtProxyUserName, KEY_PROXY_USERNAME, "");
|
||||
load(prefs, dialog.rememberPswd, KEY_PROXY_REMEMBER, "true", "false");
|
||||
if (dialog.rememberPswd.isSelected()) {
|
||||
load(prefs, dialog.txtPasswordField, KEY_PROXY_PSWD, "");
|
||||
}
|
||||
|
||||
// images
|
||||
loadImagesPath(prefs);
|
||||
|
||||
dialog.setLocation(300, 200);
|
||||
dialog.reset();
|
||||
|
||||
try {
|
||||
if (openedTab > 0) {
|
||||
dialog.jTabbedPane1.setSelectedIndex(3);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
dialog.setVisible(true);
|
||||
} else {
|
||||
dialog.requestFocus();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void loadImagesPath(Preferences prefs) {
|
||||
|
|
@ -591,6 +852,16 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
checkBox.setSelected(prop.equals(yesValue));
|
||||
}
|
||||
|
||||
private static void load(Preferences prefs, JCheckBox checkBox, String propName, String yesValue, String defaultValue) {
|
||||
String prop = prefs.get(propName, defaultValue);
|
||||
checkBox.setSelected(prop.equals(yesValue));
|
||||
}
|
||||
|
||||
private static void load(Preferences prefs, JTextField field, String propName, String defaultValue) {
|
||||
String prop = prefs.get(propName, defaultValue);
|
||||
field.setText(prop);
|
||||
}
|
||||
|
||||
private static void load(Preferences prefs, JCheckBox checkBox, String propName) {
|
||||
load(prefs, checkBox, propName, PHASE_ON);
|
||||
}
|
||||
|
|
@ -628,6 +899,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton browseButton;
|
||||
private javax.swing.JComboBox cbProxyType;
|
||||
private javax.swing.JCheckBox checkBoxBeforeCOthers;
|
||||
private javax.swing.JCheckBox checkBoxBeforeCYou;
|
||||
private javax.swing.JCheckBox checkBoxDrawOthers;
|
||||
|
|
@ -648,6 +920,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JTextField imageFolderPath;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel10;
|
||||
private javax.swing.JLabel jLabel11;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JLabel jLabel4;
|
||||
|
|
@ -661,12 +934,25 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JPanel jPanel3;
|
||||
private javax.swing.JPanel jPanel4;
|
||||
private javax.swing.JPanel jPanel5;
|
||||
private javax.swing.JPanel jPanel6;
|
||||
private javax.swing.JPanel jPanel6;
|
||||
private javax.swing.JPanel jPanel7;
|
||||
private javax.swing.JTabbedPane jTabbedPane1;
|
||||
private javax.swing.JLabel lblProxyPassword;
|
||||
private javax.swing.JLabel lblProxyPort;
|
||||
private javax.swing.JLabel lblProxyServer;
|
||||
private javax.swing.JLabel lblProxyType;
|
||||
private javax.swing.JLabel lblProxyUserName;
|
||||
private javax.swing.JCheckBox nonLandPermanentsInOnePile;
|
||||
private javax.swing.JPanel pnlProxy;
|
||||
private javax.swing.JPanel pnlProxySettings;
|
||||
private javax.swing.JCheckBox rememberPswd;
|
||||
private javax.swing.JButton saveButton;
|
||||
private javax.swing.JCheckBox showToolTipsInHand;
|
||||
private javax.swing.JPasswordField txtPasswordField;
|
||||
private javax.swing.JTextField txtProxyPort;
|
||||
private javax.swing.JTextField txtProxyServer;
|
||||
private javax.swing.JTextField txtProxyUserName;
|
||||
private javax.swing.JCheckBox useDefaultImageFolder;
|
||||
private javax.swing.JCheckBox nonLandPermanentsInOnePile;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
private static final PreferencesDialog dialog = new PreferencesDialog(new javax.swing.JFrame(), true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue