OSDN Git Service

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