OSDN Git Service

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