OSDN Git Service

f0cace683861beb1d32323958c34efa5baf6c47e
[coroid/inqubus.git] / frontend / src / saccubus / MainFrame.java
1 package saccubus;
2
3 import saccubus.converter.Converter;
4 import java.awt.BorderLayout;
5 import java.awt.Dimension;
6 import java.awt.GridBagConstraints;
7 import java.awt.GridBagLayout;
8 import java.awt.GridLayout;
9 import java.awt.Image;
10 import java.awt.Insets;
11 import java.awt.Toolkit;
12 import java.awt.dnd.DnDConstants;
13 import java.awt.dnd.DropTarget;
14 import java.awt.event.ActionEvent;
15 import java.awt.event.ActionListener;
16 import java.awt.event.KeyEvent;
17 import java.awt.event.WindowAdapter;
18 import java.awt.event.WindowEvent;
19 import java.io.File;
20 import java.io.IOException;
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 saccubus.ConvertStopFlag.State;
41 import saccubus.converter.FfmpegOption;
42 import saccubus.net.TextProgressListener;
43 import saccubus.properties.BasicSetting;
44 import saccubus.properties.ConvertSetting;
45 import saccubus.properties.InputCommentSetting;
46 import saccubus.properties.InputVideoSetting;
47 import saccubus.properties.SProperties;
48 import saccubus.properties.InputTcommentSetting;
49 import saccubus.properties.MovieSetting;
50 import saccubus.properties.OutputVideoSetting;
51 import saccubus.util.FileDropTarget;
52 import saccubus.util.PopupRightClick;
53 import yukihane.nicovideo.NicoDBFinder;
54
55 /**
56  * <p>
57  * \83^\83C\83g\83\8b\82³\82«\82ã\82Î\82·
58  * </p>
59  * 
60  * <p>
61  * \90à\96¾: \83j\83R\83j\83R\93®\89æ\82Ì\93®\89æ\82ð\83R\83\81\83\93\83g\82Â\82«\82Å\95Û\91
62  * </p>
63  * 
64  * <p>
65  * \92\98\8dì\8c : Copyright (c) 2007 PSI
66  * </p>
67  * 
68  * <p>
69  * \89ï\8eÐ\96¼:
70  * </p>
71  * 
72  * @author \96¢\93ü\97Í
73  * @version 1.0
74  */
75 public class MainFrame extends JFrame {
76
77     private static final long serialVersionUID = 2564486741331062989L;
78     public static final String VERSION = "1.22r NicoBrowser\8ag\92£ 1.1.1";
79     public static final Image WinIcon = Toolkit.getDefaultToolkit().createImage(saccubus.MainFrame.class.getResource(
80             "icon32.png"));
81     JPanel contentPane;
82     BorderLayout borderLayout1 = new BorderLayout();
83     JMenuBar jMenuBar1 = new JMenuBar();
84     JMenu jMenuFile = new JMenu();
85     JMenuItem jMenuFileExit = new JMenuItem();
86     JMenu jMenuHelp = new JMenu();
87     JMenuItem jMenuHelpAbout = new JMenuItem();
88     JLabel statusBar = new JLabel();
89     JTabbedPane MainTabbedPane = new JTabbedPane();
90     JPanel SavingInfoTabPanel = new JPanel();
91     JPanel FFMpegTabPanel = new JPanel();
92     JPanel VideoInfoPanel = new JPanel();
93     JTextField VideoID_TextField = new JTextField();
94     JButton DoButton = new JButton();
95     public static final String DoButtonDefString = "\95Ï\8a·";
96     public static final String DoButtonStopString = "\92â\8e~";
97     public static final String DoButtonWaitString = "\91Ò\8b@";
98     JPanel UserInfoPanel = new JPanel();
99     GridBagLayout gridBagLayout3 = new GridBagLayout();
100     JLabel MailAddrLabel = new JLabel();
101     JTextField MailAddrField = new JTextField();
102     JLabel PasswordLabel = new JLabel();
103     JPasswordField PasswordField = new JPasswordField();
104     GridBagLayout gridBagLayout4 = new GridBagLayout();
105     GridBagLayout gridBagLayout6 = new GridBagLayout();
106     ButtonGroup CommentSaveButtonGroup = new ButtonGroup();
107     ButtonGroup ConvSaveButtonGroup = new ButtonGroup();
108
109     public MainFrame() {
110         videoSaveInfoPanel = savePanel.getVideoSaveInfoPanel();
111
112         try {
113             setDefaultCloseOperation(EXIT_ON_CLOSE);
114             jbInit();
115             setPopup();
116             setDropTarget();
117             SProperties setting = SProperties.loadSetting(null,
118                     null);
119             this.setSetting(setting);
120         } catch (Exception exception) {
121             exception.printStackTrace();
122         }
123     }
124
125     /**
126      * \83R\83\93\83|\81[\83l\83\93\83g\82Ì\8f\89\8aú\89»\81B
127      *
128      * @throws java.lang.Exception
129      */
130     private void jbInit() throws Exception {
131         GridBagConstraints gridBagConstraints74 = new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
132                 GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0);
133         gridBagConstraints74.gridwidth = 2;
134         GridBagConstraints gridBagConstraints73 = new GridBagConstraints();
135         gridBagConstraints73.fill = GridBagConstraints.HORIZONTAL;
136         gridBagConstraints73.gridy = 6;
137         gridBagConstraints73.weightx = 1.0;
138         gridBagConstraints73.gridwidth = 4;
139         gridBagConstraints73.insets = new Insets(0, 0, 0, 5);
140         gridBagConstraints73.gridx = 1;
141         GridBagConstraints gridBagConstraints72 = new GridBagConstraints();
142         gridBagConstraints72.gridx = 0;
143         gridBagConstraints72.anchor = GridBagConstraints.WEST;
144         gridBagConstraints72.insets = new Insets(0, 5, 0, 5);
145         gridBagConstraints72.fill = GridBagConstraints.NONE;
146         gridBagConstraints72.gridwidth = 1;
147         gridBagConstraints72.gridy = 6;
148         ShadowKindLabel = new JLabel();
149         ShadowKindLabel.setText("\89e\82Ì\8eí\97Þ");
150         ShadowKindLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
151         GridBagConstraints gridBagConstraints71 = new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
152                 GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 6);
153         gridBagConstraints71.fill = GridBagConstraints.BOTH;
154         gridBagConstraints71.ipady = 0;
155         GridBagConstraints gridBagConstraints70 = new GridBagConstraints();
156         gridBagConstraints70.fill = GridBagConstraints.HORIZONTAL;
157         gridBagConstraints70.gridy = 1;
158         gridBagConstraints70.ipadx = 0;
159         gridBagConstraints70.ipady = 0;
160         gridBagConstraints70.weightx = 1.0;
161         gridBagConstraints70.insets = new Insets(0, 0, 0, 0);
162         gridBagConstraints70.gridx = 1;
163         GridBagConstraints gridBagConstraints69 = new GridBagConstraints();
164         gridBagConstraints69.gridx = 0;
165         gridBagConstraints69.ipadx = 0;
166         gridBagConstraints69.ipady = 0;
167         gridBagConstraints69.insets = new Insets(0, 5, 0, 5);
168         gridBagConstraints69.anchor = GridBagConstraints.WEST;
169         gridBagConstraints69.gridy = 1;
170         GridBagConstraints gridBagConstraints68 = new GridBagConstraints();
171         gridBagConstraints68.fill = GridBagConstraints.BOTH;
172         gridBagConstraints68.gridy = 0;
173         gridBagConstraints68.ipady = 0;
174         gridBagConstraints68.weightx = 1.0;
175         gridBagConstraints68.insets = new Insets(0, 0, 0, 0);
176         gridBagConstraints68.gridx = 1;
177         GridBagConstraints gridBagConstraints67 = new GridBagConstraints();
178         gridBagConstraints67.gridx = 0;
179         gridBagConstraints67.ipadx = 0;
180         gridBagConstraints67.ipady = 0;
181         gridBagConstraints67.insets = new Insets(0, 5, 0, 5);
182         gridBagConstraints67.anchor = GridBagConstraints.WEST;
183         gridBagConstraints67.gridy = 0;
184         GridBagConstraints gridBagConstraints66 = new GridBagConstraints();
185         gridBagConstraints66.gridx = 0;
186         gridBagConstraints66.insets = new Insets(0, 5, 5, 5);
187         gridBagConstraints66.anchor = GridBagConstraints.WEST;
188         gridBagConstraints66.gridwidth = 2;
189         gridBagConstraints66.gridy = 1;
190         ViewCommentLabel = new JLabel();
191         ViewCommentLabel.setText("\95\\8e¦\83R\83\81\83\93\83g\90\94");
192         GridBagConstraints gridBagConstraints65 = new GridBagConstraints();
193         gridBagConstraints65.fill = GridBagConstraints.HORIZONTAL;
194         gridBagConstraints65.gridy = 1;
195         gridBagConstraints65.weightx = 1.0;
196         gridBagConstraints65.gridwidth = 6;
197         gridBagConstraints65.insets = new Insets(0, 5, 5, 5);
198         gridBagConstraints65.gridx = 3;
199         GridBagConstraints gridBagConstraints64 = new GridBagConstraints(1, 1,
200                 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
201                 GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0);
202         gridBagConstraints64.gridy = 3;
203         gridBagConstraints64.fill = GridBagConstraints.HORIZONTAL;
204         gridBagConstraints64.gridx = 4;
205         GridBagConstraints gridBagConstraints63 = new GridBagConstraints(0, 4,
206                 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
207                 GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0);
208         gridBagConstraints63.gridy = 7;
209         gridBagConstraints63.gridx = 0;
210         gridBagConstraints63.gridwidth = 5;
211         GridBagConstraints gridBagConstraints62 = new GridBagConstraints(0, 3,
212                 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
213                 GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0);
214         gridBagConstraints62.gridy = 5;
215         gridBagConstraints62.gridx = 1;
216         gridBagConstraints62.fill = GridBagConstraints.HORIZONTAL;
217         gridBagConstraints62.insets = new Insets(0, 0, 5, 5);
218         gridBagConstraints62.gridwidth = 4;
219         GridBagConstraints gridBagConstraints61 = new GridBagConstraints(0, 2,
220                 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
221                 GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
222         gridBagConstraints61.gridy = 5;
223         gridBagConstraints61.gridx = 0;
224         gridBagConstraints61.fill = GridBagConstraints.VERTICAL;
225         gridBagConstraints61.anchor = GridBagConstraints.WEST;
226         gridBagConstraints61.gridwidth = 1;
227         GridBagConstraints gridBagConstraints60 = new GridBagConstraints(0, 1,
228                 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
229                 GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 0);
230         gridBagConstraints60.gridy = 3;
231         gridBagConstraints60.gridx = 1;
232         gridBagConstraints60.fill = GridBagConstraints.HORIZONTAL;
233         gridBagConstraints60.insets = new Insets(0, 0, 0, 5);
234         gridBagConstraints60.gridwidth = 3;
235         GridBagConstraints gridBagConstraints59 = new GridBagConstraints(0, 0,
236                 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
237                 GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0);
238         gridBagConstraints59.gridy = 3;
239         gridBagConstraints59.insets = new Insets(5, 5, 5, 5);
240         gridBagConstraints59.gridx = 0;
241         gridBagConstraints59.fill = GridBagConstraints.NONE;
242         gridBagConstraints59.anchor = GridBagConstraints.WEST;
243         gridBagConstraints59.weightx = 0.0;
244         gridBagConstraints59.gridwidth = 1;
245         GridBagConstraints gridBagConstraints58 = new GridBagConstraints();
246         gridBagConstraints58.gridx = 0;
247         gridBagConstraints58.anchor = GridBagConstraints.WEST;
248         gridBagConstraints58.insets = new Insets(0, 5, 5, 5);
249         gridBagConstraints58.gridwidth = 5;
250         gridBagConstraints58.weightx = 1.0;
251         gridBagConstraints58.fill = GridBagConstraints.HORIZONTAL;
252         gridBagConstraints58.gridy = 0;
253         GridBagConstraints gridBagConstraints57 = new GridBagConstraints();
254         gridBagConstraints57.fill = GridBagConstraints.BOTH;
255         gridBagConstraints57.gridy = 2;
256         gridBagConstraints57.weightx = 1.0;
257         gridBagConstraints57.insets = new Insets(0, 0, 5, 5);
258         gridBagConstraints57.gridx = 1;
259         GridBagConstraints gridBagConstraints56 = new GridBagConstraints();
260         gridBagConstraints56.gridx = 0;
261         gridBagConstraints56.insets = new Insets(0, 5, 5, 5);
262         gridBagConstraints56.anchor = GridBagConstraints.WEST;
263         gridBagConstraints56.gridy = 2;
264         ExtOptionLabel = new JLabel();
265         ExtOptionLabel.setText("\8fo\97Í\93®\89æ\82Ì\8ag\92£\8eq");
266         GridBagConstraints gridBagConstraints55 = new GridBagConstraints();
267         gridBagConstraints55.gridx = 0;
268         gridBagConstraints55.fill = GridBagConstraints.HORIZONTAL;
269         gridBagConstraints55.weightx = 1.0;
270         gridBagConstraints55.gridwidth = 2;
271         gridBagConstraints55.gridy = 1;
272         GridBagConstraints gridBagConstraints54 = new GridBagConstraints(0, 2,
273                 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
274                 GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
275         gridBagConstraints54.gridwidth = 3;
276         GridBagConstraints gridBagConstraints53 = new GridBagConstraints(1, 3,
277                 2, 1, 1.0, 0.0, GridBagConstraints.CENTER,
278                 GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0);
279         gridBagConstraints53.gridy = 5;
280         gridBagConstraints53.gridheight = 1;
281         gridBagConstraints53.weightx = 1.0;
282         gridBagConstraints53.gridwidth = 1;
283         GridBagConstraints gridBagConstraints52 = new GridBagConstraints(2, 2,
284                 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
285                 GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0);
286         gridBagConstraints52.gridy = 4;
287         gridBagConstraints52.gridwidth = 1;
288         gridBagConstraints52.weightx = 1.0;
289         gridBagConstraints52.gridx = 1;
290         GridBagConstraints gridBagConstraints51 = new GridBagConstraints(2, 1,
291                 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
292                 GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0);
293         gridBagConstraints51.gridy = 3;
294         gridBagConstraints51.gridwidth = 1;
295         gridBagConstraints51.weightx = 1.0;
296         gridBagConstraints51.gridx = 1;
297         GridBagConstraints gridBagConstraints50 = new GridBagConstraints(0, 3,
298                 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
299                 GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0);
300         gridBagConstraints50.gridy = 5;
301         GridBagConstraints gridBagConstraints49 = new GridBagConstraints(0, 2,
302                 2, 1, 0.0, 0.0, GridBagConstraints.WEST,
303                 GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0);
304         gridBagConstraints49.gridy = 4;
305         gridBagConstraints49.gridwidth = 1;
306         GridBagConstraints gridBagConstraints48 = new GridBagConstraints(0, 1,
307                 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
308                 GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0);
309         gridBagConstraints48.gridy = 3;
310
311         GridBagConstraints gridBagConstraints33 = new GridBagConstraints();
312         gridBagConstraints33.gridx = 0;
313         gridBagConstraints33.fill = GridBagConstraints.HORIZONTAL;
314         gridBagConstraints33.weightx = 1.0;
315         gridBagConstraints33.insets = new Insets(0, 5, 5, 5);
316         gridBagConstraints33.gridwidth = 5;
317         gridBagConstraints33.gridy = 9;
318
319         GridBagConstraints gridBagConstraints14 = new GridBagConstraints();
320         gridBagConstraints14.gridx = 0;
321         gridBagConstraints14.anchor = GridBagConstraints.WEST;
322         gridBagConstraints14.fill = GridBagConstraints.HORIZONTAL;
323         gridBagConstraints14.weightx = 1.0;
324         gridBagConstraints14.gridwidth = 5;
325         gridBagConstraints14.insets = new Insets(0, 5, 0, 5);
326         gridBagConstraints14.gridy = 8;
327         GridBagConstraints gridBagConstraints7 = new GridBagConstraints(0, 0,
328                 1, 1, 1.0, 1.0, GridBagConstraints.NORTH,
329                 GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0);
330         gridBagConstraints7.weighty = 0.0;
331         GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
332         gridBagConstraints6.gridx = 0;
333         gridBagConstraints6.weighty = 1.0;
334         gridBagConstraints6.weightx = 1.0;
335         gridBagConstraints6.insets = new Insets(0, 5, 0, 5);
336         gridBagConstraints6.fill = GridBagConstraints.HORIZONTAL;
337         gridBagConstraints6.anchor = GridBagConstraints.NORTH;
338         gridBagConstraints6.gridy = 1;
339         GridBagConstraints gridBagConstraints1 = new GridBagConstraints(0, 1,
340                 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
341                 GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0);
342         gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
343         gridBagConstraints1.anchor = GridBagConstraints.NORTH;
344         gridBagConstraints1.weighty = 1.0;
345         this.setIconImage(WinIcon);
346         contentPane = (JPanel) this.getContentPane();
347         contentPane.setLayout(borderLayout1);
348         setSize(new Dimension(400, 450));
349         setTitle("\82³\82«\82ã\82Î\82· " + VERSION);
350         this.addWindowListener(new MainFrame_this_windowAdapter(this));
351         statusBar.setText(" ");
352         jMenuFile.setText("\83t\83@\83C\83\8b");
353         jMenuFileExit.setText("\8fI\97¹");
354         jMenuFileExit.addActionListener(new MainFrame_jMenuFileExit_ActionAdapter(
355                 this));
356         jMenuHelp.setText("\83w\83\8b\83v");
357         jMenuHelpAbout.setText("\83o\81[\83W\83\87\83\93\8fî\95ñ");
358         jMenuHelpAbout.addActionListener(new MainFrame_jMenuHelpAbout_ActionAdapter(
359                 this));
360         VideoInfoPanel.setLayout(gridBagLayout1);
361         VideoID_TextField.setText("http://www.nicovideo.jp/watch/");
362         DoButton.setText(DoButtonDefString);
363         DoButton.addActionListener(new MainFrame_DoButton_actionAdapter(this));
364         SavingInfoTabPanel.setLayout(new GridLayout());
365         UserInfoPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "\83\86\81[\83U\90Ý\92è"));
366         UserInfoPanel.setLayout(gridBagLayout3);
367         MailAddrLabel.setText("\83\81\81[\83\8b\83A\83h\83\8c\83X");
368         PasswordLabel.setText("\83p\83X\83\8f\81[\83h");
369
370         setListenerToSavePanelButton();
371
372         FFMpegTabPanel.setLayout(gridBagLayout6);
373         PathSettingPanel.setBorder(BorderFactory.createTitledBorder(
374                 BorderFactory.createEtchedBorder(), "\83v\83\8d\83O\83\89\83\80\82Ì\88Ê\92u\82Ì\90Ý\92è"));
375         PathSettingPanel.setLayout(gridBagLayout7);
376         FFmpegPathLabel.setText("FFmpeg");
377         SettingFFmpegPathButton.setText("\8eQ\8fÆ");
378         SettingFFmpegPathButton.addActionListener(new MainFrame_SettingFFmpegPathButton_actionAdapter(
379                 this));
380         VhookPathLabel.setText("\8ag\92£vhook\83\89\83C\83u\83\89\83\8a");
381         SettingVhookPathButton.setText("\8eQ\8fÆ");
382         SettingVhookPathButton.addActionListener(new MainFrame_SettingVhookPathButton_actionAdapter(
383                 this));
384         VhookSettingPanel.setLayout(gridBagLayout8);
385         VhookSettingPanel.setBorder(BorderFactory.createTitledBorder(
386                 BorderFactory.createEtchedBorder(), "\8ag\92£vhook\83\89\83C\83u\83\89\83\8a\82Ì\90Ý\92è"));
387         FFmpegSettingPanel.setBorder(BorderFactory.createTitledBorder(
388                 BorderFactory.createEtchedBorder(), "FFmpeg\82Ì\90Ý\92è"));
389         FFmpegSettingPanel.setLayout(gridBagLayout9);
390         FontPathLabel.setText("\83t\83H\83\93\83g\83p\83X");
391         SettingFontPathButton.setText("\8eQ\8fÆ");
392         SettingFontPathButton.addActionListener(new MainFrame_SettingFontPathButton_actionAdapter(
393                 this));
394         ShowConvVideoCheckBox.setText("\95Ï\8a·\92\86\82Ì\89æ\91\9c\82ð\95\\8e¦\82·\82é");
395         InLabel.setText("\93ü\97Í\83I\83v\83V\83\87\83\93");
396         OutLabel.setText("\8fo\97Í\83I\83v\83V\83\87\83\93");
397         MainOptionLabel.setText("\83\81\83C\83\93\83I\83v\83V\83\87\83\93");
398         FontIndexLabel.setText("\83t\83H\83\93\83g\94Ô\8d\86");
399         VideoID_Label.setText("URL/ID");
400         WayBackLabel.setText("\89ß\8b\8e\83\8d\83O");
401         OpPanel.setLayout(new GridBagLayout());
402
403         BasicInfoTabPanel.setLayout(gridBagLayout12);
404         jMenuBar1.add(jMenuFile);
405         jMenuFile.add(jMenuFileExit);
406         jMenuBar1.add(jMenuHelp);
407         jMenuHelp.add(jMenuHelpAbout);
408         setJMenuBar(jMenuBar1);
409
410         contentPane.add(statusBar, BorderLayout.SOUTH);
411         contentPane.add(MainTabbedPane, java.awt.BorderLayout.CENTER);
412         contentPane.add(VideoInfoPanel, java.awt.BorderLayout.NORTH);
413         UserInfoPanel.add(PasswordField, new GridBagConstraints(1, 1, 1, 1,
414                 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
415                 new Insets(0, 5, 5, 5), 0, 0));
416         UserInfoPanel.add(MailAddrField, new GridBagConstraints(1, 0, 1, 1,
417                 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
418                 new Insets(0, 5, 5, 5), 0, 0));
419         UserInfoPanel.add(PasswordLabel, new GridBagConstraints(0, 1, 1, 1,
420                 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
421                 new Insets(0, 5, 5, 0), 0, 0));
422         UserInfoPanel.add(MailAddrLabel, new GridBagConstraints(0, 0, 1, 1,
423                 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
424                 new Insets(0, 5, 5, 0), 0, 0));
425         PathSettingPanel.add(FFmpegPathField, new GridBagConstraints(0, 1, 1,
426                 1, 1.0, 0.0, GridBagConstraints.CENTER,
427                 GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 0));
428         PathSettingPanel.add(SettingFFmpegPathButton, gridBagConstraints74);
429         PathSettingPanel.add(FFmpegPathLabel, new GridBagConstraints(0, 0, 2,
430                 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
431                 new Insets(0, 5, 5, 5), 0, 0));
432         PathSettingPanel.add(VhookPathField, new GridBagConstraints(0, 3, 1, 1,
433                 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
434                 new Insets(0, 5, 5, 5), 0, 0));
435         PathSettingPanel.add(SettingVhookPathButton, new GridBagConstraints(1,
436                 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
437                 GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0));
438         PathSettingPanel.add(VhookPathLabel, gridBagConstraints54);
439         FFmpegSettingPanel.add(CommandLineOutOptionField, gridBagConstraints53);
440         FFmpegSettingPanel.add(CommandLineInOptionField, gridBagConstraints52);
441         FFmpegSettingPanel.add(MainOptionField, gridBagConstraints51);
442         FFmpegSettingPanel.add(MainOptionLabel, gridBagConstraints48);
443         FFmpegSettingPanel.add(InLabel, gridBagConstraints49);
444         FFmpegSettingPanel.add(OutLabel, gridBagConstraints50);
445         FFmpegSettingPanel.add(getFFmpegOptionComboBoxPanel(),
446                 gridBagConstraints55);
447         FFmpegSettingPanel.add(ExtOptionLabel, gridBagConstraints56);
448         FFmpegSettingPanel.add(getExtOptionField(), gridBagConstraints57);
449         VideoInfoPanel.add(DoButton, gridBagConstraints71);
450         VideoInfoPanel.add(OpPanel, new GridBagConstraints(0, 0, 1, 1, 1.0,
451                 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
452                 new Insets(0, 0, 0, 0), 0, 0));
453         OpPanel.add(VideoID_Label, gridBagConstraints67);
454         OpPanel.add(VideoID_TextField, gridBagConstraints68);
455         OpPanel.add(WayBackLabel, gridBagConstraints69);
456         OpPanel.add(WayBackField, gridBagConstraints70);
457
458         MainTabbedPane.add(BasicInfoTabPanel, "\8aî\96{\90Ý\92è");
459         MainTabbedPane.add(SavingInfoTabPanel, "\95Û\91\90Ý\92è");
460         MainTabbedPane.add(FFMpegTabPanel, "\93®\89æ\90Ý\92è");
461         MainTabbedPane.addTab("\95Ï\8a·\90Ý\92è", null, getConvertingSettingPanel(), null);
462         SavingInfoTabPanel.add(savePanel);
463         BasicInfoTabPanel.add(UserInfoPanel, gridBagConstraints7);
464         BasicInfoTabPanel.add(getProxyInfoPanel(), gridBagConstraints6);
465         VhookSettingPanel.add(FontPathLabel, gridBagConstraints59);
466         VhookSettingPanel.add(ShowConvVideoCheckBox, gridBagConstraints63);
467         VhookSettingPanel.add(FontPathField, gridBagConstraints60);
468         VhookSettingPanel.add(FontIndexField, gridBagConstraints62);
469         VhookSettingPanel.add(FontIndexLabel, gridBagConstraints61);
470         VhookSettingPanel.add(SettingFontPathButton, gridBagConstraints64);
471         VhookSettingPanel.add(getFixFontSizeCheckBox(), gridBagConstraints14);
472         VhookSettingPanel.add(getOpaqueCommentCheckBox(), gridBagConstraints33);
473         VhookSettingPanel.add(getNotUseVhookCheckBox(), gridBagConstraints58);
474         VhookSettingPanel.add(getViewCommentField(), gridBagConstraints65);
475         VhookSettingPanel.add(ViewCommentLabel, gridBagConstraints66);
476         VhookSettingPanel.add(ShadowKindLabel, gridBagConstraints72);
477         VhookSettingPanel.add(getShadowComboBox(), gridBagConstraints73);
478
479         FFMpegTabPanel.add(PathSettingPanel, new GridBagConstraints(0, 0, 1, 1,
480                 1.0, 0.0, GridBagConstraints.NORTHEAST,
481                 GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0));
482         FFMpegTabPanel.add(FFmpegSettingPanel, gridBagConstraints1);
483     }
484
485     /**
486      * \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é.
487      */
488     private void setListenerToSavePanelButton() {
489         ActionListener al;
490         al = new InputVideoPanelButtonListener();
491         videoSaveInfoPanel.getShowSavingVideoFolderDialogButton().addActionListener(al);
492         videoSaveInfoPanel.getShowSavingVideoFileDialogButton().addActionListener(al);
493         videoSaveInfoPanel.getNibrFileChooserButton().addActionListener(al);
494
495         al = new VideoUseRadioButtonListener();
496         videoSaveInfoPanel.getVideoNoSaveButton().addActionListener(al);
497         videoSaveInfoPanel.getVideoSaveButton().addActionListener(al);
498         videoSaveInfoPanel.getVideoUseNiBrButton().addActionListener(al);
499
500         al = new InputCommentPanelButtonListener();
501         savePanel.getShowSavingCommentFolderDialogButton().addActionListener(al);
502         savePanel.getShowSavingCommentFileDialogButton().addActionListener(al);
503
504         al = new OutputVideoPanelButtonListener();
505         savePanel.getShowSavingConvertedVideoFolderDialogButton().addActionListener(al);
506         savePanel.getShowSavingConvertedVideoFileDialogButton().addActionListener(al);
507     }
508
509     private void setPopup() {
510         MainOptionField.addMouseListener(new PopupRightClick(
511                 this.MainOptionField));
512         CommandLineInOptionField.addMouseListener(new PopupRightClick(
513                 this.CommandLineInOptionField));
514         CommandLineOutOptionField.addMouseListener(new PopupRightClick(
515                 this.CommandLineOutOptionField));
516         savePanel.getCommentNumField().addMouseListener(new PopupRightClick(
517                 savePanel.getCommentNumField()));
518
519         savePanel.getCommentSavedFileField().addMouseListener(new PopupRightClick(
520                 savePanel.getCommentSavedFileField()));
521         savePanel.getCommentSavedFolderField().addMouseListener(new PopupRightClick(
522                 savePanel.getCommentSavedFolderField()));
523
524         savePanel.getConvertedVideoSavedFileField().addMouseListener(new PopupRightClick(
525                 savePanel.getConvertedVideoSavedFileField()));
526         savePanel.getConvertedVideoSavedFolderField().addMouseListener(new PopupRightClick(
527                 savePanel.getConvertedVideoSavedFolderField()));
528
529         videoSaveInfoPanel.getVideoSavedFileField().addMouseListener(new PopupRightClick(
530                 videoSaveInfoPanel.getVideoSavedFileField()));
531         videoSaveInfoPanel.getVideoSavedFolderField().addMouseListener(new PopupRightClick(
532                 videoSaveInfoPanel.getVideoSavedFolderField()));
533         videoSaveInfoPanel.getNibrFileField().addMouseListener(
534                 new PopupRightClick(videoSaveInfoPanel.getNibrFileField()));
535
536         FFmpegPathField.addMouseListener(new PopupRightClick(
537                 this.FFmpegPathField));
538         VhookPathField.addMouseListener(new PopupRightClick(this.VhookPathField));
539         VideoID_TextField.addMouseListener(new PopupRightClick(
540                 this.VideoID_TextField));
541         ViewCommentField.addMouseListener(new PopupRightClick(
542                 this.ViewCommentField));
543         FontPathField.addMouseListener(new PopupRightClick(this.FontPathField));
544         MailAddrField.addMouseListener(new PopupRightClick(this.MailAddrField));
545         PasswordField.addMouseListener(new PopupRightClick(this.PasswordField));
546         WayBackField.addMouseListener(new PopupRightClick(this.WayBackField));
547
548         ProxyTextField.addMouseListener(new PopupRightClick(this.ProxyTextField));
549         ProxyPortTextField.addMouseListener(new PopupRightClick(
550                 this.ProxyPortTextField));
551
552         FontIndexField.addMouseListener(new PopupRightClick(this.FontIndexField));
553
554         NGWordTextField.addMouseListener(new PopupRightClick(
555                 this.NGWordTextField));
556         NGIDTextField.addMouseListener(new PopupRightClick(this.NGIDTextField));
557     }
558
559     private void setDropTarget() {
560         addTarget(videoSaveInfoPanel.getVideoSavedFileField(), false);
561         addTarget(videoSaveInfoPanel.getVideoSavedFolderField(), true);
562         addTarget(videoSaveInfoPanel.getNibrFileField(), false);
563
564         addTarget(savePanel.getCommentSavedFileField(), false);
565         addTarget(savePanel.getCommentSavedFolderField(), true);
566
567         addTarget(savePanel.getConvertedVideoSavedFileField(), false);
568         addTarget(savePanel.getConvertedVideoSavedFolderField(), true);
569
570         addTarget(FFmpegPathField, false);
571         addTarget(VhookPathField, false);
572         addTarget(FontPathField, false);
573
574     }
575
576     /**
577      * \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é.
578      * @param c \90Ý\92è\91Î\8fÛ\82Ì\83e\83L\83X\83g\83t\83B\81[\83\8b\83h\83I\83u\83W\83F\83N\83g.
579      * @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.
580      * @return \83h\83\8d\83b\83v\83^\81[\83Q\83b\83g(\97p\93r\96³\82µ).
581      */
582     private DropTarget addTarget(JTextField c, boolean isDir) {
583         return new DropTarget(c, DnDConstants.ACTION_COPY, new FileDropTarget(
584                 c, isDir), true);
585     }
586     private File CurrentDir = new File(".");
587     JPanel PathSettingPanel = new JPanel();
588     JLabel FFmpegPathLabel = new JLabel();
589     GridBagLayout gridBagLayout7 = new GridBagLayout();
590     JTextField FFmpegPathField = new JTextField();
591     JButton SettingFFmpegPathButton = new JButton();
592     JLabel VhookPathLabel = new JLabel();
593     JTextField VhookPathField = new JTextField();
594     JButton SettingVhookPathButton = new JButton();
595     JPanel VhookSettingPanel = new JPanel();
596     GridBagLayout gridBagLayout8 = new GridBagLayout();
597     JPanel FFmpegSettingPanel = new JPanel();
598     GridBagLayout gridBagLayout9 = new GridBagLayout();
599     JLabel FontPathLabel = new JLabel();
600     JTextField FontPathField = new JTextField();
601     JButton SettingFontPathButton = new JButton();
602     JCheckBox ShowConvVideoCheckBox = new JCheckBox();
603     JTextField CommandLineOutOptionField = new JTextField();
604
605     private void showSaveDialog(String title, JTextField field, boolean isSave,
606             boolean isDir) {
607         JFileChooser chooser = new JFileChooser(CurrentDir);
608         chooser.setDialogTitle(title);
609         int code = 0;
610         if (isDir) {
611             chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
612         }
613         if (isSave) {
614             code = chooser.showSaveDialog(this);
615         } else {
616             code = chooser.showOpenDialog(this);
617         }
618         if (code == JFileChooser.APPROVE_OPTION) {
619             if (isDir) {
620                 CurrentDir = chooser.getCurrentDirectory();
621                 field.setText(CurrentDir.getAbsolutePath());
622             } else {
623                 File selected = chooser.getSelectedFile();
624                 CurrentDir = chooser.getCurrentDirectory();
625                 field.setText(selected.getAbsolutePath());
626             }
627         }
628     }
629
630     private SProperties getSetting() {
631         SProperties setting = new SProperties(
632                 getBasicSetting(),
633                 getInputVideoSetting(),
634                 getInputCommentSetting(),
635                 getTcommentSetting(),
636                 getOutputVideoSetting(),
637                 getMovieSetting(),
638                 getConvertSetting());
639         return setting;
640     }
641
642     /**
643      * \90Ý\92è\82ð\89æ\96Ê\82É\94½\89f\82·\82é.
644      * @param setting \94½\89f\82·\82é\90Ý\92è.
645      */
646     private void setSetting(SProperties setting) {
647         // \8aî\96{\90Ý\92è
648         final BasicSetting basic = setting.getBasicSetting();
649         MailAddrField.setText(basic.getMail());
650         PasswordField.setText(basic.getPassword());
651         // \83v\83\8d\83L\83V\8aÖ\98A
652         UseProxyCheckBox.setSelected(basic.isProxyUse());
653         ProxyTextField.setText(basic.getProxyHost());
654         int proxy_port = basic.getProxyPort();
655         if (proxy_port >= 0 && proxy_port <= 65535) {
656             ProxyPortTextField.setText(Integer.toString(proxy_port));
657         } else {
658             ProxyPortTextField.setText("");
659         }
660
661         // \95Û\91\90Ý\92è - \93ü\97Í\93®\89æ
662         final InputVideoSetting inVideo = setting.getInputVideoSetting();
663         JRadioButton activeButton;
664         switch (inVideo.getProcessKind()) {
665             case NO_SAVE:
666                 activeButton = videoSaveInfoPanel.getVideoNoSaveButton();
667                 break;
668             case NICOBROWSER:
669                 activeButton = videoSaveInfoPanel.getVideoUseNiBrButton();
670                 break;
671             case SAVE:
672             default:
673                 activeButton = videoSaveInfoPanel.getVideoSaveButton();
674                 break;
675         }
676         activeButton.doClick();
677
678         videoSaveInfoPanel.getVideoSavedFileField().setText(inVideo.getFile().getPath());
679         videoSaveInfoPanel.getVideoSavedFolderField().setText(inVideo.getFolder().getPath());
680         videoSaveInfoPanel.getDelVideoCheckBox().setSelected(inVideo.isDeleteAfterConvert());
681         final boolean videoFixName = inVideo.isAutoNaming();
682         videoSaveInfoPanel.getSaveFileRadioButton().setSelected(!videoFixName);
683         videoSaveInfoPanel.getSaveFolderRadioButton().setSelected(videoFixName);
684
685         // \95Û\91\90Ý\92è - \93ü\97Í\83R\83\81\83\93\83g
686         final InputCommentSetting inputComment = setting.getInputCommentSetting();
687         savePanel.getSavingCommentCheckBox().setSelected(inputComment.getProcessKind());
688         savePanel.getCommentSavedFileField().setText(inputComment.getFile().getPath());
689         savePanel.getDelCommentCheckBox().setSelected(inputComment.isDeleteAfterConvert());
690         savePanel.getCommentSavedFolderField().setText(inputComment.getFolder().getPath());
691         savePanel.getCommentNumField().setText(Integer.toString(inputComment.getNumOfComment()));
692         savePanel.getFixCommentNumCheckBox().setSelected(inputComment.isSelfAdjustNumOfComment());
693         boolean commentFixName = inputComment.isAutoNaming();
694         savePanel.getCommentSaveFileRadioButton().setSelected(!commentFixName);
695         savePanel.getCommentSaveFolderRadioButton().setSelected(commentFixName);
696
697         // \93\8a\8de\8eÒ\83R\83\81\83\93\83g
698         InputTcommentSetting tcom = setting.getInputTcommentSetting();
699         savePanel.setTcommentDownload(tcom.getProcessKind());
700         savePanel.setTcommentDelete(tcom.isDeleteAfterConvert());
701         savePanel.setTcommentAutoFileName(tcom.isAutoNaming());
702         savePanel.setTcommentDirectoryName(tcom.getFolder().getPath());
703         savePanel.setTcommentFileName(tcom.getFile().getPath());
704
705         // \95Û\91\90Ý\92è - \8fo\97Í\83R\83\81\83\93\83g\95t\82«\93®\89æ
706         final OutputVideoSetting outputVideo = setting.getOutputVideoSetting();
707         savePanel.getSavingConvertedVideoCheckBox().setSelected(outputVideo.getProcessKind());
708         savePanel.getAddCommentCheckBox().setSelected(outputVideo.isAddComment());
709         savePanel.getAddTcommentCheckBox().setSelected(outputVideo.isAddTcomment());
710         savePanel.getConvertedVideoSavedFileField().setText(outputVideo.getFile().getPath());
711         savePanel.getConvertedVideoSavedFolderField().setText(outputVideo.getFolder().getPath());
712         savePanel.getNotAddVideoIdConvVideoCheckBox().setSelected(outputVideo.isCutIdName());
713         boolean convFixName = outputVideo.isAutoNaming();
714         savePanel.getConvSaveFileRadioButton().setSelected(!convFixName);
715         savePanel.getConvSaveFolderRadioButton().setSelected(convFixName);
716
717         // \93®\89æ\90Ý\92è
718         final MovieSetting movie = setting.getMovieSetting();
719         FFmpegPathField.setText(movie.getFfmpeg().toString());
720         VhookPathField.setText(movie.getVhook().toString());
721         ExtOptionField.setText(movie.getFfmpegOption().getExtOption());
722         MainOptionField.setText(movie.getFfmpegOption().getMainOption());
723         CommandLineOutOptionField.setText(movie.getFfmpegOption().getOutOption());
724         CommandLineInOptionField.setText(movie.getFfmpegOption().getInOption());
725         FFmpegOptionModel.reload(movie.getOptionFile());
726
727         // \95Ï\8a·\90Ý\92è
728         final ConvertSetting conv = setting.getConvertSetting();
729         NotUseVhookCheckBox.setSelected(conv.isVhookDisabled());
730         ViewCommentField.setText(Integer.toString(conv.getMaxNumOfComment()));
731         FontPathField.setText(conv.getFont().toString());
732         FontIndexField.setText(Integer.toString(conv.getFontIndex()));
733         ShadowComboBox.setSelectedIndex(conv.getShadowIndex());
734         ShowConvVideoCheckBox.setSelected(conv.isShowConverting());
735         FixFontSizeCheckBox.setSelected(conv.isSelfAdjustFontSize());
736         OpaqueCommentCheckBox.setSelected(conv.isCommentOpaque());
737         NGWordTextField.setText(conv.getNgSetting().getWord());
738         NGIDTextField.setText(conv.getNgSetting().getId());
739     }
740
741     private FfmpegOption detectOption() throws IOException {
742         // TODO detectOption\82ð\8eg\97p\82·\82é\89Ó\8f\8a
743         final File ffmpegFile = FFmpegOptionModel.getSelectedFile();
744         if (ffmpegFile != null) {
745             return FfmpegOption.load(ffmpegFile);
746         }
747
748         final String extOption = ExtOptionField.getText();
749         final String mainOption = MainOptionField.getText();
750         final String inOption = CommandLineInOptionField.getText();
751         final String outOption = CommandLineOutOptionField.getText();
752
753         return new FfmpegOption(extOption, mainOption, inOption, outOption);
754     }
755
756     /**
757      * [\83t\83@\83C\83\8b|\8fI\97¹] \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 jMenuFileExit_actionPerformed(ActionEvent actionEvent) {
763         SProperties setting = getSetting();
764         SProperties.saveSetting(setting);
765         System.exit(0);
766     }
767
768     /**
769      * [\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
770      *
771      * @param actionEvent
772      *            ActionEvent
773      */
774     void jMenuHelpAbout_actionPerformed(ActionEvent actionEvent) {
775         MainFrame_AboutBox dlg = new MainFrame_AboutBox(this);
776         dlg.pack();
777         dlg.setLocationRelativeTo(this);
778         dlg.setVisible(true);
779     }
780
781     /* \95Ï\8a·\81E\95Û\91\82·\82é */
782     Converter Converter = null;
783     JTextField CommandLineInOptionField = new JTextField();
784     JLabel InLabel = new JLabel();
785     JLabel OutLabel = new JLabel();
786     JLabel MainOptionLabel = new JLabel();
787     JTextField MainOptionField = new JTextField();
788     JLabel FontIndexLabel = new JLabel();
789     JTextField FontIndexField = new JTextField();
790     JLabel VideoID_Label = new JLabel();
791     JLabel WayBackLabel = new JLabel();
792     JTextField WayBackField = new JTextField();
793     GridBagLayout gridBagLayout10 = new GridBagLayout();
794     GridBagLayout gridBagLayout11 = new GridBagLayout();
795     GridBagLayout gridBagLayout1 = new GridBagLayout();
796     JPanel OpPanel = new JPanel();
797     GridLayout gridLayout1 = new GridLayout();
798     JPanel BasicInfoTabPanel = new JPanel();
799     GridBagLayout gridBagLayout12 = new GridBagLayout();
800     private JPanel ConvertingSettingPanel = null;
801     private JPanel NGWordSettingPanel = null;
802     private JLabel NGWordLavel = null;
803     private JTextField NGWordTextField = null;
804     private JLabel NGIDLabel = null;
805     private JTextField NGIDTextField = null;
806     private JPanel ProxyInfoPanel = null;
807     private JLabel ProxyLabel = null;
808     private JTextField ProxyTextField = null;
809     private JLabel ProxyPortLabel = null;
810     private JTextField ProxyPortTextField = null;
811     private JCheckBox UseProxyCheckBox = null;
812     private JCheckBox FixFontSizeCheckBox = null;
813     private JCheckBox OpaqueCommentCheckBox = null;
814     private final SavePanel savePanel = new SavePanel();
815     private final VideoSaveInfoPanel videoSaveInfoPanel;
816     private JComboBox FFmpegOptionComboBox = null;
817     private JButton FFmpegOptionReloadButton = null;
818     private JPanel FFmpegOptionComboBoxPanel = null;
819
820     public void DoButton_actionPerformed(ActionEvent e) {
821         if (Converter == null || Converter.isConverted()) {
822             String url;
823
824             // 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è.
825             if (videoSaveInfoPanel.getVideoUseNiBrButton().isSelected()) {
826                 try {
827                     String fileName = videoSaveInfoPanel.getNibrFileField().getText();
828                     NicoDBFinder finder = NicoDBFinder.getInstance();
829                     NicoContent info = finder.findNicoContent(fileName);
830                     if (info != null) {
831                         url = info.getNicoId();
832                     } else {
833                         url = "";
834                     }
835                 } catch (Exception ex) {
836                     JOptionPane.showMessageDialog(this, ex.getMessage(), "\83G\83\89\81[", JOptionPane.ERROR_MESSAGE);
837                     return;
838                 }
839             } else {
840                 url = VideoID_TextField.getText();
841             }
842
843             TextProgressListener sl = new TextProgressListener() {
844
845                 public void setText(final String text) {
846                     SwingUtilities.invokeLater(new Runnable() {
847
848                         public void run() {
849                             statusBar.setText(text);
850                         }
851                     });
852                 }
853             };
854
855             ConvertStopFlag.StateChangeListener scl = new ConvertStopFlag.StateChangeListener() {
856
857                 public void changeState(final State s) {
858                     SwingUtilities.invokeLater(new Runnable() {
859
860                         public void run() {
861                             switch (s) {
862                                 case PROCESSING:
863                                     DoButton.setText(DoButtonStopString);
864                                     break;
865                                 case STOPPING:
866                                     DoButton.setText(DoButtonWaitString);
867                                     break;
868                                 case FINISHED:
869                                     DoButton.setText(DoButtonDefString);
870                             }
871                         }
872                     });
873                 }
874             };
875
876             Converter = new Converter(url, WayBackField.getText(), getSetting().toProfile(), sl,
877                     new ConvertStopFlag(scl));
878 //                                      new ConvertStopFlag(this.DoButton, DoButtonStopString,
879 //                                                      DoButtonWaitString, DoButtonDefString));
880             Converter.start();
881         } else { /* \8aJ\8en\82µ\82Ä\82¢\82é\82Ì\82Å\81A\83X\83g\83b\83v\82·\82é\81B */
882             final ConvertStopFlag flag = Converter.getStopFlag();
883             if (!flag.needStop()) { /* \82Ü\82¾\83X\83g\83b\83v\82µ\82Ä\82¢\82È\82¢\81B */
884                 flag.requestStop();
885             }
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         return new BasicSetting(mail, pass, proxyUse, proxyHost, proxyPort);
1266     }
1267
1268     private InputVideoSetting getInputVideoSetting() {
1269         VideoSaveKind kind;
1270         if (videoSaveInfoPanel.getVideoNoSaveButton().isSelected() == true) {
1271             kind = VideoSaveKind.NO_SAVE;
1272         } else if (videoSaveInfoPanel.getVideoUseNiBrButton().isSelected() == true) {
1273             kind = VideoSaveKind.NICOBROWSER;
1274         } else {
1275             kind = VideoSaveKind.SAVE;
1276         }
1277         boolean autoNaming = videoSaveInfoPanel.getSaveFolderRadioButton().isSelected();
1278         String folder = videoSaveInfoPanel.getVideoSavedFolderField().getText();
1279         String file = videoSaveInfoPanel.getVideoSavedFileField().getText();
1280         boolean delete = videoSaveInfoPanel.getDelVideoCheckBox().isSelected();
1281
1282         return new InputVideoSetting(kind, autoNaming, new File(folder), new File(file), delete);
1283     }
1284
1285     private InputCommentSetting getInputCommentSetting() {
1286         boolean download = savePanel.getSavingCommentCheckBox().isSelected();
1287         String file = savePanel.getCommentSavedFileField().getText();
1288         int back_comment;
1289         try {
1290             back_comment = Integer.parseInt(savePanel.getCommentNumField().getText());
1291         } catch (NumberFormatException ex) {
1292             back_comment = 500;
1293         }
1294         boolean delete = savePanel.getDelCommentCheckBox().isSelected();
1295         boolean autoNaming = savePanel.getCommentSaveFolderRadioButton().isSelected();
1296         String folder = savePanel.getCommentSavedFolderField().getText();
1297         boolean adjustNumOfCom = savePanel.getFixCommentNumCheckBox().isSelected();
1298
1299         return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete, adjustNumOfCom,
1300                 back_comment);
1301     }
1302
1303     /**
1304      * \89æ\96Ê\93ü\97Í\92l\82©\82ç\93\8a\8de\8eÒ\83R\83\81\83\93\83g\90Ý\92è\82ð\8dì\90¬\82·\82é.
1305      * @return \8dì\90¬\82µ\82½\93\8a\8de\8eÒ\83R\83\81\83\93\83g\90Ý\92è.
1306      */
1307     private InputTcommentSetting getTcommentSetting() {
1308         boolean down = savePanel.isTcommentDownload();
1309         boolean del = savePanel.isTcommentDelete();
1310         boolean naming = savePanel.isTcommentAutoFileName();
1311         String dir = savePanel.getTcommentDirectoryName();
1312         String f = savePanel.getTcommentFileName();
1313         return new InputTcommentSetting(down, naming, dir, f, del);
1314     }
1315
1316     private OutputVideoSetting getOutputVideoSetting() {
1317         boolean process = savePanel.getSavingConvertedVideoCheckBox().isSelected();
1318         boolean addComment = savePanel.getAddCommentCheckBox().isSelected();
1319         boolean addTcomment = savePanel.getAddTcommentCheckBox().isSelected();
1320         String file = savePanel.getConvertedVideoSavedFileField().getText();
1321         boolean cutId = savePanel.getNotAddVideoIdConvVideoCheckBox().isSelected();
1322         boolean autoNaming = savePanel.getConvSaveFolderRadioButton().isSelected();
1323         String folder = savePanel.getConvertedVideoSavedFolderField().getText();
1324
1325         return new OutputVideoSetting(process, autoNaming, new File(folder), new File(file), cutId, addComment,
1326                 addTcomment);
1327     }
1328
1329     private MovieSetting getMovieSetting() {
1330         String ffmpeg = FFmpegPathField.getText();
1331         String vhook = VhookPathField.getText();
1332         String ext = ExtOptionField.getText();
1333         String main = MainOptionField.getText();
1334         String in = CommandLineInOptionField.getText();
1335         String out = CommandLineOutOptionField.getText();
1336         File optionFile = FFmpegOptionModel.getSelectedFile();
1337
1338         FfmpegOption opt = new FfmpegOption(ext, main, in, out);
1339         return new MovieSetting(new File(ffmpeg), new File(vhook), optionFile, null);
1340     }
1341
1342     private ConvertSetting getConvertSetting() {
1343         boolean vhookDisabled = NotUseVhookCheckBox.isSelected();
1344         int maxComment = 30;
1345         try {
1346             maxComment = Integer.parseInt(ViewCommentField.getText());
1347         } catch (NumberFormatException ex) {
1348         }
1349         File font = new File(FontPathField.getText());
1350         int fontIndex = Integer.parseInt(FontIndexField.getText());
1351         int shadowIndex = ShadowComboBox.getSelectedIndex();
1352         boolean showConv = ShowConvVideoCheckBox.isSelected();
1353         boolean adjustFont = FixFontSizeCheckBox.isSelected();
1354         boolean commentOpaque = OpaqueCommentCheckBox.isSelected();
1355         ConvertSetting.NgSetting ngSetting =
1356                 new ConvertSetting.NgSetting(NGWordTextField.getText(), NGIDTextField.getText());
1357
1358         return new ConvertSetting(vhookDisabled, maxComment, font, fontIndex, shadowIndex, showConv, adjustFont,
1359                 commentOpaque, ngSetting);
1360     }
1361
1362     private class InputVideoPanelButtonListener implements ActionListener {
1363
1364         public void actionPerformed(ActionEvent e) {
1365             final Object source = e.getSource();
1366             final VideoSaveInfoPanel panel = videoSaveInfoPanel;
1367             String title;
1368             JTextField field;
1369             boolean isSave;
1370             boolean isDir;
1371
1372             if (source == panel.getShowSavingVideoFolderDialogButton()) {
1373                 title = "\93®\89æ\82Ì\95Û\91\90æ(\83t\83H\83\8b\83_)";
1374                 field = panel.getVideoSavedFolderField();
1375                 isSave = true;
1376                 isDir = true;
1377             } else if (source == panel.getShowSavingVideoFileDialogButton()) {
1378                 title = "\93®\89æ\82Ì\95Û\91\90æ(\83t\83@\83C\83\8b)";
1379                 field = panel.getVideoSavedFileField();
1380                 isSave = true;
1381                 isDir = false;
1382             } else if (source == panel.getNibrFileChooserButton()) {
1383                 title = "NicoBrowser\83t\83@\83C\83\8b\91I\91ð";
1384                 field = panel.getNibrFileField();
1385                 isSave = false;
1386                 isDir = false;
1387             } else {
1388                 return;
1389             }
1390             showSaveDialog(title, field, isSave, isDir);
1391         }
1392     }
1393
1394     private class InputCommentPanelButtonListener implements ActionListener {
1395
1396         public void actionPerformed(ActionEvent e) {
1397             final Object source = e.getSource();
1398             String title;
1399             JTextField field;
1400             boolean isSave;
1401             boolean isDir;
1402             if (source == savePanel.getShowSavingCommentFolderDialogButton()) {
1403                 title = "\83R\83\81\83\93\83g\82Ì\95Û\91\90æ(\83t\83H\83\8b\83_)";
1404                 field = savePanel.getCommentSavedFolderField();
1405                 isSave = true;
1406                 isDir = true;
1407             } else if (source == savePanel.getShowSavingCommentFolderDialogButton()) {
1408                 title = "\83R\83\81\83\93\83g\82Ì\95Û\91\90æ(\83t\83@\83C\83\8b)";
1409                 field = savePanel.getCommentSavedFileField();
1410                 isSave = true;
1411                 isDir = false;
1412             } else {
1413                 return;
1414             }
1415             showSaveDialog(title, field, isSave, isDir);
1416         }
1417     }
1418
1419     private class OutputVideoPanelButtonListener implements ActionListener {
1420
1421         public void actionPerformed(ActionEvent e) {
1422             final Object source = e.getSource();
1423             String title;
1424             JTextField field;
1425             boolean isSave;
1426             boolean isDir;
1427             if (source == savePanel.getShowSavingConvertedVideoFolderDialogButton()) {
1428                 title = "\83R\83\81\83\93\83g\95t\82«\93®\89æ\82Ì\95Û\91\90æ(\83t\83H\83\8b\83_)";
1429                 field = savePanel.getConvertedVideoSavedFolderField();
1430                 isSave = true;
1431                 isDir = true;
1432             } else if (source == savePanel.getShowSavingConvertedVideoFileDialogButton()) {
1433                 title = "\83R\83\81\83\93\83g\95t\82«\93®\89æ\82Ì\95Û\91\90æ(\83t\83@\83C\83\8b)";
1434                 field = savePanel.getConvertedVideoSavedFileField();
1435                 isSave = true;
1436                 isDir = false;
1437             } else {
1438                 return;
1439             }
1440             showSaveDialog(title, field, isSave, isDir);
1441         }
1442     }
1443
1444     private class VideoUseRadioButtonListener implements ActionListener {
1445
1446         public void actionPerformed(ActionEvent e) {
1447             Object source = e.getSource();
1448             if (source == videoSaveInfoPanel.getVideoUseNiBrButton()) {
1449                 maskExt();
1450             } else {
1451                 maskBase();
1452             }
1453         }
1454
1455         private void maskBase() {
1456             mask(true);
1457         }
1458
1459         private void maskExt() {
1460             mask(false);
1461         }
1462
1463         private void mask(boolean b) {
1464             final VideoSaveInfoPanel panel = videoSaveInfoPanel;
1465             VideoID_TextField.setEditable(b);
1466             panel.getDelVideoCheckBox().setEnabled(b);
1467
1468             panel.getSaveFolderRadioButton().setEnabled(b);
1469             panel.getVideoSavedFolderField().setEnabled(b);
1470             panel.getShowSavingVideoFolderDialogButton().setEnabled(b);
1471
1472             panel.getSaveFileRadioButton().setEnabled(b);
1473             panel.getVideoSavedFileField().setEnabled(b);
1474             panel.getShowSavingVideoFileDialogButton().setEnabled(b);
1475
1476             panel.getNibrFileField().setEnabled(!b);
1477             panel.getNibrFileChooserButton().setEnabled(!b);
1478         }
1479     }
1480 }
1481
1482 class MainFrame_this_windowAdapter extends WindowAdapter {
1483
1484     private MainFrame adaptee;
1485
1486     MainFrame_this_windowAdapter(MainFrame adaptee) {
1487         this.adaptee = adaptee;
1488     }
1489
1490     @Override
1491     public void windowClosing(WindowEvent e) {
1492         adaptee.this_windowClosing(e);
1493     }
1494 }
1495
1496 class MainFrame_SettingFontPathButton_actionAdapter implements ActionListener {
1497
1498     private MainFrame adaptee;
1499
1500     MainFrame_SettingFontPathButton_actionAdapter(MainFrame adaptee) {
1501         this.adaptee = adaptee;
1502     }
1503
1504     public void actionPerformed(ActionEvent e) {
1505         adaptee.SettingFontPathButton_actionPerformed(e);
1506     }
1507 }
1508
1509 class MainFrame_SettingVhookPathButton_actionAdapter implements ActionListener {
1510
1511     private MainFrame adaptee;
1512
1513     MainFrame_SettingVhookPathButton_actionAdapter(MainFrame adaptee) {
1514         this.adaptee = adaptee;
1515     }
1516
1517     public void actionPerformed(ActionEvent e) {
1518         adaptee.SettingVhookPathButton_actionPerformed(e);
1519     }
1520 }
1521
1522 class MainFrame_SettingFFmpegPathButton_actionAdapter implements ActionListener {
1523
1524     private MainFrame adaptee;
1525
1526     MainFrame_SettingFFmpegPathButton_actionAdapter(MainFrame adaptee) {
1527         this.adaptee = adaptee;
1528     }
1529
1530     public void actionPerformed(ActionEvent e) {
1531         adaptee.SettingFFmpegPathButton_actionPerformed(e);
1532     }
1533 }
1534
1535 class MainFrame_DoButton_actionAdapter implements ActionListener {
1536
1537     private MainFrame adaptee;
1538
1539     MainFrame_DoButton_actionAdapter(MainFrame adaptee) {
1540         this.adaptee = adaptee;
1541     }
1542
1543     public void actionPerformed(ActionEvent e) {
1544         adaptee.DoButton_actionPerformed(e);
1545     }
1546 }
1547
1548 class MainFrame_jMenuFileExit_ActionAdapter implements ActionListener {
1549
1550     MainFrame adaptee;
1551
1552     MainFrame_jMenuFileExit_ActionAdapter(MainFrame adaptee) {
1553         this.adaptee = adaptee;
1554     }
1555
1556     public void actionPerformed(ActionEvent actionEvent) {
1557         adaptee.jMenuFileExit_actionPerformed(actionEvent);
1558     }
1559 }
1560
1561 class MainFrame_jMenuHelpAbout_ActionAdapter implements ActionListener {
1562
1563     MainFrame adaptee;
1564
1565     MainFrame_jMenuHelpAbout_ActionAdapter(MainFrame adaptee) {
1566         this.adaptee = adaptee;
1567     }
1568
1569     public void actionPerformed(ActionEvent actionEvent) {
1570         adaptee.jMenuHelpAbout_actionPerformed(actionEvent);
1571     }
1572 }