OSDN Git Service

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