OSDN Git Service

コメントダウンロード設定パネルを動画のものと共通化
authoryukihane <yukihane.feather@gmail.com>
Fri, 2 Sep 2011 09:28:51 +0000 (18:28 +0900)
committeryukihane <yukihane.feather@gmail.com>
Fri, 9 Sep 2011 11:40:12 +0000 (20:40 +0900)
frontend/src/yukihane/inqubus/gui/ConfigDialog.java

index 25307b0..f7a628f 100644 (file)
@@ -65,13 +65,6 @@ public class ConfigDialog extends JDialog {
         fldProxyHost = new JTextField();
         fldProxyPort = new JTextField();
         final JPanel pnlFile = new JPanel();
-        final JPanel pnlFileComment = new JPanel();
-        final JLabel lblCommentDir = new JLabel();
-        final JLabel lblCommentFileNamePattern = new JLabel();
-        fldCommentDir = new JTextField();
-        fldCommentFileNamePattern = new JTextField();
-        btnCommentDir = new JButton();
-        cbCommentLocal = new JCheckBox();
         final JPanel pnlFileOutput = new JPanel();
         final JLabel lblOutputDir = new JLabel();
         final JLabel lblOutputFileNamePattern = new JLabel();
@@ -226,50 +219,6 @@ public class ConfigDialog extends JDialog {
 
         pnlFileComment.setBorder(BorderFactory.createTitledBorder("コメント"));
 
-        lblCommentDir.setText("保存フォルダ");
-
-        lblCommentFileNamePattern.setText("ファイル名規則");
-
-        btnCommentDir.setText("...");
-
-        cbCommentLocal.setText("local");
-
-        GroupLayout gl_pnlFileComment = new GroupLayout(pnlFileComment);
-        pnlFileComment.setLayout(gl_pnlFileComment);
-        gl_pnlFileComment.setHorizontalGroup(
-            gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addGroup(gl_pnlFileComment.createSequentialGroup()
-                .addContainerGap()
-                .addGroup(gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.LEADING)
-                    .addComponent(lblCommentFileNamePattern)
-                    .addComponent(lblCommentDir))
-                .addPreferredGap(ComponentPlacement.RELATED)
-                .addGroup(gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.LEADING)
-                    .addGroup(gl_pnlFileComment.createSequentialGroup()
-                        .addComponent(fldCommentFileNamePattern, GroupLayout.PREFERRED_SIZE, 166, GroupLayout.PREFERRED_SIZE)
-                        .addPreferredGap(ComponentPlacement.RELATED, 93, Short.MAX_VALUE)
-                        .addComponent(cbCommentLocal))
-                    .addGroup(gl_pnlFileComment.createSequentialGroup()
-                        .addComponent(fldCommentDir, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
-                        .addPreferredGap(ComponentPlacement.RELATED)
-                        .addComponent(btnCommentDir)))
-                .addContainerGap())
-        );
-        gl_pnlFileComment.setVerticalGroup(
-            gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addGroup(gl_pnlFileComment.createSequentialGroup()
-                .addGroup(gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.BASELINE)
-                    .addComponent(lblCommentDir)
-                    .addComponent(fldCommentDir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-                    .addComponent(btnCommentDir))
-                .addPreferredGap(ComponentPlacement.RELATED)
-                .addGroup(gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.BASELINE)
-                    .addComponent(lblCommentFileNamePattern)
-                    .addComponent(fldCommentFileNamePattern, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-                    .addComponent(cbCommentLocal))
-                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-        );
-
         pnlFileOutput.setBorder(BorderFactory.createTitledBorder("変換動画"));
 
         lblOutputDir.setText("保存フォルダ");
@@ -829,10 +778,7 @@ public class ConfigDialog extends JDialog {
     // ファイル - 動画
     private final DownloadLocationPanel pnlFileVideo = new DownloadLocationPanel();
     // ファイル - コメント
-    private final JTextField fldCommentDir;
-    private final JButton btnCommentDir;
-    private final JTextField fldCommentFileNamePattern;
-    private final JCheckBox cbCommentLocal;
+    private final DownloadLocationPanel pnlFileComment = new DownloadLocationPanel();
     // ファイル - 変換動画
     private final JTextField fldOutputDir;
     private final JTextField fldOutputFileNamePattern;
@@ -913,9 +859,9 @@ public class ConfigDialog extends JDialog {
         /*
          * ファイル - コメント
          */
-        fldCommentDir.setText(p.getCommentDir());
-        fldCommentFileNamePattern.setText(p.getCommentFileNamePattern());
-        cbCommentLocal.setSelected(p.getCommentUseLocal());
+        pnlFileComment.fldDir.setText(p.getCommentDir());
+        pnlFileComment.fldFileNamePattern.setText(p.getCommentFileNamePattern());
+        pnlFileComment.cbLocal.setSelected(p.getCommentUseLocal());
 
         /*
          * ファイル - 変換動画
@@ -1012,9 +958,9 @@ public class ConfigDialog extends JDialog {
         /*
          * ファイル - コメント
          */
-        p.setCommentDir(fldCommentDir.getText());
-        p.setCommentFileNamePattern(fldCommentFileNamePattern.getText());
-        p.setCommentUseLocal(cbCommentLocal.isSelected());
+        p.setCommentDir(pnlFileComment.fldDir.getText());
+        p.setCommentFileNamePattern(pnlFileComment.fldFileNamePattern.getText());
+        p.setCommentUseLocal(pnlFileComment.cbLocal.isSelected());
 
         /*
          * ファイル - 変換動画