OSDN Git Service

検索キャッシュ更新間隔設定部を削除
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / gui / ConfigDialog.java
index 81a2c2a..088c928 100644 (file)
@@ -11,25 +11,22 @@ import static javax.swing.GroupLayout.PREFERRED_SIZE;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.io.File;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.swing.BorderFactory;
 import javax.swing.ComboBoxModel;
 import javax.swing.DefaultComboBoxModel;
-import javax.swing.DefaultListModel;
 import javax.swing.GroupLayout;
 import javax.swing.GroupLayout.Alignment;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JDialog;
+import javax.swing.JFileChooser;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
-import javax.swing.JList;
 import javax.swing.JPanel;
-import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
 import javax.swing.JTextField;
 import javax.swing.LayoutStyle.ComponentPlacement;
@@ -37,9 +34,6 @@ import javax.swing.UIManager;
 import javax.swing.UnsupportedLookAndFeelException;
 import javax.swing.WindowConstants;
 import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.lang.StringUtils;
-import saccubus.FFmpegSelectedItem;
-import saccubus.OptionComboBoxModel;
 import yukihane.inqubus.Config;
 
 /**
@@ -72,26 +66,11 @@ public class ConfigDialog extends JDialog {
         fldProxyHost = new JTextField();
         fldProxyPort = new JTextField();
         final JPanel pnlFile = new JPanel();
-        final JPanel pnlFileVideo = new JPanel();
-        final JLabel lblVideoDir = new JLabel();
-        final JLabel lblVideoFileNamepattern = new JLabel();
-        fldVideoDir = new JTextField();
-        fldVideoFileNamePattern = new JTextField();
-        btnVideoDir = new JButton();
-        cbVideoLocal = new JCheckBox();
-        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();
         fldOutputDir = new JTextField();
         fldOutputFileNamePattern = new JTextField();
-        btnOutputDir = new JButton();
         cbOutputEnable = new JCheckBox();
         cbOutputCommentOverlay = new JCheckBox();
         cbOutputDisplayProgress = new JCheckBox();
@@ -114,7 +93,6 @@ public class ConfigDialog extends JDialog {
         cbFontSizeArrangeDisable = new JCheckBox();
         cbCommentOpaque = new JCheckBox();
         fldFontPath = new JTextField();
-        btnFontPath = new JButton();
         final JLabel lblFontIndex = new JLabel();
         final JLabel lblFontShadow = new JLabel();
         fldFontIndex = new JTextField();
@@ -124,23 +102,8 @@ public class ConfigDialog extends JDialog {
         final JLabel lblFfmpegDllPath = new JLabel();
         fldFfmpegPath = new JTextField();
         fldFfmpegDllPath = new JTextField();
-        btnFfmpegPath = new JButton();
-        btnFfmpegDllPath = new JButton();
         final JPanel pnlNgSetting = new JPanel();
         final JPanel pnlSearch = new JPanel();
-        final JPanel pnlSearchVideo = new JPanel();
-        final JScrollPane srcSearchVideo = new JScrollPane();
-        lstSearchVideo = new JList<>();
-        btnSearchVideoAdd = new JButton();
-        btnSearchVideoDel = new JButton();
-        final JPanel pnlSearchComment = new JPanel();
-        final JScrollPane srcSearchComment = new JScrollPane();
-        lstSearchComment = new JList<>();
-        btnSearchCommentAdd = new JButton();
-        btnSearchCommentDel = new JButton();
-        final JPanel pnlSearchCache = new JPanel();
-        final JLabel lblSearchCache = new JLabel();
-        fldSearchCache = new JTextField();
 
         setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
 
@@ -248,103 +211,16 @@ public class ConfigDialog extends JDialog {
 
         pnlFileVideo.setBorder(BorderFactory.createTitledBorder("動画"));
 
-        lblVideoDir.setText("保存フォルダ");
-
-        lblVideoFileNamepattern.setText("ファイル名規則");
-
-        btnVideoDir.setText("...");
-
-        cbVideoLocal.setText("local");
-
-        GroupLayout gl_pnlFileVideo = new GroupLayout(pnlFileVideo);
-        pnlFileVideo.setLayout(gl_pnlFileVideo);
-        gl_pnlFileVideo.setHorizontalGroup(
-            gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFileVideo.createSequentialGroup()
-                .addContainerGap()
-                .addGroup(gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
-                    .addComponent(lblVideoFileNamepattern)
-                    .addComponent(lblVideoDir))
-                .addPreferredGap(ComponentPlacement.RELATED)
-                .addGroup(gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
-                    .addGroup(gl_pnlFileVideo.createSequentialGroup()
-                        .addComponent(fldVideoDir, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
-                        .addPreferredGap(ComponentPlacement.RELATED)
-                        .addComponent(btnVideoDir))
-                    .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFileVideo.createSequentialGroup()
-                        .addComponent(fldVideoFileNamePattern, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
-                        .addPreferredGap(ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
-                        .addComponent(cbVideoLocal)))
-                .addContainerGap())
-        );
-        gl_pnlFileVideo.setVerticalGroup(
-            gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addGroup(gl_pnlFileVideo.createSequentialGroup()
-                .addGroup(gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.BASELINE)
-                    .addComponent(lblVideoDir)
-                    .addComponent(fldVideoDir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-                    .addComponent(btnVideoDir))
-                .addPreferredGap(ComponentPlacement.RELATED)
-                .addGroup(gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.BASELINE)
-                    .addComponent(lblVideoFileNamepattern)
-                    .addComponent(fldVideoFileNamePattern, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-                    .addComponent(cbVideoLocal))
-                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-        );
-
         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("保存フォルダ");
 
         lblOutputFileNamePattern.setText("ファイル名規則");
 
-        btnOutputDir.setText("...");
+        btnOutputDir.addActionListener(
+                new FileChooseAction(ConfigDialog.this, JFileChooser.DIRECTORIES_ONLY, fldOutputDir));
 
         cbOutputEnable.setText("変換");
 
@@ -528,7 +404,9 @@ public class ConfigDialog extends JDialog {
 
         cbCommentOpaque.setText("コメント透明化を行わない");
 
-        btnFontPath.setText("...");
+        final JButton btnFontPath = new JButton("...");
+        btnFontPath.addActionListener(
+                new FileChooseAction(ConfigDialog.this, JFileChooser.FILES_ONLY, fldFontPath));
 
         lblFontIndex.setText("フォント番号");
 
@@ -612,9 +490,14 @@ public class ConfigDialog extends JDialog {
 
         lblFfmpegDllPath.setText("拡張ライブラリ");
 
-        btnFfmpegPath.setText("...");
+        final JButton btnFfmpegPath = new JButton("...");
+        btnFfmpegPath.addActionListener(
+                new FileChooseAction(ConfigDialog.this, JFileChooser.FILES_ONLY, fldFfmpegPath));
+
+        final JButton btnFfmpegDllPath = new JButton("...");
+        btnFfmpegDllPath.addActionListener(
+                new FileChooseAction(ConfigDialog.this, JFileChooser.FILES_ONLY, fldFfmpegDllPath));
 
-        btnFfmpegDllPath.setText("...");
 
         GroupLayout gl_jPanel10 = new GroupLayout(jPanel10);
         jPanel10.setLayout(gl_jPanel10);
@@ -704,94 +587,8 @@ public class ConfigDialog extends JDialog {
         tabbedPane.addTab("NG設定", pnlNgSetting);
 
         pnlSearchVideo.setBorder(BorderFactory.createTitledBorder("動画検索対象フォルダ"));
-
-        lstSearchVideo.setModel(mdlSearchVideo);
-        srcSearchVideo.setViewportView(lstSearchVideo);
-
-        btnSearchVideoAdd.setText("追加...");
-
-        btnSearchVideoDel.setText("削除");
-
-        GroupLayout gl_pnlSearchVideo = new GroupLayout(pnlSearchVideo);
-        pnlSearchVideo.setLayout(gl_pnlSearchVideo);
-        gl_pnlSearchVideo.setHorizontalGroup(
-            gl_pnlSearchVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addComponent(srcSearchVideo, GroupLayout.DEFAULT_SIZE, 419, Short.MAX_VALUE)
-            .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlSearchVideo.createSequentialGroup()
-                .addContainerGap(269, Short.MAX_VALUE)
-                .addComponent(btnSearchVideoAdd)
-                .addGap(18, 18, 18)
-                .addComponent(btnSearchVideoDel)
-                .addContainerGap())
-        );
-        gl_pnlSearchVideo.setVerticalGroup(
-            gl_pnlSearchVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addGroup(gl_pnlSearchVideo.createSequentialGroup()
-                .addComponent(srcSearchVideo, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
-                .addPreferredGap(ComponentPlacement.RELATED)
-                .addGroup(gl_pnlSearchVideo.createParallelGroup(GroupLayout.Alignment.BASELINE)
-                    .addComponent(btnSearchVideoDel)
-                    .addComponent(btnSearchVideoAdd))
-                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-        );
-
         pnlSearchComment.setBorder(BorderFactory.createTitledBorder("コメント検索対象フォルダ"));
 
-        lstSearchComment.setModel(mdlSearchComment);
-        srcSearchComment.setViewportView(lstSearchComment);
-
-        btnSearchCommentAdd.setText("追加...");
-
-        btnSearchCommentDel.setText("削除");
-
-        GroupLayout gl_pnlSearchComment = new GroupLayout(pnlSearchComment);
-        pnlSearchComment.setLayout(gl_pnlSearchComment);
-        gl_pnlSearchComment.setHorizontalGroup(
-            gl_pnlSearchComment.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addComponent(srcSearchComment, GroupLayout.DEFAULT_SIZE, 419, Short.MAX_VALUE)
-            .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlSearchComment.createSequentialGroup()
-                .addContainerGap(269, Short.MAX_VALUE)
-                .addComponent(btnSearchCommentAdd)
-                .addGap(18, 18, 18)
-                .addComponent(btnSearchCommentDel)
-                .addContainerGap())
-        );
-        gl_pnlSearchComment.setVerticalGroup(
-            gl_pnlSearchComment.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addGroup(gl_pnlSearchComment.createSequentialGroup()
-                .addComponent(srcSearchComment, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
-                .addPreferredGap(ComponentPlacement.RELATED)
-                .addGroup(gl_pnlSearchComment.createParallelGroup(GroupLayout.Alignment.BASELINE)
-                    .addComponent(btnSearchCommentDel)
-                    .addComponent(btnSearchCommentAdd))
-                .addContainerGap(16, Short.MAX_VALUE))
-        );
-
-        pnlSearchCache.setBorder(BorderFactory.createEtchedBorder());
-
-        lblSearchCache.setText("キャッシュ更新(秒)");
-
-        GroupLayout gl_pnlSearchCache = new GroupLayout(pnlSearchCache);
-        pnlSearchCache.setLayout(gl_pnlSearchCache);
-        gl_pnlSearchCache.setHorizontalGroup(
-            gl_pnlSearchCache.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addGroup(gl_pnlSearchCache.createSequentialGroup()
-                .addContainerGap()
-                .addComponent(lblSearchCache)
-                .addPreferredGap(ComponentPlacement.RELATED)
-                .addComponent(fldSearchCache, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE)
-                .addContainerGap(269, Short.MAX_VALUE))
-        );
-        gl_pnlSearchCache.setVerticalGroup(
-            gl_pnlSearchCache.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addGroup(gl_pnlSearchCache.createSequentialGroup()
-                .addContainerGap()
-                .addGroup(gl_pnlSearchCache.createParallelGroup(GroupLayout.Alignment.BASELINE)
-                    .addComponent(lblSearchCache)
-                    .addComponent(fldSearchCache, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
-                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-        );
-
         GroupLayout gl_pnlSearch = new GroupLayout(pnlSearch);
         pnlSearch.setLayout(gl_pnlSearch);
         gl_pnlSearch.setHorizontalGroup(
@@ -799,7 +596,6 @@ public class ConfigDialog extends JDialog {
             .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlSearch.createSequentialGroup()
                 .addContainerGap()
                 .addGroup(gl_pnlSearch.createParallelGroup(GroupLayout.Alignment.TRAILING)
-                    .addComponent(pnlSearchCache, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                     .addComponent(pnlSearchComment, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                     .addComponent(pnlSearchVideo, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                 .addContainerGap())
@@ -811,15 +607,12 @@ public class ConfigDialog extends JDialog {
                 .addComponent(pnlSearchVideo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(ComponentPlacement.RELATED)
                 .addComponent(pnlSearchComment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-                .addPreferredGap(ComponentPlacement.RELATED)
-                .addComponent(pnlSearchCache, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                 .addContainerGap(27, Short.MAX_VALUE))
         );
 
         tabbedPane.addTab("検索", pnlSearch);
 
-        final JPanel pnlButton = new JPanel();
-        final JButton btnOk = new JButton("OK");
+        final JButton btnOk = new JButton("保存");
         btnOk.addActionListener(new ActionListener() {
 
             @Override
@@ -828,11 +621,34 @@ public class ConfigDialog extends JDialog {
                 dispose();
             }
         });
-        final JButton btnCancel = new JButton("Cancel");
-        pnlButton.add(btnOk);
-        pnlButton.add(btnCancel);
+        final JButton btnCancel = new JButton("取消");
+        btnCancel.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                dispose();
+            }
+        });
+        final JPanel pnlButton = new JPanel();
+
+        final GroupLayout glButton = new GroupLayout(pnlButton);
+        pnlButton.setLayout(glButton);
+        glButton.setHorizontalGroup(glButton.createSequentialGroup()
+            .addPreferredGap(ComponentPlacement.UNRELATED, PREFERRED_SIZE, Short.MAX_VALUE)
+            .addComponent(btnOk)
+            .addPreferredGap(ComponentPlacement.UNRELATED)
+            .addComponent(btnCancel)
+            .addContainerGap()
+        );
+        glButton.setVerticalGroup(glButton.createSequentialGroup()
+            .addGroup(glButton.createParallelGroup(Alignment.BASELINE)
+                .addComponent(btnOk)
+                .addComponent(btnCancel)
+            )
+        );
 
         GroupLayout layout = new GroupLayout(getContentPane());
+        layout.setAutoCreateContainerGaps(true);
         getContentPane().setLayout(layout);
         layout.setHorizontalGroup(
             layout.createParallelGroup(GroupLayout.Alignment.LEADING)
@@ -841,7 +657,7 @@ public class ConfigDialog extends JDialog {
         );
         layout.setVerticalGroup(
             layout.createSequentialGroup()
-                .addComponent(tabbedPane,GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addComponent(tabbedPane,GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
                 .addComponent(pnlButton)
         );
 
@@ -849,6 +665,9 @@ public class ConfigDialog extends JDialog {
         final JLabel lblSystemWaitDownload = new JLabel("ダウンロード開始最小間隔(秒)");
         final JLabel lblSystemThreadConvert = new JLabel("変換スレッド数");
         final JLabel lblSystemTempDir = new JLabel("作業フォルダ");
+        final JButton btnSystemTempDir = new JButton("...");
+        btnSystemTempDir.addActionListener(
+                new FileChooseAction(ConfigDialog.this, JFileChooser.DIRECTORIES_ONLY, fldSystemTempDir));
 
         final JPanel pnlSystemGeneral = new JPanel();
         pnlSystemGeneral.setBorder(BorderFactory.createTitledBorder("システム"));
@@ -872,6 +691,7 @@ public class ConfigDialog extends JDialog {
             .addGroup(glSystemGenegal.createSequentialGroup()
                 .addComponent(lblSystemTempDir)
                 .addComponent(fldSystemTempDir, DEFAULT_SIZE, 400, Short.MAX_VALUE)
+                .addComponent(btnSystemTempDir)
                 )
             );
 
@@ -887,7 +707,10 @@ public class ConfigDialog extends JDialog {
                 .addComponent(fldSystemThreadConvert, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE))
             .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
                 .addComponent(lblSystemTempDir)
-                .addComponent(fldSystemTempDir, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE)));
+                .addComponent(fldSystemTempDir, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE)
+                .addComponent(btnSystemTempDir)
+            )
+        );
 
         final JPanel pnlSystem = new JPanel();
         pnlSystem.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
@@ -905,7 +728,7 @@ public class ConfigDialog extends JDialog {
         tabbedPane.add("システム", pnlSystem);
 
         pack();
-        setResizable(false);
+        setMinimumSize(getSize());
         loadConfig();
     }
 
@@ -914,7 +737,6 @@ public class ConfigDialog extends JDialog {
      */
     public static void main(String args[]) {
         /* Set the Nimbus look and feel */
-        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
          */
@@ -925,16 +747,9 @@ public class ConfigDialog extends JDialog {
                     break;
                 }
             }
