OSDN Git Service

ffmpegオプションファイル更新ボタン追加
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / gui / FfmpegParamPanel.java
index fa14f29..ae03dc6 100644 (file)
@@ -1,9 +1,12 @@
 package yukihane.inqubus.gui;
 
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.io.File;
 import javax.swing.BorderFactory;
 import javax.swing.GroupLayout;
 import javax.swing.GroupLayout.Alignment;
+import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JLabel;
@@ -125,6 +128,14 @@ class FfmpegParamPanel extends JPanel {
             .addComponent(cbFfmpegOptionKeepAspect)
         );
 
+        final JButton btnReload = new JButton("更新");
+        btnReload.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                mdlFfmpegOption.reload();
+            }
+        });
 
 
         final GroupLayout glFfmpegParam = new GroupLayout(this);
@@ -134,15 +145,23 @@ class FfmpegParamPanel extends JPanel {
             .addGroup(glFfmpegParam.createSequentialGroup()
                 .addContainerGap()
                 .addGroup(glFfmpegParam.createParallelGroup(Alignment.LEADING)
+                    .addGroup(glFfmpegParam.createSequentialGroup()
+                        .addComponent(cmbFfmpegOptionFile, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(ComponentPlacement.UNRELATED)
+                        .addComponent(btnReload)
+                    )
                     .addComponent(pnlFfmpegParamOption, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                    .addComponent(cmbFfmpegOptionFile, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                )
                 .addContainerGap())
         );
         glFfmpegParam.setVerticalGroup(
             glFfmpegParam.createParallelGroup(Alignment.LEADING)
             .addGroup(glFfmpegParam.createSequentialGroup()
                 .addContainerGap()
-                .addComponent(cmbFfmpegOptionFile, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addGroup(glFfmpegParam.createParallelGroup(Alignment.BASELINE)
+                    .addComponent(cmbFfmpegOptionFile, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(btnReload)
+                )
                 .addPreferredGap(ComponentPlacement.RELATED)
                 .addComponent(pnlFfmpegParamOption)
                 .addContainerGap())