OSDN Git Service

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