OSDN Git Service

検索対象ディレクトリ登録パネルを外出し
authoryukihane <yukihane.feather@gmail.com>
Wed, 31 Aug 2011 13:51:37 +0000 (22:51 +0900)
committeryukihane <yukihane.feather@gmail.com>
Wed, 31 Aug 2011 13:54:03 +0000 (22:54 +0900)
frontend/src/yukihane/inqubus/gui/ConfigDialog.java
frontend/src/yukihane/inqubus/gui/DirectoryRegisterPanel.java [new file with mode: 0644]

index 81a2c2a..361ed5d 100644 (file)
@@ -11,7 +11,6 @@ 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;
@@ -37,9 +36,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;
 
 /**
@@ -128,11 +124,6 @@ public class ConfigDialog extends JDialog {
         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<>();
@@ -705,35 +696,6 @@ public class ConfigDialog extends JDialog {
 
         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("コメント検索対象フォルダ"));
 
@@ -1006,10 +968,7 @@ 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<>();
diff --git a/frontend/src/yukihane/inqubus/gui/DirectoryRegisterPanel.java b/frontend/src/yukihane/inqubus/gui/DirectoryRegisterPanel.java
new file mode 100644 (file)
index 0000000..d3cffea
--- /dev/null
@@ -0,0 +1,51 @@
+package yukihane.inqubus.gui;
+
+import javax.swing.DefaultListModel;
+import javax.swing.GroupLayout;
+import javax.swing.JButton;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.LayoutStyle.ComponentPlacement;
+
+/**
+ *
+ * @author yuki
+ */
+class DirectoryRegisterPanel extends JPanel {
+
+    private static final long serialVersionUID = 1L;
+    private final DefaultListModel<String> mdlSearchVideo = new DefaultListModel<>();
+    private final JList<String> lstSearchVideo = new JList<>(mdlSearchVideo);
+    private final JButton btnSearchVideoAdd = new JButton("追加...");
+    private final JButton btnSearchVideoDel = new JButton("削除");
+
+    DirectoryRegisterPanel() {
+        final JScrollPane srcSearchVideo = new JScrollPane();
+        srcSearchVideo.setViewportView(lstSearchVideo);
+
+        GroupLayout gl_pnlSearchVideo = new GroupLayout(this);
+        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))
+        );
+
+    }
+}