OSDN Git Service

位置揃え
[coroid/inqubus.git] / frontend / src / saccubus / MainFrame.java
1 package saccubus;
2
3 import java.io.IOException;
4 import saccubus.converter.Converter;
5 import java.awt.BorderLayout;
6 import java.awt.Dimension;
7 import java.awt.GridBagConstraints;
8 import java.awt.GridBagLayout;
9 import java.awt.GridLayout;
10 import java.awt.Image;
11 import java.awt.Insets;
12 import java.awt.Toolkit;
13 import java.awt.dnd.DnDConstants;
14 import java.awt.dnd.DropTarget;
15 import java.awt.event.ActionEvent;
16 import java.awt.event.ActionListener;
17 import java.awt.event.KeyEvent;
18 import java.awt.event.WindowAdapter;
19 import java.awt.event.WindowEvent;
20 import java.io.File;
21 import javax.swing.BorderFactory;
22 import javax.swing.ButtonGroup;
23 import javax.swing.GroupLayout;
24 import javax.swing.JButton;
25 import javax.swing.JCheckBox;
26 import javax.swing.JComboBox;
27 import javax.swing.JFileChooser;
28 import javax.swing.JFrame;
29 import javax.swing.JLabel;
30 import javax.swing.JMenu;
31 import javax.swing.JMenuBar;
32 import javax.swing.JMenuItem;
33 import javax.swing.JOptionPane;
34 import javax.swing.JPanel;
35 import javax.swing.JPasswordField;
36 import javax.swing.JRadioButton;
37 import javax.swing.JTabbedPane;
38 import javax.swing.JTextField;
39 import javax.swing.LayoutStyle.ComponentPlacement;
40 import javax.swing.SwingUtilities;
41 import javax.swing.border.BevelBorder;
42 import nicobrowser.entity.NicoContent;
43 import org.apache.commons.lang.StringUtils;
44 import saccubus.ConvertStopFlag.State;
45 import saccubus.converter.profile.FfmpegOption;
46 import saccubus.converter.profile.NgSetting;
47 import saccubus.net.TextProgressListener;
48 import saccubus.properties.BasicSetting;
49 import saccubus.properties.ConvertSetting;
50 import saccubus.properties.InputCommentSetting;
51 import saccubus.properties.InputVideoSetting;
52 import saccubus.properties.SProperties;
53 import saccubus.properties.InputTcommentSetting;
54 import saccubus.properties.MovieSetting;
55 import saccubus.properties.OutputVideoSetting;
56 import saccubus.util.FileDropTarget;
57 import saccubus.util.PopupRightClick;
58 import yukihane.nicovideo.NicoDBFinder;
59
60 /**
61  * <p>
62  * タイトル: さきゅばす
63  * </p>
64  *
65  * <p>
66  * 説明: ニコニコ動画の動画をコメントつきで保存
67  * </p>
68  *
69  * <p>
70  * 著作権: Copyright (c) 2007 PSI
71  * </p>
72  *
73  * <p>
74  * 会社名:
75  * </p>
76  *
77  * @author 未入力
78  * @version 1.0
79  */
80 public class MainFrame extends JFrame {
81
82     private static final long serialVersionUID = 2564486741331062989L;
83     public static final String PRODUCT_NAME = "いんきゅばす";
84     public static final String VERSION = "1.5.0";
85     public static final Image WinIcon = Toolkit.getDefaultToolkit().createImage(saccubus.MainFrame.class.getResource(
86             "icon32.png"));
87     // TODO GUIが無いためフィールドに保持.
88     private File tempDir;
89     JPanel contentPane;
90     BorderLayout borderLayout1 = new BorderLayout();
91     JMenuBar jMenuBar1 = new JMenuBar();
92     JMenu jMenuFile = new JMenu();
93     JMenuItem jMenuFileExit = new JMenuItem();
94     JMenu jMenuHelp = new JMenu();
95     JMenuItem jMenuHelpAbout = new JMenuItem();
96     JLabel statusBar = new JLabel();
97     JTabbedPane mainTabbedPane = new JTabbedPane();
98     JPanel SavingInfoTabPanel = new JPanel();
99     JPanel FFMpegTabPanel = new JPanel();
100     JPanel VideoInfoPanel = new JPanel();
101     JTextField VideoID_TextField = new JTextField();
102     JButton DoButton = new JButton();
103     public static final String DoButtonDefString = "変換";
104     public static final String DoButtonStopString = "停止";
105     public static final String DoButtonWaitString = "待機";
106     JPanel UserInfoPanel = new JPanel();
107     GridBagLayout gridBagLayout3 = new GridBagLayout();
108     // ユーザ設定
109     JLabel mailAddressLabel = new JLabel();
110     JTextField mailAddressField = new JTextField();
111     JLabel passwordLabel = new JLabel();
112     JPasswordField passwordField = new JPasswordField();
113     GridBagLayout gridBagLayout4 = new GridBagLayout();
114     GridBagLayout gridBagLayout6 = new GridBagLayout();
115     ButtonGroup CommentSaveButtonGroup = new ButtonGroup();
116     ButtonGroup ConvSaveButtonGroup = new ButtonGroup();
117
118     private void setNames() {
119         mainTabbedPane.setName("mainTabbedPane");
120
121         mailAddressField.setName("mailAddressField");
122         passwordField.setName("passwordField");
123
124         ffmpegPathField.setName("ffmpegPathField");
125         vhookPathField.setName("vhookPathField");
126
127         mainOptionField.setName("mainOptionField");
128         inputOptionField.setName("inputOptionField");
129         outputOptionField.setName("outputOptionField");
130
131         fontPathField.setName("fontPathField");
132         fontIndexField.setName("fontIndexField");
133         showConvVideoCheckBox.setName("showConvVideoCheckBox");
134     }
135
136     public MainFrame() {
137         setNames();
138
139         videoSaveInfoPanel = savePanel.getVideoSaveInfoPanel();
140
141         try {
142             setDefaultCloseOperation(EXIT_ON_CLOSE);
143             jbInit();
144             setPopup();
145             setDropTarget();
146             SProperties setting = SProperties.loadSetting(null,
147                     null);
148             this.setSetting(setting);
149         } catch (Exception exception) {
150             exception.printStackTrace();
151         }
152     }
153
154     /**
155      * コンポーネントの初期化。
156      *
157      * @throws java.lang.Exception
158      */
159     private void jbInit() throws Exception {
160         GridBagConstraints gridBagConstraints74 = new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
161                 GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0);
162         gridBagConstraints74.gridwidth = 2;
163         GridBagConstraints gridBagConstraints73 = new GridBagConstraints();
164         gridBagConstraints73.fill = GridBagConstraints.HORIZONTAL;
165         gridBagConstraints73.gridy = 6;
166         gridBagConstraints73.weightx = 1.0;
167         gridBagConstraints73.gridwidth = 4;
168         gridBagConstraints73.insets = new Insets(0, 0, 0, 5);
169         gridBagConstraints73.gridx = 1;
170         GridBagConstraints gridBagConstraints72 = new GridBagConstraints();
171         gridBagConstraints72.gridx = 0;
172         gridBagConstraints72.anchor = GridBagConstraints.WEST;
173         gridBagConstraints72.insets = new Insets(0, 5, 0, 5);
174         gridBagConstraints72.fill = GridBagConstraints.NONE;
175         gridBagConstraints72.gridwidth = 1;
176         gridBagConstraints72.gridy = 6;
177         ShadowKindLabel = new JLabel();
178         ShadowKindLabel.setText("影の種類");
179         ShadowKindLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
180         GridBagConstraints gridBagConstraints71 = new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
181                 GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 6);
182         gridBagConstraints71.fill = GridBagConstraints.BOTH;
183         gridBagConstraints71.ipady = 0;
184         GridBagConstraints gridBagConstraints70 = new GridBagConstraints();
185         gridBagConstraints70.fill = GridBagConstraints.HORIZONTAL;
186         gridBagConstraints70.gridy = 1;
187         gridBagConstraints70.ipadx = 0;
188         gridBagConstraints70.ipady = 0;
189         gridBagConstraints70.weightx = 1.0;
190         gridBagConstraints70.insets = new Insets(0, 0, 0, 0);
191         gridBagConstraints70.gridx = 1;
192         GridBagConstraints gridBagConstraints69 = new GridBagConstraints();
193         gridBagConstraints69.gridx = 0;
194         gridBagConstraints69.ipadx = 0;
195         gridBagConstraints69.ipady = 0;
196         gridBagConstraints69.insets = new Insets(0, 5, 0, 5);
197         gridBagConstraints69.anchor = GridBagConstraints.WEST;
198         gridBagConstraints69.gridy = 1;
199         GridBagConstraints gridBagConstraints68 = new GridBagConstraints();
200         gridBagConstraints68.fill = GridBagConstraints.BOTH;
201         gridBagConstraints68.gridy = 0;
202         gridBagConstraints68.ipady = 0;
203         gridBagConstraints68.weightx = 1.0;
204         gridBagConstraints68.insets = new Insets(0, 0, 0, 0);
205         gridBagConstraints68.gridx = 1;
206         GridBagConstraints gridBagConstraints67 = new GridBagConstraints();
207         gridBagConstraints67.gridx = 0;
208         gridBagConstraints67.ipadx = 0;
209         gridBagConstraints67.ipady = 0;
210         gridBagConstraints67.insets = new Insets(0, 5, 0, 5);
211         gridBagConstraints67.anchor = GridBagConstraints.WEST;
212         gridBagConstraints67.gridy = 0;
213         GridBagConstraints gridBagConstraints66 = new GridBagConstraints();
214         gridBagConstraints66.gridx = 0;
215         gridBagConstraints66.insets = new Insets(0, 5, 5, 5);
216         gridBagConstraints66.anchor = GridBagConstraints.WEST;
217         gridBagConstraints66.gridwidth = 2;
218         gridBagConstraints66.gridy = 1;
219         ViewCommentLabel = new JLabel();
220         ViewCommentLabel.setText("表示コメント数");
221         GridBagConstraints gridBagConstraints65 = new GridBagConstraints();
222         gridBagConstraints65.fill = GridBagConstraints.HORIZONTAL;
223         gridBagConstraints65.gridy = 1;
224         gridBagConstraints65.weightx = 1.0;
225         gridBagConstraints65.gridwidth = 6;
226         gridBagConstraints65.insets = new Insets(0, 5, 5, 5);
227         gridBagConstraints65.gridx = 3;
228         GridBagConstraints gridBagConstraints64 = new GridBagConstraints(1, 1,
229                 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
230                 GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0);
231         gridBagConstraints64.gridy = 3;
232         gridBagConstraints64.fill = GridBagConstraints.HORIZONTAL;
233         gridBagConstraints64.gridx = 4;
234         GridBagConstraints gridBagConstraints63 = new GridBagConstraints(0, 4,
235                 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
236                 GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0);
237         gridBagConstraints63.gridy = 7;
238         gridBagConstraints63.gridx = 0;
239         gridBagConstraints63.gridwidth = 5;
240         GridBagConstraints gridBagConstraints62 = new GridBagConstraints(0, 3,
241                 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
242                 GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0);
243         gridBagConstraints62.gridy = 5;
244         gridBagConstraints62.gridx = 1;
245         gridBagConstraints62.fill = GridBagConstraints.HORIZONTAL;
246         gridBagConstraints62.insets = new Insets(0, 0, 5, 5);
247         gridBagConstraints62.gridwidth = 4;
248         GridBagConstraints gridBagConstraints61 = new GridBagConstraints(0, 2,
249                 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
250                 GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
251         gridBagConstraints61.gridy = 5;
252         gridBagConstraints61.gridx = 0;
253         gridBagConstraints61.fill = GridBagConstraints.VERTICAL;
254         gridBagConstraints61.anchor = GridBagConstraints.WEST;
255         gridBagConstraints61.gridwidth = 1;
256         GridBagConstraints gridBagConstraints60 = new GridBagConstraints(0, 1,
257                 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
258                 GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 0);
259         gridBagConstraints60.gridy = 3;
260         gridBagConstraints60.gridx = 1;
261         gridBagConstraints60.fill = GridBagConstraints.HORIZONTAL;
262         gridBagConstraints60.insets = new Insets(0, 0, 0, 5);
263         gridBagConstraints60.gridwidth = 3;
264         GridBagConstraints gridBagConstraints59 = new GridBagConstraints(0, 0,
265                 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
266                 GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0);
267         gridBagConstraints59.gridy = 3;
268         gridBagConstraints59.insets = new Insets(5, 5, 5, 5);
269         gridBagConstraints59.gridx = 0;
270         gridBagConstraints59.fill = GridBagConstraints.NONE;
271         gridBagConstraints59.anchor = GridBagConstraints.WEST;
272         gridBagConstraints59.weightx = 0.0;
273         gridBagConstraints59.gridwidth = 1;
274         GridBagConstraints gridBagConstraints58 = new GridBagConstraints();
275         gridBagConstraints58.gridx = 0;
276         gridBagConstraints58.anchor = GridBagConstraints.WEST;
277         gridBagConstraints58.insets = new Insets(0, 5, 5, 5);
278         gridBagConstraints58.gridwidth = 5;
279         gridBagConstraints58.weightx = 1.0;
280         gridBagConstraints58.fill = GridBagConstraints.HORIZONTAL;
281         gridBagConstraints58.gridy = 0;
282
283         GridBagConstraints gridBagConstraints54 = new GridBagConstraints(0, 2, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
284                 GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
285         gridBagConstraints54.gridwidth = 3;
286
287         GridBagConstraints gridBagConstraints33 = new GridBagConstraints();
288         gridBagConstraints33.gridx = 0;
289         gridBagConstraints33.fill = GridBagConstraints.HORIZONTAL;
290         gridBagConstraints33.weightx = 1.0;
291         gridBagConstraints33.insets = new Insets(0, 5, 5, 5);
292         gridBagConstraints33.gridwidth = 5;
293         gridBagConstraints33.gridy = 9;
294
295         GridBagConstraints gridBagConstraints14 = new GridBagConstraints();
296         gridBagConstraints14.gridx = 0;
297         gridBagConstraints14.anchor = GridBagConstraints.WEST;
298         gridBagConstraints14.fill = GridBagConstraints.HORIZONTAL;
299         gridBagConstraints14.weightx = 1.0;
300         gridBagConstraints14.gridwidth = 5;
301         gridBagConstraints14.insets = new Insets(0, 5, 0, 5);
302         gridBagConstraints14.gridy = 8;
303         GridBagConstraints gridBagConstraints7 = new GridBagConstraints(0, 0,
304                 1, 1, 1.0, 1.0, GridBagConstraints.NORTH,
305                 GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0);
306         gridBagConstraints7.weighty = 0.0;
307         GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
308         gridBagConstraints6.gridx = 0;
309         gridBagConstraints6.weighty = 1.0;
310         gridBagConstraints6.weightx = 1.0;
311         gridBagConstraints6.insets = new Insets(0, 5, 0, 5);
312         gridBagConstraints6.fill = GridBagConstraints.HORIZONTAL;
313         gridBagConstraints6.anchor = GridBagConstraints.NORTH;
314         gridBagConstraints6.gridy = 1;
315         GridBagConstraints gridBagConstraints1 = new GridBagConstraints(0, 1,
316                 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
317                 GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0);
318         gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
319         gridBagConstraints1.anchor = GridBagConstraints.NORTH;
320         gridBagConstraints1.weighty = 1.0;
321
322         this.setIconImage(WinIcon);
323         contentPane = (JPanel) this.getContentPane();
324         contentPane.setLayout(borderLayout1);
325         setSize(new Dimension(400, 450));
326         setTitle(PRODUCT_NAME + " " + VERSION);
327         this.addWindowListener(new MainFrame_this_windowAdapter(this));
328         statusBar.setText(" ");
329         jMenuFile.setText("ファイル");
330         jMenuFileExit.setText("終了");
331         jMenuFileExit.addActionListener(new MainFrame_jMenuFileExit_ActionAdapter(
332                 this));
333         jMenuHelp.setText("ヘルプ");
334         jMenuHelpAbout.setText("バージョン情報");
335         jMenuHelpAbout.addActionListener(new MainFrame_jMenuHelpAbout_ActionAdapter(
336                 this));
337         VideoInfoPanel.setLayout(gridBagLayout1);
338         VideoID_TextField.setText("http://www.nicovideo.jp/watch/");
339         DoButton.setText(DoButtonDefString);
340         DoButton.addActionListener(new MainFrame_DoButton_actionAdapter(this));
341         SavingInfoTabPanel.setLayout(new GridLayout());
342         UserInfoPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "ユーザ設定"));
343         UserInfoPanel.setLayout(gridBagLayout3);
344         mailAddressLabel.setText("メールアドレス");
345         passwordLabel.setText("パスワード");
346
347         setListenerToSavePanelButton();
348
349         FFMpegTabPanel.setLayout(gridBagLayout6);
350         PathSettingPanel.setBorder(BorderFactory.createTitledBorder(
351                 BorderFactory.createEtchedBorder(), "プログラムの位置の設定"));
352         PathSettingPanel.setLayout(gridBagLayout7);
353         FFmpegPathLabel.setText("FFmpeg");
354         SettingFFmpegPathButton.setText("参照");
355         SettingFFmpegPathButton.addActionListener(new MainFrame_SettingFFmpegPathButton_actionAdapter(
356                 this));
357         VhookPathLabel.setText("拡張vhookライブラリ");
358         SettingVhookPathButton.setText("参照");
359         SettingVhookPathButton.addActionListener(new MainFrame_SettingVhookPathButton_actionAdapter(
360                 this));
361         VhookSettingPanel.setLayout(gridBagLayout8);
362         VhookSettingPanel.setBorder(BorderFactory.createTitledBorder(
363                 BorderFactory.createEtchedBorder(), "拡張vhookライブラリの設定"));
364         FFmpegSettingPanel.setBorder(BorderFactory.createTitledBorder(
365                 BorderFactory.createEtchedBorder(), "FFmpegの設定"));
366         FFmpegSettingPanel.setLayout(gblFFmpegSettingPanel);
367         FontPathLabel.setText("フォントパス");
368         SettingFontPathButton.setText("参照");
369         SettingFontPathButton.addActionListener(new MainFrame_SettingFontPathButton_actionAdapter(
370                 this));
371         showConvVideoCheckBox.setText("変換中の画像を表示する");
372
373         extOptionLabel.setText("出力動画の拡張子");
374         inputOptionLabel.setText("入力オプション");
375         outputOptionLabel.setText("出力オプション");
376         mainOptionLabel.setText("メインオプション");
377         avfilterOptionLabel.setText("avfilterオプション");
378
379         FontIndexLabel.setText("フォント番号");
380         VideoID_Label.setText("URL/ID");
381         WayBackLabel.setText("過去ログ");
382         OpPanel.setLayout(new GridBagLayout());
383
384         BasicInfoTabPanel.setLayout(gridBagLayout12);
385         jMenuBar1.add(jMenuFile);
386         jMenuFile.add(jMenuFileExit);
387         jMenuBar1.add(jMenuHelp);
388         jMenuHelp.add(jMenuHelpAbout);
389         setJMenuBar(jMenuBar1);
390
391         contentPane.add(statusBar, BorderLayout.SOUTH);
392         contentPane.add(mainTabbedPane, java.awt.BorderLayout.CENTER);
393         contentPane.add(VideoInfoPanel, java.awt.BorderLayout.NORTH);
394         UserInfoPanel.add(passwordField, new GridBagConstraints(1, 1, 1, 1,
395                 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
396                 new Insets(0, 5, 5, 5), 0, 0));
397         UserInfoPanel.add(mailAddressField, new GridBagConstraints(1, 0, 1, 1,
398                 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
399                 new Insets(0, 5, 5, 5), 0, 0));
400         UserInfoPanel.add(passwordLabel, new GridBagConstraints(0, 1, 1, 1,
401                 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
402                 new Insets(0, 5, 5, 0), 0, 0));
403         UserInfoPanel.add(mailAddressLabel, new GridBagConstraints(0, 0, 1, 1,
404                 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
405                 new Insets(0, 5, 5, 0), 0, 0));
406         PathSettingPanel.add(ffmpegPathField, new GridBagConstraints(0, 1, 1,
407                 1, 1.0, 0.0, GridBagConstraints.CENTER,
408                 GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 0));
409         PathSettingPanel.add(SettingFFmpegPathButton, gridBagConstraints74);
410         PathSettingPanel.add(FFmpegPathLabel, new GridBagConstraints(0, 0, 2,
411                 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
412                 new Insets(0, 5, 5, 5), 0, 0));
413         PathSettingPanel.add(vhookPathField, new GridBagConstraints(0, 3, 1, 1,
414                 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
415                 new Insets(0, 5, 5, 5), 0, 0));
416         PathSettingPanel.add(SettingVhookPathButton, new GridBagConstraints(1,
417                 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
418                 GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0));
419         PathSettingPanel.add(VhookPathLabel, gridBagConstraints54);
420
421
422         final GroupLayout layout = new GroupLayout(FFmpegSettingPanel);
423         FFmpegSettingPanel.setLayout(layout);
424
425         layout.setHorizontalGroup(layout.createParallelGroup()
426                 .addComponent(getFFmpegOptionComboBoxPanel())
427                 .addGroup(layout.createSequentialGroup()
428                     .addGroup(layout.createParallelGroup()
429                         .addComponent(extOptionLabel)
430                         .addComponent(mainOptionLabel)
431                         .addComponent(inputOptionLabel)
432                         .addComponent(outputOptionLabel))
433                     .addGroup(layout.createParallelGroup()
434                         .addComponent(extOptionField)
435                         .addComponent(mainOptionField)
436                         .addComponent(inputOptionField)
437                         .addComponent(outputOptionField)))
438                 .addGroup(layout.createParallelGroup()
439                     .addGroup(layout.createSequentialGroup()
440                         .addComponent(resizeCheckBox)
441                         .addPreferredGap(ComponentPlacement.UNRELATED)
442                         .addComponent(resizeWidthLabel)
443                         .addPreferredGap(ComponentPlacement.RELATED)
444                         .addComponent(resizeWidthField)
445                         .addPreferredGap(ComponentPlacement.UNRELATED)
446                         .addComponent(resizeHeightLabel)
447                         .addPreferredGap(ComponentPlacement.RELATED)
448                         .addComponent(resizeHeigitField)))
449                     .addGroup(layout.createSequentialGroup()
450                         .addGap(10)
451                         .addComponent(adjustRatioCheckBox))
452                     .addGroup(layout.createSequentialGroup()
453                         .addGap(20)
454                     .addComponent(padCheckBox))
455                 );
456
457         layout.setVerticalGroup(layout.createSequentialGroup()
458                 .addComponent(getFFmpegOptionComboBoxPanel())
459                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
460                     .addComponent(extOptionLabel)
461                     .addComponent(extOptionField))
462                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
463                     .addComponent(mainOptionLabel)
464                     .addComponent(mainOptionField))
465                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
466                     .addComponent(inputOptionLabel)
467                     .addComponent(inputOptionField))
468                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
469                     .addComponent(outputOptionLabel)
470                     .addComponent(outputOptionField))
471                 .addGroup(layout.createSequentialGroup()
472                     .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
473                         .addComponent(resizeCheckBox)
474                         .addComponent(resizeWidthLabel)
475                         .addComponent(resizeWidthField)
476                         .addComponent(resizeHeightLabel)
477                         .addComponent(resizeHeigitField))
478                     .addComponent(adjustRatioCheckBox)
479                     .addComponent(padCheckBox)));
480
481
482         VideoInfoPanel.add(DoButton, gridBagConstraints71);
483         VideoInfoPanel.add(OpPanel, new GridBagConstraints(0, 0, 1, 1, 1.0,
484                 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
485                 new Insets(0, 0, 0, 0), 0, 0));
486         OpPanel.add(VideoID_Label, gridBagConstraints67);
487         OpPanel.add(VideoID_TextField, gridBagConstraints68);
488         OpPanel.add(WayBackLabel, gridBagConstraints69);
489         OpPanel.add(WayBackField, gridBagConstraints70);
490
491         mainTabbedPane.add(BasicInfoTabPanel, "基本設定");
492         mainTabbedPane.add(SavingInfoTabPanel, "保存設定");
493         mainTabbedPane.add(FFMpegTabPanel, "動画設定");
494         mainTabbedPane.addTab("変換設定", null, getConvertingSettingPanel(), null);
495         SavingInfoTabPanel.add(savePanel);
496         BasicInfoTabPanel.add(UserInfoPanel, gridBagConstraints7);
497         BasicInfoTabPanel.add(getProxyInfoPanel(), gridBagConstraints6);
498         VhookSettingPanel.add(FontPathLabel, gridBagConstraints59);
499         VhookSettingPanel.add(showConvVideoCheckBox, gridBagConstraints63);
500         VhookSettingPanel.add(fontPathField, gridBagConstraints60);
501         VhookSettingPanel.add(fontIndexField, gridBagConstraints62);
502         VhookSettingPanel.add(FontIndexLabel, gridBagConstraints61);
503         VhookSettingPanel.add(SettingFontPathButton, gridBagConstraints64);
504         VhookSettingPanel.add(getFixFontSizeCheckBox(), gridBagConstraints14);
505         VhookSettingPanel.add(getOpaqueCommentCheckBox(), gridBagConstraints33);
506         VhookSettingPanel.add(getNotUseVhookCheckBox(), gridBagConstraints58);
507         VhookSettingPanel.add(getViewCommentField(), gridBagConstraints65);
508         VhookSettingPanel.add(ViewCommentLabel, gridBagConstraints66);
509         VhookSettingPanel.add(ShadowKindLabel, gridBagConstraints72);
510         VhookSettingPanel.add(getShadowComboBox(), gridBagConstraints73);
511
512         FFMpegTabPanel.add(PathSettingPanel, new GridBagConstraints(0, 0, 1, 1,
513                 1.0, 0.0, GridBagConstraints.NORTHEAST,
514                 GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0));
515         FFMpegTabPanel.add(FFmpegSettingPanel, gridBagConstraints1);
516     }
517
518     /**
519      * 保存設定パネル内のボタンにアクションリスナを割り当てる.
520      */
521     private void setListenerToSavePanelButton() {
522         ActionListener al;
523         al = new InputVideoPanelButtonListener();
524         videoSaveInfoPanel.getShowSavingVideoFolderDialogButton().addActionListener(al);
525         videoSaveInfoPanel.getShowSavingVideoFileDialogButton().addActionListener(al);
526         videoSaveInfoPanel.getNibrFileChooserButton().addActionListener(al);
527
528         al = new VideoUseRadioButtonListener();
529         videoSaveInfoPanel.getVideoNoSaveButton().addActionListener(al);
530         videoSaveInfoPanel.getVideoSaveButton().addActionListener(al);
531         videoSaveInfoPanel.getVideoUseNiBrButton().addActionListener(al);
532
533         al = new InputCommentPanelButtonListener();
534         savePanel.getShowSavingCommentFolderDialogButton().addActionListener(al);
535         savePanel.getShowSavingCommentFileDialogButton().addActionListener(al);
536
537         al = new OutputVideoPanelButtonListener();
538         savePanel.getShowSavingConvertedVideoFolderDialogButton().addActionListener(al);
539         savePanel.getShowSavingConvertedVideoFileDialogButton().addActionListener(al);
540     }
541
542     private void setPopup() {
543         mainOptionField.addMouseListener(new PopupRightClick(
544                 this.mainOptionField));
545         inputOptionField.addMouseListener(new PopupRightClick(
546                 this.inputOptionField));
547         outputOptionField.addMouseListener(new PopupRightClick(
548                 this.outputOptionField));
549         savePanel.getCommentNumField().addMouseListener(new PopupRightClick(
550                 savePanel.getCommentNumField()));
551
552         savePanel.getCommentSavedFileField().addMouseListener(new PopupRightClick(
553                 savePanel.getCommentSavedFileField()));
554         savePanel.getCommentSavedFolderField().addMouseListener(new PopupRightClick(
555                 savePanel.getCommentSavedFolderField()));
556
557         savePanel.getConvertedVideoSavedFileField().addMouseListener(new PopupRightClick(
558                 savePanel.getConvertedVideoSavedFileField()));
559         savePanel.getConvertedVideoSavedFolderField().addMouseListener(new PopupRightClick(
560                 savePanel.getConvertedVideoSavedFolderField()));
561
562         videoSaveInfoPanel.getVideoSavedFileField().addMouseListener(new PopupRightClick(
563                 videoSaveInfoPanel.getVideoSavedFileField()));
564         videoSaveInfoPanel.getVideoSavedFolderField().addMouseListener(new PopupRightClick(
565                 videoSaveInfoPanel.getVideoSavedFolderField()));
566         videoSaveInfoPanel.getNibrFileField().addMouseListener(
567                 new PopupRightClick(videoSaveInfoPanel.getNibrFileField()));
568
569         ffmpegPathField.addMouseListener(new PopupRightClick(
570                 this.ffmpegPathField));
571         vhookPathField.addMouseListener(new PopupRightClick(this.vhookPathField));
572         VideoID_TextField.addMouseListener(new PopupRightClick(
573                 this.VideoID_TextField));
574         viewCommentField.addMouseListener(new PopupRightClick(
575                 this.viewCommentField));
576         fontPathField.addMouseListener(new PopupRightClick(this.fontPathField));
577         mailAddressField.addMouseListener(new PopupRightClick(this.mailAddressField));
578         passwordField.addMouseListener(new PopupRightClick(this.passwordField));
579         WayBackField.addMouseListener(new PopupRightClick(this.WayBackField));
580
581         proxyTextField.addMouseListener(new PopupRightClick(this.proxyTextField));
582         proxyPortTextField.addMouseListener(new PopupRightClick(
583                 this.proxyPortTextField));
584
585         fontIndexField.addMouseListener(new PopupRightClick(this.fontIndexField));
586
587         ngWordTextField.addMouseListener(new PopupRightClick(
588                 this.ngWordTextField));
589         ngIdTextField.addMouseListener(new PopupRightClick(this.ngIdTextField));
590     }
591
592     private void setDropTarget() {
593         addTarget(videoSaveInfoPanel.getVideoSavedFileField(), false);
594         addTarget(videoSaveInfoPanel.getVideoSavedFolderField(), true);
595         addTarget(videoSaveInfoPanel.getNibrFileField(), false);
596
597         addTarget(savePanel.getCommentSavedFileField(), false);
598         addTarget(savePanel.getCommentSavedFolderField(), true);
599
600         addTarget(savePanel.getConvertedVideoSavedFileField(), false);
601         addTarget(savePanel.getConvertedVideoSavedFolderField(), true);
602
603         addTarget(ffmpegPathField, false);
604         addTarget(vhookPathField, false);
605         addTarget(fontPathField, false);
606
607     }
608
609     /**
610      * テキストフィールドに対しドロップを行った場合にファイルもしくはディレクトリの文字列を設定できるようにする.
611      * @param c 設定対象のテキストフィールドオブジェクト.
612      * @param isDir ディレクトリを設定する場合はtrue, ファイルの場合はfalse.
613      * @return ドロップターゲット(用途無し).
614      */
615     private DropTarget addTarget(JTextField c, boolean isDir) {
616         return new DropTarget(c, DnDConstants.ACTION_COPY, new FileDropTarget(
617                 c, isDir), true);
618     }
619     private File CurrentDir = new File(".");
620     private JPanel PathSettingPanel = new JPanel();
621     private JLabel FFmpegPathLabel = new JLabel();
622     private GridBagLayout gridBagLayout7 = new GridBagLayout();
623     private JTextField ffmpegPathField = new JTextField();
624     private JButton SettingFFmpegPathButton = new JButton();
625     private JLabel VhookPathLabel = new JLabel();
626     private JTextField vhookPathField = new JTextField();
627     private JButton SettingVhookPathButton = new JButton();
628     private JPanel VhookSettingPanel = new JPanel();
629     private GridBagLayout gridBagLayout8 = new GridBagLayout();
630     private JPanel FFmpegSettingPanel = new JPanel();
631     private GridBagLayout gblFFmpegSettingPanel = new GridBagLayout();
632     private JLabel FontPathLabel = new JLabel();
633     private JTextField fontPathField = new JTextField();
634     private JButton SettingFontPathButton = new JButton();
635     private JCheckBox showConvVideoCheckBox = new JCheckBox();
636
637     private void showSaveDialog(String title, JTextField field, boolean isSave,
638             boolean isDir) {
639         JFileChooser chooser = new JFileChooser(CurrentDir);
640         chooser.setDialogTitle(title);
641         int code = 0;
642         if (isDir) {
643             chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
644         }
645         if (isSave) {
646             code = chooser.showSaveDialog(this);
647         } else {
648             code = chooser.showOpenDialog(this);
649         }
650         if (code == JFileChooser.APPROVE_OPTION) {
651             if (isDir) {
652                 CurrentDir = chooser.getSelectedFile();
653                 field.setText(CurrentDir.getAbsolutePath());
654             } else {
655                 File selected = chooser.getSelectedFile();
656                 CurrentDir = chooser.getCurrentDirectory();
657                 field.setText(selected.getAbsolutePath());
658             }
659         }
660     }
661
662     private SProperties getSetting() {
663         SProperties setting = new SProperties(
664                 getBasicSetting(),
665                 getInputVideoSetting(),
666                 getInputCommentSetting(),
667                 getTcommentSetting(),
668                 getOutputVideoSetting(),
669                 getMovieSetting(),
670                 getConvertSetting());
671         return setting;
672     }
673
674     /**
675      * 設定を画面に反映する.
676      * @param setting 反映する設定.
677      */
678     private void setSetting(SProperties setting) {
679         // 基本設定
680         final BasicSetting basic = setting.getBasicSetting();
681         tempDir = basic.getTempDir();
682         mailAddressField.setText(basic.getUser().getMail());
683         passwordField.setText(basic.getUser().getPassword());
684         // プロキシ関連
685         useProxyCheckBox.setSelected(basic.isProxyUse());
686         proxyTextField.setText(basic.getProxyHost());
687         int proxy_port = basic.getProxyPort();
688         if (proxy_port >= 0 && proxy_port <= 65535) {
689             proxyPortTextField.setText(Integer.toString(proxy_port));
690         } else {
691             proxyPortTextField.setText("");
692         }
693
694         // 保存設定 - 入力動画
695         final InputVideoSetting inVideo = setting.getInputVideoSetting();
696         JRadioButton activeButton;
697         switch (inVideo.getProcessKind()) {
698             case NO_SAVE:
699                 activeButton = videoSaveInfoPanel.getVideoNoSaveButton();
700                 break;
701             case NICOBROWSER:
702                 activeButton = videoSaveInfoPanel.getVideoUseNiBrButton();
703                 break;
704             case SAVE:
705             default:
706                 activeButton = videoSaveInfoPanel.getVideoSaveButton();
707                 break;
708         }
709         activeButton.doClick();
710
711         videoSaveInfoPanel.getVideoSavedFileField().setText(inVideo.getFile().getPath());
712         videoSaveInfoPanel.getVideoSavedFolderField().setText(inVideo.getFolder().getPath());
713         videoSaveInfoPanel.getDelVideoCheckBox().setSelected(inVideo.isDeleteAfterConvert());
714         final boolean videoFixName = inVideo.isAutoNaming();
715         videoSaveInfoPanel.getSaveFileRadioButton().setSelected(!videoFixName);
716         videoSaveInfoPanel.getSaveFolderRadioButton().setSelected(videoFixName);
717         videoSaveInfoPanel.getNibrFileField().setText(inVideo.getNicoBrowserFile().getPath());
718
719         // 保存設定 - 入力コメント
720         final InputCommentSetting inputComment = setting.getInputCommentSetting();
721         savePanel.getSavingCommentCheckBox().setSelected(inputComment.getProcessKind());
722         savePanel.getCommentSavedFileField().setText(inputComment.getFile().getPath());
723         savePanel.getDelCommentCheckBox().setSelected(inputComment.isDeleteAfterConvert());
724         savePanel.getCommentSavedFolderField().setText(inputComment.getFolder().getPath());
725         savePanel.getCommentNumField().setText(Integer.toString(inputComment.getNumOfComment()));
726         savePanel.getFixCommentNumCheckBox().setSelected(inputComment.isSelfAdjustNumOfComment());
727         boolean commentFixName = inputComment.isAutoNaming();
728         savePanel.getCommentSaveFileRadioButton().setSelected(!commentFixName);
729         savePanel.getCommentSaveFolderRadioButton().setSelected(commentFixName);
730
731         // 投稿者コメント
732         InputTcommentSetting tcom = setting.getInputTcommentSetting();
733         savePanel.setTcommentDownload(tcom.getProcessKind());
734         savePanel.setTcommentDelete(tcom.isDeleteAfterConvert());
735         savePanel.setTcommentAutoFileName(tcom.isAutoNaming());
736         savePanel.setTcommentDirectoryName(tcom.getFolder().getPath());
737         savePanel.setTcommentFileName(tcom.getFile().getPath());
738
739         // 保存設定 - 出力コメント付き動画
740         final OutputVideoSetting outputVideo = setting.getOutputVideoSetting();
741         savePanel.getSavingConvertedVideoCheckBox().setSelected(outputVideo.getProcessKind());
742         savePanel.getAddCommentCheckBox().setSelected(outputVideo.isAddComment());
743         savePanel.getAddTcommentCheckBox().setSelected(outputVideo.isAddTcomment());
744         savePanel.getConvertedVideoSavedFileField().setText(outputVideo.getFile().getPath());
745         savePanel.getConvertedVideoSavedFolderField().setText(outputVideo.getFolder().getPath());
746         savePanel.getNotAddVideoIdConvVideoCheckBox().setSelected(outputVideo.isCutIdName());
747         boolean convFixName = outputVideo.isAutoNaming();
748         savePanel.getConvSaveFileRadioButton().setSelected(!convFixName);
749         savePanel.getConvSaveFolderRadioButton().setSelected(convFixName);
750
751         // 動画設定
752         final MovieSetting movie = setting.getMovieSetting();
753         ffmpegPathField.setText(movie.getFfmpeg().toString());
754         vhookPathField.setText(movie.getVhook().toString());
755         extOptionField.setText(movie.getFfmpegOption().getExtOption());
756         mainOptionField.setText(movie.getFfmpegOption().getMainOption());
757         inputOptionField.setText(movie.getFfmpegOption().getInOption());
758         outputOptionField.setText(movie.getFfmpegOption().getOutOption());
759         avfilterOptionField.setText(movie.getFfmpegOption().getAvfilterOption());
760         FFmpegOptionModel.reload(movie.getOptionFile());
761
762         // 変換設定
763         final ConvertSetting conv = setting.getConvertSetting();
764         disableVhookCheckBox.setSelected(conv.isVhookDisabled());
765         viewCommentField.setText(Integer.toString(conv.getMaxNumOfComment()));
766         fontPathField.setText(conv.getFont().toString());
767         fontIndexField.setText(Integer.toString(conv.getFontIndex()));
768         shadowComboBox.setSelectedIndex(conv.getShadowIndex());
769         showConvVideoCheckBox.setSelected(conv.isShowConverting());
770         fixFontSizeCheckBox.setSelected(conv.isSelfAdjustFontSize());
771         opaqueCommentCheckBox.setSelected(conv.isCommentOpaque());
772         ngWordTextField.setText(conv.getNgSetting().getWord());
773         ngIdTextField.setText(conv.getNgSetting().getId());
774     }
775
776     /**
777      * [ファイル|終了] アクションが実行されました。
778      *
779      * @param actionEvent
780      *            ActionEvent
781      */
782     void jMenuFileExit_actionPerformed(ActionEvent actionEvent) {
783         SProperties setting = getSetting();
784         SProperties.saveSetting(setting);
785         System.exit(0);
786     }
787
788     /**
789      * [ヘルプ|バージョン情報] アクションが実行されました。
790      *
791      * @param actionEvent
792      *            ActionEvent
793      */
794     void jMenuHelpAbout_actionPerformed(ActionEvent actionEvent) {
795         MainFrame_AboutBox dlg = new MainFrame_AboutBox(this);
796         dlg.pack();
797         dlg.setLocationRelativeTo(this);
798         dlg.setVisible(true);
799     }
800
801     /* 変換・保存する */
802     private Converter Converter = null;
803     // FFmpegの設定 ここから
804     private final JLabel extOptionLabel = new JLabel();
805     private final JTextField extOptionField = new JTextField();
806     private JLabel mainOptionLabel = new JLabel();
807     private JTextField mainOptionField = new JTextField();
808     private JLabel inputOptionLabel = new JLabel();
809     private JTextField inputOptionField = new JTextField();
810     private JLabel outputOptionLabel = new JLabel();
811     private JTextField outputOptionField = new JTextField();
812     private final JLabel avfilterOptionLabel = new JLabel();
813     private final JTextField avfilterOptionField = new JTextField();
814     private final JCheckBox resizeCheckBox = new JCheckBox("次のサイズに収まるようリサイズ");
815     private final JLabel resizeWidthLabel = new JLabel("横");
816     private final JTextField resizeWidthField = new JTextField();
817     private final JLabel resizeHeightLabel = new JLabel("縦");
818     private final JTextField resizeHeigitField = new JTextField();
819     private final JCheckBox adjustRatioCheckBox = new JCheckBox("アスペクト比を維持");
820     private final JCheckBox padCheckBox = new JCheckBox("黒幕を付与");
821     // FFmpegの設定 ここまで
822     private JLabel FontIndexLabel = new JLabel();
823     private JTextField fontIndexField = new JTextField();
824     private JLabel VideoID_Label = new JLabel();
825     private JLabel WayBackLabel = new JLabel();
826     private JTextField WayBackField = new JTextField();
827     private GridBagLayout gridBagLayout1 = new GridBagLayout();
828     private JPanel OpPanel = new JPanel();
829     private JPanel BasicInfoTabPanel = new JPanel();
830     private GridBagLayout gridBagLayout12 = new GridBagLayout();
831     private JPanel ConvertingSettingPanel = null;
832     private JPanel NGWordSettingPanel = null;
833     private JLabel NGWordLavel = null;
834     private JTextField ngWordTextField = null;
835     private JLabel NGIDLabel = null;
836     private JTextField ngIdTextField = null;
837     // プロキシ設定
838     private JPanel ProxyInfoPanel = null;
839     private JCheckBox useProxyCheckBox = null;
840     private JLabel proxyLabel = null;
841     private JTextField proxyTextField = null;
842     private JLabel proxyPortLabel = null;
843     private JTextField proxyPortTextField = null;
844     //
845     private JCheckBox fixFontSizeCheckBox = null;
846     private JCheckBox opaqueCommentCheckBox = null;
847     private final SavePanel savePanel = new SavePanel();
848     private final VideoSaveInfoPanel videoSaveInfoPanel;
849     private JComboBox FFmpegOptionComboBox = null;
850     private JButton FFmpegOptionReloadButton = null;
851     private JPanel FFmpegOptionComboBoxPanel = null;
852
853     public void DoButton_actionPerformed(ActionEvent e) {
854         if (Converter == null || Converter.isConverted()) {
855             try {
856                 executeConvert();
857             } catch (Exception ex) {
858                 String text = ex.getMessage();
859                 if (StringUtils.isEmpty(text)) {
860                     text = "予期しないエラーのため中断しました。";
861                 }
862                 ex.printStackTrace();
863                 statusBar.setText(text);
864             }
865         } else { /* 開始しているので、ストップする。 */
866             final ConvertStopFlag flag = Converter.getStopFlag();
867             if (!flag.needStop()) { /* まだストップしていない。 */
868                 flag.requestStop();
869             }
870         }
871     }
872
873     private void executeConvert() throws IOException {
874         String url;
875
876         // NicoBrowserファイルを利用する場合は、ファイル名からビデオIDを特定.
877         if (videoSaveInfoPanel.getVideoUseNiBrButton().isSelected()) {
878             try {
879                 String fileName = videoSaveInfoPanel.getNibrFileField().getText();
880                 NicoDBFinder finder = NicoDBFinder.getInstance();
881                 NicoContent info = finder.findNicoContent(fileName);
882                 if (info != null) {
883                     url = info.getNicoId();
884                 } else {
885                     url = "";
886                 }
887             } catch (Exception ex) {
888                 JOptionPane.showMessageDialog(this, ex.getMessage(), "エラー", JOptionPane.ERROR_MESSAGE);
889                 return;
890             }
891         } else {
892             url = VideoID_TextField.getText();
893         }
894
895         TextProgressListener sl = new TextProgressListener() {
896
897             public void setText(final String text) {
898                 SwingUtilities.invokeLater(new Runnable() {
899
900                     public void run() {
901                         statusBar.setText(text);
902                     }
903                 });
904             }
905         };
906
907         ConvertStopFlag.StateChangeListener scl = new ConvertStopFlag.StateChangeListener() {
908
909             public void changeState(final State s) {
910                 SwingUtilities.invokeLater(new Runnable() {
911
912                     public void run() {
913                         switch (s) {
914                             case STOPPING:
915                                 DoButton.setText(DoButtonWaitString);
916                                 break;
917                             case FINISHED:
918                                 DoButton.setText(DoButtonDefString);
919                         }
920                     }
921                 });
922             }
923         };
924
925         Converter = new Converter(url, WayBackField.getText(), getSetting().toProfile(), sl,
926                 new ConvertStopFlag(scl));
927         DoButton.setText(DoButtonStopString);
928         new Thread(Converter).start();
929
930     }
931
932     /* FFmpegへのパス */
933     public void SettingFFmpegPathButton_actionPerformed(ActionEvent e) {
934         showSaveDialog("FFmpegへのパス", ffmpegPathField, false, false);
935     }
936
937     public void SettingVhookPathButton_actionPerformed(ActionEvent e) {
938         showSaveDialog("拡張vhookライブラリへのパス", vhookPathField, false, false);
939     }
940
941     public void SettingFontPathButton_actionPerformed(ActionEvent e) {
942         showSaveDialog("フォントへのパス", fontPathField, false, false);
943     }
944
945     public void this_windowClosing(WindowEvent e) {
946         this.jMenuFileExit_actionPerformed(null);
947     }
948
949     /**
950      * This method initializes ConvertingSettingPanel
951      *
952      * @return javax.swing.JPanel
953      */
954     private JPanel getConvertingSettingPanel() {
955         if (ConvertingSettingPanel == null) {
956             GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
957             gridBagConstraints11.weighty = 1.0;
958             gridBagConstraints11.weightx = 1.0;
959             gridBagConstraints11.insets = new Insets(0, 5, 0, 5);
960             gridBagConstraints11.gridy = 1;
961             gridBagConstraints11.gridx = 0;
962             gridBagConstraints11.anchor = GridBagConstraints.NORTH;
963             gridBagConstraints11.fill = GridBagConstraints.HORIZONTAL;
964             GridBagConstraints gridBagConstraints = new GridBagConstraints(0,
965                     2, 1, 1, 1.0, 1.0, GridBagConstraints.NORTH,
966                     GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0);
967             gridBagConstraints.gridx = 0;
968             gridBagConstraints.anchor = GridBagConstraints.CENTER;
969             gridBagConstraints.weighty = 0.0;
970             gridBagConstraints.gridy = 0;
971             ConvertingSettingPanel = new JPanel();
972             ConvertingSettingPanel.setLayout(new GridBagLayout());
973             ConvertingSettingPanel.add(getNGWordSettingPanel(),
974                     gridBagConstraints11);
975             ConvertingSettingPanel.add(VhookSettingPanel, gridBagConstraints);
976         }
977         return ConvertingSettingPanel;
978     }
979
980     /**
981      * This method initializes NGWordSettingPanel
982      *
983      * @return javax.swing.JPanel
984      */
985     private JPanel getNGWordSettingPanel() {
986         if (NGWordSettingPanel == null) {
987             GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
988             gridBagConstraints5.fill = GridBagConstraints.HORIZONTAL;
989             gridBagConstraints5.gridy = 1;
990             gridBagConstraints5.weightx = 1.0;
991             gridBagConstraints5.insets = new Insets(0, 5, 5, 5);
992             gridBagConstraints5.gridx = 1;
993             GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
994             gridBagConstraints4.gridx = 0;
995             gridBagConstraints4.anchor = GridBagConstraints.WEST;
996             gridBagConstraints4.insets = new Insets(0, 5, 5, 0);
997             gridBagConstraints4.gridy = 1;
998             NGIDLabel = new JLabel();
999             NGIDLabel.setText("NG ID");
1000             GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
1001             gridBagConstraints3.fill = GridBagConstraints.HORIZONTAL;
1002             gridBagConstraints3.gridy = 0;
1003             gridBagConstraints3.weightx = 1.0;
1004             gridBagConstraints3.insets = new Insets(0, 5, 5, 5);
1005             gridBagConstraints3.gridx = 1;
1006             GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
1007             gridBagConstraints2.gridx = 0;
1008             gridBagConstraints2.insets = new Insets(0, 5, 5, 0);
1009             gridBagConstraints2.gridy = 0;
1010             NGWordLavel = new JLabel();
1011             NGWordLavel.setText("NGワード");
1012             NGWordSettingPanel = new JPanel();
1013             NGWordSettingPanel.setLayout(new GridBagLayout());
1014             NGWordSettingPanel.setBorder(BorderFactory.createTitledBorder(null,
1015                     "NGワード・ID設定"));
1016             NGWordSettingPanel.add(NGWordLavel, gridBagConstraints2);
1017             NGWordSettingPanel.add(getNGWordTextField(), gridBagConstraints3);
1018             NGWordSettingPanel.add(NGIDLabel, gridBagConstraints4);
1019             NGWordSettingPanel.add(getNGIDTextField(), gridBagConstraints5);
1020         }
1021         return NGWordSettingPanel;
1022     }
1023
1024     /**
1025      * This method initializes NGWordTextField
1026      *
1027      * @return javax.swing.JTextField
1028      */
1029     private JTextField getNGWordTextField() {
1030         if (ngWordTextField == null) {
1031             ngWordTextField = new JTextField();
1032             ngWordTextField.setName("ngWordTextField");
1033         }
1034         return ngWordTextField;
1035     }
1036
1037     /**
1038      * This method initializes NGIDTextField
1039      *
1040      * @return javax.swing.JTextField
1041      */
1042     private JTextField getNGIDTextField() {
1043         if (ngIdTextField == null) {
1044             ngIdTextField = new JTextField();
1045             ngIdTextField.setName("ngIdTextField");
1046         }
1047         return ngIdTextField;
1048     }
1049
1050     /**
1051      * This method initializes ProxyInfoPanel
1052      *
1053      * @return javax.swing.JPanel
1054      */
1055     private JPanel getProxyInfoPanel() {
1056         if (ProxyInfoPanel == null) {
1057             GridBagConstraints gridBagConstraints13 = new GridBagConstraints();
1058             gridBagConstraints13.gridx = 0;
1059             gridBagConstraints13.gridwidth = 2;
1060             gridBagConstraints13.weightx = 1.0;
1061             gridBagConstraints13.fill = GridBagConstraints.HORIZONTAL;
1062             gridBagConstraints13.insets = new Insets(0, 5, 0, 5);
1063             gridBagConstraints13.gridy = 0;
1064             GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
1065             gridBagConstraints12.fill = GridBagConstraints.HORIZONTAL;
1066             gridBagConstraints12.gridy = 2;
1067             gridBagConstraints12.weightx = 1.0;
1068             gridBagConstraints12.insets = new Insets(5, 0, 5, 5);
1069             gridBagConstraints12.gridx = 1;
1070             GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
1071             gridBagConstraints10.gridx = 0;
1072             gridBagConstraints10.insets = new Insets(5, 5, 5, 5);
1073             gridBagConstraints10.gridy = 2;
1074             proxyPortLabel = new JLabel();
1075             proxyPortLabel.setText("ポート番号");
1076             GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
1077             gridBagConstraints9.fill = GridBagConstraints.BOTH;
1078             gridBagConstraints9.gridy = 1;
1079             gridBagConstraints9.weightx = 1.0;
1080             gridBagConstraints9.insets = new Insets(0, 0, 0, 5);
1081             gridBagConstraints9.gridx = 1;
1082             GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
1083             gridBagConstraints8.gridx = 0;
1084             gridBagConstraints8.insets = new Insets(0, 5, 0, 5);
1085             gridBagConstraints8.fill = GridBagConstraints.NONE;
1086             gridBagConstraints8.anchor = GridBagConstraints.EAST;
1087             gridBagConstraints8.gridy = 1;
1088             proxyLabel = new JLabel();
1089             proxyLabel.setText("プロキシ");
1090             ProxyInfoPanel = new JPanel();
1091             ProxyInfoPanel.setLayout(new GridBagLayout());
1092             ProxyInfoPanel.setBorder(BorderFactory.createTitledBorder(null,
1093                     "プロキシ設定"));
1094             ProxyInfoPanel.add(proxyLabel, gridBagConstraints8);
1095             ProxyInfoPanel.add(getProxyTextField(), gridBagConstraints9);
1096             ProxyInfoPanel.add(proxyPortLabel, gridBagConstraints10);
1097             ProxyInfoPanel.add(getProxyPortTextField(), gridBagConstraints12);
1098             ProxyInfoPanel.add(getUseProxyCheckBox(), gridBagConstraints13);
1099         }
1100         return ProxyInfoPanel;
1101     }
1102
1103     /**
1104      * This method initializes ProxyTextField
1105      *
1106      * @return javax.swing.JTextField
1107      */
1108     private JTextField getProxyTextField() {
1109         if (proxyTextField == null) {
1110             proxyTextField = new JTextField();
1111             proxyTextField.setName("proxyTextField");
1112         }
1113         return proxyTextField;
1114     }
1115
1116     /**
1117      * This method initializes ProxyPortTextField
1118      *
1119      * @return javax.swing.JTextField
1120      */
1121     private JTextField getProxyPortTextField() {
1122         if (proxyPortTextField == null) {
1123             proxyPortTextField = new JTextField();
1124             proxyPortTextField.setName("proxyPortTextField");
1125         }
1126         return proxyPortTextField;
1127     }
1128
1129     /**
1130      * This method initializes UseProxyCheckBox
1131      *
1132      * @return javax.swing.JCheckBox
1133      */
1134     private JCheckBox getUseProxyCheckBox() {
1135         if (useProxyCheckBox == null) {
1136             useProxyCheckBox = new JCheckBox();
1137             useProxyCheckBox.setText("プロキシを使う");
1138             useProxyCheckBox.setName("useProxyCheckBox");
1139         }
1140         return useProxyCheckBox;
1141     }
1142
1143     /**
1144      * This method initializes FixFontSizeCheckBox
1145      *
1146      * @return javax.swing.JCheckBox
1147      */
1148     private JCheckBox getFixFontSizeCheckBox() {
1149         if (fixFontSizeCheckBox == null) {
1150             fixFontSizeCheckBox = new JCheckBox();
1151             fixFontSizeCheckBox.setText("フォントサイズを画面にあわせて自動調整する");
1152             fixFontSizeCheckBox.setName("fixFontSizeCheckBox");
1153         }
1154         return fixFontSizeCheckBox;
1155     }
1156
1157     /**
1158      * This method initializes OpaqueCommentCheckBox
1159      *
1160      * @return javax.swing.JCheckBox
1161      */
1162     private JCheckBox getOpaqueCommentCheckBox() {
1163         if (opaqueCommentCheckBox == null) {
1164             opaqueCommentCheckBox = new JCheckBox();
1165             opaqueCommentCheckBox.setText("全てのコメントを不透明にする");
1166             opaqueCommentCheckBox.setName("opaqueCommentCheckBox");
1167         }
1168         return opaqueCommentCheckBox;
1169     }
1170     /**
1171      * This method initializes FFmpegOptionComboBox
1172      *
1173      * @return javax.swing.JComboBox
1174      */
1175     private final OptionComboBoxModel FFmpegOptionModel = new OptionComboBoxModel();
1176     private JCheckBox disableVhookCheckBox = null;
1177     private JTextField viewCommentField = null;
1178     private JLabel ViewCommentLabel = null;
1179     private JLabel ShadowKindLabel = null;
1180     private JComboBox shadowComboBox = null;
1181
1182     private JComboBox getFFmpegOptionComboBox() {
1183         if (FFmpegOptionComboBox == null) {
1184             FFmpegOptionComboBox = new JComboBox(FFmpegOptionModel);
1185             FFmpegOptionComboBox.addActionListener(new java.awt.event.ActionListener() {
1186
1187                 public void actionPerformed(java.awt.event.ActionEvent e) {
1188                     if (FFmpegOptionModel.isFile()) {// ファイル
1189                         extOptionField.setEnabled(false);
1190                         mainOptionField.setEnabled(false);
1191                         inputOptionField.setEnabled(false);
1192                         outputOptionField.setEnabled(false);
1193                         avfilterOptionField.setEnabled(false);
1194                     } else {// ファイルでない
1195                         extOptionField.setEnabled(true);
1196                         mainOptionField.setEnabled(true);
1197                         inputOptionField.setEnabled(true);
1198                         outputOptionField.setEnabled(true);
1199                         avfilterOptionField.setEditable(true);
1200                     }
1201                 }
1202             });
1203         }
1204         return FFmpegOptionComboBox;
1205     }
1206
1207     /**
1208      * This method initializes FFmpegOptionReloadButton
1209      *
1210      * @return javax.swing.JButton
1211      */
1212     private JButton getFFmpegOptionReloadButton() {
1213         if (FFmpegOptionReloadButton == null) {
1214             FFmpegOptionReloadButton = new JButton();
1215             FFmpegOptionReloadButton.setText("更新");
1216             FFmpegOptionReloadButton.addActionListener(new java.awt.event.ActionListener() {
1217
1218                 public void actionPerformed(java.awt.event.ActionEvent e) {
1219                     FFmpegOptionModel.reload();
1220                 }
1221             });
1222         }
1223         return FFmpegOptionReloadButton;
1224     }
1225
1226     /**
1227      * This method initializes FFmpegOptionComboBoxPanel
1228      *
1229      * @return javax.swing.JPanel
1230      */
1231     private JPanel getFFmpegOptionComboBoxPanel() {
1232         if (FFmpegOptionComboBoxPanel == null) {
1233             GridBagConstraints gridBagConstraints47 = new GridBagConstraints();
1234             gridBagConstraints47.fill = GridBagConstraints.BOTH;
1235             gridBagConstraints47.gridx = -1;
1236             gridBagConstraints47.gridy = -1;
1237             gridBagConstraints47.insets = new Insets(0, 0, 5, 5);
1238             GridBagConstraints gridBagConstraints46 = new GridBagConstraints();
1239             gridBagConstraints46.fill = GridBagConstraints.HORIZONTAL;
1240             gridBagConstraints46.gridwidth = 3;
1241             gridBagConstraints46.gridx = -1;
1242             gridBagConstraints46.gridy = -1;
1243             gridBagConstraints46.weightx = 1.0;
1244             gridBagConstraints46.insets = new Insets(0, 5, 5, 5);
1245             FFmpegOptionComboBoxPanel = new JPanel();
1246             FFmpegOptionComboBoxPanel.setLayout(new GridBagLayout());
1247             FFmpegOptionComboBoxPanel.add(getFFmpegOptionComboBox(),
1248                     gridBagConstraints46);
1249             FFmpegOptionComboBoxPanel.add(getFFmpegOptionReloadButton(),
1250                     gridBagConstraints47);
1251         }
1252         return FFmpegOptionComboBoxPanel;
1253     }
1254
1255     /**
1256      * This method initializes NotUseVhookCheckBox
1257      *
1258      * @return javax.swing.JCheckBox
1259      */
1260     private JCheckBox getNotUseVhookCheckBox() {
1261         if (disableVhookCheckBox == null) {
1262             disableVhookCheckBox = new JCheckBox();
1263             disableVhookCheckBox.setText("拡張vhookライブラリを無効にする(デバッグ用)");
1264             disableVhookCheckBox.setName("disableVhookCheckBox");
1265         }
1266         return disableVhookCheckBox;
1267     }
1268
1269     /**
1270      * This method initializes ViewCommentField
1271      *
1272      * @return javax.swing.JTextField
1273      */
1274     private JTextField getViewCommentField() {
1275         if (viewCommentField == null) {
1276             viewCommentField = new JTextField();
1277             viewCommentField.setName("viewCommentField");
1278         }
1279         return viewCommentField;
1280     }
1281
1282     /**
1283      * This method initializes ShadowComboBox
1284      *
1285      * @return javax.swing.JComboBox
1286      */
1287     private JComboBox getShadowComboBox() {
1288         if (shadowComboBox == null) {
1289             shadowComboBox = new JComboBox(SProperties.ShadowKindArray);
1290             shadowComboBox.setName("shadowComboBox");
1291         }
1292         return shadowComboBox;
1293     }
1294
1295     private BasicSetting getBasicSetting() {
1296         String mail = mailAddressField.getText();
1297         String pass = String.valueOf(passwordField.getPassword());
1298         boolean proxyUse = useProxyCheckBox.isSelected();
1299         String proxyHost = proxyTextField.getText();
1300         int proxyPort;
1301         try {
1302             proxyPort = Integer.parseInt(proxyPortTextField.getText());
1303         } catch (NumberFormatException e) {
1304             proxyPort = -1;
1305         }
1306         // TODO 作業用ディレクトリの設定GUI無し
1307         return new BasicSetting(tempDir, mail, pass, proxyUse, proxyHost, proxyPort);
1308     }
1309
1310     private InputVideoSetting getInputVideoSetting() {
1311         VideoSaveKind kind;
1312         if (videoSaveInfoPanel.getVideoNoSaveButton().isSelected() == true) {
1313             kind = VideoSaveKind.NO_SAVE;
1314         } else if (videoSaveInfoPanel.getVideoUseNiBrButton().isSelected() == true) {
1315             kind = VideoSaveKind.NICOBROWSER;
1316         } else {
1317             kind = VideoSaveKind.SAVE;
1318         }
1319         boolean autoNaming = videoSaveInfoPanel.getSaveFolderRadioButton().isSelected();
1320         String folder = videoSaveInfoPanel.getVideoSavedFolderField().getText();
1321         String file = videoSaveInfoPanel.getVideoSavedFileField().getText();
1322         boolean delete = videoSaveInfoPanel.getDelVideoCheckBox().isSelected();
1323         String nibrFile = videoSaveInfoPanel.getNibrFileField().getText();
1324
1325         return new InputVideoSetting(kind, autoNaming, new File(folder), new File(file), delete, new File(nibrFile));
1326     }
1327
1328     private InputCommentSetting getInputCommentSetting() {
1329         boolean download = savePanel.getSavingCommentCheckBox().isSelected();
1330         String file = savePanel.getCommentSavedFileField().getText();
1331         int back_comment;
1332         try {
1333             back_comment = Integer.parseInt(savePanel.getCommentNumField().getText());
1334         } catch (NumberFormatException ex) {
1335             back_comment = 500;
1336         }
1337         boolean delete = savePanel.getDelCommentCheckBox().isSelected();
1338         boolean autoNaming = savePanel.getCommentSaveFolderRadioButton().isSelected();
1339         String folder = savePanel.getCommentSavedFolderField().getText();
1340         boolean adjustNumOfCom = savePanel.getFixCommentNumCheckBox().isSelected();
1341
1342         return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete, adjustNumOfCom,
1343                 back_comment);
1344     }
1345
1346     /**
1347      * 画面入力値から投稿者コメント設定を作成する.
1348      * @return 作成した投稿者コメント設定.
1349      */
1350     private InputTcommentSetting getTcommentSetting() {
1351         boolean down = savePanel.isTcommentDownload();
1352         boolean del = savePanel.isTcommentDelete();
1353         boolean naming = savePanel.isTcommentAutoFileName();
1354         String dir = savePanel.getTcommentDirectoryName();
1355         String f = savePanel.getTcommentFileName();
1356         return new InputTcommentSetting(down, naming, dir, f, del);
1357     }
1358
1359     private OutputVideoSetting getOutputVideoSetting() {
1360         boolean process = savePanel.getSavingConvertedVideoCheckBox().isSelected();
1361         boolean addComment = savePanel.getAddCommentCheckBox().isSelected();
1362         boolean addTcomment = savePanel.getAddTcommentCheckBox().isSelected();
1363         String file = savePanel.getConvertedVideoSavedFileField().getText();
1364         boolean cutId = savePanel.getNotAddVideoIdConvVideoCheckBox().isSelected();
1365         boolean autoNaming = savePanel.getConvSaveFolderRadioButton().isSelected();
1366         String folder = savePanel.getConvertedVideoSavedFolderField().getText();
1367
1368         return new OutputVideoSetting(process, autoNaming, new File(folder), new File(file), cutId, addComment,
1369                 addTcomment);
1370     }
1371
1372     private MovieSetting getMovieSetting() {
1373         String ffmpeg = ffmpegPathField.getText();
1374         String vhook = vhookPathField.getText();
1375         String ext = extOptionField.getText();
1376         String main = mainOptionField.getText();
1377         String in = inputOptionField.getText();
1378         String out = outputOptionField.getText();
1379         String avfilter = avfilterOptionField.getText();
1380         File optionFile = FFmpegOptionModel.getSelectedFile();
1381
1382         FfmpegOption opt = new FfmpegOption(ext, main, in, out, avfilter);
1383         return new MovieSetting(new File(ffmpeg), new File(vhook), optionFile, opt);
1384     }
1385
1386     private ConvertSetting getConvertSetting() {
1387         boolean vhookDisabled = disableVhookCheckBox.isSelected();
1388         int maxComment = 30;
1389         try {
1390             maxComment = Integer.parseInt(viewCommentField.getText());
1391         } catch (NumberFormatException ex) {
1392         }
1393         File font = new File(fontPathField.getText());
1394         int fontIndex = Integer.parseInt(fontIndexField.getText());
1395         int shadowIndex = shadowComboBox.getSelectedIndex();
1396         boolean showConv = showConvVideoCheckBox.isSelected();
1397         boolean adjustFont = fixFontSizeCheckBox.isSelected();
1398         boolean commentOpaque = opaqueCommentCheckBox.isSelected();
1399         NgSetting ngSetting = new NgSetting(ngWordTextField.getText(), ngIdTextField.getText());
1400
1401         return new ConvertSetting(vhookDisabled, maxComment, font, fontIndex, shadowIndex, showConv, adjustFont,
1402                 commentOpaque, ngSetting);
1403     }
1404
1405     private class InputVideoPanelButtonListener implements ActionListener {
1406
1407         public void actionPerformed(ActionEvent e) {
1408             final Object source = e.getSource();
1409             final VideoSaveInfoPanel panel = videoSaveInfoPanel;
1410             String title;
1411             JTextField field;
1412             boolean isSave;
1413             boolean isDir;
1414
1415             if (source == panel.getShowSavingVideoFolderDialogButton()) {
1416                 title = "動画の保存先(フォルダ)";
1417                 field = panel.getVideoSavedFolderField();
1418                 isSave = true;
1419                 isDir = true;
1420             } else if (source == panel.getShowSavingVideoFileDialogButton()) {
1421                 title = "動画の保存先(ファイル)";
1422                 field = panel.getVideoSavedFileField();
1423                 isSave = true;
1424                 isDir = false;
1425             } else if (source == panel.getNibrFileChooserButton()) {
1426                 title = "NicoBrowserファイル選択";
1427                 field = panel.getNibrFileField();
1428                 isSave = false;
1429                 isDir = false;
1430             } else {
1431                 return;
1432             }
1433             showSaveDialog(title, field, isSave, isDir);
1434         }
1435     }
1436
1437     private class InputCommentPanelButtonListener implements ActionListener {
1438
1439         public void actionPerformed(ActionEvent e) {
1440             final Object source = e.getSource();
1441             String title;
1442             JTextField field;
1443             boolean isSave;
1444             boolean isDir;
1445             if (source == savePanel.getShowSavingCommentFolderDialogButton()) {
1446                 title = "コメントの保存先(フォルダ)";
1447                 field = savePanel.getCommentSavedFolderField();
1448                 isSave = true;
1449                 isDir = true;
1450             } else if (source == savePanel.getShowSavingCommentFileDialogButton()) {
1451                 title = "コメントの保存先(ファイル)";
1452                 field = savePanel.getCommentSavedFileField();
1453                 isSave = true;
1454                 isDir = false;
1455             } else {
1456                 return;
1457             }
1458             showSaveDialog(title, field, isSave, isDir);
1459         }
1460     }
1461
1462     private class OutputVideoPanelButtonListener implements ActionListener {
1463
1464         public void actionPerformed(ActionEvent e) {
1465             final Object source = e.getSource();
1466             String title;
1467             JTextField field;
1468             boolean isSave;
1469             boolean isDir;
1470             if (source == savePanel.getShowSavingConvertedVideoFolderDialogButton()) {
1471                 title = "コメント付き動画の保存先(フォルダ)";
1472                 field = savePanel.getConvertedVideoSavedFolderField();
1473                 isSave = true;
1474                 isDir = true;
1475             } else if (source == savePanel.getShowSavingConvertedVideoFileDialogButton()) {
1476                 title = "コメント付き動画の保存先(ファイル)";
1477                 field = savePanel.getConvertedVideoSavedFileField();
1478                 isSave = true;
1479                 isDir = false;
1480             } else {
1481                 return;
1482             }
1483             showSaveDialog(title, field, isSave, isDir);
1484         }
1485     }
1486
1487     private class VideoUseRadioButtonListener implements ActionListener {
1488
1489         public void actionPerformed(ActionEvent e) {
1490             Object source = e.getSource();
1491             if (source == videoSaveInfoPanel.getVideoUseNiBrButton()) {
1492                 maskExt();
1493             } else {
1494                 maskBase();
1495             }
1496         }
1497
1498         private void maskBase() {
1499             mask(true);
1500         }
1501
1502         private void maskExt() {
1503             mask(false);
1504         }
1505
1506         private void mask(boolean b) {
1507             final VideoSaveInfoPanel panel = videoSaveInfoPanel;
1508             VideoID_TextField.setEditable(b);
1509             panel.getDelVideoCheckBox().setEnabled(b);
1510
1511             panel.getSaveFolderRadioButton().setEnabled(b);
1512             panel.getVideoSavedFolderField().setEnabled(b);
1513             panel.getShowSavingVideoFolderDialogButton().setEnabled(b);
1514
1515             panel.getSaveFileRadioButton().setEnabled(b);
1516             panel.getVideoSavedFileField().setEnabled(b);
1517             panel.getShowSavingVideoFileDialogButton().setEnabled(b);
1518
1519             panel.getNibrFileField().setEnabled(!b);
1520             panel.getNibrFileChooserButton().setEnabled(!b);
1521         }
1522     }
1523 }
1524
1525 class MainFrame_this_windowAdapter extends WindowAdapter {
1526
1527     private MainFrame adaptee;
1528
1529     MainFrame_this_windowAdapter(MainFrame adaptee) {
1530         this.adaptee = adaptee;
1531     }
1532
1533     @Override
1534     public void windowClosing(WindowEvent e) {
1535         adaptee.this_windowClosing(e);
1536     }
1537 }
1538
1539 class MainFrame_SettingFontPathButton_actionAdapter implements ActionListener {
1540
1541     private MainFrame adaptee;
1542
1543     MainFrame_SettingFontPathButton_actionAdapter(MainFrame adaptee) {
1544         this.adaptee = adaptee;
1545     }
1546
1547     public void actionPerformed(ActionEvent e) {
1548         adaptee.SettingFontPathButton_actionPerformed(e);
1549     }
1550 }
1551
1552 class MainFrame_SettingVhookPathButton_actionAdapter implements ActionListener {
1553
1554     private MainFrame adaptee;
1555
1556     MainFrame_SettingVhookPathButton_actionAdapter(MainFrame adaptee) {
1557         this.adaptee = adaptee;
1558     }
1559
1560     public void actionPerformed(ActionEvent e) {
1561         adaptee.SettingVhookPathButton_actionPerformed(e);
1562     }
1563 }
1564
1565 class MainFrame_SettingFFmpegPathButton_actionAdapter implements ActionListener {
1566
1567     private MainFrame adaptee;
1568
1569     MainFrame_SettingFFmpegPathButton_actionAdapter(MainFrame adaptee) {
1570         this.adaptee = adaptee;
1571     }
1572
1573     public void actionPerformed(ActionEvent e) {
1574         adaptee.SettingFFmpegPathButton_actionPerformed(e);
1575     }
1576 }
1577
1578 class MainFrame_DoButton_actionAdapter implements ActionListener {
1579
1580     private MainFrame adaptee;
1581
1582     MainFrame_DoButton_actionAdapter(MainFrame adaptee) {
1583         this.adaptee = adaptee;
1584     }
1585
1586     public void actionPerformed(ActionEvent e) {
1587         adaptee.DoButton_actionPerformed(e);
1588     }
1589 }
1590
1591 class MainFrame_jMenuFileExit_ActionAdapter implements ActionListener {
1592
1593     MainFrame adaptee;
1594
1595     MainFrame_jMenuFileExit_ActionAdapter(MainFrame adaptee) {
1596         this.adaptee = adaptee;
1597     }
1598
1599     public void actionPerformed(ActionEvent actionEvent) {
1600         adaptee.jMenuFileExit_actionPerformed(actionEvent);
1601     }
1602 }
1603
1604 class MainFrame_jMenuHelpAbout_ActionAdapter implements ActionListener {
1605
1606     MainFrame adaptee;
1607
1608     MainFrame_jMenuHelpAbout_ActionAdapter(MainFrame adaptee) {
1609         this.adaptee = adaptee;
1610     }
1611
1612     public void actionPerformed(ActionEvent actionEvent) {
1613         adaptee.jMenuHelpAbout_actionPerformed(actionEvent);
1614     }
1615 }