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, GroupLayout.PREFERRED_SIZE)
608 .addPreferredGap(ComponentPlacement.RELATED)
609 .addComponent(pnlSearchComment, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
610 .addContainerGap(27, Short.MAX_VALUE))
613 tabbedPane.addTab("検索", pnlSearch);
615 final JButton btnOk = new JButton("保存");
616 btnOk.addActionListener(new ActionListener() {
619 public void actionPerformed(ActionEvent e) {
624 final JButton btnCancel = new JButton("取消");
625 btnCancel.addActionListener(new ActionListener() {
628 public void actionPerformed(ActionEvent e) {
632 final JPanel pnlButton = new JPanel();
634 final GroupLayout glButton = new GroupLayout(pnlButton);
635 pnlButton.setLayout(glButton);
636 glButton.setHorizontalGroup(glButton.createSequentialGroup()
637 .addPreferredGap(ComponentPlacement.UNRELATED, PREFERRED_SIZE, Short.MAX_VALUE)
639 .addPreferredGap(ComponentPlacement.UNRELATED)
640 .addComponent(btnCancel)
643 glButton.setVerticalGroup(glButton.createSequentialGroup()
644 .addGroup(glButton.createParallelGroup(Alignment.BASELINE)
646 .addComponent(btnCancel)
650 GroupLayout layout = new GroupLayout(getContentPane());
651 layout.setAutoCreateContainerGaps(true);
652 getContentPane().setLayout(layout);
653 layout.setHorizontalGroup(
654 layout.createParallelGroup(GroupLayout.Alignment.LEADING)
655 .addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 460, Short.MAX_VALUE)
656 .addComponent(pnlButton)
658 layout.setVerticalGroup(
659 layout.createSequentialGroup()
660 .addComponent(tabbedPane,GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
661 .addComponent(pnlButton)
664 final JLabel lblSystemThreadDownload = new JLabel("ダウンロードスレッド数");
665 final JLabel lblSystemWaitDownload = new JLabel("ダウンロード開始最小間隔(秒)");
666 final JLabel lblSystemThreadConvert = new JLabel("変換スレッド数");
667 final JLabel lblSystemTempDir = new JLabel("作業フォルダ");
668 final JButton btnSystemTempDir = new JButton("...");
669 btnSystemTempDir.addActionListener(
670 new FileChooseAction(ConfigDialog.this, JFileChooser.DIRECTORIES_ONLY, fldSystemTempDir));
672 final JPanel pnlSystemGeneral = new JPanel();
673 pnlSystemGeneral.setBorder(BorderFactory.createTitledBorder("システム"));
674 final GroupLayout glSystemGenegal = new GroupLayout(pnlSystemGeneral);
675 glSystemGenegal.setAutoCreateGaps(true);
676 glSystemGenegal.setAutoCreateContainerGaps(true);
677 pnlSystemGeneral.setLayout(glSystemGenegal);
679 glSystemGenegal.setHorizontalGroup(glSystemGenegal.createParallelGroup()
680 .addGroup(glSystemGenegal.createSequentialGroup()
681 .addGroup(glSystemGenegal.createParallelGroup()
682 .addComponent(lblSystemThreadDownload)
683 .addComponent(lblSystemWaitDownload)
684 .addComponent(lblSystemThreadConvert))
685 .addGroup(glSystemGenegal.createParallelGroup()
686 .addComponent(fldSystemThreadDownload, PREFERRED_SIZE, 40, PREFERRED_SIZE)
687 .addComponent(fldSystemWaitDownload, PREFERRED_SIZE, 40, PREFERRED_SIZE)
688 .addComponent(fldSystemThreadConvert, PREFERRED_SIZE, 40, PREFERRED_SIZE)
691 .addGroup(glSystemGenegal.createSequentialGroup()
692 .addComponent(lblSystemTempDir)
693 .addComponent(fldSystemTempDir, DEFAULT_SIZE, 400, Short.MAX_VALUE)
694 .addComponent(btnSystemTempDir)
698 glSystemGenegal.setVerticalGroup(glSystemGenegal.createSequentialGroup()
699 .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
700 .addComponent(lblSystemThreadDownload)
701 .addComponent(fldSystemThreadDownload, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE))
702 .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
703 .addComponent(lblSystemWaitDownload)
704 .addComponent(fldSystemWaitDownload, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE))
705 .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
706 .addComponent(lblSystemThreadConvert)
707 .addComponent(fldSystemThreadConvert, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE))
708 .addGroup(glSystemGenegal.createParallelGroup(Alignment.BASELINE)
709 .addComponent(lblSystemTempDir)
710 .addComponent(fldSystemTempDir, DEFAULT_SIZE, PREFERRED_SIZE, PREFERRED_SIZE)
711 .addComponent(btnSystemTempDir)
715 final JPanel pnlSystem = new JPanel();
716 pnlSystem.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
717 final GroupLayout glSystem = new GroupLayout(pnlSystem);
718 glSystem.setAutoCreateGaps(true);
719 glSystem.setAutoCreateContainerGaps(true);
720 pnlSystem.setLayout(glSystem);
722 glSystem.setHorizontalGroup(glSystem.createParallelGroup()
723 .addComponent(pnlSystemGeneral));
725 glSystem.setVerticalGroup(glSystem.createSequentialGroup()
726 .addComponent(pnlSystemGeneral));
728 tabbedPane.add("システム", pnlSystem);
731 setMinimumSize(getSize());
736 * @param args the command line arguments
738 public static void main(String args[]) {
739 /* Set the Nimbus look and feel */
740 /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
741 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
744 for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
745 if ("Nimbus".equals(info.getName())) {
746 UIManager.setLookAndFeel(info.getClassName());
750 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
751 java.util.logging.Logger.getLogger(ConfigDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
754 /* Create and display the form */
755 java.awt.EventQueue.invokeLater(new Runnable() {
759 new ConfigDialog().setVisible(true);
763 // Variables declaration - do not modify//GEN-BEGIN:variables
767 private final JTextField fldMail;
768 private final JTextField fldPassword;
770 private final JCheckBox cbProxyUse;
771 private final JTextField fldProxyHost;
772 private final JTextField fldProxyPort;
775 private final DownloadLocationPanel pnlFileVideo = new DownloadLocationPanel();
777 private final DownloadLocationPanel pnlFileComment = new DownloadLocationPanel();
779 private final JTextField fldOutputDir;
780 private final JTextField fldOutputFileNamePattern;
781 private final JButton btnOutputDir = new JButton("...");
782 private final JCheckBox cbOutputEnable;
783 private final JCheckBox cbOutputCommentOverlay;
784 private final JCheckBox cbOutputDisplayProgress;
786 private final JTextField fldReplaceFrom = new JTextField();
787 private final JTextField fldReplaceTo = new JTextField();
790 private final JCheckBox cbCommentSizeAuto;
791 private final JTextField fldCommentSizeManual;
792 private final JCheckBox cbCommentMinSizeAuto;
793 private final JTextField fldCommentMinSizeManual;
794 private final JCheckBox cbCommentDisplaySizeDefault;
795 private final JTextField fldCommentDisplaySizeManual;
797 private final JTextField fldFontPath;
798 private final JTextField fldFontIndex;
799 private final JComboBox<String> cmbFontShadow = new JComboBox<>();
800 private final JCheckBox cbFontSizeArrangeDisable;
801 private final JCheckBox cbCommentOpaque;
804 private final JTextField fldFfmpegPath;
805 private final JTextField fldFfmpegDllPath;
806 // ffmpeg - ffmpegパラメータ
807 private final FfmpegParamPanel pnlFfmpegParam = new FfmpegParamPanel();
810 private final NgRegisterPanel pnlNgWord = new NgRegisterPanel();
812 private final NgRegisterPanel pnlNgId = new NgRegisterPanel();
815 private final DirectoryRegisterPanel pnlSearchVideo = new DirectoryRegisterPanel();
817 private final DirectoryRegisterPanel pnlSearchComment = new DirectoryRegisterPanel();
819 private final JTextField fldSystemThreadDownload = new JTextField();
820 private final JTextField fldSystemWaitDownload = new JTextField();
821 private final JTextField fldSystemThreadConvert = new JTextField();
822 private final JTextField fldSystemTempDir = new JTextField();
825 // End of variables declaration//GEN-END:variables
827 private void loadConfig() {
828 final Config p = Config.INSTANCE;
833 fldMail.setText(p.getId());
834 fldPassword.setText(p.getPassword());
839 cbProxyUse.setSelected(p.getProxyUse());
840 fldProxyHost.setText(p.getProxyHost());
841 fldProxyPort.setText(p.getProxyPort());
846 pnlFileVideo.fldDir.setText(p.getVideoDir());
847 pnlFileVideo.fldFileNamePattern.setText(p.getVideoFileNamePattern());
848 pnlFileVideo.cbLocal.setSelected(p.getVideoUseLocal());
853 pnlFileComment.fldDir.setText(p.getCommentDir());
854 pnlFileComment.fldFileNamePattern.setText(p.getCommentFileNamePattern());
855 pnlFileComment.cbLocal.setSelected(p.getCommentUseLocal());
860 fldOutputDir.setText(p.getOutputDir());
861 fldOutputFileNamePattern.setText(p.getOutputFileNamePattern());
862 cbOutputEnable.setSelected(p.getOutputEnable());
863 cbOutputCommentOverlay.setSelected(p.getOutputCommentOverlay());
864 cbOutputDisplayProgress.setSelected(p.getOutputDisplayProgress());
869 fldReplaceFrom.setText(p.getReplaceFrom());
870 fldReplaceTo.setText(p.getReplaceTo());
875 cbCommentSizeAuto.setSelected(p.getCommentSizeAutosize());
876 fldCommentSizeManual.setText(p.getCommentSizeManual());
877 cbCommentMinSizeAuto.setSelected(p.getCommentMinSizeAutosize());
878 fldCommentSizeManual.setText(p.getCommentMinSizeManual());
879 cbCommentDisplaySizeDefault.setSelected(p.getCommentDisplaySizeDefault());
880 fldCommentDisplaySizeManual.setText(p.getCommentDisplaySizeManual());
885 fldFontPath.setText(p.getFontPath());
886 fldFontIndex.setText(p.getFontIndex());
887 cmbFontShadow.setSelectedIndex(p.getFontShadow());
888 cbFontSizeArrangeDisable.setSelected(p.getFontSizeArrangeDisable());
889 cbCommentOpaque.setSelected(p.getCommentOpaque());
894 fldFfmpegPath.setText(p.getFfmpegPath());
895 fldFfmpegDllPath.setText(p.getFfmpegDllPath());
898 * ffmpeg - ffmpegパラメータ
900 pnlFfmpegParam.init(p);
905 final List<String> ngWords = p.getNgWords();
906 pnlNgWord.init(ngWords);
907 final List<String> ngIds = p.getNgIds();
913 pnlSearchVideo.init(p.getSearchVideoDirs());
914 pnlSearchComment.init(p.getSearchCommentDirs());
919 fldSystemThreadDownload.setText(Integer.toString(p.getSystemDownloadThread()));
920 fldSystemWaitDownload.setText(Integer.toString(p.getSystemDownloadWait()));
921 fldSystemThreadConvert.setText(Integer.toString(p.getSystemConvertThread()));
922 fldSystemTempDir.setText(p.getSystemTempDir());
925 private void saveConfig() {
926 final Config p = Config.INSTANCE;
932 p.setId(fldMail.getText());
933 p.setPassword(fldPassword.getText());
938 p.setProxyUse(cbProxyUse.isSelected());
939 p.setProxyHost(fldProxyHost.getText());
940 p.setProxyPort(fldProxyPort.getText());
945 p.setVideoDir(pnlFileVideo.fldDir.getText());
946 p.setVideoFileNamePattern(pnlFileVideo.fldFileNamePattern.getText());
947 p.setVideoUseLocal(pnlFileVideo.cbLocal.isSelected());
952 p.setCommentDir(pnlFileComment.fldDir.getText());
953 p.setCommentFileNamePattern(pnlFileComment.fldFileNamePattern.getText());
954 p.setCommentUseLocal(pnlFileComment.cbLocal.isSelected());
959 p.setOutputDir(fldOutputDir.getText());
960 p.setOutputFileNamePattern(fldOutputFileNamePattern.getText());
961 p.setOutputEnable(cbOutputEnable.isSelected());
962 p.setOutputCommentOverlay(cbOutputCommentOverlay.isSelected());
963 p.setOutputDisplayProgress(cbOutputDisplayProgress.isSelected());
968 p.setReplaceFrom(fldReplaceFrom.getText());
969 p.setReplaceTo(fldReplaceTo.getText());
974 p.setCommentSizeAutosize(cbCommentSizeAuto.isSelected());
975 p.setCommentSizeManual(fldCommentSizeManual.getText());
976 p.setCommentMinSizeAutosize(cbCommentMinSizeAuto.isSelected());
977 p.setCommentMinSizeManual(fldCommentSizeManual.getText());
978 p.setCommentDisplaySizeDefault(cbCommentDisplaySizeDefault.isSelected());
979 p.setCommentDisplaySizeManual(fldCommentDisplaySizeManual.getText());
984 p.setFontPath(fldFontPath.getText());
985 p.setFontIndex(fldFontIndex.getText());
986 p.setFontShadow(cmbFontShadow.getSelectedIndex());
987 p.setFontSizeArrangeDisable(cbFontSizeArrangeDisable.isSelected());
988 p.setCommentOpaque(cbCommentOpaque.isSelected());
993 p.setFfmpegPath(fldFfmpegPath.getText());
994 p.setFfmpegDllPath(fldFfmpegDllPath.getText());
997 * ffmpeg - ffmpegパラメータ
999 final File fileFfmpegOption = pnlFfmpegParam.mdlFfmpegOption.getSelectedFile();
1000 p.setFfmpegOptionFile(fileFfmpegOption != null ? fileFfmpegOption.getPath() : null);
1001 p.setFfmpegExtension(pnlFfmpegParam.fldFfmpegOptionExtension.getText());
1002 p.setFfmpegMainOption(pnlFfmpegParam.fldFfmpegOptionMain.getText());
1003 p.setFfmpegInOption(pnlFfmpegParam.fldFfmpegOptionIn.getText());
1004 p.setFfmpegOutOption(pnlFfmpegParam.fldFfmpegOptionOut.getText());
1005 p.setFfmpegAvOption(pnlFfmpegParam.fldFfmpegOptionAv.getText());
1006 p.setFfmpegResizeEnable(pnlFfmpegParam.cbFfmpegOptionResize.isSelected());
1007 p.setFfmpegResizeWidth(pnlFfmpegParam.fldFfmpegOptionResizeWidth.getText());
1008 p.setFfmpegResizeHeight(pnlFfmpegParam.fldFfmpegOptionResizeHeight.getText());
1009 p.setFfmpegKeepAspect(pnlFfmpegParam.cbFfmpegOptionKeepAspect.isSelected());
1014 p.setNgWords(pnlNgWord.getAllElements());
1015 p.setNgIds(pnlNgId.getAllElements());
1020 p.setSearchVideoDirs(pnlSearchVideo.getAllElements());
1021 p.setSearchCommentDirs(pnlSearchComment.getAllElements());
1026 p.setSystemDownloadThread(Integer.parseInt(fldSystemThreadDownload.getText()));
1027 p.setSystemDownloadWait(Integer.parseInt(fldSystemWaitDownload.getText()));
1028 p.setSystemConvertThread(Integer.parseInt(fldSystemThreadConvert.getText()));
1029 p.setSystemTempDir(fldSystemTempDir.getText());
1033 } catch (ConfigurationException ex) {
1034 logger.log(Level.SEVERE, "コンフィグファイル保存に失敗", ex);
1039 class DownloadLocationPanel extends JPanel {
1040 final JTextField fldDir = new JTextField();
1041 final JTextField fldFileNamePattern = new JTextField();
1042 final JCheckBox cbLocal = new JCheckBox("local");
1044 DownloadLocationPanel(){
1047 final JLabel lblVideoDir = new JLabel("保存フォルダ");
1048 final JLabel lblVideoFileNamepattern = new JLabel("ファイル名規則");
1050 final JButton btnDir = new JButton("...");
1051 btnDir.addActionListener(
1052 new FileChooseAction(DownloadLocationPanel.this, JFileChooser.DIRECTORIES_ONLY, fldDir));
1054 final GroupLayout gl = new GroupLayout(this);
1056 gl.setHorizontalGroup(
1057 gl.createParallelGroup(GroupLayout.Alignment.LEADING)
1058 .addGroup(GroupLayout.Alignment.TRAILING, gl.createSequentialGroup()
1060 .addGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING)
1061 .addComponent(lblVideoFileNamepattern)
1062 .addComponent(lblVideoDir))
1063 .addPreferredGap(ComponentPlacement.RELATED)
1064 .addGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING)
1065 .addGroup(gl.createSequentialGroup()
1066 .addComponent(fldDir, GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
1067 .addPreferredGap(ComponentPlacement.RELATED)
1068 .addComponent(btnDir))
1069 .addGroup(GroupLayout.Alignment.TRAILING, gl.createSequentialGroup()
1070 .addComponent(fldFileNamePattern, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE)
1071 .addPreferredGap(ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
1072 .addComponent(cbLocal)))
1075 gl.setVerticalGroup(
1076 gl.createParallelGroup(GroupLayout.Alignment.LEADING)
1077 .addGroup(gl.createSequentialGroup()
1078 .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
1079 .addComponent(lblVideoDir)
1080 .addComponent(fldDir, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
1081 .addComponent(btnDir))
1082 .addPreferredGap(ComponentPlacement.RELATED)
1083 .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
1084 .addComponent(lblVideoFileNamepattern)
1085 .addComponent(fldFileNamePattern, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
1086 .addComponent(cbLocal))
1087 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))