OSDN Git Service

ffmpegオプションファイル選択コンボボックスの初期化
authoryukihane <yukihane.feather@gmail.com>
Tue, 30 Aug 2011 10:53:30 +0000 (19:53 +0900)
committeryukihane <yukihane.feather@gmail.com>
Tue, 30 Aug 2011 10:53:30 +0000 (19:53 +0900)
frontend/src/saccubus/FFmpegSelectedItem.java [new file with mode: 0644]
frontend/src/saccubus/OptionComboBoxModel.java
frontend/src/yukihane/inqubus/gui/ConfigDialog.java

diff --git a/frontend/src/saccubus/FFmpegSelectedItem.java b/frontend/src/saccubus/FFmpegSelectedItem.java
new file mode 100644 (file)
index 0000000..70c2862
--- /dev/null
@@ -0,0 +1,40 @@
+package saccubus;
+
+import java.io.File;
+
+public class FFmpegSelectedItem {
+       private final int Index;
+
+       private final File File;
+
+       private final String Name;
+
+       FFmpegSelectedItem(int index, File file, String name) {
+               Index = index;
+               File = file;
+               if (name == null) {
+                       String tmp = file.getName();
+                       Name = tmp.substring(0, tmp.lastIndexOf("."));
+               } else {
+                       Name = name;
+               }
+       }
+
+    @Override
+       public String toString() {
+               return Name;
+       }
+
+       File getFile() {
+               return File;
+       }
+
+       /**
+        * 識別に使う
+        *
+        * @return
+        */
+       int getIndex() {
+               return Index;
+       }
+}
index e36d13b..d92f3de 100644 (file)
@@ -130,38 +130,3 @@ public class OptionComboBoxModel extends DefaultComboBoxModel<FFmpegSelectedItem
        }
 
 }
-class FFmpegSelectedItem {
-       private final int Index;
-
-       private final File File;
-
-       private final String Name;
-
-       protected FFmpegSelectedItem(int index, File file, String name) {
-               Index = index;
-               File = file;
-               if (name == null) {
-                       String tmp = file.getName();
-                       Name = tmp.substring(0, tmp.lastIndexOf("."));
-               } else {
-                       Name = name;
-               }
-       }
-
-       public String toString() {
-               return Name;
-       }
-
-       protected File getFile() {
-               return File;
-       }
-
-       /**
-        * 識別に使う
-        *
-        * @return
-        */
-       protected int getIndex() {
-               return Index;
-       }
-}
index 44827d0..38fa445 100644 (file)
@@ -38,6 +38,8 @@ import javax.swing.UIManager;
 import javax.swing.UnsupportedLookAndFeelException;
 import javax.swing.WindowConstants;
 import org.apache.commons.configuration.ConfigurationException;
+import saccubus.FFmpegSelectedItem;
+import saccubus.OptionComboBoxModel;
 import yukihane.inqubus.Config;
 
 /**
@@ -128,7 +130,6 @@ public class ConfigDialog extends JDialog {
         final JPanel pnlFfmpegParam = new JPanel();
         rbFfmpegOptionFile = new JRadioButton();
         rbFfmpegOptionDirectInput = new JRadioButton();
-        cmbFfmpegOptionFile = new JComboBox();
         final JPanel pnlFfmpegParamOption = new JPanel();
         final JLabel lblFfmpegOptionExtension = new JLabel();
         final JLabel lblFfmpegOptionMain = new JLabel();
@@ -690,8 +691,6 @@ public class ConfigDialog extends JDialog {
         buttonGroup1.add(rbFfmpegOptionDirectInput);
         rbFfmpegOptionDirectInput.setText("直接入力");
 
-        cmbFfmpegOptionFile.setModel(new DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
-
         pnlFfmpegParamOption.setBorder(BorderFactory.createEtchedBorder());
 
         lblFfmpegOptionExtension.setText("出力動画の拡張子");
@@ -1230,7 +1229,7 @@ public class ConfigDialog extends JDialog {
     // ffmpeg - ffmpegパラメータ
     private final JRadioButton rbFfmpegOptionFile;
     private final JRadioButton rbFfmpegOptionDirectInput;
-    private final JComboBox cmbFfmpegOptionFile;
+    private final JComboBox<FFmpegSelectedItem> cmbFfmpegOptionFile = new JComboBox<>(new OptionComboBoxModel());
     private final JTextField fldFfmpegOptionExtension;
     private final JTextField fldFfmpegOptionMain;
     private final JTextField fldFfmpegOptionIn;