OSDN Git Service

ffmpegパネルのレイアウト修正
authoryukihane <yukihane.feather@gmail.com>
Fri, 2 Sep 2011 12:18:44 +0000 (21:18 +0900)
committeryukihane <yukihane.feather@gmail.com>
Fri, 9 Sep 2011 11:40:44 +0000 (20:40 +0900)
frontend/src/yukihane/inqubus/gui/ConfigDialog.java
frontend/src/yukihane/inqubus/gui/FfmpegParamPanel.java

index 2b179d8..cae59a3 100644 (file)
@@ -97,7 +97,7 @@ public class ConfigDialog extends JDialog {
         final JLabel lblFontShadow = new JLabel();
         fldFontIndex = new JTextField();
         final JPanel pnlFfmpeg = new JPanel();
-        final JPanel jPanel10 = new JPanel();
+        final JPanel pnlFfmpegBinPath = new JPanel();
         final JLabel lblFfmpegPath = new JLabel();
         final JLabel lblFfmpegDllPath = new JLabel();
         fldFfmpegPath = new JTextField();
@@ -484,7 +484,7 @@ public class ConfigDialog extends JDialog {
 
         tabbedPane.addTab("コメント", pnlComment);
 
-        jPanel10.setBorder(BorderFactory.createTitledBorder("ファイルパス"));
+        pnlFfmpegBinPath.setBorder(BorderFactory.createTitledBorder("ファイルパス"));
 
         lblFfmpegPath.setText("ffmpeg");
 
@@ -499,8 +499,8 @@ public class ConfigDialog extends JDialog {
                 new FileChooseAction(ConfigDialog.this, JFileChooser.FILES_ONLY, fldFfmpegDllPath));
 
 
-        GroupLayout gl_jPanel10 = new GroupLayout(jPanel10);
-        jPanel10.setLayout(gl_jPanel10);
+        GroupLayout gl_jPanel10 = new GroupLayout(pnlFfmpegBinPath);
+        pnlFfmpegBinPath.setLayout(gl_jPanel10);
         gl_jPanel10.setHorizontalGroup(
             gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
             .addGroup(gl_jPanel10.createSequentialGroup()
@@ -537,25 +537,17 @@ public class ConfigDialog extends JDialog {
 
 
 
-        GroupLayout gl_pnlFfmpeg = new GroupLayout(pnlFfmpeg);
-        pnlFfmpeg.setLayout(gl_pnlFfmpeg);
-        gl_pnlFfmpeg.setHorizontalGroup(
-            gl_pnlFfmpeg.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFfmpeg.createSequentialGroup()
-                .addContainerGap()
-                .addGroup(gl_pnlFfmpeg.createParallelGroup(GroupLayout.Alignment.TRAILING)
-                    .addComponent(pnlFfmpegParam, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                    .addComponent(jPanel10, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-                .addContainerGap())
+        final GroupLayout glFfmpeg = new GroupLayout(pnlFfmpeg);
+        glFfmpeg.setAutoCreateContainerGaps(true);
+        pnlFfmpeg.setLayout(glFfmpeg);
+        glFfmpeg.setHorizontalGroup(glFfmpeg.createParallelGroup(GroupLayout.Alignment.LEADING)
+            .addComponent(pnlFfmpegBinPath)
+            .addComponent(pnlFfmpegParam)
         );
-        gl_pnlFfmpeg.setVerticalGroup(
-            gl_pnlFfmpeg.createParallelGroup(GroupLayout.Alignment.LEADING)
-            .addGroup(gl_pnlFfmpeg.createSequentialGroup()
-                .addContainerGap()
-                .addComponent(jPanel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-                .addPreferredGap(ComponentPlacement.RELATED)
-                .addComponent(pnlFfmpegParam, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                .addContainerGap())
+        glFfmpeg.setVerticalGroup(glFfmpeg.createSequentialGroup()
+            .addComponent(pnlFfmpegBinPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+            .addPreferredGap(ComponentPlacement.RELATED)
+            .addComponent(pnlFfmpegParam)
         );
 
         tabbedPane.addTab("ffmpeg", pnlFfmpeg);
index f97e295..fda09b1 100644 (file)
@@ -64,70 +64,67 @@ class FfmpegParamPanel extends JPanel {
         pnlFfmpegParamOption.setBorder(BorderFactory.createEtchedBorder());
 
         final GroupLayout glFfmpegParamOption = new GroupLayout(pnlFfmpegParamOption);
+        glFfmpegParamOption.setAutoCreateContainerGaps(true);
         pnlFfmpegParamOption.setLayout(glFfmpegParamOption);
-        glFfmpegParamOption.setHorizontalGroup(
-            glFfmpegParamOption.createParallelGroup(Alignment.LEADING)
+        glFfmpegParamOption.setHorizontalGroup(glFfmpegParamOption.createParallelGroup(Alignment.LEADING)
             .addGroup(glFfmpegParamOption.createSequentialGroup()
                 .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.LEADING)
-                    .addGroup(glFfmpegParamOption.createSequentialGroup()
-                        .addContainerGap()
-                        .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.LEADING)
-                            .addComponent(lblFfmpegOptionAvfilter)
-                            .addComponent(lblFfmpegOptionExtension)
-                            .addComponent(lblFfmpegOptionMain)
-                            .addComponent(lblFfmpegOptionIn)
-                            .addComponent(lblFfmpegOptionOut))
-                        .addPreferredGap(ComponentPlacement.RELATED)
-                        .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.LEADING)
-                            .addComponent(fldFfmpegOptionExtension, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
-                            .addComponent(fldFfmpegOptionMain, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
-                            .addComponent(fldFfmpegOptionIn, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
-                            .addComponent(fldFfmpegOptionOut, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
-                            .addComponent(fldFfmpegOptionAv, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)))
-                    .addGroup(glFfmpegParamOption.createSequentialGroup()
-                        .addGap(12, 12, 12)
-                        .addComponent(cbFfmpegOptionResize)
-                        .addPreferredGap(ComponentPlacement.UNRELATED)
-                        .addComponent(lblFfmpegOptionResizeWidth)
-                        .addPreferredGap(ComponentPlacement.RELATED)
-                        .addComponent(fldFfmpegOptionResizeWidth, GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE)
-                        .addGap(12, 12, 12)
-                        .addComponent(lblFfmpegOptionResizeHeight)
-                        .addPreferredGap(ComponentPlacement.RELATED)
-                        .addComponent(fldFfmpegOptionResizeHeight, GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE))
-                    .addGroup(glFfmpegParamOption.createSequentialGroup()
-                        .addGap(33, 33, 33)
-                        .addComponent(cbFfmpegOptionKeepAspect)))
-                .addContainerGap())
-        );
-        glFfmpegParamOption.setVerticalGroup(
-            glFfmpegParamOption.createParallelGroup(Alignment.LEADING)
-            .addGroup(glFfmpegParamOption.createSequentialGroup()
-                .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
+                    .addComponent(lblFfmpegOptionAvfilter)
                     .addComponent(lblFfmpegOptionExtension)
-                    .addComponent(fldFfmpegOptionExtension, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
-                .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
                     .addComponent(lblFfmpegOptionMain)
-                    .addComponent(fldFfmpegOptionMain, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
-                .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
                     .addComponent(lblFfmpegOptionIn)
-                    .addComponent(fldFfmpegOptionIn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
-                .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
                     .addComponent(lblFfmpegOptionOut)
-                    .addComponent(fldFfmpegOptionOut, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
-                .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
-                    .addComponent(lblFfmpegOptionAvfilter)
-                    .addComponent(fldFfmpegOptionAv, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
-                .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
-                    .addComponent(cbFfmpegOptionResize)
-                    .addComponent(lblFfmpegOptionResizeWidth)
-                    .addComponent(fldFfmpegOptionResizeWidth, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-                    .addComponent(lblFfmpegOptionResizeHeight)
-                    .addComponent(fldFfmpegOptionResizeHeight, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+                )
+                .addPreferredGap(ComponentPlacement.RELATED)
+                .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.LEADING)
+                    .addComponent(fldFfmpegOptionExtension, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(fldFfmpegOptionMain, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
+                    .addComponent(fldFfmpegOptionIn, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
+                    .addComponent(fldFfmpegOptionOut, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
+                    .addComponent(fldFfmpegOptionAv, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
+                )
+            )
+            .addGroup(glFfmpegParamOption.createSequentialGroup()
+                .addComponent(cbFfmpegOptionResize)
+                .addPreferredGap(ComponentPlacement.UNRELATED)
+                .addComponent(lblFfmpegOptionResizeWidth)
+                .addPreferredGap(ComponentPlacement.RELATED)
+                .addComponent(fldFfmpegOptionResizeWidth, GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(ComponentPlacement.UNRELATED)
+                .addComponent(lblFfmpegOptionResizeHeight)
+                .addPreferredGap(ComponentPlacement.RELATED)
+                .addComponent(fldFfmpegOptionResizeHeight, GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE))
+            .addGroup(glFfmpegParamOption.createSequentialGroup()
+                .addGap(15)
                 .addComponent(cbFfmpegOptionKeepAspect)
             )
         );
 
+        glFfmpegParamOption.setVerticalGroup(glFfmpegParamOption.createSequentialGroup()
+            .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
+                .addComponent(lblFfmpegOptionExtension)
+                .addComponent(fldFfmpegOptionExtension, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
+                .addComponent(lblFfmpegOptionMain)
+                .addComponent(fldFfmpegOptionMain, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
+                .addComponent(lblFfmpegOptionIn)
+                .addComponent(fldFfmpegOptionIn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
+                .addComponent(lblFfmpegOptionOut)
+                .addComponent(fldFfmpegOptionOut, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
+                .addComponent(lblFfmpegOptionAvfilter)
+                .addComponent(fldFfmpegOptionAv, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addGroup(glFfmpegParamOption.createParallelGroup(Alignment.BASELINE)
+                .addComponent(cbFfmpegOptionResize)
+                .addComponent(lblFfmpegOptionResizeWidth)
+                .addComponent(fldFfmpegOptionResizeWidth, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addComponent(lblFfmpegOptionResizeHeight)
+                .addComponent(fldFfmpegOptionResizeHeight, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+            .addComponent(cbFfmpegOptionKeepAspect)
+        );
+
 
 
         final GroupLayout glFfmpegParam = new GroupLayout(this);
@@ -147,7 +144,7 @@ class FfmpegParamPanel extends JPanel {
                 .addContainerGap()
                 .addComponent(cmbFfmpegOptionFile, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(ComponentPlacement.RELATED)
-                .addComponent(pnlFfmpegParamOption, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addComponent(pnlFfmpegParamOption)
                 .addContainerGap())
         );
     }