OSDN Git Service

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