OSDN Git Service

ffmpegオプションファイル選択コンボボックスの初期化
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / gui / ConfigDialog.java
1 /*
2  * Properties.java
3  *
4  * Created on 2011/08/20, 16:33:03
5  */
6 package yukihane.inqubus.gui;
7
8 import static javax.swing.GroupLayout.DEFAULT_SIZE;
9 import static javax.swing.GroupLayout.PREFERRED_SIZE;
10
11 import java.awt.event.ActionEvent;
12 import java.awt.event.ActionListener;
13 import java.util.ArrayList;
14 import java.util.List;
15 import java.util.logging.Level;
16 import java.util.logging.Logger;
17 import javax.swing.BorderFactory;
18 import javax.swing.ButtonGroup;
19 import javax.swing.ComboBoxModel;
20 import javax.swing.DefaultComboBoxModel;
21 import javax.swing.DefaultListModel;
22 import javax.swing.GroupLayout;
23 import javax.swing.GroupLayout.Alignment;
24 import javax.swing.JButton;
25 import javax.swing.JCheckBox;
26 import javax.swing.JComboBox;
27 import javax.swing.JDialog;
28 import javax.swing.JFrame;
29 import javax.swing.JLabel;
30 import javax.swing.JList;
31 import javax.swing.JPanel;
32 import javax.swing.JRadioButton;
33 import javax.swing.JScrollPane;
34 import javax.swing.JTabbedPane;
35 import javax.swing.JTextField;
36 import javax.swing.LayoutStyle.ComponentPlacement;
37 import javax.swing.UIManager;
38 import javax.swing.UnsupportedLookAndFeelException;
39 import javax.swing.WindowConstants;
40 import org.apache.commons.configuration.ConfigurationException;
41 import saccubus.FFmpegSelectedItem;
42 import saccubus.OptionComboBoxModel;
43 import yukihane.inqubus.Config;
44
45 /**
46  *
47  * @author yuki
48  */
49 public class ConfigDialog extends JDialog {
50     private static final long serialVersionUID = 1L;
51     private static final Logger logger = Logger.getLogger(ConfigDialog.class.getName());
52
53     /** Creates new form Properties */
54     public ConfigDialog() {
55         this(null);
56     }
57
58     public ConfigDialog(JFrame owner){
59         super(owner);
60
61         final ButtonGroup buttonGroup1 = new ButtonGroup();
62         final JTabbedPane tabbedPane = new JTabbedPane();
63         final JPanel pnlNetwork = new JPanel();
64         final JPanel pnlAccount = new JPanel();
65         final JLabel lblMail = new JLabel();
66         fldMail = new JTextField();
67         final JLabel lblPassword = new JLabel();
68         fldPassword = new JTextField();
69         final JPanel pnlProxy = new JPanel();
70         cbProxyUse = new JCheckBox();
71         final JLabel lblProxyHost = new JLabel();
72         final JLabel lblProxyPort = new JLabel();
73         fldProxyHost = new JTextField();
74         fldProxyPort = new JTextField();
75         final JPanel pnlFile = new JPanel();
76         final JPanel pnlFileVideo = new JPanel();
77         final JLabel lblVideoDir = new JLabel();
78         final JLabel lblVideoFileNamepattern = new JLabel();
79         fldVideoDir = new JTextField();
80         fldVideoFileNamePattern = new JTextField();
81         btnVideoDir = new JButton();
82         cbVideoLocal = new JCheckBox();
83         final JPanel pnlFileComment = new JPanel();
84         final JLabel lblCommentDir = new JLabel();
85         final JLabel lblCommentFileNamePattern = new JLabel();
86         fldCommentDir = new JTextField();
87         fldCommentFileNamePattern = new JTextField();
88         btnCommentDir = new JButton();
89         cbCommentLocal = new JCheckBox();
90         final JPanel pnlFileOutput = new JPanel();
91         final JLabel lblOutputDir = new JLabel();
92         final JLabel lblOutputFileNamePattern = new JLabel();
93         fldOutputDir = new JTextField();
94         fldOutputFileNamePattern = new JTextField();
95         btnOutputDir = new JButton();
96         cbOutputEnable = new JCheckBox();
97         cbOutputCommentOverlay = new JCheckBox();
98         cbOutputDisplayProgress = new JCheckBox();
99         final JPanel pnlComment = new JPanel();
100         final JPanel pnlCommentStandard = new JPanel();
101         final JLabel lblCommentSize = new JLabel();
102         cbCommentSizeAuto = new JCheckBox();
103         final JLabel lblCommentSizeManual = new JLabel();
104         fldCommentSizeManual = new JTextField();
105         final JLabel lblCommentMinSize = new JLabel();
106         cbCommentMinSizeAuto = new JCheckBox();
107         fldCommentMinSizeManual = new JTextField();
108         final JLabel lblCommentMinSizeManual = new JLabel();
109         final JLabel lblCommentDisplayMax = new JLabel();
110         cbCommentDisplaySizeDefault = new JCheckBox();
111         final JLabel lblCommentDisplayMaxManual = new JLabel();
112         fldCommentDisplaySizeManual = new JTextField();
113         final JPanel pnlCommentAdvanced = new JPanel();
114         final JLabel lblFontPath = new JLabel();
115         cbFontSizeArrangeDisable = new JCheckBox();
116         cbCommentOpaque = new JCheckBox();
117         fldFontPath = new JTextField();
118         btnFontPath = new JButton();
119         final JLabel lblFontIndex = new JLabel();
120         final JLabel lblFontShadow = new JLabel();
121         fldFontIndex = new JTextField();
122         final JPanel pnlFfmpeg = new JPanel();
123         final JPanel jPanel10 = new JPanel();
124         final JLabel lblFfmpegPath = new JLabel();
125         final JLabel lblFfmpegDllPath = new JLabel();
126         fldFfmpegPath = new JTextField();
127         fldFfmpegDllPath = new JTextField();
128         btnFfmpegPath = new JButton();
129         btnFfmpegDllPath = new JButton();
130         final JPanel pnlFfmpegParam = new JPanel();
131         rbFfmpegOptionFile = new JRadioButton();
132         rbFfmpegOptionDirectInput = new JRadioButton();
133         final JPanel pnlFfmpegParamOption = new JPanel();
134         final JLabel lblFfmpegOptionExtension = new JLabel();
135         final JLabel lblFfmpegOptionMain = new JLabel();
136         final JLabel lblFfmpegOptionIn = new JLabel();
137         final JLabel lblFfmpegOptionOut = new JLabel();
138         final JLabel lblFfmpegOptionAvfilter = new JLabel();
139         cbFfmpegOptionResize = new JCheckBox();
140         final JLabel lblFfmpegOptionResizeWidth = new JLabel();
141         fldFfmpegOptionResizeWidth = new JTextField();
142         final JLabel lblFfmpegOptionResizeHeight = new JLabel();
143         fldFfmpegOptionResizeHeight = new JTextField();
144         cbFfmpegOptionKeepAspect = new JCheckBox();
145         fldFfmpegOptionExtension = new JTextField();
146         fldFfmpegOptionMain = new JTextField();
147         fldFfmpegOptionIn = new JTextField();
148         fldFfmpegOptionOut = new JTextField();
149         fldFfmpegOptionAv = new JTextField();
150         final JPanel pnlNgSetting = new JPanel();
151         final JPanel pnlNgWord = new JPanel();
152         final JScrollPane scrNgWord = new JScrollPane();
153         lstNgWord = new JList<>();
154         fldNgWord = new JTextField();
155         btnNgWordAdd = new JButton();
156         btnNgWordDel = new JButton();
157         final JPanel pnlNgId = new JPanel();
158         final JScrollPane scrNgId = new JScrollPane();
159         lstNgId = new JList<>();
160         fldNgId = new JTextField();
161         btnNgIdAdd = new JButton();
162         btnNgIdDel = new JButton();
163         final JPanel pnlSearch = new JPanel();
164         final JPanel pnlSearchVideo = new JPanel();
165         final JScrollPane srcSearchVideo = new JScrollPane();
166         lstSearchVideo = new JList<>();
167         btnSearchVideoAdd = new JButton();
168         btnSearchVideoDel = new JButton();
169         final JPanel pnlSearchComment = new JPanel();
170         final JScrollPane srcSearchComment = new JScrollPane();
171         lstSearchComment = new JList<>();
172         btnSearchCommentAdd = new JButton();
173         btnSearchCommentDel = new JButton();
174         final JPanel pnlSearchCache = new JPanel();
175         final JLabel lblSearchCache = new JLabel();
176         fldSearchCache = new JTextField();
177
178         setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
179
180         pnlNetwork.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
181
182         pnlAccount.setBorder(BorderFactory.createTitledBorder("アカウント"));
183
184         lblMail.setText("ID(メールアドレス)");
185
186         lblPassword.setText("パスワード");
187
188         GroupLayout gl_pnlAccount = new GroupLayout(pnlAccount);
189         pnlAccount.setLayout(gl_pnlAccount);
190         gl_pnlAccount.setHorizontalGroup(
191             gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
192             .addGroup(gl_pnlAccount.createSequentialGroup()
193                 .addContainerGap()
194                 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
195                     .addComponent(lblMail)
196                     .addComponent(lblPassword))
197                 .addPreferredGap(ComponentPlacement.RELATED)
198                 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
199                     .addComponent(fldPassword, GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)
200                     .addComponent(fldMail, GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE))
201                 .addContainerGap())
202         );
203         gl_pnlAccount.setVerticalGroup(
204             gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
205             .addGroup(gl_pnlAccount.createSequentialGroup()
206                 .addContainerGap()
207                 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.BASELINE)
208                     .addComponent(lblMail)
209                     .addComponent(fldMail, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
210                 .addPreferredGap(ComponentPlacement.RELATED)
211                 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.BASELINE)
212                     .addComponent(lblPassword)
213                     .addComponent(fldPassword, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
214                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
215         );
216
217         pnlProxy.setBorder(BorderFactory.createTitledBorder("プロキシ"));
218
219         cbProxyUse.setText("プロキシを使用する");
220
221         lblProxyHost.setText("ホスト名");
222
223         lblProxyPort.setText("ポート番号");
224
225         GroupLayout gl_pnlProxy = new GroupLayout(pnlProxy);
226         pnlProxy.setLayout(gl_pnlProxy);
227         gl_pnlProxy.setHorizontalGroup(
228             gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.LEADING)
229             .addGroup(gl_pnlProxy.createSequentialGroup()
230                 .addContainerGap()
231                 .addGroup(gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.LEADING)
232                     .addComponent(cbProxyUse)
233                     .addGroup(gl_pnlProxy.createSequentialGroup()
234                         .addComponent(lblProxyHost)
235                         .addGap(18, 18, 18)
236                         .addComponent(fldProxyHost, GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE))
237                     .addGroup(gl_pnlProxy.createSequentialGroup()
238                         .addComponent(lblProxyPort)
239                         .addPreferredGap(ComponentPlacement.RELATED)
240                         .addComponent(fldProxyPort, GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE)))
241                 .addContainerGap(181, Short.MAX_VALUE))
242         );
243         gl_pnlProxy.setVerticalGroup(
244             gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.LEADING)
245             .addGroup(gl_pnlProxy.createSequentialGroup()
246                 .addContainerGap()
247                 .addComponent(cbProxyUse)
248                 .addPreferredGap(ComponentPlacement.RELATED)
249                 .addGroup(gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.BASELINE)
250                     .addComponent(lblProxyHost)
251                     .addComponent(fldProxyHost, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
252                 .addPreferredGap(ComponentPlacement.RELATED)
253                 .addGroup(gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.BASELINE)
254                     .addComponent(lblProxyPort)
255                     .addComponent(fldProxyPort, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
256                 .addContainerGap(39, Short.MAX_VALUE))
257         );
258
259         GroupLayout gl_pnlNetwork = new GroupLayout(pnlNetwork);
260         pnlNetwork.setLayout(gl_pnlNetwork);
261         gl_pnlNetwork.setHorizontalGroup(
262             gl_pnlNetwork.createParallelGroup(GroupLayout.Alignment.LEADING)
263             .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlNetwork.createSequentialGroup()
264                 .addContainerGap()
265                 .addGroup(gl_pnlNetwork.createParallelGroup(GroupLayout.Alignment.TRAILING)
266                     .addComponent(pnlProxy, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
267                     .addComponent(pnlAccount, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
268                 .addContainerGap())
269         );
270         gl_pnlNetwork.setVerticalGroup(
271             gl_pnlNetwork.createParallelGroup(GroupLayout.Alignment.LEADING)
272             .addGroup(gl_pnlNetwork.createSequentialGroup()
273                 .addContainerGap()
274                 .addComponent(pnlAccount, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
275                 .addPreferredGap(ComponentPlacement.RELATED)
276                 .addComponent(pnlProxy, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
277                 .addContainerGap(178, Short.MAX_VALUE))
278         );
279
280         tabbedPane.addTab("ネットワーク", pnlNetwork);
281
282         pnlFileVideo.setBorder(BorderFactory.createTitledBorder("動画"));
283
284         lblVideoDir.setText("保存フォルダ");
285
286         lblVideoFileNamepattern.setText("ファイル名規則");
287
288         btnVideoDir.setText("...");
289
290         cbVideoLocal.setText("local");
291
292         GroupLayout gl_pnlFileVideo = new GroupLayout(pnlFileVideo);
293         pnlFileVideo.setLayout(gl_pnlFileVideo);
294         gl_pnlFileVideo.setHorizontalGroup(
295             gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
296             .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFileVideo.createSequentialGroup()
297                 .addContainerGap()
298                 .addGroup(gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
299                     .addComponent(lblVideoFileNamepattern)
300                     .addComponent(lblVideoDir))
301                 .addPreferredGap(ComponentPlacement.RELATED)
302                 .addGroup(gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
303                     .addGroup(gl_pnlFileVideo.createSequentialGroup()
304                         .addComponent(fldVideoDir, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
305                         .addPreferredGap(ComponentPlacement.RELATED)
306                         .addComponent(btnVideoDir))
307                     .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFileVideo.createSequentialGroup()
308                         .addComponent(fldVideoFileNamePattern, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
309                         .addPreferredGap(ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
310                         .addComponent(cbVideoLocal)))
311                 .addContainerGap())
312         );
313         gl_pnlFileVideo.setVerticalGroup(
314             gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
315             .addGroup(gl_pnlFileVideo.createSequentialGroup()
316                 .addGroup(gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.BASELINE)
317                     .addComponent(lblVideoDir)
318                     .addComponent(fldVideoDir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
319                     .addComponent(btnVideoDir))
320                 .addPreferredGap(ComponentPlacement.RELATED)
321                 .addGroup(gl_pnlFileVideo.createParallelGroup(GroupLayout.Alignment.BASELINE)
322                     .addComponent(lblVideoFileNamepattern)
323                     .addComponent(fldVideoFileNamePattern, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
324                     .addComponent(cbVideoLocal))
325                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
326         );
327
328         pnlFileComment.setBorder(BorderFactory.createTitledBorder("コメント"));
329
330         lblCommentDir.setText("保存フォルダ");
331
332         lblCommentFileNamePattern.setText("ファイル名規則");
333
334         btnCommentDir.setText("...");
335
336         cbCommentLocal.setText("local");
337
338         GroupLayout gl_pnlFileComment = new GroupLayout(pnlFileComment);
339         pnlFileComment.setLayout(gl_pnlFileComment);
340         gl_pnlFileComment.setHorizontalGroup(
341             gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.LEADING)
342             .addGroup(gl_pnlFileComment.createSequentialGroup()
343                 .addContainerGap()
344                 .addGroup(gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.LEADING)
345                     .addComponent(lblCommentFileNamePattern)
346                     .addComponent(lblCommentDir))
347                 .addPreferredGap(ComponentPlacement.RELATED)
348                 .addGroup(gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.LEADING)
349                     .addGroup(gl_pnlFileComment.createSequentialGroup()
350                         .addComponent(fldCommentFileNamePattern, GroupLayout.PREFERRED_SIZE, 166, GroupLayout.PREFERRED_SIZE)
351                         .addPreferredGap(ComponentPlacement.RELATED, 93, Short.MAX_VALUE)
352                         .addComponent(cbCommentLocal))
353                     .addGroup(gl_pnlFileComment.createSequentialGroup()
354                         .addComponent(fldCommentDir, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
355                         .addPreferredGap(ComponentPlacement.RELATED)
356                         .addComponent(btnCommentDir)))
357                 .addContainerGap())
358         );
359         gl_pnlFileComment.setVerticalGroup(
360             gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.LEADING)
361             .addGroup(gl_pnlFileComment.createSequentialGroup()
362                 .addGroup(gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.BASELINE)
363                     .addComponent(lblCommentDir)
364                     .addComponent(fldCommentDir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
365                     .addComponent(btnCommentDir))
366                 .addPreferredGap(ComponentPlacement.RELATED)
367                 .addGroup(gl_pnlFileComment.createParallelGroup(GroupLayout.Alignment.BASELINE)
368                     .addComponent(lblCommentFileNamePattern)
369                     .addComponent(fldCommentFileNamePattern, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
370                     .addComponent(cbCommentLocal))
371                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
372         );
373
374         pnlFileOutput.setBorder(BorderFactory.createTitledBorder("変換動画"));
375
376         lblOutputDir.setText("保存フォルダ");
377
378         lblOutputFileNamePattern.setText("ファイル名規則");
379
380         btnOutputDir.setText("...");
381
382         cbOutputEnable.setText("変換");
383
384         cbOutputCommentOverlay.setText("コメント付与");
385
386         cbOutputDisplayProgress.setText("変換中動画表示");
387
388         GroupLayout gl_pnlFileOutput = new GroupLayout(pnlFileOutput);
389         pnlFileOutput.setLayout(gl_pnlFileOutput);
390         gl_pnlFileOutput.setHorizontalGroup(
391             gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.LEADING)
392             .addGroup(gl_pnlFileOutput.createSequentialGroup()
393                 .addContainerGap()
394                 .addGroup(gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.LEADING)
395                     .addComponent(lblOutputFileNamePattern)
396                     .addComponent(lblOutputDir))
397                 .addPreferredGap(ComponentPlacement.RELATED)
398                 .addGroup(gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.LEADING)
399                     .addGroup(gl_pnlFileOutput.createSequentialGroup()
400                         .addComponent(fldOutputDir, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
401                         .addPreferredGap(ComponentPlacement.RELATED)
402                         .addComponent(btnOutputDir)
403                         .addContainerGap())
404                     .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFileOutput.createSequentialGroup()
405                         .addComponent(fldOutputFileNamePattern, GroupLayout.PREFERRED_SIZE, 167, GroupLayout.PREFERRED_SIZE)
406                         .addPreferredGap(ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
407                         .addGroup(gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.LEADING)
408                             .addComponent(cbOutputDisplayProgress)
409                             .addGroup(gl_pnlFileOutput.createSequentialGroup()
410                                 .addComponent(cbOutputEnable)
411                                 .addPreferredGap(ComponentPlacement.RELATED)
412                                 .addComponent(cbOutputCommentOverlay))))))
413         );
414         gl_pnlFileOutput.setVerticalGroup(
415             gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.LEADING)
416             .addGroup(gl_pnlFileOutput.createSequentialGroup()
417                 .addGroup(gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.BASELINE)
418                     .addComponent(lblOutputDir)
419                     .addComponent(fldOutputDir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
420                     .addComponent(btnOutputDir))
421                 .addPreferredGap(ComponentPlacement.RELATED)
422                 .addGroup(gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.BASELINE)
423                     .addComponent(lblOutputFileNamePattern)
424                     .addComponent(fldOutputFileNamePattern, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
425                     .addComponent(cbOutputCommentOverlay)
426                     .addComponent(cbOutputEnable))
427                 .addPreferredGap(ComponentPlacement.RELATED)
428                 .addComponent(cbOutputDisplayProgress)
429                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
430         );
431
432         final JPanel pnlFileProhibit = new JPanel();
433         pnlFileProhibit.setBorder(BorderFactory.createTitledBorder("禁則文字"));
434         final JLabel lblReplaceFrom = new JLabel("置換対象文字");
435         final JLabel lblReplaceTo = new JLabel("置換後文字");
436
437         final GroupLayout glProhibit = new GroupLayout(pnlFileProhibit);
438         glProhibit.setAutoCreateContainerGaps(true);
439         glProhibit.setAutoCreateGaps(true);
440         pnlFileProhibit.setLayout(glProhibit);
441
442         glProhibit.setHorizontalGroup(glProhibit.createSequentialGroup()
443             .addGroup(glProhibit.createParallelGroup()
444                 .addComponent(lblReplaceFrom)
445                 .addComponent(lblReplaceTo)
446             )
447             .addGroup(glProhibit.createParallelGroup()
448                 .addComponent(fldReplaceFrom)
449                 .addComponent(fldReplaceTo)
450             )
451         );
452
453         glProhibit.setVerticalGroup(glProhibit.createSequentialGroup()
454             .addGroup(glProhibit.createParallelGroup(Alignment.BASELINE)
455                 .addComponent(lblReplaceFrom)
456                 .addComponent(fldReplaceFrom)
457             )
458             .addGroup(glProhibit.createParallelGroup(Alignment.BASELINE)
459                 .addComponent(lblReplaceTo)
460                 .addComponent(fldReplaceTo)
461             )
462         );
463
464         GroupLayout gl_pnlFile = new GroupLayout(pnlFile);
465         pnlFile.setLayout(gl_pnlFile);
466         gl_pnlFile.setHorizontalGroup(
467             gl_pnlFile.createParallelGroup(GroupLayout.Alignment.LEADING)
468             .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFile.createSequentialGroup()
469                 .addContainerGap()
470                 .addGroup(gl_pnlFile.createParallelGroup(GroupLayout.Alignment.TRAILING)
471                     .addComponent(pnlFileOutput, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
472                     .addComponent(pnlFileVideo, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
473                     .addComponent(pnlFileComment, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
474                     .addComponent(pnlFileProhibit, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
475                 )
476                 .addContainerGap())
477         );
478         gl_pnlFile.setVerticalGroup(
479             gl_pnlFile.createParallelGroup(GroupLayout.Alignment.LEADING)
480             .addGroup(gl_pnlFile.createSequentialGroup()
481                 .addContainerGap()
482                 .addComponent(pnlFileVideo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
483                 .addPreferredGap(ComponentPlacement.RELATED)
484                 .addComponent(pnlFileComment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
485                 .addPreferredGap(ComponentPlacement.RELATED)
486                 .addComponent(pnlFileOutput, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
487                 .addPreferredGap(ComponentPlacement.RELATED)
488                 .addComponent(pnlFileProhibit, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
489                 .addContainerGap())
490         );
491
492         tabbedPane.addTab("ファイル", pnlFile);
493
494         pnlCommentStandard.setBorder(BorderFactory.createTitledBorder(""));
495
496         lblCommentSize.setText("再生時間に応じたコメントの取得数");
497
498         cbCommentSizeAuto.setText("自動調整");
499
500         lblCommentSizeManual.setText("手動取得");
501
502         lblCommentMinSize.setText("1分当たりのコメント取得数");
503
504         cbCommentMinSizeAuto.setText("自動調整");
505
506         lblCommentMinSizeManual.setText("手動取得");
507
508         lblCommentDisplayMax.setText("1画面に表示する最大コメント数");
509
510         cbCommentDisplaySizeDefault.setText("標準(30)");
511
512         lblCommentDisplayMaxManual.setText("手動設定");
513
514         GroupLayout gl_pnlCommentStandard = new GroupLayout(pnlCommentStandard);
515         pnlCommentStandard.setLayout(gl_pnlCommentStandard);
516         gl_pnlCommentStandard.setAutoCreateContainerGaps(true);
517         gl_pnlCommentStandard.setAutoCreateGaps(true);
518         gl_pnlCommentStandard.setHorizontalGroup(
519             gl_pnlCommentStandard.createSequentialGroup()
520                 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.LEADING)
521                     .addComponent(lblCommentSize)
522                     .addComponent(lblCommentMinSize)
523                     .addComponent(lblCommentDisplayMax))
524                 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.LEADING)
525                     .addComponent(cbCommentSizeAuto)
526                     .addComponent(cbCommentMinSizeAuto)
527                     .addComponent(cbCommentDisplaySizeDefault))
528                 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.LEADING)
529                     .addComponent(lblCommentSizeManual)
530                     .addComponent(lblCommentMinSizeManual)
531                     .addComponent(lblCommentDisplayMaxManual))
532                 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.LEADING)
533                     .addComponent(fldCommentSizeManual, 48, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
534                     .addComponent(fldCommentMinSizeManual, 48, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
535                     .addComponent(fldCommentDisplaySizeManual, 48, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
536         );
537         gl_pnlCommentStandard.setVerticalGroup(
538             gl_pnlCommentStandard.createSequentialGroup()
539                 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.BASELINE)
540                     .addComponent(lblCommentSize)
541                     .addComponent(cbCommentSizeAuto)
542                     .addComponent(lblCommentSizeManual)
543                     .addComponent(fldCommentSizeManual))
544                 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.BASELINE)
545                     .addComponent(lblCommentMinSize)
546                     .addComponent(cbCommentMinSizeAuto)
547                     .addComponent(lblCommentMinSizeManual)
548                     .addComponent(fldCommentMinSizeManual))
549                 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.BASELINE)
550                     .addComponent(lblCommentDisplayMax)
551                     .addComponent(cbCommentDisplaySizeDefault)
552                     .addComponent(lblCommentDisplayMaxManual)
553                     .addComponent(fldCommentDisplaySizeManual))
554         );
555
556         pnlCommentAdvanced.setBorder(BorderFactory.createTitledBorder("高度な設定"));
557
558         lblFontPath.setText("フォントパス");
559
560         cbFontSizeArrangeDisable.setText("フォントサイズ調整を行わない");
561
562         cbCommentOpaque.setText("コメント透明化を行わない");
563
564         btnFontPath.setText("...");
565
566         lblFontIndex.setText("フォント番号");
567
568         lblFontShadow.setText("影の種類");
569         final ComboBoxModel<String> cbmFontShadow
570                 = new DefaultComboBoxModel<>(new String[]{"0:なし", "1:ニコニコ動画風", "2:右下", "3:囲い込み"});
571         cmbFontShadow.setModel(cbmFontShadow);
572
573         GroupLayout gl_pnlCommentAdvanced = new GroupLayout(pnlCommentAdvanced);
574         pnlCommentAdvanced.setLayout(gl_pnlCommentAdvanced);
575         gl_pnlCommentAdvanced.setHorizontalGroup(
576             gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.LEADING)
577             .addGroup(gl_pnlCommentAdvanced.createSequentialGroup()
578                 .addContainerGap()
579                 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.LEADING)
580                     .addComponent(cbCommentOpaque)
581                     .addGroup(gl_pnlCommentAdvanced.createSequentialGroup()
582                         .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.LEADING)
583                             .addComponent(lblFontPath)
584                             .addComponent(lblFontIndex)
585                             .addComponent(lblFontShadow))
586                         .addGap(18, 18, 18)
587                         .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.LEADING)
588                             .addComponent(fldFontPath, GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
589                             .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
590                                 .addComponent(cmbFontShadow, GroupLayout.Alignment.LEADING)
591                                 .addComponent(fldFontIndex, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE)))
592                         .addPreferredGap(ComponentPlacement.RELATED)
593                         .addComponent(btnFontPath))
594                     .addComponent(cbFontSizeArrangeDisable))
595                 .addContainerGap())
596         );
597         gl_pnlCommentAdvanced.setVerticalGroup(
598             gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.LEADING)
599             .addGroup(gl_pnlCommentAdvanced.createSequentialGroup()
600                 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.BASELINE)
601                     .addComponent(lblFontPath)
602                     .addComponent(fldFontPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
603                     .addComponent(btnFontPath))
604                 .addPreferredGap(ComponentPlacement.RELATED)
605                 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.BASELINE)
606                     .addComponent(lblFontIndex)
607                     .addComponent(fldFontIndex, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
608                 .addPreferredGap(ComponentPlacement.RELATED)
609                 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.BASELINE)
610                     .addComponent(lblFontShadow)
611                     .addComponent(cmbFontShadow, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
612                 .addPreferredGap(ComponentPlacement.RELATED)
613                 .addComponent(cbFontSizeArrangeDisable)
614                 .addPreferredGap(ComponentPlacement.RELATED)
615                 .addComponent(cbCommentOpaque)
616                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
617         );
618
619         GroupLayout gl_pnlComment = new GroupLayout(pnlComment);
620         pnlComment.setLayout(gl_pnlComment);
621         gl_pnlComment.setHorizontalGroup(
622             gl_pnlComment.createParallelGroup(GroupLayout.Alignment.LEADING)
623             .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlComment.createSequentialGroup()
624                 .addContainerGap()
625                 .addGroup(gl_pnlComment.createParallelGroup(GroupLayout.Alignment.TRAILING)
626                     .addComponent(pnlCommentAdvanced, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
627                     .addComponent(pnlCommentStandard, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
628                 .addContainerGap())
629         );
630         gl_pnlComment.setVerticalGroup(
631             gl_pnlComment.createParallelGroup(GroupLayout.Alignment.LEADING)
632             .addGroup(gl_pnlComment.createSequentialGroup()
633                 .addContainerGap()
634                 .addComponent(pnlCommentStandard, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
635                 .addPreferredGap(ComponentPlacement.RELATED)
636                 .addComponent(pnlCommentAdvanced, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
637                 .addContainerGap(168, Short.MAX_VALUE))
638         );
639
640         tabbedPane.addTab("コメント", pnlComment);
641
642         jPanel10.setBorder(BorderFactory.createTitledBorder("ファイルパス"));
643
644         lblFfmpegPath.setText("ffmpeg");
645
646         lblFfmpegDllPath.setText("拡張ライブラリ");
647
648         btnFfmpegPath.setText("...");
649
650         btnFfmpegDllPath.setText("...");
651
652         GroupLayout gl_jPanel10 = new GroupLayout(jPanel10);
653         jPanel10.setLayout(gl_jPanel10);
654         gl_jPanel10.setHorizontalGroup(
655             gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
656             .addGroup(gl_jPanel10.createSequentialGroup()
657                 .addContainerGap()
658                 .addGroup(gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
659                     .addComponent(lblFfmpegDllPath)
660                     .addComponent(lblFfmpegPath))
661                 .addPreferredGap(ComponentPlacement.RELATED)
662                 .addGroup(gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
663                     .addComponent(fldFfmpegDllPath, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
664                     .addComponent(fldFfmpegPath, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE))
665                 .addPreferredGap(ComponentPlacement.RELATED)
666                 .addGroup(gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
667                     .addComponent(btnFfmpegPath, GroupLayout.Alignment.TRAILING)
668                     .addComponent(btnFfmpegDllPath, GroupLayout.Alignment.TRAILING))
669                 .addContainerGap())
670         );
671         gl_jPanel10.setVerticalGroup(
672             gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
673             .addGroup(gl_jPanel10.createSequentialGroup()
674                 .addGroup(gl_jPanel10.createParallelGroup(GroupLayout.Alignment.BASELINE)
675                     .addComponent(lblFfmpegPath)
676                     .addComponent(fldFfmpegPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
677                     .addComponent(btnFfmpegPath))
678                 .addPreferredGap(ComponentPlacement.RELATED)
679                 .addGroup(gl_jPanel10.createParallelGroup(GroupLayout.Alignment.BASELINE)
680                     .addComponent(lblFfmpegDllPath)
681                     .addComponent(fldFfmpegDllPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
682                     .addComponent(btnFfmpegDllPath))
683                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
684         );
685
686         pnlFfmpegParam.setBorder(BorderFactory.createTitledBorder("ffmpegパラメータ"));
687
688         buttonGroup1.add(rbFfmpegOptionFile);
689         rbFfmpegOptionFile.setText("オプションファイル");
690
691         buttonGroup1.add(rbFfmpegOptionDirectInput);
692         rbFfmpegOptionDirectInput.setText("直接入力");
693
694         pnlFfmpegParamOption.setBorder(BorderFactory.createEtchedBorder());
695
696         lblFfmpegOptionExtension.setText("出力動画の拡張子");
697
698         lblFfmpegOptionMain.setText("メインオプション");
699
700         lblFfmpegOptionIn.setText("入力オプション");
701
702         lblFfmpegOptionOut.setText("出力オプション");
703
704         lblFfmpegOptionAvfilter.setText("avfilterオプション");
705
706         cbFfmpegOptionResize.setText("次のサイズに収まるよう縮小(-s)");
707
708         lblFfmpegOptionResizeWidth.setText("横");
709
710         lblFfmpegOptionResizeHeight.setText("縦");
711
712         cbFfmpegOptionKeepAspect.setText("アスペクト比を維持");
713
714         GroupLayout gl_pnlFfmpegParamOption = new GroupLayout(pnlFfmpegParamOption);
715         pnlFfmpegParamOption.setLayout(gl_pnlFfmpegParamOption);
716         gl_pnlFfmpegParamOption.setHorizontalGroup(
717             gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.LEADING)
718             .addGroup(gl_pnlFfmpegParamOption.createSequentialGroup()
719                 .addGroup(gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.LEADING)
720                     .addGroup(gl_pnlFfmpegParamOption.createSequentialGroup()
721                         .addContainerGap()
722                         .addGroup(gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.LEADING)
723                             .addComponent(lblFfmpegOptionAvfilter)
724                             .addComponent(lblFfmpegOptionExtension)
725                             .addComponent(lblFfmpegOptionMain)
726                             .addComponent(lblFfmpegOptionIn)
727                             .addComponent(lblFfmpegOptionOut))
728                         .addPreferredGap(ComponentPlacement.RELATED)
729                         .addGroup(gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.LEADING)
730                             .addComponent(fldFfmpegOptionExtension, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE)
731                             .addComponent(fldFfmpegOptionMain, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
732                             .addComponent(fldFfmpegOptionIn, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
733                             .addComponent(fldFfmpegOptionOut, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
734                             .addComponent(fldFfmpegOptionAv, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)))
735                     .addGroup(gl_pnlFfmpegParamOption.createSequentialGroup()
736                         .addGap(12, 12, 12)
737                         .addComponent(cbFfmpegOptionResize)
738                         .addPreferredGap(ComponentPlacement.UNRELATED)
739                         .addComponent(lblFfmpegOptionResizeWidth)
740                         .addPreferredGap(ComponentPlacement.RELATED)
741                         .addComponent(fldFfmpegOptionResizeWidth, GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE)
742                         .addGap(12, 12, 12)
743                         .addComponent(lblFfmpegOptionResizeHeight)
744                         .addPreferredGap(ComponentPlacement.RELATED)
745                         .addComponent(fldFfmpegOptionResizeHeight, GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE))
746                     .addGroup(gl_pnlFfmpegParamOption.createSequentialGroup()
747                         .addGap(33, 33, 33)
748                         .addComponent(cbFfmpegOptionKeepAspect)))
749                 .addContainerGap())
750         );
751         gl_pnlFfmpegParamOption.setVerticalGroup(
752             gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.LEADING)
753             .addGroup(gl_pnlFfmpegParamOption.createSequentialGroup()
754                 .addContainerGap()
755                 .addGroup(gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.BASELINE)
756                     .addComponent(lblFfmpegOptionExtension)
757                     .addComponent(fldFfmpegOptionExtension, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
758                 .addPreferredGap(ComponentPlacement.RELATED)
759                 .addGroup(gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.BASELINE)
760                     .addComponent(lblFfmpegOptionMain)
761                     .addComponent(fldFfmpegOptionMain, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
762                 .addPreferredGap(ComponentPlacement.RELATED)
763                 .addGroup(gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.BASELINE)
764                     .addComponent(lblFfmpegOptionIn)
765                     .addComponent(fldFfmpegOptionIn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
766                 .addPreferredGap(ComponentPlacement.RELATED)
767                 .addGroup(gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.BASELINE)
768                     .addComponent(lblFfmpegOptionOut)
769                     .addComponent(fldFfmpegOptionOut, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
770                 .addPreferredGap(ComponentPlacement.RELATED)
771                 .addGroup(gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.BASELINE)
772                     .addComponent(lblFfmpegOptionAvfilter)
773                     .addComponent(fldFfmpegOptionAv, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
774                 .addPreferredGap(ComponentPlacement.RELATED)
775                 .addGroup(gl_pnlFfmpegParamOption.createParallelGroup(GroupLayout.Alignment.BASELINE)
776                     .addComponent(cbFfmpegOptionResize)
777                     .addComponent(lblFfmpegOptionResizeWidth)
778                     .addComponent(fldFfmpegOptionResizeWidth, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
779                     .addComponent(lblFfmpegOptionResizeHeight)
780                     .addComponent(fldFfmpegOptionResizeHeight, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
781                 .addPreferredGap(ComponentPlacement.RELATED)
782                 .addComponent(cbFfmpegOptionKeepAspect)
783                 .addContainerGap())
784         );
785
786         GroupLayout gl_pnlFfmpegParam = new GroupLayout(pnlFfmpegParam);
787         pnlFfmpegParam.setLayout(gl_pnlFfmpegParam);
788         gl_pnlFfmpegParam.setHorizontalGroup(
789             gl_pnlFfmpegParam.createParallelGroup(Alignment.LEADING)
790             .addGroup(gl_pnlFfmpegParam.createSequentialGroup()
791                 .addContainerGap()
792                 .addGroup(gl_pnlFfmpegParam.createParallelGroup(Alignment.LEADING)
793                     .addComponent(pnlFfmpegParamOption, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
794                     .addGroup(gl_pnlFfmpegParam.createSequentialGroup()
795                         .addComponent(rbFfmpegOptionFile)
796                         .addPreferredGap(ComponentPlacement.RELATED)
797                         .addComponent(cmbFfmpegOptionFile, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
798                     .addComponent(rbFfmpegOptionDirectInput))
799                 .addContainerGap())
800         );
801         gl_pnlFfmpegParam.setVerticalGroup(
802             gl_pnlFfmpegParam.createParallelGroup(Alignment.LEADING)
803             .addGroup(gl_pnlFfmpegParam.createSequentialGroup()
804                 .addContainerGap()
805                 .addGroup(gl_pnlFfmpegParam.createParallelGroup(Alignment.BASELINE)
806                     .addComponent(rbFfmpegOptionFile)
807                     .addComponent(cmbFfmpegOptionFile, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
808                 .addPreferredGap(ComponentPlacement.RELATED)
809                 .addComponent(rbFfmpegOptionDirectInput)
810                 .addPreferredGap(ComponentPlacement.RELATED)
811                 .addComponent(pnlFfmpegParamOption, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
812                 .addContainerGap())
813         );
814
815         GroupLayout gl_pnlFfmpeg = new GroupLayout(pnlFfmpeg);
816         pnlFfmpeg.setLayout(gl_pnlFfmpeg);
817         gl_pnlFfmpeg.setHorizontalGroup(
818             gl_pnlFfmpeg.createParallelGroup(GroupLayout.Alignment.LEADING)
819             .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFfmpeg.createSequentialGroup()
820                 .addContainerGap()
821                 .addGroup(gl_pnlFfmpeg.createParallelGroup(GroupLayout.Alignment.TRAILING)
822                     .addComponent(pnlFfmpegParam, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
823                     .addComponent(jPanel10, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
824                 .addContainerGap())
825         );
826         gl_pnlFfmpeg.setVerticalGroup(
827             gl_pnlFfmpeg.createParallelGroup(GroupLayout.Alignment.LEADING)
828             .addGroup(gl_pnlFfmpeg.createSequentialGroup()
829                 .addContainerGap()
830                 .addComponent(jPanel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
831                 .addPreferredGap(ComponentPlacement.RELATED)
832                 .addComponent(pnlFfmpegParam, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
833                 .addContainerGap())
834         );
835
836         tabbedPane.addTab("ffmpeg", pnlFfmpeg);
837
838         pnlNgWord.setBorder(BorderFactory.createTitledBorder("NGワード"));
839
840         lstNgWord.setModel(mdlNgWord);
841         scrNgWord.setViewportView(lstNgWord);
842
843         btnNgWordAdd.setText("追加");
844
845         btnNgWordDel.setText("削除");
846
847         GroupLayout gl_pnlNgWord = new GroupLayout(pnlNgWord);
848         pnlNgWord.setLayout(gl_pnlNgWord);
849         gl_pnlNgWord.setHorizontalGroup(
850             gl_pnlNgWord.createParallelGroup(GroupLayout.Alignment.LEADING)
851             .addGroup(gl_pnlNgWord.createSequentialGroup()
852                 .addContainerGap()
853                 .addGroup(gl_pnlNgWord.createParallelGroup(GroupLayout.Alignment.LEADING)
854                     .addComponent(scrNgWord, GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
855                     .addGroup(gl_pnlNgWord.createSequentialGroup()
856                         .addComponent(fldNgWord, GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
857                         .addPreferredGap(ComponentPlacement.RELATED)
858                         .addComponent(btnNgWordAdd)
859                         .addGap(18, 18, 18)
860                         .addComponent(btnNgWordDel)))
861                 .addContainerGap())
862         );
863         gl_pnlNgWord.setVerticalGroup(
864             gl_pnlNgWord.createParallelGroup(GroupLayout.Alignment.LEADING)
865             .addGroup(gl_pnlNgWord.createSequentialGroup()
866                 .addComponent(scrNgWord, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
867                 .addPreferredGap(ComponentPlacement.RELATED)
868                 .addGroup(gl_pnlNgWord.createParallelGroup(GroupLayout.Alignment.BASELINE)
869                     .addComponent(fldNgWord, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
870                     .addComponent(btnNgWordDel)
871                     .addComponent(btnNgWordAdd))
872                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
873         );
874
875         pnlNgId.setBorder(BorderFactory.createTitledBorder("NGID"));
876
877         lstNgId.setModel(mdlNgId);
878         scrNgId.setViewportView(lstNgId);
879
880         btnNgIdAdd.setText("追加");
881
882         btnNgIdDel.setText("削除");
883
884         GroupLayout gl_pnlNgId = new GroupLayout(pnlNgId);
885         pnlNgId.setLayout(gl_pnlNgId);
886         gl_pnlNgId.setHorizontalGroup(
887             gl_pnlNgId.createParallelGroup(GroupLayout.Alignment.LEADING)
888             .addGroup(gl_pnlNgId.createSequentialGroup()
889                 .addContainerGap()
890                 .addGroup(gl_pnlNgId.createParallelGroup(GroupLayout.Alignment.LEADING)
891                     .addComponent(scrNgId, GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
892                     .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlNgId.createSequentialGroup()
893                         .addComponent(fldNgId, GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
894                         .addPreferredGap(ComponentPlacement.RELATED)
895                         .addComponent(btnNgIdAdd)
896                         .addGap(18, 18, 18)
897                         .addComponent(btnNgIdDel)))
898                 .addContainerGap())
899         );
900         gl_pnlNgId.setVerticalGroup(
901             gl_pnlNgId.createParallelGroup(GroupLayout.Alignment.LEADING)
902             .addGroup(gl_pnlNgId.createSequentialGroup()
903                 .addComponent(scrNgId, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
904                 .addPreferredGap(ComponentPlacement.RELATED)
905                 .addGroup(gl_pnlNgId.createParallelGroup(GroupLayout.Alignment.BASELINE)
906                     .addComponent(fldNgId, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
907                     .addComponent(btnNgIdDel)
908                     .addComponent(btnNgIdAdd))
909                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
910         );
911
912         GroupLayout gl_pnlNgSetting = new GroupLayout(pnlNgSetting);
913         pnlNgSetting.setLayout(gl_pnlNgSetting);
914         gl_pnlNgSetting.setHorizontalGroup(
915             gl_pnlNgSetting.createParallelGroup(GroupLayout.Alignment.LEADING)
916             .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlNgSetting.createSequentialGroup()
917                 .addContainerGap()
918                 .addGroup(gl_pnlNgSetting.createParallelGroup(GroupLayout.Alignment.TRAILING)
919                     .addComponent(pnlNgId, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
920                     .addComponent(pnlNgWord, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
921                 .addContainerGap())
922         );
923         gl_pnlNgSetting.setVerticalGroup(
924             gl_pnlNgSetting.createParallelGroup(GroupLayout.Alignment.LEADING)
925             .addGroup(gl_pnlNgSetting.createSequentialGroup()
926                 .addContainerGap()
927                 .addComponent(pnlNgWord, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
928                 .addPreferredGap(ComponentPlacement.RELATED)
929                 .addComponent(pnlNgId, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
930                 .addContainerGap(82, Short.MAX_VALUE))
931         );
932
933         tabbedPane.addTab("NG設定", pnlNgSetting);
934
935         pnlSearchVideo.setBorder(BorderFactory.createTitledBorder("動画検索対象フォルダ"));
936
937         lstSearchVideo.setModel(mdlSearchVideo);
938         srcSearchVideo.setViewportView(lstSearchVideo);
939
940         btnSearchVideoAdd.setText("追加...");
941
942         btnSearchVideoDel.setText("削除");
943
944         GroupLayout gl_pnlSearchVideo = new GroupLayout(pnlSearchVideo);
945         pnlSearchVideo.setLayout(gl_pnlSearchVideo);
946         gl_pnlSearchVideo.setHorizontalGroup(
947             gl_pnlSearchVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
948             .addComponent(srcSearchVideo, GroupLayout.DEFAULT_SIZE, 419, Short.MAX_VALUE)
949             .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlSearchVideo.createSequentialGroup()
950                 .addContainerGap(269, Short.MAX_VALUE)
951                 .addComponent(btnSearchVideoAdd)
952                 .addGap(18, 18, 18)
953                 .addComponent(btnSearchVideoDel)
954                 .addContainerGap())
955         );
956         gl_pnlSearchVideo.setVerticalGroup(
957             gl_pnlSearchVideo.createParallelGroup(GroupLayout.Alignment.LEADING)
958             .addGroup(gl_pnlSearchVideo.createSequentialGroup()
959                 .addComponent(srcSearchVideo, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
960                 .addPreferredGap(ComponentPlacement.RELATED)
961                 .addGroup(gl_pnlSearchVideo.createParallelGroup(GroupLayout.Alignment.BASELINE)
962                     .addComponent(btnSearchVideoDel)
963                     .addComponent(btnSearchVideoAdd))
964                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
965         );
966
967         pnlSearchComment.setBorder(BorderFactory.createTitledBorder("コメント検索対象フォルダ"));
968
969         lstSearchComment.setModel(mdlSearchComment);
970         srcSearchComment.setViewportView(lstSearchComment);
971
972         btnSearchCommentAdd.setText("追加...");
973
974         btnSearchCommentDel.setText("削除");
975
976         GroupLayout gl_pnlSearchComment = new GroupLayout(pnlSearchComment);
977         pnlSearchComment.setLayout(gl_pnlSearchComment);
978         gl_pnlSearchComment.setHorizontalGroup(
979             gl_pnlSearchComment.createParallelGroup(GroupLayout.Alignment.LEADING)
980             .addComponent(srcSearchComment, GroupLayout.DEFAULT_SIZE, 419, Short.MAX_VALUE)
981             .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlSearchComment.createSequentialGroup()
982                 .addContainerGap(269, Short.MAX_VALUE)
983                 .addComponent(btnSearchCommentAdd)
984                 .addGap(18, 18, 18)
985                 .addComponent(btnSearchCommentDel)
986                 .addContainerGap())
987         );
988         gl_pnlSearchComment.setVerticalGroup(
989             gl_pnlSearchComment.createParallelGroup(GroupLayout.Alignment.LEADING)
990             .addGroup(gl_pnlSearchComment.createSequentialGroup()
991                 .addComponent(srcSearchComment, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
992                 .addPreferredGap(ComponentPlacement.RELATED)
993                 .addGroup(gl_pnlSearchComment.createParallelGroup(GroupLayout.Alignment.BASELINE)
994                     .addComponent(btnSearchCommentDel)
995                     .addComponent(btnSearchCommentAdd))
996                 .addContainerGap(16, Short.MAX_VALUE))
997         );
998
999         pnlSearchCache.setBorder(BorderFactory.createEtchedBorder());
1000
1001         lblSearchCache.setText("キャッシュ更新(秒)");
1002
1003         GroupLayout gl_pnlSearchCache = new GroupLayout(pnlSearchCache);
1004         pnlSearchCache.setLayout(gl_pnlSearchCache);
1005         gl_pnlSearchCache.setHorizontalGroup(
1006             gl_pnlSearchCache.createParallelGroup(GroupLayout.Alignment.LEADING)
1007             .addGroup(gl_pnlSearchCache.createSequentialGroup()
1008                 .addContainerGap()
1009                 .addComponent(lblSearchCache)
1010                 .addPreferredGap(ComponentPlacement.RELATED)
1011                 .addComponent(fldSearchCache, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE)
1012                 .addContainerGap(269, Short.MAX_VALUE))
1013         );
1014         gl_pnlSearchCache.setVerticalGroup(
1015             gl_pnlSearchCache.createParallelGroup(GroupLayout.Alignment.LEADING)
1016             .addGroup(gl_pnlSearchCache.createSequentialGroup()
1017                 .addContainerGap()
1018                 .addGroup(gl_pnlSearchCache.createParallelGroup(GroupLayout.Alignment.BASELINE)
1019                     .addComponent(lblSearchCache)
1020                     .addComponent(fldSearchCache, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
1021                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
1022         );
1023
1024         GroupLayout gl_pnlSearch = new GroupLayout(pnlSearch);
1025         pnlSearch.setLayout(gl_pnlSearch);
1026         gl_pnlSearch.setHorizontalGroup(
1027             gl_pnlSearch.createParallelGroup(GroupLayout.Alignment.LEADING)
1028             .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlSearch.createSequentialGroup()
1029                 .addContainerGap()
1030                 .addGroup(gl_pnlSearch.createParallelGroup(GroupLayout.Alignment.TRAILING)
1031                     .addComponent(pnlSearchCache, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1032                     .addComponent(pnlSearchComment, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
1033                     .addComponent(pnlSearchVideo, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
1034                 .addContainerGap())
1035         );
1036         gl_pnlSearch.setVerticalGroup(
1037             gl_pnlSearch.createParallelGroup(GroupLayout.Alignment.LEADING)
1038             .addGroup(gl_pnlSearch.createSequentialGroup()
1039                 .addContainerGap()
1040                 .addComponent(pnlSearchVideo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
1041                 .addPreferredGap(ComponentPlacement.RELATED)
1042                 .addComponent(pnlSearchComment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
1043                 .addPreferredGap(ComponentPlacement.RELATED)
1044                 .addComponent(pnlSearchCache, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
1045                 .addContainerGap(27, Short.MAX_VALUE))
1046         );
1047
1048         tabbedPane.addTab("検索", pnlSearch);
1049
1050         final JPanel pnlButton = new JPanel();
1051         final JButton btnOk = new JButton("OK");
1052         btnOk.addActionListener(new ActionListener() {
1053
1054             @Override
1055             public void actionPerformed(ActionEvent e) {
1056                 saveConfig();
1057                 dispose();
1058             }
1059         });
1060         final JButton btnCancel = new JButton("Cancel");
1061         pnlButton.add(btnOk);
1062         pnlButton.add(btnCancel);
1063
1064         GroupLayout layout = new GroupLayout(getContentPane());
1065         getContentPane().setLayout(layout);
1066         layout.setHorizontalGroup(
1067             layout.createParallelGroup(GroupLayout.Alignment.LEADING)
1068             .addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE)
1069             .addComponent(pnlButton)
1070         );
1071         layout.setVerticalGroup(
1072             layout.createSequentialGroup()
1073                 .addComponent(tabbedPane,GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
1074                 .addComponent(pnlButton)
1075         );
1076
1077         final JLabel lblSystemThreadDownload = new JLabel("ダウンロードスレッド数");
1078         final JLabel lblSystemWaitDownload = new JLabel("ダウンロード開始最小間隔(秒)");
1079         final JLabel lblSystemThreadConvert = new JLabel("変換スレッド数");
1080         final JLabel lblSystemTempDir = new JLabel("作業フォルダ");
1081
1082         final JPanel pnlSystemGeneral = new JPanel();
1083         pnlSystemGeneral.setBorder(BorderFactory.createTitledBorder("システム"));
1084         final GroupLayout glSystemGenegal = new GroupLayout(pnlSystemGeneral);
1085         glSystemGenegal.setAutoCreateGaps(true);
1086         glSystemGenegal.setAutoCreateContainerGaps(true);
1087         pnlSystemGeneral.setLayout(glSystemGenegal);
1088
1089         glSystemGenegal.setHorizontalGroup(glSystemGenegal.createParallelGroup()
1090             .addGroup(glSystemGenegal.createSequentialGroup()
1091                 .addGroup(glSystemGenegal.createParallelGroup()
1092                     .addComponent(lblSystemThreadDownload)
1093                     .addComponent(lblSystemWaitDownload)
1094                     .addComponent(lblSystemThreadConvert))
1095                 .addGroup(glSystemGenegal.createParallelGroup()
1096                     .addComponent(fldSystemThreadDownload, PREFERRED_SIZE, 40, PREFERRED_SIZE)
1097                     .addComponent(fldSystemWaitDownload, PREFERRED_SIZE, 40, PREFERRED_SIZE)
1098                     .addComponent(fldSystemThreadConvert, PREFERRED_SIZE, 40, PREFERRED_SIZE)
1099                 )
1100             )
1101             .addGroup(glSystemGenegal.createSequentialGroup()
1102                 .addComponent(lblSystemTempDir)
1103                 .addComponent(fldSystemTempDir, DEFAULT_SIZE, 400, Short.MAX_VALUE)
1104                 )
1105             );
1106
1107         glSystemGenegal.setVerticalGroup(glSystemGenegal.createSequentialGroup()
1108             .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
1109                 .addComponent(lblSystemThreadDownload)
1110                 .addComponent(fldSystemThreadDownload, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE))
1111             .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
1112                 .addComponent(lblSystemWaitDownload)
1113                 .addComponent(fldSystemWaitDownload, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE))
1114             .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
1115                 .addComponent(lblSystemThreadConvert)
1116                 .addComponent(fldSystemThreadConvert, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE))
1117             .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
1118                 .addComponent(lblSystemTempDir)
1119                 .addComponent(fldSystemTempDir, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE)));
1120
1121         final JPanel pnlSystem = new JPanel();
1122         pnlSystem.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
1123         final GroupLayout glSystem = new GroupLayout(pnlSystem);
1124         glSystem.setAutoCreateGaps(true);
1125         glSystem.setAutoCreateContainerGaps(true);
1126         pnlSystem.setLayout(glSystem);
1127
1128         glSystem.setHorizontalGroup(glSystem.createParallelGroup()
1129             .addComponent(pnlSystemGeneral));
1130
1131         glSystem.setVerticalGroup(glSystem.createSequentialGroup()
1132             .addComponent(pnlSystemGeneral));
1133
1134         tabbedPane.add("システム", pnlSystem);
1135
1136         pack();
1137         setResizable(false);
1138         loadConfig();
1139     }
1140
1141     /**
1142      * @param args the command line arguments
1143      */
1144     public static void main(String args[]) {
1145         /* Set the Nimbus look and feel */
1146         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
1147         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
1148          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
1149          */
1150         try {
1151             for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
1152                 if ("Nimbus".equals(info.getName())) {
1153                     UIManager.setLookAndFeel(info.getClassName());
1154                     break;
1155                 }
1156             }
1157         } catch (ClassNotFoundException ex) {
1158             java.util.logging.Logger.getLogger(ConfigDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1159         } catch (InstantiationException ex) {
1160             java.util.logging.Logger.getLogger(ConfigDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1161         } catch (IllegalAccessException ex) {
1162             java.util.logging.Logger.getLogger(ConfigDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1163         } catch (UnsupportedLookAndFeelException ex) {
1164             java.util.logging.Logger.getLogger(ConfigDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
1165         }
1166         //</editor-fold>
1167
1168         /* Create and display the form */
1169         java.awt.EventQueue.invokeLater(new Runnable() {
1170
1171             @Override
1172             public void run() {
1173                 new ConfigDialog().setVisible(true);
1174             }
1175         });
1176     }
1177     // Variables declaration - do not modify//GEN-BEGIN:variables
1178
1179     // ネットワーク
1180     // ネットワーク - アカウント
1181     private final JTextField fldMail;
1182     private final JTextField fldPassword;
1183     // ネットワーク - プロキシ
1184     private final JCheckBox cbProxyUse;
1185     private final JTextField fldProxyHost;
1186     private final JTextField fldProxyPort;
1187     // ファイル
1188     // ファイル - 動画
1189     private final JTextField fldVideoDir;
1190     private final JButton btnVideoDir;
1191     private final JTextField fldVideoFileNamePattern;
1192     private final JCheckBox cbVideoLocal;
1193     // ファイル - コメント
1194     private final JTextField fldCommentDir;
1195     private final JButton btnCommentDir;
1196     private final JTextField fldCommentFileNamePattern;
1197     private final JCheckBox cbCommentLocal;
1198     // ファイル - 変換動画
1199     private final JTextField fldOutputDir;
1200     private final JTextField fldOutputFileNamePattern;
1201     private final JButton btnOutputDir;
1202     private final JCheckBox cbOutputEnable;
1203     private final JCheckBox cbOutputCommentOverlay;
1204     private final JCheckBox cbOutputDisplayProgress;
1205     // ファイル - 禁則文字
1206     private final JTextField fldReplaceFrom = new JTextField();
1207     private final JTextField fldReplaceTo = new JTextField();
1208     // コメント
1209     // コメント
1210     private final JCheckBox cbCommentSizeAuto;
1211     private final JTextField fldCommentSizeManual;
1212     private final JCheckBox cbCommentMinSizeAuto;
1213     private final JTextField fldCommentMinSizeManual;
1214     private final JCheckBox cbCommentDisplaySizeDefault;
1215     private final JTextField fldCommentDisplaySizeManual;
1216     // コメント - 高度な設定
1217     private final JTextField fldFontPath;
1218     private final JButton btnFontPath;
1219     private final JTextField fldFontIndex;
1220     private final JComboBox<String> cmbFontShadow = new JComboBox<>();
1221     private final JCheckBox cbFontSizeArrangeDisable;
1222     private final JCheckBox cbCommentOpaque;
1223     // ffmpeg
1224     // ffmpeg - ファイルパス
1225     private final JTextField fldFfmpegPath;
1226     private final JButton btnFfmpegPath;
1227     private final JTextField fldFfmpegDllPath;
1228     private final JButton btnFfmpegDllPath;
1229     // ffmpeg - ffmpegパラメータ
1230     private final JRadioButton rbFfmpegOptionFile;
1231     private final JRadioButton rbFfmpegOptionDirectInput;
1232     private final JComboBox<FFmpegSelectedItem> cmbFfmpegOptionFile = new JComboBox<>(new OptionComboBoxModel());
1233     private final JTextField fldFfmpegOptionExtension;
1234     private final JTextField fldFfmpegOptionMain;
1235     private final JTextField fldFfmpegOptionIn;
1236     private final JTextField fldFfmpegOptionOut;
1237     private final JTextField fldFfmpegOptionAv;
1238     private final JCheckBox cbFfmpegOptionResize;
1239     private final JTextField fldFfmpegOptionResizeWidth;
1240     private final JTextField fldFfmpegOptionResizeHeight;
1241     private final JCheckBox cbFfmpegOptionKeepAspect;
1242     // NG設定
1243     // NG設定 - NGワード
1244     private final JList<String> lstNgWord;
1245     private final DefaultListModel<String> mdlNgWord = new DefaultListModel<>();
1246     private final JTextField fldNgWord;
1247     private final JButton btnNgWordAdd;
1248     private final JButton btnNgWordDel;
1249     // NG設定 - NGID
1250     private final JList<String> lstNgId;
1251     private final DefaultListModel<String> mdlNgId = new DefaultListModel<>();
1252     private final JTextField fldNgId;
1253     private final JButton btnNgIdAdd;
1254     private final JButton btnNgIdDel;
1255     // 検索
1256     // 検索 - 動画検索対象フォルダ
1257     private final JList<String> lstSearchVideo;
1258     private final DefaultListModel<String> mdlSearchVideo = new DefaultListModel<>();
1259     private final JButton btnSearchVideoAdd;
1260     private final JButton btnSearchVideoDel;
1261     // 検索 - コメント検索対象フォルダ
1262     private final JList<String> lstSearchComment;
1263     private final DefaultListModel<String> mdlSearchComment = new DefaultListModel<>();
1264     private final JButton btnSearchCommentAdd;
1265     private final JButton btnSearchCommentDel;
1266     // 検索 - キャッシュ更新(秒)
1267     private final JTextField fldSearchCache;
1268     // システム
1269     private final JTextField fldSystemThreadDownload = new JTextField();
1270     private final JTextField fldSystemWaitDownload = new JTextField();
1271     private final JTextField fldSystemThreadConvert = new JTextField();
1272     private final JTextField fldSystemTempDir = new JTextField();
1273
1274
1275     // End of variables declaration//GEN-END:variables
1276
1277     private void loadConfig() {
1278         final Config p = Config.INSTANCE;
1279
1280         /*
1281          * ネットワーク - アカウント
1282          */
1283         fldMail.setText(p.getId());
1284         fldPassword.setText(p.getPassword());
1285
1286         /*
1287          * ネットワーク - プロキシ
1288          */
1289         cbProxyUse.setSelected(p.getProxyUse());
1290         fldProxyHost.setText(p.getProxyHost());
1291         fldProxyPort.setText(p.getProxyPort());
1292
1293         /*
1294          * ファイル - 動画
1295          */
1296         fldVideoDir.setText(p.getVideoDir());
1297         fldVideoFileNamePattern.setText(p.getVideoFileNamePattern());
1298         cbVideoLocal.setSelected(p.getVideoUseLocal());
1299
1300         /*
1301          * ファイル - コメント
1302          */
1303         fldCommentDir.setText(p.getCommentDir());
1304         fldCommentFileNamePattern.setText(p.getCommentFileNamePattern());
1305         cbCommentLocal.setSelected(p.getCommentUseLocal());
1306
1307         /*
1308          * ファイル - 変換動画
1309          */
1310         fldOutputDir.setText(p.getOutputDir());
1311         fldOutputFileNamePattern.setText(p.getOutputFileNamePattern());
1312         cbOutputEnable.setSelected(p.getOutputEnable());
1313         cbOutputCommentOverlay.setSelected(p.getOutputCommentOverlay());
1314         cbOutputDisplayProgress.setSelected(p.getOutputDisplayProgress());
1315
1316         /*
1317          * ファイル - 禁則文字
1318          */
1319         fldReplaceFrom.setText(p.getReplaceFrom());
1320         fldReplaceTo.setText(p.getReplaceTo());
1321
1322         /**
1323          * コメント
1324          */
1325         cbCommentSizeAuto.setSelected(p.getCommentSizeAutosize());
1326         fldCommentSizeManual.setText(p.getCommentSizeManual());
1327         cbCommentMinSizeAuto.setSelected(p.getCommentMinSizeAutosize());
1328         fldCommentSizeManual.setText(p.getCommentMinSizeManual());
1329         cbCommentDisplaySizeDefault.setSelected(p.getCommentDisplaySizeDefault());
1330         fldCommentDisplaySizeManual.setText(p.getCommentDisplaySizeManual());
1331
1332         /**
1333          * コメント - 高度な設定
1334          */
1335         fldFontPath.setText(p.getFontPath());
1336         fldFontIndex.setText(p.getFontIndex());
1337         cmbFontShadow.setSelectedIndex(p.getFontShadow());
1338         cbFontSizeArrangeDisable.setSelected(p.getFontSizeArrangeDisable());
1339         cbCommentOpaque.setSelected(p.getCommentOpaque());
1340
1341         /*
1342          * ffmpeg - ファイルパス
1343          */
1344         fldFfmpegPath.setText(p.getFfmpegPath());
1345         fldFfmpegDllPath.setText(p.getFfmpegDllPath());
1346
1347         /*
1348          * ffmpeg - ffmpegパラメータ
1349          */
1350         rbFfmpegOptionFile.setSelected(!p.getFfmpegParamInputDirect());
1351         rbFfmpegOptionDirectInput.setSelected(p.getFfmpegParamInputDirect());
1352         // TODO cmbFfmpegOptionFile
1353         fldFfmpegOptionExtension.setText(p.getFfmpegExtension());
1354         fldFfmpegOptionMain.setText(p.getFfmpegMainOption());
1355         fldFfmpegOptionIn.setText(p.getFfmpegInOption());
1356         fldFfmpegOptionOut.setText(p.getFfmpegOutOption());
1357         fldFfmpegOptionAv.setText(p.getFfmpegAvOption());
1358         cbFfmpegOptionResize.setSelected(p.getFfmpegResizeEnable());
1359         fldFfmpegOptionResizeWidth.setText(p.getFfmpegResizeWidth());
1360         fldFfmpegOptionResizeHeight.setText(p.getFfmpegResizeHeight());
1361         cbFfmpegOptionKeepAspect.setSelected(p.getFfmpegKeepAspect());
1362
1363         /*
1364          * NG 設定
1365          */
1366         final List<String> ngWords = p.getNgWords();
1367         for (String s : ngWords) {
1368             mdlNgWord.addElement(s);
1369         }
1370         final List<String> ngIds = p.getNgIds();
1371         for (String s : ngIds) {
1372             mdlNgId.addElement(s);
1373         }
1374
1375         /*
1376          * システム
1377          */
1378         fldSystemThreadDownload.setText(Integer.toString(p.getSystemDownloadThread()));
1379         fldSystemWaitDownload.setText(Integer.toString(p.getSystemDownloadWait()));
1380         fldSystemThreadConvert.setText(Integer.toString(p.getSystemConvertThread()));
1381         fldSystemTempDir.setText(p.getSystemTempDir());
1382     }
1383
1384     private void saveConfig() {
1385         final Config p = Config.INSTANCE;
1386
1387         /*
1388          * ネットワーク - アカウント
1389          */
1390
1391         p.setId(fldMail.getText());
1392         p.setPassword(fldPassword.getText());
1393
1394         /*
1395          * ネットワーク - プロキシ
1396          */
1397         p.setProxyUse(cbProxyUse.isSelected());
1398         p.setProxyHost(fldProxyHost.getText());
1399         p.setProxyPort(fldProxyPort.getText());
1400
1401         /*
1402          * ファイル - 動画
1403          */
1404         p.setVideoDir(fldVideoDir.getText());
1405         p.setVideoFileNamePattern(fldVideoFileNamePattern.getText());
1406         p.setVideoUseLocal(cbVideoLocal.isSelected());
1407
1408         /*
1409          * ファイル - コメント
1410          */
1411         p.setCommentDir(fldCommentDir.getText());
1412         p.setCommentFileNamePattern(fldCommentFileNamePattern.getText());
1413         p.setCommentUseLocal(cbCommentLocal.isSelected());
1414
1415         /*
1416          * ファイル - 変換動画
1417          */
1418         p.setOutputDir(fldOutputDir.getText());
1419         p.setOutputFileNamePattern(fldOutputFileNamePattern.getText());
1420         p.setOutputEnable(cbOutputEnable.isSelected());
1421         p.setOutputCommentOverlay(cbOutputCommentOverlay.isSelected());
1422         p.setOutputDisplayProgress(cbOutputDisplayProgress.isSelected());
1423
1424         /*
1425          * ファイル - 禁則文字
1426          */
1427         p.setReplaceFrom(fldReplaceFrom.getText());
1428         p.setReplaceTo(fldReplaceTo.getText());
1429
1430         /*
1431          * コメント
1432          */
1433         p.setCommentSizeAutosize(cbCommentSizeAuto.isSelected());
1434         p.setCommentSizeManual(fldCommentSizeManual.getText());
1435         p.setCommentMinSizeAutosize(cbCommentMinSizeAuto.isSelected());
1436         p.setCommentMinSizeManual(fldCommentSizeManual.getText());
1437         p.setCommentDisplaySizeDefault(cbCommentDisplaySizeDefault.isSelected());
1438         p.setCommentDisplaySizeManual(fldCommentDisplaySizeManual.getText());
1439
1440         /**
1441          * コメント - 高度な設定
1442          */
1443         p.setFontPath(fldFontPath.getText());
1444         p.setFontIndex(fldFontIndex.getText());
1445         p.setFontShadow(cmbFontShadow.getSelectedIndex());
1446         p.setFontSizeArrangeDisable(cbFontSizeArrangeDisable.isSelected());
1447         p.setCommentOpaque(cbCommentOpaque.isSelected());
1448
1449         /*
1450          * ffmpeg - ファイルパス
1451          */
1452         p.setFfmpegPath(fldFfmpegPath.getText());
1453         p.setFfmpegDllPath(fldFfmpegDllPath.getText());
1454
1455         /*
1456          * ffmpeg - ffmpegパラメータ
1457          */
1458         p.setFfmpegParamInputDirect(rbFfmpegOptionDirectInput.isSelected());
1459         // TODO cmbFfmpegOptionFile
1460         p.setFfmpegExtension(fldFfmpegOptionExtension.getText());
1461         p.setFfmpegMainOption(fldFfmpegOptionMain.getText());
1462         p.setFfmpegInOption(fldFfmpegOptionIn.getText());
1463         p.setFfmpegOutOption(fldFfmpegOptionOut.getText());
1464         p.setFfmpegAvOption(fldFfmpegOptionAv.getText());
1465         p.setFfmpegResizeEnable(cbFfmpegOptionResize.isSelected());
1466         p.setFfmpegResizeWidth(fldFfmpegOptionResizeWidth.getText());
1467         p.setFfmpegResizeHeight(fldFfmpegOptionResizeHeight.getText());
1468         p.setFfmpegKeepAspect(cbFfmpegOptionKeepAspect.isSelected());
1469
1470         /*
1471          * NG 設定
1472          */
1473         final List<String> ngWords = new ArrayList<>(mdlNgId.getSize());
1474         for (int i = 0; i < mdlNgId.getSize(); i++) {
1475             ngWords.add(mdlNgId.get(i));
1476         }
1477         p.setNgWords(ngWords);
1478         final List<String> ngIds = new ArrayList<>(mdlNgWord.getSize());
1479         for(int i = 0; i<mdlNgWord.getSize();i++) {
1480             ngIds.add(mdlNgWord.get(i));
1481         }
1482         p.setNgIds(ngIds);
1483
1484         /*
1485          * システム
1486          */
1487         p.setSystemDownloadThread(Integer.parseInt(fldSystemThreadDownload.getText()));
1488         p.setSystemDownloadWait(Integer.parseInt(fldSystemWaitDownload.getText()));
1489         p.setSystemConvertThread(Integer.parseInt(fldSystemThreadConvert.getText()));
1490         p.setSystemTempDir(fldSystemTempDir.getText());
1491
1492         try {
1493             p.save();
1494         } catch (ConfigurationException ex) {
1495             logger.log(Level.SEVERE, "コンフィグファイル保存に失敗", ex);
1496         }
1497     }
1498 }