OSDN Git Service

videoInfoPanel初期化を別メソッドに切り出し
authoryukihane <yukihane.feather@gmail.com>
Fri, 19 Aug 2011 10:11:16 +0000 (19:11 +0900)
committeryukihane <yukihane.feather@gmail.com>
Fri, 19 Aug 2011 10:13:06 +0000 (19:13 +0900)
frontend/src/saccubus/MainFrame.java

index e431d0f..9d8fce0 100644 (file)
@@ -175,12 +175,60 @@ public class MainFrame extends JFrame {
         }
     }
 
+    private void initVideoInfoPanel() {
+
+        videoIdLabel.setText("URL/ID");
+        wayBackLabel.setText("過去ログ");
+        videoIdField.setText("http://www.nicovideo.jp/watch/");
+
+        final GroupLayout oppLayout = new GroupLayout(opPanel);
+        opPanel.setLayout(oppLayout);
+
+        oppLayout.setHorizontalGroup(oppLayout.createSequentialGroup()
+                .addGroup(oppLayout.createParallelGroup()
+                    .addComponent(videoIdLabel)
+                    .addComponent(wayBackLabel))
+                .addGroup(oppLayout.createParallelGroup()
+                    .addComponent(videoIdField)
+                    .addGroup(oppLayout.createSequentialGroup()
+                        .addComponent(wayBackField)))
+                );
+
+        oppLayout.setVerticalGroup(oppLayout.createSequentialGroup()
+                    .addGroup(oppLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+                        .addComponent(videoIdLabel)
+                        .addComponent(videoIdField))
+                    .addGroup(oppLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+                        .addComponent(wayBackLabel)
+                        .addComponent(wayBackField))
+                );
+
+        doButton.setText(DoButtonDefString);
+        doButton.addActionListener(new MainFrame_DoButton_actionAdapter(this));
+
+        videoInfoPanel.setLayout(gridBagLayout1);
+        videoInfoPanel.add(opPanel, new GridBagConstraints(0, 0, 1, 1, 1.0,
+                0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+                new Insets(0, 0, 0, 0), 0, 0));
+
+        final GridBagConstraints gridBagConstraints71 = new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
+                GridBagConstraints.CENTER,
+                GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 6);
+        gridBagConstraints71.fill = GridBagConstraints.BOTH;
+        gridBagConstraints71.ipady = 0;
+
+        videoInfoPanel.add(doButton, gridBagConstraints71);
+    }
+
     /**
      * コンポーネントの初期化。
      *
      * @throws java.lang.Exception
      */
     private void jbInit() throws Exception {
+
+        initVideoInfoPanel();
+
         GridBagConstraints gridBagConstraints74 = new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                 GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0);
         gridBagConstraints74.gridwidth = 2;
@@ -201,10 +249,6 @@ public class MainFrame extends JFrame {
         ShadowKindLabel = new JLabel();
         ShadowKindLabel.setText("影の種類");
         ShadowKindLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
-        GridBagConstraints gridBagConstraints71 = new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
-                GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 6);
-        gridBagConstraints71.fill = GridBagConstraints.BOTH;
-        gridBagConstraints71.ipady = 0;
         GridBagConstraints gridBagConstraints66 = new GridBagConstraints();
         gridBagConstraints66.gridx = 0;
         gridBagConstraints66.insets = new Insets(0, 5, 5, 5);
@@ -329,7 +373,6 @@ public class MainFrame extends JFrame {
         jMenuHelpAbout.setText("バージョン情報");
         jMenuHelpAbout.addActionListener(new MainFrame_jMenuHelpAbout_ActionAdapter(
                 this));
-        videoInfoPanel.setLayout(gridBagLayout1);
         SavingInfoTabPanel.setLayout(new GridLayout());
         UserInfoPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "ユーザ設定"));
         UserInfoPanel.setLayout(gridBagLayout3);
@@ -485,41 +528,6 @@ public class MainFrame extends JFrame {
 
 
 
-        videoIdLabel.setText("URL/ID");
-        wayBackLabel.setText("過去ログ");
-        videoIdField.setText("http://www.nicovideo.jp/watch/");
-
-        final GroupLayout oppLayout = new GroupLayout(opPanel);
-        opPanel.setLayout(oppLayout);
-
-        oppLayout.setHorizontalGroup(oppLayout.createSequentialGroup()
-                .addGroup(oppLayout.createParallelGroup()
-                    .addComponent(videoIdLabel)
-                    .addComponent(wayBackLabel))
-                .addGroup(oppLayout.createParallelGroup()
-                    .addComponent(videoIdField)
-                    .addGroup(oppLayout.createSequentialGroup()
-                        .addComponent(wayBackField)))
-                );
-
-        oppLayout.setVerticalGroup(oppLayout.createSequentialGroup()
-                    .addGroup(oppLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
-                        .addComponent(videoIdLabel)
-                        .addComponent(videoIdField))
-                    .addGroup(oppLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
-                        .addComponent(wayBackLabel)
-                        .addComponent(wayBackField))
-                );
-
-        doButton.setText(DoButtonDefString);
-        doButton.addActionListener(new MainFrame_DoButton_actionAdapter(this));
-
-        videoInfoPanel.add(opPanel, new GridBagConstraints(0, 0, 1, 1, 1.0,
-                0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(0, 0, 0, 0), 0, 0));
-        videoInfoPanel.add(doButton, gridBagConstraints71);
-
-        
         mainTabbedPane.add(BasicInfoTabPanel, "基本設定");
         mainTabbedPane.add(SavingInfoTabPanel, "保存設定");
         mainTabbedPane.add(FFMpegTabPanel, "動画設定");