OSDN Git Service

cookie使用設定GUI
authoryukihane <yukihane.feather@gmail.com>
Sat, 17 Sep 2011 11:37:20 +0000 (20:37 +0900)
committeryukihane <yukihane.feather@gmail.com>
Sat, 17 Sep 2011 11:37:20 +0000 (20:37 +0900)
frontend/src/yukihane/inqubus/gui/ConfigDialog.java

index ab1bbf0..08ad934 100644 (file)
@@ -15,6 +15,7 @@ import java.util.List;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
 import javax.swing.ComboBoxModel;
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.GroupLayout;
@@ -28,6 +29,7 @@ import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JPasswordField;
+import javax.swing.JRadioButton;
 import javax.swing.JSpinner;
 import javax.swing.JTabbedPane;
 import javax.swing.JTextField;
@@ -176,9 +178,70 @@ public class ConfigDialog extends JDialog {
                 .addGroup(gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.BASELINE)
                     .addComponent(lblProxyPort)
                     .addComponent(fldProxyPort, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
-                .addContainerGap(39, Short.MAX_VALUE))
+                .addContainerGap())
+        );
+
+
+        final JCheckBox cbxCookie = new JCheckBox("ブラウザのログイン情報を使用してアクセスする");
+        final JRadioButton btnCookieIe = new JRadioButton("IE(7以降) (Windows)");
+        final JRadioButton btnCookieFirefox = new JRadioButton("Firefox(4以降) (Windows)");
+        final JRadioButton btnCookieChrome = new JRadioButton("Google Chrome (Windows)");
+        final JRadioButton btnCookieChromium = new JRadioButton("Chrome派生ブラウザ (Windows)");
+        final JRadioButton btnCookieOpera = new JRadioButton("Opera (Windows)");
+        final JRadioButton btnCookieOther = new JRadioButton("上記以外 - cookie保存ディレクトリを次に入力");
+        final JTextField fldCookie = new JTextField();
+        final JButton btnCookie = new JButton("...");
+        btnCookie.addActionListener(new FileChooseActionListener(this, JFileChooser.DIRECTORIES_ONLY, fldCookie));
+
+        final ButtonGroup grpCookie = new ButtonGroup();
+        grpCookie.add(btnCookieIe);
+        grpCookie.add(btnCookieFirefox);
+        grpCookie.add(btnCookieChrome);
+        grpCookie.add(btnCookieChromium);
+        grpCookie.add(btnCookieOpera);
+        grpCookie.add(btnCookieOther);
+
+        final JPanel pnlCookie = new JPanel();
+        pnlCookie.setBorder(BorderFactory.createTitledBorder("cookie"));
+        final GroupLayout glCookie = new GroupLayout(pnlCookie);
+        pnlCookie.setLayout(glCookie);
+        glCookie.setAutoCreateContainerGaps(true);
+        glCookie.setAutoCreateGaps(true);
+
+        glCookie.setHorizontalGroup(glCookie.createParallelGroup()
+            .addComponent(cbxCookie)
+            .addGroup(glCookie.createSequentialGroup()
+                .addGap(10)
+                .addGroup(glCookie.createParallelGroup()
+                    .addComponent(btnCookieIe)
+                    .addComponent(btnCookieFirefox)
+                    .addComponent(btnCookieChrome)
+                    .addComponent(btnCookieChromium)
+                    .addComponent(btnCookieOpera)
+                    .addComponent(btnCookieOther)
+                    .addGroup(glCookie.createSequentialGroup()
+                        .addComponent(fldCookie)
+                        .addComponent(btnCookie)
+                    )
+                )
+            )
+        );
+
+        glCookie.setVerticalGroup(glCookie.createSequentialGroup()
+            .addComponent(cbxCookie)
+            .addComponent(btnCookieIe)
+            .addComponent(btnCookieFirefox)
+            .addComponent(btnCookieChrome)
+            .addComponent(btnCookieChromium)
+            .addComponent(btnCookieOpera)
+            .addComponent(btnCookieOther)
+            .addGroup(glCookie.createParallelGroup(Alignment.BASELINE)
+                .addComponent(fldCookie)
+                .addComponent(btnCookie)
+            )
         );
 
+
         GroupLayout gl_pnlNetwork = new GroupLayout(pnlNetwork);
         pnlNetwork.setLayout(gl_pnlNetwork);
         gl_pnlNetwork.setHorizontalGroup(
@@ -187,7 +250,9 @@ public class ConfigDialog extends JDialog {
                 .addContainerGap()
                 .addGroup(gl_pnlNetwork.createParallelGroup(GroupLayout.Alignment.TRAILING)
                     .addComponent(pnlProxy, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                    .addComponent(pnlAccount, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                    .addComponent(pnlAccount, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                    .addComponent(pnlCookie, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                )
                 .addContainerGap())
         );
         gl_pnlNetwork.setVerticalGroup(
@@ -197,7 +262,10 @@ public class ConfigDialog extends JDialog {
                 .addComponent(pnlAccount, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(ComponentPlacement.RELATED)
                 .addComponent(pnlProxy, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-                .addContainerGap(178, Short.MAX_VALUE))
+                .addPreferredGap(ComponentPlacement.RELATED)
+                .addComponent(pnlCookie, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addContainerGap()
+            )
         );
 
         tabbedPane.addTab("ネットワーク", pnlNetwork);