OSDN Git Service

URL/過去ログ入力欄のレイアウトをGroupLayoutで実装し直し
authoryukihane <yukihane.feather@gmail.com>
Fri, 19 Aug 2011 09:56:13 +0000 (18:56 +0900)
committeryukihane <yukihane.feather@gmail.com>
Fri, 19 Aug 2011 09:59:13 +0000 (18:59 +0900)
frontend/src/saccubus/MainFrame.java

index 2684653..faf7552 100644 (file)
@@ -205,35 +205,6 @@ public class MainFrame extends JFrame {
                 GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 6);
         gridBagConstraints71.fill = GridBagConstraints.BOTH;
         gridBagConstraints71.ipady = 0;
-        GridBagConstraints gridBagConstraints70 = new GridBagConstraints();
-        gridBagConstraints70.fill = GridBagConstraints.HORIZONTAL;
-        gridBagConstraints70.gridy = 1;
-        gridBagConstraints70.ipadx = 0;
-        gridBagConstraints70.ipady = 0;
-        gridBagConstraints70.weightx = 1.0;
-        gridBagConstraints70.insets = new Insets(0, 0, 0, 0);
-        gridBagConstraints70.gridx = 1;
-        GridBagConstraints gridBagConstraints69 = new GridBagConstraints();
-        gridBagConstraints69.gridx = 0;
-        gridBagConstraints69.ipadx = 0;
-        gridBagConstraints69.ipady = 0;
-        gridBagConstraints69.insets = new Insets(0, 5, 0, 5);
-        gridBagConstraints69.anchor = GridBagConstraints.WEST;
-        gridBagConstraints69.gridy = 1;
-        GridBagConstraints gridBagConstraints68 = new GridBagConstraints();
-        gridBagConstraints68.fill = GridBagConstraints.BOTH;
-        gridBagConstraints68.gridy = 0;
-        gridBagConstraints68.ipady = 0;
-        gridBagConstraints68.weightx = 1.0;
-        gridBagConstraints68.insets = new Insets(0, 0, 0, 0);
-        gridBagConstraints68.gridx = 1;
-        GridBagConstraints gridBagConstraints67 = new GridBagConstraints();
-        gridBagConstraints67.gridx = 0;
-        gridBagConstraints67.ipadx = 0;
-        gridBagConstraints67.ipady = 0;
-        gridBagConstraints67.insets = new Insets(0, 5, 0, 5);
-        gridBagConstraints67.anchor = GridBagConstraints.WEST;
-        gridBagConstraints67.gridy = 0;
         GridBagConstraints gridBagConstraints66 = new GridBagConstraints();
         gridBagConstraints66.gridx = 0;
         gridBagConstraints66.insets = new Insets(0, 5, 5, 5);
@@ -359,8 +330,6 @@ public class MainFrame extends JFrame {
         jMenuHelpAbout.addActionListener(new MainFrame_jMenuHelpAbout_ActionAdapter(
                 this));
         videoInfoPanel.setLayout(gridBagLayout1);
-        DoButton.setText(DoButtonDefString);
-        DoButton.addActionListener(new MainFrame_DoButton_actionAdapter(this));
         SavingInfoTabPanel.setLayout(new GridLayout());
         UserInfoPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "ユーザ設定"));
         UserInfoPanel.setLayout(gridBagLayout3);
@@ -520,16 +489,35 @@ public class MainFrame extends JFrame {
         videoIdLabel.setText("URL/ID");
         wayBackLabel.setText("過去ログ");
         videoIdField.setText("http://www.nicovideo.jp/watch/");
+        DoButton.setText(DoButtonDefString);
+        DoButton.addActionListener(new MainFrame_DoButton_actionAdapter(this));
+
+        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))
+                );
 
-        opPanel.setLayout(new GridBagLayout());
 
         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));
-        opPanel.add(videoIdLabel, gridBagConstraints67);
-        opPanel.add(videoIdField, gridBagConstraints68);
-        opPanel.add(wayBackLabel, gridBagConstraints69);
-        opPanel.add(wayBackField, gridBagConstraints70);
 
         mainTabbedPane.add(BasicInfoTabPanel, "基本設定");
         mainTabbedPane.add(SavingInfoTabPanel, "保存設定");