4 * Created on 2011/08/20, 16:33:03
6 package yukihane.inqubus.gui;
8 import static javax.swing.GroupLayout.DEFAULT_SIZE;
9 import static javax.swing.GroupLayout.PREFERRED_SIZE;
11 import java.awt.event.ActionEvent;
12 import java.awt.event.ActionListener;
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.GroupLayout;
21 import javax.swing.GroupLayout.Alignment;
22 import javax.swing.JButton;
23 import javax.swing.JCheckBox;
24 import javax.swing.JComboBox;
25 import javax.swing.JDialog;
26 import javax.swing.JFileChooser;
27 import javax.swing.JFrame;
28 import javax.swing.JLabel;
29 import javax.swing.JPanel;
30 import javax.swing.JTabbedPane;
31 import javax.swing.JTextField;
32 import javax.swing.LayoutStyle.ComponentPlacement;
33 import javax.swing.UIManager;
34 import javax.swing.UnsupportedLookAndFeelException;
35 import javax.swing.WindowConstants;
36 import org.apache.commons.configuration.ConfigurationException;
37 import yukihane.inqubus.Config;
43 public class ConfigDialog extends JDialog {
44 private static final long serialVersionUID = 1L;
45 private static final Logger logger = Logger.getLogger(ConfigDialog.class.getName());
47 /** Creates new form Properties */
48 public ConfigDialog() {
52 public ConfigDialog(JFrame owner){
55 final JTabbedPane tabbedPane = new JTabbedPane();
56 final JPanel pnlNetwork = new JPanel();
57 final JPanel pnlAccount = new JPanel();
58 final JLabel lblMail = new JLabel();
59 fldMail = new JTextField();
60 final JLabel lblPassword = new JLabel();
61 fldPassword = new JTextField();
62 final JPanel pnlProxy = new JPanel();
63 cbProxyUse = new JCheckBox();
64 final JLabel lblProxyHost = new JLabel();
65 final JLabel lblProxyPort = new JLabel();
66 fldProxyHost = new JTextField();
67 fldProxyPort = new JTextField();
68 final JPanel pnlFile = new JPanel();
69 final JPanel pnlFileOutput = new JPanel();
70 final JLabel lblOutputDir = new JLabel();
71 final JLabel lblOutputFileNamePattern = new JLabel();
72 fldOutputDir = new JTextField();
73 fldOutputFileNamePattern = new JTextField();
74 cbOutputEnable = new JCheckBox();
75 cbOutputCommentOverlay = new JCheckBox();
76 cbOutputDisplayProgress = new JCheckBox();
77 final JPanel pnlComment = new JPanel();
78 final JPanel pnlCommentStandard = new JPanel();
79 final JLabel lblCommentSize = new JLabel();
80 cbCommentSizeAuto = new JCheckBox();
81 final JLabel lblCommentSizeManual = new JLabel();
82 fldCommentSizeManual = new JTextField();
83 final JLabel lblCommentMinSize = new JLabel();
84 cbCommentMinSizeAuto = new JCheckBox();
85 fldCommentMinSizeManual = new JTextField();
86 final JLabel lblCommentMinSizeManual = new JLabel();
87 final JLabel lblCommentDisplayMax = new JLabel();
88 cbCommentDisplaySizeDefault = new JCheckBox();
89 final JLabel lblCommentDisplayMaxManual = new JLabel();
90 fldCommentDisplaySizeManual = new JTextField();
91 final JPanel pnlCommentAdvanced = new JPanel();
92 final JLabel lblFontPath = new JLabel();
93 cbFontSizeArrangeDisable = new JCheckBox();
94 cbCommentOpaque = new JCheckBox();
95 fldFontPath = new JTextField();
96 final JLabel lblFontIndex = new JLabel();
97 final JLabel lblFontShadow = new JLabel();
98 fldFontIndex = new JTextField();
99 final JPanel pnlFfmpeg = new JPanel();
100 final JPanel jPanel10 = new JPanel();
101 final JLabel lblFfmpegPath = new JLabel();
102 final JLabel lblFfmpegDllPath = new JLabel();
103 fldFfmpegPath = new JTextField();
104 fldFfmpegDllPath = new JTextField();
105 final JPanel pnlNgSetting = new JPanel();
106 final JPanel pnlSearch = new JPanel();
108 setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
110 pnlNetwork.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
112 pnlAccount.setBorder(BorderFactory.createTitledBorder("アカウント"));
114 lblMail.setText("ID(メールアドレス)");
116 lblPassword.setText("パスワード");
118 GroupLayout gl_pnlAccount = new GroupLayout(pnlAccount);
119 pnlAccount.setLayout(gl_pnlAccount);
120 gl_pnlAccount.setHorizontalGroup(
121 gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
122 .addGroup(gl_pnlAccount.createSequentialGroup()
124 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
125 .addComponent(lblMail)
126 .addComponent(lblPassword))
127 .addPreferredGap(ComponentPlacement.RELATED)
128 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
129 .addComponent(fldPassword, GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)
130 .addComponent(fldMail, GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE))
133 gl_pnlAccount.setVerticalGroup(
134 gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.LEADING)
135 .addGroup(gl_pnlAccount.createSequentialGroup()
137 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.BASELINE)
138 .addComponent(lblMail)
139 .addComponent(fldMail, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
140 .addPreferredGap(ComponentPlacement.RELATED)
141 .addGroup(gl_pnlAccount.createParallelGroup(GroupLayout.Alignment.BASELINE)
142 .addComponent(lblPassword)
143 .addComponent(fldPassword, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
144 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
147 pnlProxy.setBorder(BorderFactory.createTitledBorder("プロキシ"));
149 cbProxyUse.setText("プロキシを使用する");
151 lblProxyHost.setText("ホスト名");
153 lblProxyPort.setText("ポート番号");
155 GroupLayout gl_pnlProxy = new GroupLayout(pnlProxy);
156 pnlProxy.setLayout(gl_pnlProxy);
157 gl_pnlProxy.setHorizontalGroup(
158 gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.LEADING)
159 .addGroup(gl_pnlProxy.createSequentialGroup()
161 .addGroup(gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.LEADING)
162 .addComponent(cbProxyUse)
163 .addGroup(gl_pnlProxy.createSequentialGroup()
164 .addComponent(lblProxyHost)
166 .addComponent(fldProxyHost, GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE))
167 .addGroup(gl_pnlProxy.createSequentialGroup()
168 .addComponent(lblProxyPort)
169 .addPreferredGap(ComponentPlacement.RELATED)
170 .addComponent(fldProxyPort, GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE)))
171 .addContainerGap(181, Short.MAX_VALUE))
173 gl_pnlProxy.setVerticalGroup(
174 gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.LEADING)
175 .addGroup(gl_pnlProxy.createSequentialGroup()
177 .addComponent(cbProxyUse)
178 .addPreferredGap(ComponentPlacement.RELATED)
179 .addGroup(gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.BASELINE)
180 .addComponent(lblProxyHost)
181 .addComponent(fldProxyHost, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
182 .addPreferredGap(ComponentPlacement.RELATED)
183 .addGroup(gl_pnlProxy.createParallelGroup(GroupLayout.Alignment.BASELINE)
184 .addComponent(lblProxyPort)
185 .addComponent(fldProxyPort, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
186 .addContainerGap(39, Short.MAX_VALUE))
189 GroupLayout gl_pnlNetwork = new GroupLayout(pnlNetwork);
190 pnlNetwork.setLayout(gl_pnlNetwork);
191 gl_pnlNetwork.setHorizontalGroup(
192 gl_pnlNetwork.createParallelGroup(GroupLayout.Alignment.LEADING)
193 .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlNetwork.createSequentialGroup()
195 .addGroup(gl_pnlNetwork.createParallelGroup(GroupLayout.Alignment.TRAILING)
196 .addComponent(pnlProxy, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
197 .addComponent(pnlAccount, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
200 gl_pnlNetwork.setVerticalGroup(
201 gl_pnlNetwork.createParallelGroup(GroupLayout.Alignment.LEADING)
202 .addGroup(gl_pnlNetwork.createSequentialGroup()
204 .addComponent(pnlAccount, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
205 .addPreferredGap(ComponentPlacement.RELATED)
206 .addComponent(pnlProxy, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
207 .addContainerGap(178, Short.MAX_VALUE))
210 tabbedPane.addTab("ネットワーク", pnlNetwork);
212 pnlFileVideo.setBorder(BorderFactory.createTitledBorder("動画"));
214 pnlFileComment.setBorder(BorderFactory.createTitledBorder("コメント"));
216 pnlFileOutput.setBorder(BorderFactory.createTitledBorder("変換動画"));
218 lblOutputDir.setText("保存フォルダ");
220 lblOutputFileNamePattern.setText("ファイル名規則");
222 btnOutputDir.addActionListener(
223 new FileChooseAction(ConfigDialog.this, JFileChooser.DIRECTORIES_ONLY, fldOutputDir));
225 cbOutputEnable.setText("変換");
227 cbOutputCommentOverlay.setText("コメント付与");
229 cbOutputDisplayProgress.setText("変換中動画表示");
231 GroupLayout gl_pnlFileOutput = new GroupLayout(pnlFileOutput);
232 pnlFileOutput.setLayout(gl_pnlFileOutput);
233 gl_pnlFileOutput.setHorizontalGroup(
234 gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.LEADING)
235 .addGroup(gl_pnlFileOutput.createSequentialGroup()
237 .addGroup(gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.LEADING)
238 .addComponent(lblOutputFileNamePattern)
239 .addComponent(lblOutputDir))
240 .addPreferredGap(ComponentPlacement.RELATED)
241 .addGroup(gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.LEADING)
242 .addGroup(gl_pnlFileOutput.createSequentialGroup()
243 .addComponent(fldOutputDir, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
244 .addPreferredGap(ComponentPlacement.RELATED)
245 .addComponent(btnOutputDir)
247 .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFileOutput.createSequentialGroup()
248 .addComponent(fldOutputFileNamePattern, GroupLayout.PREFERRED_SIZE, 167, GroupLayout.PREFERRED_SIZE)
249 .addPreferredGap(ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
250 .addGroup(gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.LEADING)
251 .addComponent(cbOutputDisplayProgress)
252 .addGroup(gl_pnlFileOutput.createSequentialGroup()
253 .addComponent(cbOutputEnable)
254 .addPreferredGap(ComponentPlacement.RELATED)
255 .addComponent(cbOutputCommentOverlay))))))
257 gl_pnlFileOutput.setVerticalGroup(
258 gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.LEADING)
259 .addGroup(gl_pnlFileOutput.createSequentialGroup()
260 .addGroup(gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.BASELINE)
261 .addComponent(lblOutputDir)
262 .addComponent(fldOutputDir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
263 .addComponent(btnOutputDir))
264 .addPreferredGap(ComponentPlacement.RELATED)
265 .addGroup(gl_pnlFileOutput.createParallelGroup(GroupLayout.Alignment.BASELINE)
266 .addComponent(lblOutputFileNamePattern)
267 .addComponent(fldOutputFileNamePattern, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
268 .addComponent(cbOutputCommentOverlay)
269 .addComponent(cbOutputEnable))
270 .addPreferredGap(ComponentPlacement.RELATED)
271 .addComponent(cbOutputDisplayProgress)
272 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
275 final JPanel pnlFileProhibit = new JPanel();
276 pnlFileProhibit.setBorder(BorderFactory.createTitledBorder("禁則文字"));
277 final JLabel lblReplaceFrom = new JLabel("置換対象文字");
278 final JLabel lblReplaceTo = new JLabel("置換後文字");
280 final GroupLayout glProhibit = new GroupLayout(pnlFileProhibit);
281 glProhibit.setAutoCreateContainerGaps(true);
282 glProhibit.setAutoCreateGaps(true);
283 pnlFileProhibit.setLayout(glProhibit);
285 glProhibit.setHorizontalGroup(glProhibit.createSequentialGroup()
286 .addGroup(glProhibit.createParallelGroup()
287 .addComponent(lblReplaceFrom)
288 .addComponent(lblReplaceTo)
290 .addGroup(glProhibit.createParallelGroup()
291 .addComponent(fldReplaceFrom)
292 .addComponent(fldReplaceTo)
296 glProhibit.setVerticalGroup(glProhibit.createSequentialGroup()
297 .addGroup(glProhibit.createParallelGroup(Alignment.BASELINE)
298 .addComponent(lblReplaceFrom)
299 .addComponent(fldReplaceFrom)
301 .addGroup(glProhibit.createParallelGroup(Alignment.BASELINE)
302 .addComponent(lblReplaceTo)
303 .addComponent(fldReplaceTo)
307 GroupLayout gl_pnlFile = new GroupLayout(pnlFile);
308 pnlFile.setLayout(gl_pnlFile);
309 gl_pnlFile.setHorizontalGroup(
310 gl_pnlFile.createParallelGroup(GroupLayout.Alignment.LEADING)
311 .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFile.createSequentialGroup()
313 .addGroup(gl_pnlFile.createParallelGroup(GroupLayout.Alignment.TRAILING)
314 .addComponent(pnlFileOutput, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
315 .addComponent(pnlFileVideo, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
316 .addComponent(pnlFileComment, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
317 .addComponent(pnlFileProhibit, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
321 gl_pnlFile.setVerticalGroup(
322 gl_pnlFile.createParallelGroup(GroupLayout.Alignment.LEADING)
323 .addGroup(gl_pnlFile.createSequentialGroup()
325 .addComponent(pnlFileVideo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
326 .addPreferredGap(ComponentPlacement.RELATED)
327 .addComponent(pnlFileComment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
328 .addPreferredGap(ComponentPlacement.RELATED)
329 .addComponent(pnlFileOutput, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
330 .addPreferredGap(ComponentPlacement.RELATED)
331 .addComponent(pnlFileProhibit, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
335 tabbedPane.addTab("ファイル", pnlFile);
337 pnlCommentStandard.setBorder(BorderFactory.createTitledBorder(""));
339 lblCommentSize.setText("再生時間に応じたコメントの取得数");
341 cbCommentSizeAuto.setText("自動調整");
343 lblCommentSizeManual.setText("手動取得");
345 lblCommentMinSize.setText("1分当たりのコメント取得数");
347 cbCommentMinSizeAuto.setText("自動調整");
349 lblCommentMinSizeManual.setText("手動取得");
351 lblCommentDisplayMax.setText("1画面に表示する最大コメント数");
353 cbCommentDisplaySizeDefault.setText("標準(30)");
355 lblCommentDisplayMaxManual.setText("手動設定");
357 GroupLayout gl_pnlCommentStandard = new GroupLayout(pnlCommentStandard);
358 pnlCommentStandard.setLayout(gl_pnlCommentStandard);
359 gl_pnlCommentStandard.setAutoCreateContainerGaps(true);
360 gl_pnlCommentStandard.setAutoCreateGaps(true);
361 gl_pnlCommentStandard.setHorizontalGroup(
362 gl_pnlCommentStandard.createSequentialGroup()
363 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.LEADING)
364 .addComponent(lblCommentSize)
365 .addComponent(lblCommentMinSize)
366 .addComponent(lblCommentDisplayMax))
367 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.LEADING)
368 .addComponent(cbCommentSizeAuto)
369 .addComponent(cbCommentMinSizeAuto)
370 .addComponent(cbCommentDisplaySizeDefault))
371 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.LEADING)
372 .addComponent(lblCommentSizeManual)
373 .addComponent(lblCommentMinSizeManual)
374 .addComponent(lblCommentDisplayMaxManual))
375 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.LEADING)
376 .addComponent(fldCommentSizeManual, 48, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
377 .addComponent(fldCommentMinSizeManual, 48, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
378 .addComponent(fldCommentDisplaySizeManual, 48, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
380 gl_pnlCommentStandard.setVerticalGroup(
381 gl_pnlCommentStandard.createSequentialGroup()
382 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.BASELINE)
383 .addComponent(lblCommentSize)
384 .addComponent(cbCommentSizeAuto)
385 .addComponent(lblCommentSizeManual)
386 .addComponent(fldCommentSizeManual))
387 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.BASELINE)
388 .addComponent(lblCommentMinSize)
389 .addComponent(cbCommentMinSizeAuto)
390 .addComponent(lblCommentMinSizeManual)
391 .addComponent(fldCommentMinSizeManual))
392 .addGroup(gl_pnlCommentStandard.createParallelGroup(GroupLayout.Alignment.BASELINE)
393 .addComponent(lblCommentDisplayMax)
394 .addComponent(cbCommentDisplaySizeDefault)
395 .addComponent(lblCommentDisplayMaxManual)
396 .addComponent(fldCommentDisplaySizeManual))
399 pnlCommentAdvanced.setBorder(BorderFactory.createTitledBorder("高度な設定"));
401 lblFontPath.setText("フォントパス");
403 cbFontSizeArrangeDisable.setText("フォントサイズ調整を行わない");
405 cbCommentOpaque.setText("コメント透明化を行わない");
407 final JButton btnFontPath = new JButton("...");
408 btnFontPath.addActionListener(
409 new FileChooseAction(ConfigDialog.this, JFileChooser.FILES_ONLY, fldFontPath));
411 lblFontIndex.setText("フォント番号");
413 lblFontShadow.setText("影の種類");
414 final ComboBoxModel<String> cbmFontShadow
415 = new DefaultComboBoxModel<>(new String[]{"0:なし", "1:ニコニコ動画風", "2:右下", "3:囲い込み"});
416 cmbFontShadow.setModel(cbmFontShadow);
418 GroupLayout gl_pnlCommentAdvanced = new GroupLayout(pnlCommentAdvanced);
419 pnlCommentAdvanced.setLayout(gl_pnlCommentAdvanced);
420 gl_pnlCommentAdvanced.setHorizontalGroup(
421 gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.LEADING)
422 .addGroup(gl_pnlCommentAdvanced.createSequentialGroup()
424 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.LEADING)
425 .addComponent(cbCommentOpaque)
426 .addGroup(gl_pnlCommentAdvanced.createSequentialGroup()
427 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.LEADING)
428 .addComponent(lblFontPath)
429 .addComponent(lblFontIndex)
430 .addComponent(lblFontShadow))
432 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.LEADING)
433 .addComponent(fldFontPath, GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
434 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
435 .addComponent(cmbFontShadow, GroupLayout.Alignment.LEADING)
436 .addComponent(fldFontIndex, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE)))
437 .addPreferredGap(ComponentPlacement.RELATED)
438 .addComponent(btnFontPath))
439 .addComponent(cbFontSizeArrangeDisable))
442 gl_pnlCommentAdvanced.setVerticalGroup(
443 gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.LEADING)
444 .addGroup(gl_pnlCommentAdvanced.createSequentialGroup()
445 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.BASELINE)
446 .addComponent(lblFontPath)
447 .addComponent(fldFontPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
448 .addComponent(btnFontPath))
449 .addPreferredGap(ComponentPlacement.RELATED)
450 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.BASELINE)
451 .addComponent(lblFontIndex)
452 .addComponent(fldFontIndex, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
453 .addPreferredGap(ComponentPlacement.RELATED)
454 .addGroup(gl_pnlCommentAdvanced.createParallelGroup(GroupLayout.Alignment.BASELINE)
455 .addComponent(lblFontShadow)
456 .addComponent(cmbFontShadow, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
457 .addPreferredGap(ComponentPlacement.RELATED)
458 .addComponent(cbFontSizeArrangeDisable)
459 .addPreferredGap(ComponentPlacement.RELATED)
460 .addComponent(cbCommentOpaque)
461 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
464 GroupLayout gl_pnlComment = new GroupLayout(pnlComment);
465 pnlComment.setLayout(gl_pnlComment);
466 gl_pnlComment.setHorizontalGroup(
467 gl_pnlComment.createParallelGroup(GroupLayout.Alignment.LEADING)
468 .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlComment.createSequentialGroup()
470 .addGroup(gl_pnlComment.createParallelGroup(GroupLayout.Alignment.TRAILING)
471 .addComponent(pnlCommentAdvanced, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
472 .addComponent(pnlCommentStandard, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
475 gl_pnlComment.setVerticalGroup(
476 gl_pnlComment.createParallelGroup(GroupLayout.Alignment.LEADING)
477 .addGroup(gl_pnlComment.createSequentialGroup()
479 .addComponent(pnlCommentStandard, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
480 .addPreferredGap(ComponentPlacement.RELATED)
481 .addComponent(pnlCommentAdvanced, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
482 .addContainerGap(168, Short.MAX_VALUE))
485 tabbedPane.addTab("コメント", pnlComment);
487 jPanel10.setBorder(BorderFactory.createTitledBorder("ファイルパス"));
489 lblFfmpegPath.setText("ffmpeg");
491 lblFfmpegDllPath.setText("拡張ライブラリ");
493 final JButton btnFfmpegPath = new JButton("...");
494 btnFfmpegPath.addActionListener(
495 new FileChooseAction(ConfigDialog.this, JFileChooser.FILES_ONLY, fldFfmpegPath));
497 final JButton btnFfmpegDllPath = new JButton("...");
498 btnFfmpegDllPath.addActionListener(
499 new FileChooseAction(ConfigDialog.this, JFileChooser.FILES_ONLY, fldFfmpegDllPath));
502 GroupLayout gl_jPanel10 = new GroupLayout(jPanel10);
503 jPanel10.setLayout(gl_jPanel10);
504 gl_jPanel10.setHorizontalGroup(
505 gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
506 .addGroup(gl_jPanel10.createSequentialGroup()
508 .addGroup(gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
509 .addComponent(lblFfmpegDllPath)
510 .addComponent(lblFfmpegPath))
511 .addPreferredGap(ComponentPlacement.RELATED)
512 .addGroup(gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
513 .addComponent(fldFfmpegDllPath, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
514 .addComponent(fldFfmpegPath, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE))
515 .addPreferredGap(ComponentPlacement.RELATED)
516 .addGroup(gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
517 .addComponent(btnFfmpegPath, GroupLayout.Alignment.TRAILING)
518 .addComponent(btnFfmpegDllPath, GroupLayout.Alignment.TRAILING))
521 gl_jPanel10.setVerticalGroup(
522 gl_jPanel10.createParallelGroup(GroupLayout.Alignment.LEADING)
523 .addGroup(gl_jPanel10.createSequentialGroup()
524 .addGroup(gl_jPanel10.createParallelGroup(GroupLayout.Alignment.BASELINE)
525 .addComponent(lblFfmpegPath)
526 .addComponent(fldFfmpegPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
527 .addComponent(btnFfmpegPath))
528 .addPreferredGap(ComponentPlacement.RELATED)
529 .addGroup(gl_jPanel10.createParallelGroup(GroupLayout.Alignment.BASELINE)
530 .addComponent(lblFfmpegDllPath)
531 .addComponent(fldFfmpegDllPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
532 .addComponent(btnFfmpegDllPath))
533 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
536 pnlFfmpegParam.setBorder(BorderFactory.createTitledBorder("ffmpegパラメータ"));
540 GroupLayout gl_pnlFfmpeg = new GroupLayout(pnlFfmpeg);
541 pnlFfmpeg.setLayout(gl_pnlFfmpeg);
542 gl_pnlFfmpeg.setHorizontalGroup(
543 gl_pnlFfmpeg.createParallelGroup(GroupLayout.Alignment.LEADING)
544 .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlFfmpeg.createSequentialGroup()
546 .addGroup(gl_pnlFfmpeg.createParallelGroup(GroupLayout.Alignment.TRAILING)
547 .addComponent(pnlFfmpegParam, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
548 .addComponent(jPanel10, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
551 gl_pnlFfmpeg.setVerticalGroup(
552 gl_pnlFfmpeg.createParallelGroup(GroupLayout.Alignment.LEADING)
553 .addGroup(gl_pnlFfmpeg.createSequentialGroup()
555 .addComponent(jPanel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
556 .addPreferredGap(ComponentPlacement.RELATED)
557 .addComponent(pnlFfmpegParam, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
561 tabbedPane.addTab("ffmpeg", pnlFfmpeg);
563 pnlNgWord.setBorder(BorderFactory.createTitledBorder("NGワード"));
564 pnlNgId.setBorder(BorderFactory.createTitledBorder("NGID"));
566 GroupLayout gl_pnlNgSetting = new GroupLayout(pnlNgSetting);
567 pnlNgSetting.setLayout(gl_pnlNgSetting);
568 gl_pnlNgSetting.setHorizontalGroup(
569 gl_pnlNgSetting.createParallelGroup(GroupLayout.Alignment.LEADING)
570 .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlNgSetting.createSequentialGroup()
572 .addGroup(gl_pnlNgSetting.createParallelGroup(GroupLayout.Alignment.TRAILING)
573 .addComponent(pnlNgId, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
574 .addComponent(pnlNgWord, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
577 gl_pnlNgSetting.setVerticalGroup(
578 gl_pnlNgSetting.createParallelGroup(GroupLayout.Alignment.LEADING)
579 .addGroup(gl_pnlNgSetting.createSequentialGroup()
581 .addComponent(pnlNgWord, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
582 .addPreferredGap(ComponentPlacement.RELATED)
583 .addComponent(pnlNgId, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
587 tabbedPane.addTab("NG設定", pnlNgSetting);
589 pnlSearchVideo.setBorder(BorderFactory.createTitledBorder("動画検索対象フォルダ"));
590 pnlSearchComment.setBorder(BorderFactory.createTitledBorder("コメント検索対象フォルダ"));
592 GroupLayout gl_pnlSearch = new GroupLayout(pnlSearch);
593 pnlSearch.setLayout(gl_pnlSearch);
594 gl_pnlSearch.setHorizontalGroup(
595 gl_pnlSearch.createParallelGroup(GroupLayout.Alignment.LEADING)
596 .addGroup(GroupLayout.Alignment.TRAILING, gl_pnlSearch.createSequentialGroup()
598 .addGroup(gl_pnlSearch.createParallelGroup(GroupLayout.Alignment.TRAILING)
599 .addComponent(pnlSearchComment, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
600 .addComponent(pnlSearchVideo, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
603 gl_pnlSearch.setVerticalGroup(
604 gl_pnlSearch.createParallelGroup(GroupLayout.Alignment.LEADING)
605 .addGroup(gl_pnlSearch.createSequentialGroup()
607 .addComponent(pnlSearchVideo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
608 .addPreferredGap(ComponentPlacement.RELATED)
609 .addComponent(pnlSearchComment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
614 tabbedPane.addTab("検索", pnlSearch);
616 final JButton btnOk = new JButton("保存");
617 btnOk.addActionListener(new ActionListener() {
620 public void actionPerformed(ActionEvent e) {
625 final JButton btnCancel = new JButton("取消");
626 btnCancel.addActionListener(new ActionListener() {
629 public void actionPerformed(ActionEvent e) {
633 final JPanel pnlButton = new JPanel();
635 final GroupLayout glButton = new GroupLayout(pnlButton);
636 pnlButton.setLayout(glButton);
637 glButton.setHorizontalGroup(glButton.createSequentialGroup()
638 .addPreferredGap(ComponentPlacement.UNRELATED, PREFERRED_SIZE, Short.MAX_VALUE)
640 .addPreferredGap(ComponentPlacement.UNRELATED)
641 .addComponent(btnCancel)
644 glButton.setVerticalGroup(glButton.createSequentialGroup()
645 .addGroup(glButton.createParallelGroup(Alignment.BASELINE)
647 .addComponent(btnCancel)
651 GroupLayout layout = new GroupLayout(getContentPane());
652 layout.setAutoCreateContainerGaps(true);
653 getContentPane().setLayout(layout);
654 layout.setHorizontalGroup(
655 layout.createParallelGroup(GroupLayout.Alignment.LEADING)
656 .addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE)
657 .addComponent(pnlButton)
659 layout.setVerticalGroup(
660 layout.createSequentialGroup()
661 .addComponent(tabbedPane,GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
662 .addComponent(pnlButton)
665 final JLabel lblSystemThreadDownload = new JLabel("ダウンロードスレッド数");
666 final JLabel lblSystemWaitDownload = new JLabel("ダウンロード開始最小間隔(秒)");
667 final JLabel lblSystemThreadConvert = new JLabel("変換スレッド数");
668 final JLabel lblSystemTempDir = new JLabel("作業フォルダ");
669 final JButton btnSystemTempDir = new JButton("...");
670 btnSystemTempDir.addActionListener(
671 new FileChooseAction(ConfigDialog.this, JFileChooser.DIRECTORIES_ONLY, fldSystemTempDir));
673 final JPanel pnlSystemGeneral = new JPanel();
674 pnlSystemGeneral.setBorder(BorderFactory.createTitledBorder("システム"));
675 final GroupLayout glSystemGenegal = new GroupLayout(pnlSystemGeneral);
676 glSystemGenegal.setAutoCreateGaps(true);
677 glSystemGenegal.setAutoCreateContainerGaps(true);
678 pnlSystemGeneral.setLayout(glSystemGenegal);
680 glSystemGenegal.setHorizontalGroup(glSystemGenegal.createParallelGroup()
681 .addGroup(glSystemGenegal.createSequentialGroup()
682 .addGroup(glSystemGenegal.createParallelGroup()
683 .addComponent(lblSystemThreadDownload)
684 .addComponent(lblSystemWaitDownload)
685 .addComponent(lblSystemThreadConvert))
686 .addGroup(glSystemGenegal.createParallelGroup()
687 .addComponent(fldSystemThreadDownload, PREFERRED_SIZE, 40, PREFERRED_SIZE)
688 .addComponent(fldSystemWaitDownload, PREFERRED_SIZE, 40, PREFERRED_SIZE)
689 .addComponent(fldSystemThreadConvert, PREFERRED_SIZE, 40, PREFERRED_SIZE)
692 .addGroup(glSystemGenegal.createSequentialGroup()
693 .addComponent(lblSystemTempDir)
694 .addComponent(fldSystemTempDir, DEFAULT_SIZE, 400, Short.MAX_VALUE)
695 .addComponent(btnSystemTempDir)
699 glSystemGenegal.setVerticalGroup(glSystemGenegal.createSequentialGroup()
700 .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
701 .addComponent(lblSystemThreadDownload)
702 .addComponent(fldSystemThreadDownload, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE))
703 .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
704 .addComponent(lblSystemWaitDownload)
705 .addComponent(fldSystemWaitDownload, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE))
706 .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
707 .addComponent(lblSystemThreadConvert)
708 .addComponent(fldSystemThreadConvert, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE))
709 .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
710 .addComponent(lblSystemTempDir)
711 .addComponent(fldSystemTempDir, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE)
712 .addComponent(btnSystemTempDir)
716 final JPanel pnlSystem = new JPanel();
717 pnlSystem.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
718 final GroupLayout glSystem = new GroupLayout(pnlSystem);
719 glSystem.setAutoCreateGaps(true);
720 glSystem.setAutoCreateContainerGaps(true);
721 pnlSystem.setLayout(glSystem);
723 glSystem.setHorizontalGroup(glSystem.createParallelGroup()
724 .addComponent(pnlSystemGeneral));
726 glSystem.setVerticalGroup(glSystem.createSequentialGroup()
727 .addComponent(pnlSystemGeneral));
729 tabbedPane.add("システム", pnlSystem);
732 setMinimumSize(getSize());
737 * @param args the command line arguments
739 public static void main(String args[]) {
740 /* Set the Nimbus look and feel */
741 /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
742 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
745 for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
746 if ("Nimbus".equals(info.getName())) {
747 UIManager.setLookAndFeel(info.getClassName());
751 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
752 java.util.logging.Logger.getLogger(ConfigDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
755 /* Create and display the form */
756 java.awt.EventQueue.invokeLater(new Runnable() {
760 new ConfigDialog().setVisible(true);
764 // Variables declaration - do not modify//GEN-BEGIN:variables
768 private final JTextField fldMail;
769 private final JTextField fldPassword;
771 private final JCheckBox cbProxyUse;
772 private final JTextField fldProxyHost;
773 private final JTextField fldProxyPort;
776 private final DownloadLocationPanel pnlFileVideo = new DownloadLocationPanel();
778 private final DownloadLocationPanel pnlFileComment = new DownloadLocationPanel();
780 private final JTextField fldOutputDir;
781 private final JTextField fldOutputFileNamePattern;
782 private final JButton btnOutputDir = new JButton("...");
783 private final JCheckBox cbOutputEnable;
784 private final JCheckBox cbOutputCommentOverlay;
785 private final JCheckBox cbOutputDisplayProgress;
787 private final JTextField fldReplaceFrom = new JTextField();
788 private final JTextField fldReplaceTo = new JTextField();
791 private final JCheckBox cbCommentSizeAuto;
792 private final JTextField fldCommentSizeManual;
793 private final JCheckBox cbCommentMinSizeAuto;
794 private final JTextField fldCommentMinSizeManual;
795 private final JCheckBox cbCommentDisplaySizeDefault;
796 private final JTextField fldCommentDisplaySizeManual;
798 private final JTextField fldFontPath;
799 private final JTextField fldFontIndex;
800 private final JComboBox<String> cmbFontShadow = new JComboBox<>();
801 private final JCheckBox cbFontSizeArrangeDisable;
802 private final JCheckBox cbCommentOpaque;
805 private final JTextField fldFfmpegPath;
806 private final JTextField fldFfmpegDllPath;
807 // ffmpeg - ffmpegパラメータ
808 private final FfmpegParamPanel pnlFfmpegParam = new FfmpegParamPanel();
811 private final NgRegisterPanel pnlNgWord = new NgRegisterPanel();
813 private final NgRegisterPanel pnlNgId = new NgRegisterPanel();
816 private final DirectoryRegisterPanel pnlSearchVideo = new DirectoryRegisterPanel();
818 private final DirectoryRegisterPanel pnlSearchComment = new DirectoryRegisterPanel();
820 private final JTextField fldSystemThreadDownload = new JTextField();
821 private final JTextField fldSystemWaitDownload = new JTextField();
822 private final JTextField fldSystemThreadConvert = new JTextField();
823 private final JTextField fldSystemTempDir = new JTextField();
826 // End of variables declaration//GEN-END:variables
828 private void loadConfig() {
829 final Config p = Config.INSTANCE;
834 fldMail.setText(p.getId());
835 fldPassword.setText(p.getPassword());
840 cbProxyUse.setSelected(p.getProxyUse());
841 fldProxyHost.setText(p.getProxyHost());
842 fldProxyPort.setText(p.getProxyPort());
847 pnlFileVideo.fldDir.setText(p.getVideoDir());
848 pnlFileVideo.fldFileNamePattern.setText(p.getVideoFileNamePattern());
849 pnlFileVideo.cbLocal.setSelected(p.getVideoUseLocal());
854 pnlFileComment.fldDir.setText(p.getCommentDir());
855 pnlFileComment.fldFileNamePattern.setText(p.getCommentFileNamePattern());
856 pnlFileComment.cbLocal.setSelected(p.getCommentUseLocal());
861 fldOutputDir.setText(p.getOutputDir());
862 fldOutputFileNamePattern.setText(p.getOutputFileNamePattern());
863 cbOutputEnable.setSelected(p.getOutputEnable());
864 cbOutputCommentOverlay.setSelected(p.getOutputCommentOverlay());
865 cbOutputDisplayProgress.setSelected(p.getOutputDisplayProgress());
870 fldReplaceFrom.setText(p.getReplaceFrom());
871 fldReplaceTo.setText(p.getReplaceTo());
876 cbCommentSizeAuto.setSelected(p.getCommentSizeAutosize());
877 fldCommentSizeManual.setText(p.getCommentSizeManual());
878 cbCommentMinSizeAuto.setSelected(p.getCommentMinSizeAutosize());
879 fldCommentSizeManual.setText(p.getCommentMinSizeManual());
880 cbCommentDisplaySizeDefault.setSelected(p.getCommentDisplaySizeDefault());
881 fldCommentDisplaySizeManual.setText(p.getCommentDisplaySizeManual());
886 fldFontPath.setText(p.getFontPath());
887 fldFontIndex.setText(p.getFontIndex());
888 cmbFontShadow.setSelectedIndex(p.getFontShadow());
889 cbFontSizeArrangeDisable.setSelected(p.getFontSizeArrangeDisable());
890 cbCommentOpaque.setSelected(p.getCommentOpaque());
895 fldFfmpegPath.setText(p.getFfmpegPath());
896 fldFfmpegDllPath.setText(p.getFfmpegDllPath());
899 * ffmpeg - ffmpegパラメータ
901 pnlFfmpegParam.init(p);
906 final List<String> ngWords = p.getNgWords();
907 pnlNgWord.init(ngWords);
908 final List<String> ngIds = p.getNgIds();
914 pnlSearchVideo.init(p.getSearchVideoDirs());
915 pnlSearchComment.init(p.getSearchCommentDirs());
920 fldSystemThreadDownload.setText(Integer.toString(p.getSystemDownloadThread()));
921 fldSystemWaitDownload.setText(Integer.toString(p.getSystemDownloadWait()));
922 fldSystemThreadConvert.setText(Integer.toString(p.getSystemConvertThread()));
923 fldSystemTempDir.setText(p.getSystemTempDir());
926 private void saveConfig() {
927 final Config p = Config.INSTANCE;
933 p.setId(fldMail.getText());
934 p.setPassword(fldPassword.getText());
939 p.setProxyUse(cbProxyUse.isSelected());
940 p.setProxyHost(fldProxyHost.getText());
941 p.setProxyPort(fldProxyPort.getText());
946 p.setVideoDir(pnlFileVideo.fldDir.getText());
947 p.setVideoFileNamePattern(pnlFileVideo.fldFileNamePattern.getText());
948 p.setVideoUseLocal(pnlFileVideo.cbLocal.isSelected());
953 p.setCommentDir(pnlFileComment.fldDir.getText());
954 p.setCommentFileNamePattern(pnlFileComment.fldFileNamePattern.getText());
955 p.setCommentUseLocal(pnlFileComment.cbLocal.isSelected());
960 p.setOutputDir(fldOutputDir.getText());
961 p.setOutputFileNamePattern(fldOutputFileNamePattern.getText());
962 p.setOutputEnable(cbOutputEnable.isSelected());
963 p.setOutputCommentOverlay(cbOutputCommentOverlay.isSelected());
964 p.setOutputDisplayProgress(cbOutputDisplayProgress.isSelected());
969 p.setReplaceFrom(fldReplaceFrom.getText());
970 p.setReplaceTo(fldReplaceTo.getText());
975 p.setCommentSizeAutosize(cbCommentSizeAuto.isSelected());
976 p.setCommentSizeManual(fldCommentSizeManual.getText());
977 p.setCommentMinSizeAutosize(cbCommentMinSizeAuto.isSelected());
978 p.setCommentMinSizeManual(fldCommentSizeManual.getText());
979 p.setCommentDisplaySizeDefault(cbCommentDisplaySizeDefault.isSelected());
980 p.setCommentDisplaySizeManual(fldCommentDisplaySizeManual.getText());
985 p.setFontPath(fldFontPath.getText());
986 p.setFontIndex(fldFontIndex.getText());
987 p.setFontShadow(cmbFontShadow.getSelectedIndex());
988 p.setFontSizeArrangeDisable(cbFontSizeArrangeDisable.isSelected());
989 p.setCommentOpaque(cbCommentOpaque.isSelected());
994 p.setFfmpegPath(fldFfmpegPath.getText());
995 p.setFfmpegDllPath(fldFfmpegDllPath.getText());
998 * ffmpeg - ffmpegパラメータ
1000 final File fileFfmpegOption = pnlFfmpegParam.mdlFfmpegOption.getSelectedFile();
1001 p.setFfmpegOptionFile(fileFfmpegOption != null ? fileFfmpegOption.getPath() : null);
1002 p.setFfmpegExtension(pnlFfmpegParam.fldFfmpegOptionExtension.getText());
1003 p.setFfmpegMainOption(pnlFfmpegParam.fldFfmpegOptionMain.getText());
1004 p.setFfmpegInOption(pnlFfmpegParam.fldFfmpegOptionIn.getText());
1005 p.setFfmpegOutOption(pnlFfmpegParam.fldFfmpegOptionOut.getText());
1006 p.setFfmpegAvOption(pnlFfmpegParam.fldFfmpegOptionAv.getText());
1007 p.setFfmpegResizeEnable(pnlFfmpegParam.cbFfmpegOptionResize.isSelected());
1008 p.setFfmpegResizeWidth(pnlFfmpegParam.fldFfmpegOptionResizeWidth.getText());
1009 p.setFfmpegResizeHeight(pnlFfmpegParam.fldFfmpegOptionResizeHeight.getText());
1010 p.setFfmpegKeepAspect(pnlFfmpegParam.cbFfmpegOptionKeepAspect.isSelected());
1015 p.setNgWords(pnlNgWord.getAllElements());
1016 p.setNgIds(pnlNgId.getAllElements());
1021 p.setSearchVideoDirs(pnlSearchVideo.getAllElements());
1022 p.setSearchCommentDirs(pnlSearchComment.getAllElements());
1027 p.setSystemDownloadThread(Integer.parseInt(fldSystemThreadDownload.getText()));
1028 p.setSystemDownloadWait(Integer.parseInt(fldSystemWaitDownload.getText()));
1029 p.setSystemConvertThread(Integer.parseInt(fldSystemThreadConvert.getText()));
1030 p.setSystemTempDir(fldSystemTempDir.getText());
1034 } catch (ConfigurationException ex) {
1035 logger.log(Level.SEVERE, "コンフィグファイル保存に失敗", ex);
1040 class DownloadLocationPanel extends JPanel {
1041 final JTextField fldDir = new JTextField();
1042 final JTextField fldFileNamePattern = new JTextField();
1043 final JCheckBox cbLocal = new JCheckBox("local");
1045 DownloadLocationPanel(){
1048 final JLabel lblVideoDir = new JLabel("保存フォルダ");
1049 final JLabel lblVideoFileNamepattern = new JLabel("ファイル名規則");
1051 final JButton btnDir = new JButton("...");
1052 btnDir.addActionListener(
1053 new FileChooseAction(DownloadLocationPanel.this, JFileChooser.DIRECTORIES_ONLY, fldDir));
1055 final GroupLayout gl = new GroupLayout(this);
1057 gl.setHorizontalGroup(
1058 gl.createParallelGroup(GroupLayout.Alignment.LEADING)
1059 .addGroup(GroupLayout.Alignment.TRAILING, gl.createSequentialGroup()
1061 .addGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING)
1062 .addComponent(lblVideoFileNamepattern)
1063 .addComponent(lblVideoDir))
1064 .addPreferredGap(ComponentPlacement.RELATED)
1065 .addGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING)
1066 .addGroup(gl.createSequentialGroup()
1067 .addComponent(fldDir, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
1068 .addPreferredGap(ComponentPlacement.RELATED)
1069 .addComponent(btnDir))
1070 .addGroup(GroupLayout.Alignment.TRAILING, gl.createSequentialGroup()
1071 .addComponent(fldFileNamePattern, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
1072 .addPreferredGap(ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
1073 .addComponent(cbLocal)))
1076 gl.setVerticalGroup(
1077 gl.createParallelGroup(GroupLayout.Alignment.LEADING)
1078 .addGroup(gl.createSequentialGroup()
1079 .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
1080 .addComponent(lblVideoDir)
1081 .addComponent(fldDir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
1082 .addComponent(btnDir))
1083 .addPreferredGap(ComponentPlacement.RELATED)
1084 .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
1085 .addComponent(lblVideoFileNamepattern)
1086 .addComponent(fldFileNamePattern, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
1087 .addComponent(cbLocal))
1088 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))