OSDN Git Service

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