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