OSDN Git Service

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