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