-        } catch (ClassNotFoundException ex) {
-            java.util.logging.Logger.getLogger(ConfigDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
-        } catch (InstantiationException ex) {
-            java.util.logging.Logger.getLogger(ConfigDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
-        } catch (IllegalAccessException ex) {
-            java.util.logging.Logger.getLogger(ConfigDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
-        } catch (UnsupportedLookAndFeelException ex) {
+        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
             java.util.logging.Logger.getLogger(ConfigDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
         }
-        //</editor-fold>
 
         /* Create and display the form */
         java.awt.EventQueue.invokeLater(new Runnable() {
@@ -957,19 +772,13 @@ public class ConfigDialog extends JDialog {
     private final JTextField fldProxyPort;
     // ファイル
     // ファイル - 動画
-    private final JTextField fldVideoDir;
-    private final JButton btnVideoDir;
-    private final JTextField fldVideoFileNamePattern;
-    private final JCheckBox cbVideoLocal;
+    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;
-    private final JButton btnOutputDir;
+    private final JButton btnOutputDir = new JButton("...");
     private final JCheckBox cbOutputEnable;
     private final JCheckBox cbOutputCommentOverlay;
     private final JCheckBox cbOutputDisplayProgress;
@@ -986,7 +795,6 @@ public class ConfigDialog extends JDialog {
     private final JTextField fldCommentDisplaySizeManual;
     // コメント - 高度な設定
     private final JTextField fldFontPath;
-    private final JButton btnFontPath;
     private final JTextField fldFontIndex;
     private final JComboBox<String> cmbFontShadow = new JComboBox<>();
     private final JCheckBox cbFontSizeArrangeDisable;
@@ -994,9 +802,7 @@ public class ConfigDialog extends JDialog {
     // ffmpeg
     // ffmpeg - ファイルパス
     private final JTextField fldFfmpegPath;
-    private final JButton btnFfmpegPath;
     private final JTextField fldFfmpegDllPath;
-    private final JButton btnFfmpegDllPath;
     // ffmpeg - ffmpegパラメータ
     private final FfmpegParamPanel pnlFfmpegParam = new FfmpegParamPanel();
     // NG設定
@@ -1006,17 +812,9 @@ public class ConfigDialog extends JDialog {
     private final NgRegisterPanel pnlNgId = new NgRegisterPanel();
     // 検索
     // 検索 - 動画検索対象フォルダ
-    private final JList<String> lstSearchVideo;
-    private final DefaultListModel<String> mdlSearchVideo = new DefaultListModel<>();
-    private final JButton btnSearchVideoAdd;
-    private final JButton btnSearchVideoDel;
+    private final DirectoryRegisterPanel pnlSearchVideo = new DirectoryRegisterPanel();
     // 検索 - コメント検索対象フォルダ
-    private final JList<String> lstSearchComment;
-    private final DefaultListModel<String> mdlSearchComment = new DefaultListModel<>();
-    private final JButton btnSearchCommentAdd;
-    private final JButton btnSearchCommentDel;
-    // 検索 - キャッシュ更新(秒)
-    private final JTextField fldSearchCache;
+    private final DirectoryRegisterPanel pnlSearchComment = new DirectoryRegisterPanel();
     // システム
     private final JTextField fldSystemThreadDownload = new JTextField();
     private final JTextField fldSystemWaitDownload = new JTextField();
@@ -1045,16 +843,16 @@ public class ConfigDialog extends JDialog {
         /*
          * ファイル - 動画
          */
-        fldVideoDir.setText(p.getVideoDir());
-        fldVideoFileNamePattern.setText(p.getVideoFileNamePattern());
-        cbVideoLocal.setSelected(p.getVideoUseLocal());
+        pnlFileVideo.fldDir.setText(p.getVideoDir());
+        pnlFileVideo.fldFileNamePattern.setText(p.getVideoFileNamePattern());
+        pnlFileVideo.cbLocal.setSelected(p.getVideoUseLocal());
 
         /*
          * ファイル - コメント
          */
-        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());
 
         /*
          * ファイル - 変換動画
@@ -1110,6 +908,12 @@ public class ConfigDialog extends JDialog {
         pnlNgId.init(ngIds);
 
         /*
+         * 検索
+         */
+        pnlSearchVideo.init(p.getSearchVideoDirs());
+        pnlSearchComment.init(p.getSearchCommentDirs());
+
+        /*
          * システム
          */
         fldSystemThreadDownload.setText(Integer.toString(p.getSystemDownloadThread()));
@@ -1138,16 +942,16 @@ public class ConfigDialog extends JDialog {
         /*
          * ファイル - 動画
          */
-        p.setVideoDir(fldVideoDir.getText());
-        p.setVideoFileNamePattern(fldVideoFileNamePattern.getText());
-        p.setVideoUseLocal(cbVideoLocal.isSelected());
+        p.setVideoDir(pnlFileVideo.fldDir.getText());
+        p.setVideoFileNamePattern(pnlFileVideo.fldFileNamePattern.getText());
+        p.setVideoUseLocal(pnlFileVideo.cbLocal.isSelected());
 
         /*
          * ファイル - コメント
          */
-        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());
 
         /*
          * ファイル - 変換動画
@@ -1211,6 +1015,12 @@ public class ConfigDialog extends JDialog {
         p.setNgIds(pnlNgId.getAllElements());
 
         /*
+         * 検索
+         */
+        p.setSearchVideoDirs(pnlSearchVideo.getAllElements());
+        p.setSearchCommentDirs(pnlSearchComment.getAllElements());
+
+        /*
          * システム
          */
         p.setSystemDownloadThread(Integer.parseInt(fldSystemThreadDownload.getText()));
@@ -1225,3 +1035,57 @@ public class ConfigDialog extends JDialog {
         }
     }
 }
+
+class DownloadLocationPanel extends JPanel {
+    final JTextField fldDir = new JTextField();
+    final JTextField fldFileNamePattern = new JTextField();
+    final JCheckBox cbLocal = new JCheckBox("local");
+
+    DownloadLocationPanel(){
+        super();
+
+        final JLabel lblVideoDir = new JLabel("保存フォルダ");
+        final JLabel lblVideoFileNamepattern = new JLabel("ファイル名規則");
+
+        final JButton btnDir = new JButton("...");
+        btnDir.addActionListener(
+                new FileChooseAction(DownloadLocationPanel.this, JFileChooser.DIRECTORIES_ONLY, fldDir));
+
+        final GroupLayout gl = new GroupLayout(this);
+        setLayout(gl);
+        gl.setHorizontalGroup(
+            gl.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(GroupLayout.Alignment.TRAILING, gl.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addComponent(lblVideoFileNamepattern)
+                    .addComponent(lblVideoDir))
+                .addPreferredGap(ComponentPlacement.RELATED)
+                .addGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING)
+                    .addGroup(gl.createSequentialGroup()
+                        .addComponent(fldDir, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
+                        .addPreferredGap(ComponentPlacement.RELATED)
+                        .addComponent(btnDir))
+                    .addGroup(GroupLayout.Alignment.TRAILING, gl.createSequentialGroup()
+                        .addComponent(fldFileNamePattern, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
+                        .addComponent(cbLocal)))
+                .addContainerGap())
+        );
+        gl.setVerticalGroup(
+            gl.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addGroup(gl.createSequentialGroup()
+                .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
+                    .addComponent(lblVideoDir)
+                    .addComponent(fldDir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(btnDir))
+                .addPreferredGap(ComponentPlacement.RELATED)
+                .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
+                    .addComponent(lblVideoFileNamepattern)
+                    .addComponent(fldFileNamePattern, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cbLocal))
+                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+
+    }
+}