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