OSDN Git Service

login情報を使用するかcookieを使用するかの選択肢
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / gui / ConfigDialog.java
index aeae92e..13bef37 100644 (file)
@@ -59,10 +59,8 @@ public class ConfigDialog extends JDialog {
         final JTabbedPane tabbedPane = new JTabbedPane();
         final JPanel pnlNetwork = new JPanel();
         final JPanel pnlAccount = new JPanel();
-        final JLabel lblMail = new JLabel();
         fldMail = new JTextField();
         fldPassword.setEchoChar('*');
-        final JLabel lblPassword = new JLabel();
         final JPanel pnlProxy = new JPanel();
         cbProxyUse = new JCheckBox();
         final JLabel lblProxyHost = new JLabel();
@@ -106,29 +104,35 @@ public class ConfigDialog extends JDialog {
 
         pnlAccount.setBorder(BorderFactory.createTitledBorder("アカウント"));
 
-        lblMail.setText("ID(メールアドレス)");
-
-        lblPassword.setText("パスワード");
+        final JRadioButton btnAccount = new JRadioButton("次の情報を使用してログインする");
+        final JLabel lblMail = new JLabel("ID(メールアドレス)");
+        final JLabel lblPassword = new JLabel("パスワード");
 
         GroupLayout gl_pnlAccount = new GroupLayout(pnlAccount);
         pnlAccount.setLayout(gl_pnlAccount);
-        gl_pnlAccount.setHorizontalGroup(
-            gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
+        gl_pnlAccount.setHorizontalGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addComponent(btnAccount)
             .addGroup(gl_pnlAccount.createSequentialGroup()
                 .addContainerGap()
+                .addGap(10)
                 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
                     .addComponent(lblMail)
-                    .addComponent(lblPassword))
+                    .addComponent(lblPassword)
+                )
                 .addPreferredGap(ComponentPlacement.RELATED)
                 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
                     .addComponent(fldPassword, GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)
-                    .addComponent(fldMail, GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE))
-                .addContainerGap())
+                    .addComponent(fldMail, GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)
+                )
+                .addContainerGap()
+            )
         );
         gl_pnlAccount.setVerticalGroup(
             gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
             .addGroup(gl_pnlAccount.createSequentialGroup()
                 .addContainerGap()
+                .addComponent(btnAccount)
+                .addPreferredGap(ComponentPlacement.RELATED)
                 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.BASELINE)
                     .addComponent(lblMail)
                     .addComponent(fldMail, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
@@ -140,7 +144,7 @@ public class ConfigDialog extends JDialog {
         );
 
 
-        final JCheckBox cbxCookie = new JCheckBox("ブラウザのログイン情報を使用してアクセスする");
+        final JRadioButton btnLoginCookie = new JRadioButton("ブラウザのログイン情報を使用してアクセスする");
         final JRadioButton btnCookieIe = new JRadioButton("IE(7以降) (Windows)");
         final JRadioButton btnCookieFirefox = new JRadioButton("Firefox(4以降) (Windows)");
         final JRadioButton btnCookieChrome = new JRadioButton("Google Chrome (Windows)");
@@ -151,6 +155,10 @@ public class ConfigDialog extends JDialog {
         final JButton btnCookie = new JButton("...");
         btnCookie.addActionListener(new FileChooseActionListener(this, JFileChooser.DIRECTORIES_ONLY, fldCookie));
 
+        final ButtonGroup grpLoginType = new ButtonGroup();
+        grpLoginType.add(btnAccount);
+        grpLoginType.add(btnLoginCookie);
+
         final ButtonGroup grpCookie = new ButtonGroup();
         grpCookie.add(btnCookieIe);
         grpCookie.add(btnCookieFirefox);
@@ -167,7 +175,7 @@ public class ConfigDialog extends JDialog {
         glCookie.setAutoCreateGaps(true);
 
         glCookie.setHorizontalGroup(glCookie.createParallelGroup()
-            .addComponent(cbxCookie)
+            .addComponent(btnLoginCookie)
             .addGroup(glCookie.createSequentialGroup()
                 .addGap(10)
                 .addGroup(glCookie.createParallelGroup()
@@ -186,7 +194,7 @@ public class ConfigDialog extends JDialog {
         );
 
         glCookie.setVerticalGroup(glCookie.createSequentialGroup()
-            .addComponent(cbxCookie)
+            .addComponent(btnLoginCookie)
             .addComponent(btnCookieIe)
             .addComponent(btnCookieFirefox)
             .addComponent(btnCookieChrome)