いんきゅばす(仮称; 旧名: さきゅばすのNicoBrowser拡張版)
Révision | baf6bb4a00e3e2935993cd0c8c07fb61a3f10c64 (tree) |
---|---|
l'heure | 2011-05-28 03:44:06 |
Auteur | yuki <yuki@c066...> |
Commiter | yuki |
Merging revisions 378-423 of 20100515_frontend_testing
git-svn-id: http://192.168.11.7/svn/saccubus/trunk@424 c066991c-cf13-ec4a-a49a-846e61667af5
@@ -1,16 +1,10 @@ | ||
1 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
2 | -<html> | |
3 | -<head> | |
4 | - <meta content="text/html; charset=UTF-8" http-equiv="content-type"> | |
5 | - <title>README</title> | |
6 | -</head> | |
7 | -<body> | |
8 | -<p><iframe style="border-style: none;" marginheight="0" border="0" | |
9 | - src="http://rcm-jp.amazon.co.jp/e/cm?t=feather0e-22&o=9&p=15&l=st1&mode=toys-jp&search=%E5%88%9D%E9%9F%B3%E3%83%9F%E3%82%AF&fc1=000000&lt1=&lc1=3366FF&bg1=FFFFFF&f=ifr" | |
10 | - marginwidth="0" frameborder="0" height="240" scrolling="no" width="468"></iframe></p> | |
2 | +<html><head> | |
3 | + | |
4 | + <meta content="text/html; charset=UTF-8" http-equiv="content-type"><title>README</title></head><body> | |
5 | +<p><iframe style="border-style: none;" marginheight="0" border="0" src="http://rcm-jp.amazon.co.jp/e/cm?t=feather0e-22&o=9&p=15&l=st1&mode=toys-jp&search=%E5%88%9D%E9%9F%B3%E3%83%9F%E3%82%AF&fc1=000000&lt1=&lc1=3366FF&bg1=FFFFFF&f=ifr" marginwidth="0" frameborder="0" height="240" scrolling="no" width="468"></iframe></p> | |
11 | 6 | <h3>本プログラムについて</h3> |
12 | -<p>本プログラムは、<a | |
13 | - href="http://feather.cocolog-nifty.com/weblog/2009/11/nicobrowser---f.html">NicoBrowser</a>で | |
7 | +<p>本プログラムは、<a href="http://feather.cocolog-nifty.com/weblog/2009/11/nicobrowser---f.html">NicoBrowser</a>で | |
14 | 8 | ダウンロードしたコンテンツを<a href="http://saccubus.sourceforge.jp/">さきゅばす</a>ver.1.22r |
15 | 9 | に処理させることができるよう拡張したものです。</p> |
16 | 10 | <h3> 改正著作権法に関して留意事項<br> |
@@ -26,8 +20,7 @@ | ||
26 | 20 | <li>投稿者コメントのダウンロード、動画への付与。</li> |
27 | 21 | <li>公式動画(soで始まる動画)のコメントダウンロード、変換。</li> |
28 | 22 | <ul> |
29 | - <li>ただし、URLの入力には未対応。<a | |
30 | - href="http://www.nicovideo.jp/watch/so8900221">http://www.nicovideo.jp/watch/so8900221</a> | |
23 | + <li>ただし、URLの入力には未対応。<a href="http://www.nicovideo.jp/watch/so8900221">http://www.nicovideo.jp/watch/so8900221</a> | |
31 | 24 | でなく <a href="http://www.nicovideo.jp/watch/1259333700">http://www.nicovideo.jp/watch/1259333700</a> |
32 | 25 | と入力する必要がある。<br> |
33 | 26 | </li> |
@@ -55,8 +48,7 @@ | ||
55 | 48 | <p>また、Linuxで動作させる場合には、上記以外にSDL, SDL_ttf, SDL_gfxの導入が必要です。<br> |
56 | 49 | </p> |
57 | 50 | <p>NicoBrowser拡張機能を使用する場合、NicoBrowser ver.0.1.1以降がセットアップされている必要があります。</p> |
58 | -<p>Windows VistaやWindows7ではDEP機能によってffmpegが正常に動作しないようです。この場合は、<a | |
59 | - href="http://windows.microsoft.com/ja-JP/windows-vista/Change-Data-Execution-Prevention-settings">こ | |
51 | +<p>Windows VistaやWindows7ではDEP機能によってffmpegが正常に動作しないようです。この場合は、<a href="http://windows.microsoft.com/ja-JP/windows-vista/Change-Data-Execution-Prevention-settings">こ | |
60 | 52 | ちら</a>を参考にして、binディレクトリにあるffmpeg.exeをDEP対象から外して下さい。</p> |
61 | 53 | <p> </p> |
62 | 54 | <h3>本プログラムの導入方法</h3> |
@@ -69,25 +61,29 @@ | ||
69 | 61 | <p></p> |
70 | 62 | <p> </p> |
71 | 63 | <h3>拡張機能の使い方</h3> |
72 | -<p><a | |
73 | - href="http://feather.cocolog-nifty.com/weblog/WindowsLiveWriter/saccubus_frame.png"><img | |
74 | - style="border-width: 0px; display: inline;" title="saccubus_frame" | |
75 | - alt="saccubus_frame" | |
76 | - src="http://feather.cocolog-nifty.com/weblog/WindowsLiveWriter/saccubus_frame_thumb.png" | |
77 | - border="0" height="244" width="156"></a> </p> | |
64 | +<p><a href="http://feather.cocolog-nifty.com/weblog/WindowsLiveWriter/saccubus_frame.png"><img style="border-width: 0px; display: inline;" title="saccubus_frame" alt="saccubus_frame" src="http://feather.cocolog-nifty.com/weblog/WindowsLiveWriter/saccubus_frame_thumb.png" border="0" height="244" width="156"></a> </p> | |
78 | 65 | <p>さきゅばすを起動し、上図枠内のラジオボタン「NicoBrowserダウンロードファイルを用いる」をクリックし、<strong>テキスト |
79 | 66 | フィールドにファイルをドラッグ&ドロップ</strong>、あるいは直接入力する。</p> |
80 | 67 | <p> </p> |
81 | 68 | <h3>注意点</h3> |
82 | 69 | <ul> |
83 | - <li><a | |
84 | - href="http://feather.cocolog-nifty.com/weblog/2009/11/ipum---1377.html">ipum</a>やNicoBrowser | |
70 | + <li><a href="http://feather.cocolog-nifty.com/weblog/2009/11/ipum---1377.html">ipum</a>やNicoBrowser | |
85 | 71 | との同時起動は行えない。 </li> |
86 | 72 | <li>Windows Vistaや7ではさきゅばすの変換処理が進まない場合があるらしい。対処方法は前述「動作環境」を参照。</li> |
87 | 73 | </ul> |
88 | 74 | <p><br> |
89 | 75 | </p> |
90 | -<h3> 更新履歴</h3> | |
76 | +<h3>更新履歴</h3> | |
77 | +<p>2010/06/05 ver.1.4.4<br> | |
78 | +コンフィグロード時「入力コメント」タブの「コメント取得数は自動で調整する」チェックボックスとフォルダ/ファイル保存選択ラジオボタンの値を誤って読み込んでいた問題を修正。<br> | |
79 | +過去ログ取得URL変更に対応(ver.1.4.2と同様)。 | |
80 | +</p> | |
81 | +<p>2010/05/29 ver.1.4.3<br> | |
82 | +投稿者コメントを変換後削除するオプションが保存できていなかった問題の修正。<br> | |
83 | +ファイルチューザダイアログでファイル選択後、1階層上のディレクトリが選択されてしまう問題の修正。<br> | |
84 | +入力投稿者コメントタブ等のボタンが機能していなかった問題の修正。<br> | |
85 | +各入力ファイル(動画、コメント、投稿者コメント)を自動命名で同一ディレクトリに保存するように設定していた場合、正しくファイル命名できなかった問題を修正。これに伴い、投稿者コメントファイルの拡張子を.txmlにする。(コメントファイルと区別できるように) | |
86 | +</p> | |
91 | 87 | <p>2010/05/13 ver.1.4.2<br> |
92 | 88 | サービスのアクセスURL変更に対応。<br> |
93 | 89 | </p> |
@@ -140,5 +136,4 @@ UIの見直し。<br> | ||
140 | 136 | <p>2009/12/03 ver.0.0.0<br> |
141 | 137 | 初版<br> |
142 | 138 | </p> |
143 | -</body> | |
144 | -</html> | |
139 | +</body></html> | |
\ No newline at end of file |
@@ -0,0 +1,32 @@ | ||
1 | +-, MINUS, NO_MASK | |
2 | +^, CIRCUMFLEX, NO_MASK | |
3 | +@, AT, NO_MASK | |
4 | +[, OPEN_BRACKET, NO_MASK | |
5 | +;, SEMICOLON, NO_MASK | |
6 | +:, COLON, NO_MASK | |
7 | +], CLOSE_BRACKET, NO_MASK | |
8 | +COMMA, COMMA, NO_MASK | |
9 | +., PERIOD, NO_MASK | |
10 | +/, SLASH, NO_MASK | |
11 | +\, BACK_SLASH, NO_MASK | |
12 | +!, 1, SHIFT_MASK | |
13 | +", 2, SHIFT_MASK | |
14 | +#, 3, SHIFT_MASK | |
15 | +$, 4, SHIFT_MASK | |
16 | +%, 5, SHIFT_MASK | |
17 | +&, 6, SHIFT_MASK | |
18 | +', 7, SHIFT_MASK | |
19 | +(, 8, SHIFT_MASK | |
20 | +), 9, SHIFT_MASK | |
21 | +=, MINUS, SHIFT_MASK | |
22 | +~, CIRCUMFLEX, SHIFT_MASK | |
23 | +|, BACK_SLASH, SHIFT_MASK | |
24 | +`, AT, SHIFT_MASK | |
25 | +{, OPEN_BRACKET, SHIFT_MASK | |
26 | ++, SEMICOLON, SHIFT_MASK | |
27 | +*, COLON, SHIFT_MASK | |
28 | +}, CLOSE_BRACKET, SHIFT_MASK | |
29 | +<, COMMA, SHIFT_MASK | |
30 | +>, PERIOD, SHIFT_MASK | |
31 | +?, SLASH, SHIFT_MASK | |
32 | +_, BACK_SLASH, SHIFT_MASK |
@@ -22,6 +22,7 @@ dist.jar=${dist.dir}/Saccubus.jar | ||
22 | 22 | dist.javadoc.dir=${dist.dir}/javadoc |
23 | 23 | endorsed.classpath= |
24 | 24 | excludes= |
25 | +file.reference.jmockit.jar=F:\\data\\java\\jmockit-0.998\\jmockit.jar | |
25 | 26 | includes=** |
26 | 27 | jar.compress=false |
27 | 28 | javac.classpath=\ |
@@ -44,7 +45,9 @@ javac.target=1.5 | ||
44 | 45 | javac.test.classpath=\ |
45 | 46 | ${javac.classpath}:\ |
46 | 47 | ${build.classes.dir}:\ |
47 | - ${libs.junit_4.classpath} | |
48 | + ${libs.junit_4.classpath}:\ | |
49 | + ${libs.FEST-Swing.classpath}:\ | |
50 | + ${file.reference.jmockit.jar} | |
48 | 51 | javadoc.additionalparam= |
49 | 52 | javadoc.author=false |
50 | 53 | javadoc.encoding=${source.encoding} |
@@ -77,7 +77,7 @@ import yukihane.nicovideo.NicoDBFinder; | ||
77 | 77 | public class MainFrame extends JFrame { |
78 | 78 | |
79 | 79 | private static final long serialVersionUID = 2564486741331062989L; |
80 | - public static final String VERSION = "1.22r NicoBrowser拡張 1.4.2"; | |
80 | + public static final String VERSION = "1.22r NicoBrowser拡張 1.4.4"; | |
81 | 81 | public static final Image WinIcon = Toolkit.getDefaultToolkit().createImage(saccubus.MainFrame.class.getResource( |
82 | 82 | "icon32.png")); |
83 | 83 | // TODO GUIが無いためフィールドに保持. |
@@ -90,7 +90,7 @@ public class MainFrame extends JFrame { | ||
90 | 90 | JMenu jMenuHelp = new JMenu(); |
91 | 91 | JMenuItem jMenuHelpAbout = new JMenuItem(); |
92 | 92 | JLabel statusBar = new JLabel(); |
93 | - JTabbedPane MainTabbedPane = new JTabbedPane(); | |
93 | + JTabbedPane mainTabbedPane = new JTabbedPane(); | |
94 | 94 | JPanel SavingInfoTabPanel = new JPanel(); |
95 | 95 | JPanel FFMpegTabPanel = new JPanel(); |
96 | 96 | JPanel VideoInfoPanel = new JPanel(); |
@@ -101,16 +101,37 @@ public class MainFrame extends JFrame { | ||
101 | 101 | public static final String DoButtonWaitString = "待機"; |
102 | 102 | JPanel UserInfoPanel = new JPanel(); |
103 | 103 | GridBagLayout gridBagLayout3 = new GridBagLayout(); |
104 | - JLabel MailAddrLabel = new JLabel(); | |
105 | - JTextField MailAddrField = new JTextField(); | |
106 | - JLabel PasswordLabel = new JLabel(); | |
107 | - JPasswordField PasswordField = new JPasswordField(); | |
104 | + // ユーザ設定 | |
105 | + JLabel mailAddressLabel = new JLabel(); | |
106 | + JTextField mailAddressField = new JTextField(); | |
107 | + JLabel passwordLabel = new JLabel(); | |
108 | + JPasswordField passwordField = new JPasswordField(); | |
108 | 109 | GridBagLayout gridBagLayout4 = new GridBagLayout(); |
109 | 110 | GridBagLayout gridBagLayout6 = new GridBagLayout(); |
110 | 111 | ButtonGroup CommentSaveButtonGroup = new ButtonGroup(); |
111 | 112 | ButtonGroup ConvSaveButtonGroup = new ButtonGroup(); |
112 | 113 | |
114 | + private void setNames() { | |
115 | + mainTabbedPane.setName("mainTabbedPane"); | |
116 | + | |
117 | + mailAddressField.setName("mailAddressField"); | |
118 | + passwordField.setName("passwordField"); | |
119 | + | |
120 | + ffmpegPathField.setName("ffmpegPathField"); | |
121 | + vhookPathField.setName("vhookPathField"); | |
122 | + | |
123 | + mainOptionField.setName("mainOptionField"); | |
124 | + inputOptionField.setName("inputOptionField"); | |
125 | + outputOptionField.setName("outputOptionField"); | |
126 | + | |
127 | + fontPathField.setName("fontPathField"); | |
128 | + fontIndexField.setName("fontIndexField"); | |
129 | + showConvVideoCheckBox.setName("showConvVideoCheckBox"); | |
130 | + } | |
131 | + | |
113 | 132 | public MainFrame() { |
133 | + setNames(); | |
134 | + | |
114 | 135 | videoSaveInfoPanel = savePanel.getVideoSaveInfoPanel(); |
115 | 136 | |
116 | 137 | try { |
@@ -368,8 +389,8 @@ public class MainFrame extends JFrame { | ||
368 | 389 | SavingInfoTabPanel.setLayout(new GridLayout()); |
369 | 390 | UserInfoPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "ユーザ設定")); |
370 | 391 | UserInfoPanel.setLayout(gridBagLayout3); |
371 | - MailAddrLabel.setText("メールアドレス"); | |
372 | - PasswordLabel.setText("パスワード"); | |
392 | + mailAddressLabel.setText("メールアドレス"); | |
393 | + passwordLabel.setText("パスワード"); | |
373 | 394 | |
374 | 395 | setListenerToSavePanelButton(); |
375 | 396 |
@@ -395,10 +416,10 @@ public class MainFrame extends JFrame { | ||
395 | 416 | SettingFontPathButton.setText("参照"); |
396 | 417 | SettingFontPathButton.addActionListener(new MainFrame_SettingFontPathButton_actionAdapter( |
397 | 418 | this)); |
398 | - ShowConvVideoCheckBox.setText("変換中の画像を表示する"); | |
399 | - InLabel.setText("入力オプション"); | |
400 | - OutLabel.setText("出力オプション"); | |
401 | - MainOptionLabel.setText("メインオプション"); | |
419 | + showConvVideoCheckBox.setText("変換中の画像を表示する"); | |
420 | + inputOptionLabel.setText("入力オプション"); | |
421 | + outputOptionLabel.setText("出力オプション"); | |
422 | + mainOptionLabel.setText("メインオプション"); | |
402 | 423 | FontIndexLabel.setText("フォント番号"); |
403 | 424 | VideoID_Label.setText("URL/ID"); |
404 | 425 | WayBackLabel.setText("過去ログ"); |
@@ -412,40 +433,40 @@ public class MainFrame extends JFrame { | ||
412 | 433 | setJMenuBar(jMenuBar1); |
413 | 434 | |
414 | 435 | contentPane.add(statusBar, BorderLayout.SOUTH); |
415 | - contentPane.add(MainTabbedPane, java.awt.BorderLayout.CENTER); | |
436 | + contentPane.add(mainTabbedPane, java.awt.BorderLayout.CENTER); | |
416 | 437 | contentPane.add(VideoInfoPanel, java.awt.BorderLayout.NORTH); |
417 | - UserInfoPanel.add(PasswordField, new GridBagConstraints(1, 1, 1, 1, | |
438 | + UserInfoPanel.add(passwordField, new GridBagConstraints(1, 1, 1, 1, | |
418 | 439 | 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, |
419 | 440 | new Insets(0, 5, 5, 5), 0, 0)); |
420 | - UserInfoPanel.add(MailAddrField, new GridBagConstraints(1, 0, 1, 1, | |
441 | + UserInfoPanel.add(mailAddressField, new GridBagConstraints(1, 0, 1, 1, | |
421 | 442 | 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, |
422 | 443 | new Insets(0, 5, 5, 5), 0, 0)); |
423 | - UserInfoPanel.add(PasswordLabel, new GridBagConstraints(0, 1, 1, 1, | |
444 | + UserInfoPanel.add(passwordLabel, new GridBagConstraints(0, 1, 1, 1, | |
424 | 445 | 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, |
425 | 446 | new Insets(0, 5, 5, 0), 0, 0)); |
426 | - UserInfoPanel.add(MailAddrLabel, new GridBagConstraints(0, 0, 1, 1, | |
447 | + UserInfoPanel.add(mailAddressLabel, new GridBagConstraints(0, 0, 1, 1, | |
427 | 448 | 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, |
428 | 449 | new Insets(0, 5, 5, 0), 0, 0)); |
429 | - PathSettingPanel.add(FFmpegPathField, new GridBagConstraints(0, 1, 1, | |
450 | + PathSettingPanel.add(ffmpegPathField, new GridBagConstraints(0, 1, 1, | |
430 | 451 | 1, 1.0, 0.0, GridBagConstraints.CENTER, |
431 | 452 | GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 0)); |
432 | 453 | PathSettingPanel.add(SettingFFmpegPathButton, gridBagConstraints74); |
433 | 454 | PathSettingPanel.add(FFmpegPathLabel, new GridBagConstraints(0, 0, 2, |
434 | 455 | 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, |
435 | 456 | new Insets(0, 5, 5, 5), 0, 0)); |
436 | - PathSettingPanel.add(VhookPathField, new GridBagConstraints(0, 3, 1, 1, | |
457 | + PathSettingPanel.add(vhookPathField, new GridBagConstraints(0, 3, 1, 1, | |
437 | 458 | 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, |
438 | 459 | new Insets(0, 5, 5, 5), 0, 0)); |
439 | 460 | PathSettingPanel.add(SettingVhookPathButton, new GridBagConstraints(1, |
440 | 461 | 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, |
441 | 462 | GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); |
442 | 463 | PathSettingPanel.add(VhookPathLabel, gridBagConstraints54); |
443 | - FFmpegSettingPanel.add(CommandLineOutOptionField, gridBagConstraints53); | |
444 | - FFmpegSettingPanel.add(CommandLineInOptionField, gridBagConstraints52); | |
445 | - FFmpegSettingPanel.add(MainOptionField, gridBagConstraints51); | |
446 | - FFmpegSettingPanel.add(MainOptionLabel, gridBagConstraints48); | |
447 | - FFmpegSettingPanel.add(InLabel, gridBagConstraints49); | |
448 | - FFmpegSettingPanel.add(OutLabel, gridBagConstraints50); | |
464 | + FFmpegSettingPanel.add(outputOptionField, gridBagConstraints53); | |
465 | + FFmpegSettingPanel.add(inputOptionField, gridBagConstraints52); | |
466 | + FFmpegSettingPanel.add(mainOptionField, gridBagConstraints51); | |
467 | + FFmpegSettingPanel.add(mainOptionLabel, gridBagConstraints48); | |
468 | + FFmpegSettingPanel.add(inputOptionLabel, gridBagConstraints49); | |
469 | + FFmpegSettingPanel.add(outputOptionLabel, gridBagConstraints50); | |
449 | 470 | FFmpegSettingPanel.add(getFFmpegOptionComboBoxPanel(), |
450 | 471 | gridBagConstraints55); |
451 | 472 | FFmpegSettingPanel.add(ExtOptionLabel, gridBagConstraints56); |
@@ -459,17 +480,17 @@ public class MainFrame extends JFrame { | ||
459 | 480 | OpPanel.add(WayBackLabel, gridBagConstraints69); |
460 | 481 | OpPanel.add(WayBackField, gridBagConstraints70); |
461 | 482 | |
462 | - MainTabbedPane.add(BasicInfoTabPanel, "基本設定"); | |
463 | - MainTabbedPane.add(SavingInfoTabPanel, "保存設定"); | |
464 | - MainTabbedPane.add(FFMpegTabPanel, "動画設定"); | |
465 | - MainTabbedPane.addTab("変換設定", null, getConvertingSettingPanel(), null); | |
483 | + mainTabbedPane.add(BasicInfoTabPanel, "基本設定"); | |
484 | + mainTabbedPane.add(SavingInfoTabPanel, "保存設定"); | |
485 | + mainTabbedPane.add(FFMpegTabPanel, "動画設定"); | |
486 | + mainTabbedPane.addTab("変換設定", null, getConvertingSettingPanel(), null); | |
466 | 487 | SavingInfoTabPanel.add(savePanel); |
467 | 488 | BasicInfoTabPanel.add(UserInfoPanel, gridBagConstraints7); |
468 | 489 | BasicInfoTabPanel.add(getProxyInfoPanel(), gridBagConstraints6); |
469 | 490 | VhookSettingPanel.add(FontPathLabel, gridBagConstraints59); |
470 | - VhookSettingPanel.add(ShowConvVideoCheckBox, gridBagConstraints63); | |
471 | - VhookSettingPanel.add(FontPathField, gridBagConstraints60); | |
472 | - VhookSettingPanel.add(FontIndexField, gridBagConstraints62); | |
491 | + VhookSettingPanel.add(showConvVideoCheckBox, gridBagConstraints63); | |
492 | + VhookSettingPanel.add(fontPathField, gridBagConstraints60); | |
493 | + VhookSettingPanel.add(fontIndexField, gridBagConstraints62); | |
473 | 494 | VhookSettingPanel.add(FontIndexLabel, gridBagConstraints61); |
474 | 495 | VhookSettingPanel.add(SettingFontPathButton, gridBagConstraints64); |
475 | 496 | VhookSettingPanel.add(getFixFontSizeCheckBox(), gridBagConstraints14); |
@@ -511,12 +532,12 @@ public class MainFrame extends JFrame { | ||
511 | 532 | } |
512 | 533 | |
513 | 534 | private void setPopup() { |
514 | - MainOptionField.addMouseListener(new PopupRightClick( | |
515 | - this.MainOptionField)); | |
516 | - CommandLineInOptionField.addMouseListener(new PopupRightClick( | |
517 | - this.CommandLineInOptionField)); | |
518 | - CommandLineOutOptionField.addMouseListener(new PopupRightClick( | |
519 | - this.CommandLineOutOptionField)); | |
535 | + mainOptionField.addMouseListener(new PopupRightClick( | |
536 | + this.mainOptionField)); | |
537 | + inputOptionField.addMouseListener(new PopupRightClick( | |
538 | + this.inputOptionField)); | |
539 | + outputOptionField.addMouseListener(new PopupRightClick( | |
540 | + this.outputOptionField)); | |
520 | 541 | savePanel.getCommentNumField().addMouseListener(new PopupRightClick( |
521 | 542 | savePanel.getCommentNumField())); |
522 | 543 |
@@ -537,27 +558,27 @@ public class MainFrame extends JFrame { | ||
537 | 558 | videoSaveInfoPanel.getNibrFileField().addMouseListener( |
538 | 559 | new PopupRightClick(videoSaveInfoPanel.getNibrFileField())); |
539 | 560 | |
540 | - FFmpegPathField.addMouseListener(new PopupRightClick( | |
541 | - this.FFmpegPathField)); | |
542 | - VhookPathField.addMouseListener(new PopupRightClick(this.VhookPathField)); | |
561 | + ffmpegPathField.addMouseListener(new PopupRightClick( | |
562 | + this.ffmpegPathField)); | |
563 | + vhookPathField.addMouseListener(new PopupRightClick(this.vhookPathField)); | |
543 | 564 | VideoID_TextField.addMouseListener(new PopupRightClick( |
544 | 565 | this.VideoID_TextField)); |
545 | - ViewCommentField.addMouseListener(new PopupRightClick( | |
546 | - this.ViewCommentField)); | |
547 | - FontPathField.addMouseListener(new PopupRightClick(this.FontPathField)); | |
548 | - MailAddrField.addMouseListener(new PopupRightClick(this.MailAddrField)); | |
549 | - PasswordField.addMouseListener(new PopupRightClick(this.PasswordField)); | |
566 | + viewCommentField.addMouseListener(new PopupRightClick( | |
567 | + this.viewCommentField)); | |
568 | + fontPathField.addMouseListener(new PopupRightClick(this.fontPathField)); | |
569 | + mailAddressField.addMouseListener(new PopupRightClick(this.mailAddressField)); | |
570 | + passwordField.addMouseListener(new PopupRightClick(this.passwordField)); | |
550 | 571 | WayBackField.addMouseListener(new PopupRightClick(this.WayBackField)); |
551 | 572 | |
552 | - ProxyTextField.addMouseListener(new PopupRightClick(this.ProxyTextField)); | |
553 | - ProxyPortTextField.addMouseListener(new PopupRightClick( | |
554 | - this.ProxyPortTextField)); | |
573 | + proxyTextField.addMouseListener(new PopupRightClick(this.proxyTextField)); | |
574 | + proxyPortTextField.addMouseListener(new PopupRightClick( | |
575 | + this.proxyPortTextField)); | |
555 | 576 | |
556 | - FontIndexField.addMouseListener(new PopupRightClick(this.FontIndexField)); | |
577 | + fontIndexField.addMouseListener(new PopupRightClick(this.fontIndexField)); | |
557 | 578 | |
558 | - NGWordTextField.addMouseListener(new PopupRightClick( | |
559 | - this.NGWordTextField)); | |
560 | - NGIDTextField.addMouseListener(new PopupRightClick(this.NGIDTextField)); | |
579 | + ngWordTextField.addMouseListener(new PopupRightClick( | |
580 | + this.ngWordTextField)); | |
581 | + ngIdTextField.addMouseListener(new PopupRightClick(this.ngIdTextField)); | |
561 | 582 | } |
562 | 583 | |
563 | 584 | private void setDropTarget() { |
@@ -571,9 +592,9 @@ public class MainFrame extends JFrame { | ||
571 | 592 | addTarget(savePanel.getConvertedVideoSavedFileField(), false); |
572 | 593 | addTarget(savePanel.getConvertedVideoSavedFolderField(), true); |
573 | 594 | |
574 | - addTarget(FFmpegPathField, false); | |
575 | - addTarget(VhookPathField, false); | |
576 | - addTarget(FontPathField, false); | |
595 | + addTarget(ffmpegPathField, false); | |
596 | + addTarget(vhookPathField, false); | |
597 | + addTarget(fontPathField, false); | |
577 | 598 | |
578 | 599 | } |
579 | 600 |
@@ -588,23 +609,22 @@ public class MainFrame extends JFrame { | ||
588 | 609 | c, isDir), true); |
589 | 610 | } |
590 | 611 | private File CurrentDir = new File("."); |
591 | - JPanel PathSettingPanel = new JPanel(); | |
592 | - JLabel FFmpegPathLabel = new JLabel(); | |
593 | - GridBagLayout gridBagLayout7 = new GridBagLayout(); | |
594 | - JTextField FFmpegPathField = new JTextField(); | |
595 | - JButton SettingFFmpegPathButton = new JButton(); | |
596 | - JLabel VhookPathLabel = new JLabel(); | |
597 | - JTextField VhookPathField = new JTextField(); | |
598 | - JButton SettingVhookPathButton = new JButton(); | |
599 | - JPanel VhookSettingPanel = new JPanel(); | |
600 | - GridBagLayout gridBagLayout8 = new GridBagLayout(); | |
601 | - JPanel FFmpegSettingPanel = new JPanel(); | |
602 | - GridBagLayout gridBagLayout9 = new GridBagLayout(); | |
603 | - JLabel FontPathLabel = new JLabel(); | |
604 | - JTextField FontPathField = new JTextField(); | |
605 | - JButton SettingFontPathButton = new JButton(); | |
606 | - JCheckBox ShowConvVideoCheckBox = new JCheckBox(); | |
607 | - JTextField CommandLineOutOptionField = new JTextField(); | |
612 | + private JPanel PathSettingPanel = new JPanel(); | |
613 | + private JLabel FFmpegPathLabel = new JLabel(); | |
614 | + private GridBagLayout gridBagLayout7 = new GridBagLayout(); | |
615 | + private JTextField ffmpegPathField = new JTextField(); | |
616 | + private JButton SettingFFmpegPathButton = new JButton(); | |
617 | + private JLabel VhookPathLabel = new JLabel(); | |
618 | + private JTextField vhookPathField = new JTextField(); | |
619 | + private JButton SettingVhookPathButton = new JButton(); | |
620 | + private JPanel VhookSettingPanel = new JPanel(); | |
621 | + private GridBagLayout gridBagLayout8 = new GridBagLayout(); | |
622 | + private JPanel FFmpegSettingPanel = new JPanel(); | |
623 | + private GridBagLayout gridBagLayout9 = new GridBagLayout(); | |
624 | + private JLabel FontPathLabel = new JLabel(); | |
625 | + private JTextField fontPathField = new JTextField(); | |
626 | + private JButton SettingFontPathButton = new JButton(); | |
627 | + private JCheckBox showConvVideoCheckBox = new JCheckBox(); | |
608 | 628 | |
609 | 629 | private void showSaveDialog(String title, JTextField field, boolean isSave, |
610 | 630 | boolean isDir) { |
@@ -621,7 +641,7 @@ public class MainFrame extends JFrame { | ||
621 | 641 | } |
622 | 642 | if (code == JFileChooser.APPROVE_OPTION) { |
623 | 643 | if (isDir) { |
624 | - CurrentDir = chooser.getCurrentDirectory(); | |
644 | + CurrentDir = chooser.getSelectedFile(); | |
625 | 645 | field.setText(CurrentDir.getAbsolutePath()); |
626 | 646 | } else { |
627 | 647 | File selected = chooser.getSelectedFile(); |
@@ -651,16 +671,16 @@ public class MainFrame extends JFrame { | ||
651 | 671 | // 基本設定 |
652 | 672 | final BasicSetting basic = setting.getBasicSetting(); |
653 | 673 | tempDir = basic.getTempDir(); |
654 | - MailAddrField.setText(basic.getUser().getMail()); | |
655 | - PasswordField.setText(basic.getUser().getPassword()); | |
674 | + mailAddressField.setText(basic.getUser().getMail()); | |
675 | + passwordField.setText(basic.getUser().getPassword()); | |
656 | 676 | // プロキシ関連 |
657 | - UseProxyCheckBox.setSelected(basic.isProxyUse()); | |
658 | - ProxyTextField.setText(basic.getProxyHost()); | |
677 | + useProxyCheckBox.setSelected(basic.isProxyUse()); | |
678 | + proxyTextField.setText(basic.getProxyHost()); | |
659 | 679 | int proxy_port = basic.getProxyPort(); |
660 | 680 | if (proxy_port >= 0 && proxy_port <= 65535) { |
661 | - ProxyPortTextField.setText(Integer.toString(proxy_port)); | |
681 | + proxyPortTextField.setText(Integer.toString(proxy_port)); | |
662 | 682 | } else { |
663 | - ProxyPortTextField.setText(""); | |
683 | + proxyPortTextField.setText(""); | |
664 | 684 | } |
665 | 685 | |
666 | 686 | // 保存設定 - 入力動画 |
@@ -722,26 +742,26 @@ public class MainFrame extends JFrame { | ||
722 | 742 | |
723 | 743 | // 動画設定 |
724 | 744 | final MovieSetting movie = setting.getMovieSetting(); |
725 | - FFmpegPathField.setText(movie.getFfmpeg().toString()); | |
726 | - VhookPathField.setText(movie.getVhook().toString()); | |
727 | - ExtOptionField.setText(movie.getFfmpegOption().getExtOption()); | |
728 | - MainOptionField.setText(movie.getFfmpegOption().getMainOption()); | |
729 | - CommandLineOutOptionField.setText(movie.getFfmpegOption().getOutOption()); | |
730 | - CommandLineInOptionField.setText(movie.getFfmpegOption().getInOption()); | |
745 | + ffmpegPathField.setText(movie.getFfmpeg().toString()); | |
746 | + vhookPathField.setText(movie.getVhook().toString()); | |
747 | + extOptionField.setText(movie.getFfmpegOption().getExtOption()); | |
748 | + mainOptionField.setText(movie.getFfmpegOption().getMainOption()); | |
749 | + outputOptionField.setText(movie.getFfmpegOption().getOutOption()); | |
750 | + inputOptionField.setText(movie.getFfmpegOption().getInOption()); | |
731 | 751 | FFmpegOptionModel.reload(movie.getOptionFile()); |
732 | 752 | |
733 | 753 | // 変換設定 |
734 | 754 | final ConvertSetting conv = setting.getConvertSetting(); |
735 | - NotUseVhookCheckBox.setSelected(conv.isVhookDisabled()); | |
736 | - ViewCommentField.setText(Integer.toString(conv.getMaxNumOfComment())); | |
737 | - FontPathField.setText(conv.getFont().toString()); | |
738 | - FontIndexField.setText(Integer.toString(conv.getFontIndex())); | |
739 | - ShadowComboBox.setSelectedIndex(conv.getShadowIndex()); | |
740 | - ShowConvVideoCheckBox.setSelected(conv.isShowConverting()); | |
741 | - FixFontSizeCheckBox.setSelected(conv.isSelfAdjustFontSize()); | |
742 | - OpaqueCommentCheckBox.setSelected(conv.isCommentOpaque()); | |
743 | - NGWordTextField.setText(conv.getNgSetting().getWord()); | |
744 | - NGIDTextField.setText(conv.getNgSetting().getId()); | |
755 | + disableVhookCheckBox.setSelected(conv.isVhookDisabled()); | |
756 | + viewCommentField.setText(Integer.toString(conv.getMaxNumOfComment())); | |
757 | + fontPathField.setText(conv.getFont().toString()); | |
758 | + fontIndexField.setText(Integer.toString(conv.getFontIndex())); | |
759 | + shadowComboBox.setSelectedIndex(conv.getShadowIndex()); | |
760 | + showConvVideoCheckBox.setSelected(conv.isShowConverting()); | |
761 | + fixFontSizeCheckBox.setSelected(conv.isSelfAdjustFontSize()); | |
762 | + opaqueCommentCheckBox.setSelected(conv.isCommentOpaque()); | |
763 | + ngWordTextField.setText(conv.getNgSetting().getWord()); | |
764 | + ngIdTextField.setText(conv.getNgSetting().getId()); | |
745 | 765 | } |
746 | 766 | |
747 | 767 | /** |
@@ -770,38 +790,38 @@ public class MainFrame extends JFrame { | ||
770 | 790 | } |
771 | 791 | |
772 | 792 | /* 変換・保存する */ |
773 | - Converter Converter = null; | |
774 | - JTextField CommandLineInOptionField = new JTextField(); | |
775 | - JLabel InLabel = new JLabel(); | |
776 | - JLabel OutLabel = new JLabel(); | |
777 | - JLabel MainOptionLabel = new JLabel(); | |
778 | - JTextField MainOptionField = new JTextField(); | |
779 | - JLabel FontIndexLabel = new JLabel(); | |
780 | - JTextField FontIndexField = new JTextField(); | |
781 | - JLabel VideoID_Label = new JLabel(); | |
782 | - JLabel WayBackLabel = new JLabel(); | |
783 | - JTextField WayBackField = new JTextField(); | |
784 | - GridBagLayout gridBagLayout10 = new GridBagLayout(); | |
785 | - GridBagLayout gridBagLayout11 = new GridBagLayout(); | |
786 | - GridBagLayout gridBagLayout1 = new GridBagLayout(); | |
787 | - JPanel OpPanel = new JPanel(); | |
788 | - GridLayout gridLayout1 = new GridLayout(); | |
789 | - JPanel BasicInfoTabPanel = new JPanel(); | |
790 | - GridBagLayout gridBagLayout12 = new GridBagLayout(); | |
793 | + private Converter Converter = null; | |
794 | + private JLabel inputOptionLabel = new JLabel(); | |
795 | + private JTextField inputOptionField = new JTextField(); | |
796 | + private JLabel outputOptionLabel = new JLabel(); | |
797 | + private JTextField outputOptionField = new JTextField(); | |
798 | + private JLabel mainOptionLabel = new JLabel(); | |
799 | + private JTextField mainOptionField = new JTextField(); | |
800 | + private JLabel FontIndexLabel = new JLabel(); | |
801 | + private JTextField fontIndexField = new JTextField(); | |
802 | + private JLabel VideoID_Label = new JLabel(); | |
803 | + private JLabel WayBackLabel = new JLabel(); | |
804 | + private JTextField WayBackField = new JTextField(); | |
805 | + private GridBagLayout gridBagLayout1 = new GridBagLayout(); | |
806 | + private JPanel OpPanel = new JPanel(); | |
807 | + private JPanel BasicInfoTabPanel = new JPanel(); | |
808 | + private GridBagLayout gridBagLayout12 = new GridBagLayout(); | |
791 | 809 | private JPanel ConvertingSettingPanel = null; |
792 | 810 | private JPanel NGWordSettingPanel = null; |
793 | 811 | private JLabel NGWordLavel = null; |
794 | - private JTextField NGWordTextField = null; | |
812 | + private JTextField ngWordTextField = null; | |
795 | 813 | private JLabel NGIDLabel = null; |
796 | - private JTextField NGIDTextField = null; | |
814 | + private JTextField ngIdTextField = null; | |
815 | + // プロキシ設定 | |
797 | 816 | private JPanel ProxyInfoPanel = null; |
798 | - private JLabel ProxyLabel = null; | |
799 | - private JTextField ProxyTextField = null; | |
800 | - private JLabel ProxyPortLabel = null; | |
801 | - private JTextField ProxyPortTextField = null; | |
802 | - private JCheckBox UseProxyCheckBox = null; | |
803 | - private JCheckBox FixFontSizeCheckBox = null; | |
804 | - private JCheckBox OpaqueCommentCheckBox = null; | |
817 | + private JCheckBox useProxyCheckBox = null; | |
818 | + private JLabel proxyLabel = null; | |
819 | + private JTextField proxyTextField = null; | |
820 | + private JLabel proxyPortLabel = null; | |
821 | + private JTextField proxyPortTextField = null; | |
822 | + // | |
823 | + private JCheckBox fixFontSizeCheckBox = null; | |
824 | + private JCheckBox opaqueCommentCheckBox = null; | |
805 | 825 | private final SavePanel savePanel = new SavePanel(); |
806 | 826 | private final VideoSaveInfoPanel videoSaveInfoPanel; |
807 | 827 | private JComboBox FFmpegOptionComboBox = null; |
@@ -889,15 +909,15 @@ public class MainFrame extends JFrame { | ||
889 | 909 | |
890 | 910 | /* FFmpegへのパス */ |
891 | 911 | public void SettingFFmpegPathButton_actionPerformed(ActionEvent e) { |
892 | - showSaveDialog("FFmpegへのパス", FFmpegPathField, false, false); | |
912 | + showSaveDialog("FFmpegへのパス", ffmpegPathField, false, false); | |
893 | 913 | } |
894 | 914 | |
895 | 915 | public void SettingVhookPathButton_actionPerformed(ActionEvent e) { |
896 | - showSaveDialog("拡張vhookライブラリへのパス", VhookPathField, false, false); | |
916 | + showSaveDialog("拡張vhookライブラリへのパス", vhookPathField, false, false); | |
897 | 917 | } |
898 | 918 | |
899 | 919 | public void SettingFontPathButton_actionPerformed(ActionEvent e) { |
900 | - showSaveDialog("フォントへのパス", FontPathField, false, false); | |
920 | + showSaveDialog("フォントへのパス", fontPathField, false, false); | |
901 | 921 | } |
902 | 922 | |
903 | 923 | public void this_windowClosing(WindowEvent e) { |
@@ -985,10 +1005,11 @@ public class MainFrame extends JFrame { | ||
985 | 1005 | * @return javax.swing.JTextField |
986 | 1006 | */ |
987 | 1007 | private JTextField getNGWordTextField() { |
988 | - if (NGWordTextField == null) { | |
989 | - NGWordTextField = new JTextField(); | |
1008 | + if (ngWordTextField == null) { | |
1009 | + ngWordTextField = new JTextField(); | |
1010 | + ngWordTextField.setName("ngWordTextField"); | |
990 | 1011 | } |
991 | - return NGWordTextField; | |
1012 | + return ngWordTextField; | |
992 | 1013 | } |
993 | 1014 | |
994 | 1015 | /** |
@@ -997,10 +1018,11 @@ public class MainFrame extends JFrame { | ||
997 | 1018 | * @return javax.swing.JTextField |
998 | 1019 | */ |
999 | 1020 | private JTextField getNGIDTextField() { |
1000 | - if (NGIDTextField == null) { | |
1001 | - NGIDTextField = new JTextField(); | |
1021 | + if (ngIdTextField == null) { | |
1022 | + ngIdTextField = new JTextField(); | |
1023 | + ngIdTextField.setName("ngIdTextField"); | |
1002 | 1024 | } |
1003 | - return NGIDTextField; | |
1025 | + return ngIdTextField; | |
1004 | 1026 | } |
1005 | 1027 | |
1006 | 1028 | /** |
@@ -1027,8 +1049,8 @@ public class MainFrame extends JFrame { | ||
1027 | 1049 | gridBagConstraints10.gridx = 0; |
1028 | 1050 | gridBagConstraints10.insets = new Insets(5, 5, 5, 5); |
1029 | 1051 | gridBagConstraints10.gridy = 2; |
1030 | - ProxyPortLabel = new JLabel(); | |
1031 | - ProxyPortLabel.setText("ポート番号"); | |
1052 | + proxyPortLabel = new JLabel(); | |
1053 | + proxyPortLabel.setText("ポート番号"); | |
1032 | 1054 | GridBagConstraints gridBagConstraints9 = new GridBagConstraints(); |
1033 | 1055 | gridBagConstraints9.fill = GridBagConstraints.BOTH; |
1034 | 1056 | gridBagConstraints9.gridy = 1; |
@@ -1041,15 +1063,15 @@ public class MainFrame extends JFrame { | ||
1041 | 1063 | gridBagConstraints8.fill = GridBagConstraints.NONE; |
1042 | 1064 | gridBagConstraints8.anchor = GridBagConstraints.EAST; |
1043 | 1065 | gridBagConstraints8.gridy = 1; |
1044 | - ProxyLabel = new JLabel(); | |
1045 | - ProxyLabel.setText("プロキシ"); | |
1066 | + proxyLabel = new JLabel(); | |
1067 | + proxyLabel.setText("プロキシ"); | |
1046 | 1068 | ProxyInfoPanel = new JPanel(); |
1047 | 1069 | ProxyInfoPanel.setLayout(new GridBagLayout()); |
1048 | 1070 | ProxyInfoPanel.setBorder(BorderFactory.createTitledBorder(null, |
1049 | 1071 | "プロキシ設定")); |
1050 | - ProxyInfoPanel.add(ProxyLabel, gridBagConstraints8); | |
1072 | + ProxyInfoPanel.add(proxyLabel, gridBagConstraints8); | |
1051 | 1073 | ProxyInfoPanel.add(getProxyTextField(), gridBagConstraints9); |
1052 | - ProxyInfoPanel.add(ProxyPortLabel, gridBagConstraints10); | |
1074 | + ProxyInfoPanel.add(proxyPortLabel, gridBagConstraints10); | |
1053 | 1075 | ProxyInfoPanel.add(getProxyPortTextField(), gridBagConstraints12); |
1054 | 1076 | ProxyInfoPanel.add(getUseProxyCheckBox(), gridBagConstraints13); |
1055 | 1077 | } |
@@ -1062,10 +1084,11 @@ public class MainFrame extends JFrame { | ||
1062 | 1084 | * @return javax.swing.JTextField |
1063 | 1085 | */ |
1064 | 1086 | private JTextField getProxyTextField() { |
1065 | - if (ProxyTextField == null) { | |
1066 | - ProxyTextField = new JTextField(); | |
1087 | + if (proxyTextField == null) { | |
1088 | + proxyTextField = new JTextField(); | |
1089 | + proxyTextField.setName("proxyTextField"); | |
1067 | 1090 | } |
1068 | - return ProxyTextField; | |
1091 | + return proxyTextField; | |
1069 | 1092 | } |
1070 | 1093 | |
1071 | 1094 | /** |
@@ -1074,10 +1097,11 @@ public class MainFrame extends JFrame { | ||
1074 | 1097 | * @return javax.swing.JTextField |
1075 | 1098 | */ |
1076 | 1099 | private JTextField getProxyPortTextField() { |
1077 | - if (ProxyPortTextField == null) { | |
1078 | - ProxyPortTextField = new JTextField(); | |
1100 | + if (proxyPortTextField == null) { | |
1101 | + proxyPortTextField = new JTextField(); | |
1102 | + proxyPortTextField.setName("proxyPortTextField"); | |
1079 | 1103 | } |
1080 | - return ProxyPortTextField; | |
1104 | + return proxyPortTextField; | |
1081 | 1105 | } |
1082 | 1106 | |
1083 | 1107 | /** |
@@ -1086,11 +1110,12 @@ public class MainFrame extends JFrame { | ||
1086 | 1110 | * @return javax.swing.JCheckBox |
1087 | 1111 | */ |
1088 | 1112 | private JCheckBox getUseProxyCheckBox() { |
1089 | - if (UseProxyCheckBox == null) { | |
1090 | - UseProxyCheckBox = new JCheckBox(); | |
1091 | - UseProxyCheckBox.setText("プロキシを使う"); | |
1113 | + if (useProxyCheckBox == null) { | |
1114 | + useProxyCheckBox = new JCheckBox(); | |
1115 | + useProxyCheckBox.setText("プロキシを使う"); | |
1116 | + useProxyCheckBox.setName("useProxyCheckBox"); | |
1092 | 1117 | } |
1093 | - return UseProxyCheckBox; | |
1118 | + return useProxyCheckBox; | |
1094 | 1119 | } |
1095 | 1120 | |
1096 | 1121 | /** |
@@ -1099,11 +1124,12 @@ public class MainFrame extends JFrame { | ||
1099 | 1124 | * @return javax.swing.JCheckBox |
1100 | 1125 | */ |
1101 | 1126 | private JCheckBox getFixFontSizeCheckBox() { |
1102 | - if (FixFontSizeCheckBox == null) { | |
1103 | - FixFontSizeCheckBox = new JCheckBox(); | |
1104 | - FixFontSizeCheckBox.setText("フォントサイズを画面にあわせて自動調整する"); | |
1127 | + if (fixFontSizeCheckBox == null) { | |
1128 | + fixFontSizeCheckBox = new JCheckBox(); | |
1129 | + fixFontSizeCheckBox.setText("フォントサイズを画面にあわせて自動調整する"); | |
1130 | + fixFontSizeCheckBox.setName("fixFontSizeCheckBox"); | |
1105 | 1131 | } |
1106 | - return FixFontSizeCheckBox; | |
1132 | + return fixFontSizeCheckBox; | |
1107 | 1133 | } |
1108 | 1134 | |
1109 | 1135 | /** |
@@ -1112,11 +1138,12 @@ public class MainFrame extends JFrame { | ||
1112 | 1138 | * @return javax.swing.JCheckBox |
1113 | 1139 | */ |
1114 | 1140 | private JCheckBox getOpaqueCommentCheckBox() { |
1115 | - if (OpaqueCommentCheckBox == null) { | |
1116 | - OpaqueCommentCheckBox = new JCheckBox(); | |
1117 | - OpaqueCommentCheckBox.setText("全てのコメントを不透明にする"); | |
1141 | + if (opaqueCommentCheckBox == null) { | |
1142 | + opaqueCommentCheckBox = new JCheckBox(); | |
1143 | + opaqueCommentCheckBox.setText("全てのコメントを不透明にする"); | |
1144 | + opaqueCommentCheckBox.setName("opaqueCommentCheckBox"); | |
1118 | 1145 | } |
1119 | - return OpaqueCommentCheckBox; | |
1146 | + return opaqueCommentCheckBox; | |
1120 | 1147 | } |
1121 | 1148 | /** |
1122 | 1149 | * This method initializes FFmpegOptionComboBox |
@@ -1125,12 +1152,12 @@ public class MainFrame extends JFrame { | ||
1125 | 1152 | */ |
1126 | 1153 | private final OptionComboBoxModel FFmpegOptionModel = new OptionComboBoxModel(); |
1127 | 1154 | private JLabel ExtOptionLabel = null; |
1128 | - private JTextField ExtOptionField = null; | |
1129 | - private JCheckBox NotUseVhookCheckBox = null; | |
1130 | - private JTextField ViewCommentField = null; | |
1155 | + private JTextField extOptionField = null; | |
1156 | + private JCheckBox disableVhookCheckBox = null; | |
1157 | + private JTextField viewCommentField = null; | |
1131 | 1158 | private JLabel ViewCommentLabel = null; |
1132 | 1159 | private JLabel ShadowKindLabel = null; |
1133 | - private JComboBox ShadowComboBox = null; | |
1160 | + private JComboBox shadowComboBox = null; | |
1134 | 1161 | |
1135 | 1162 | private JComboBox getFFmpegOptionComboBox() { |
1136 | 1163 | if (FFmpegOptionComboBox == null) { |
@@ -1139,15 +1166,15 @@ public class MainFrame extends JFrame { | ||
1139 | 1166 | |
1140 | 1167 | public void actionPerformed(java.awt.event.ActionEvent e) { |
1141 | 1168 | if (FFmpegOptionModel.isFile()) {// ファイル |
1142 | - ExtOptionField.setEnabled(false); | |
1143 | - MainOptionField.setEnabled(false); | |
1144 | - CommandLineInOptionField.setEnabled(false); | |
1145 | - CommandLineOutOptionField.setEnabled(false); | |
1169 | + extOptionField.setEnabled(false); | |
1170 | + mainOptionField.setEnabled(false); | |
1171 | + inputOptionField.setEnabled(false); | |
1172 | + outputOptionField.setEnabled(false); | |
1146 | 1173 | } else {// ファイルでない |
1147 | - ExtOptionField.setEnabled(true); | |
1148 | - MainOptionField.setEnabled(true); | |
1149 | - CommandLineInOptionField.setEnabled(true); | |
1150 | - CommandLineOutOptionField.setEnabled(true); | |
1174 | + extOptionField.setEnabled(true); | |
1175 | + mainOptionField.setEnabled(true); | |
1176 | + inputOptionField.setEnabled(true); | |
1177 | + outputOptionField.setEnabled(true); | |
1151 | 1178 | } |
1152 | 1179 | } |
1153 | 1180 | }); |
@@ -1209,10 +1236,11 @@ public class MainFrame extends JFrame { | ||
1209 | 1236 | * @return javax.swing.JTextField |
1210 | 1237 | */ |
1211 | 1238 | private JTextField getExtOptionField() { |
1212 | - if (ExtOptionField == null) { | |
1213 | - ExtOptionField = new JTextField(); | |
1239 | + if (extOptionField == null) { | |
1240 | + extOptionField = new JTextField(); | |
1241 | + extOptionField.setName("extOptionField"); | |
1214 | 1242 | } |
1215 | - return ExtOptionField; | |
1243 | + return extOptionField; | |
1216 | 1244 | } |
1217 | 1245 | |
1218 | 1246 | /** |
@@ -1221,11 +1249,12 @@ public class MainFrame extends JFrame { | ||
1221 | 1249 | * @return javax.swing.JCheckBox |
1222 | 1250 | */ |
1223 | 1251 | private JCheckBox getNotUseVhookCheckBox() { |
1224 | - if (NotUseVhookCheckBox == null) { | |
1225 | - NotUseVhookCheckBox = new JCheckBox(); | |
1226 | - NotUseVhookCheckBox.setText("拡張vhookライブラリを無効にする(デバッグ用)"); | |
1252 | + if (disableVhookCheckBox == null) { | |
1253 | + disableVhookCheckBox = new JCheckBox(); | |
1254 | + disableVhookCheckBox.setText("拡張vhookライブラリを無効にする(デバッグ用)"); | |
1255 | + disableVhookCheckBox.setName("disableVhookCheckBox"); | |
1227 | 1256 | } |
1228 | - return NotUseVhookCheckBox; | |
1257 | + return disableVhookCheckBox; | |
1229 | 1258 | } |
1230 | 1259 | |
1231 | 1260 | /** |
@@ -1234,10 +1263,11 @@ public class MainFrame extends JFrame { | ||
1234 | 1263 | * @return javax.swing.JTextField |
1235 | 1264 | */ |
1236 | 1265 | private JTextField getViewCommentField() { |
1237 | - if (ViewCommentField == null) { | |
1238 | - ViewCommentField = new JTextField(); | |
1266 | + if (viewCommentField == null) { | |
1267 | + viewCommentField = new JTextField(); | |
1268 | + viewCommentField.setName("viewCommentField"); | |
1239 | 1269 | } |
1240 | - return ViewCommentField; | |
1270 | + return viewCommentField; | |
1241 | 1271 | } |
1242 | 1272 | |
1243 | 1273 | /** |
@@ -1246,20 +1276,21 @@ public class MainFrame extends JFrame { | ||
1246 | 1276 | * @return javax.swing.JComboBox |
1247 | 1277 | */ |
1248 | 1278 | private JComboBox getShadowComboBox() { |
1249 | - if (ShadowComboBox == null) { | |
1250 | - ShadowComboBox = new JComboBox(SProperties.ShadowKindArray); | |
1279 | + if (shadowComboBox == null) { | |
1280 | + shadowComboBox = new JComboBox(SProperties.ShadowKindArray); | |
1281 | + shadowComboBox.setName("shadowComboBox"); | |
1251 | 1282 | } |
1252 | - return ShadowComboBox; | |
1283 | + return shadowComboBox; | |
1253 | 1284 | } |
1254 | 1285 | |
1255 | 1286 | private BasicSetting getBasicSetting() { |
1256 | - String mail = MailAddrField.getText(); | |
1257 | - String pass = String.valueOf(PasswordField.getPassword()); | |
1258 | - boolean proxyUse = UseProxyCheckBox.isSelected(); | |
1259 | - String proxyHost = ProxyTextField.getText(); | |
1287 | + String mail = mailAddressField.getText(); | |
1288 | + String pass = String.valueOf(passwordField.getPassword()); | |
1289 | + boolean proxyUse = useProxyCheckBox.isSelected(); | |
1290 | + String proxyHost = proxyTextField.getText(); | |
1260 | 1291 | int proxyPort; |
1261 | 1292 | try { |
1262 | - proxyPort = Integer.parseInt(ProxyPortTextField.getText()); | |
1293 | + proxyPort = Integer.parseInt(proxyPortTextField.getText()); | |
1263 | 1294 | } catch (NumberFormatException e) { |
1264 | 1295 | proxyPort = -1; |
1265 | 1296 | } |
@@ -1330,12 +1361,12 @@ public class MainFrame extends JFrame { | ||
1330 | 1361 | } |
1331 | 1362 | |
1332 | 1363 | private MovieSetting getMovieSetting() { |
1333 | - String ffmpeg = FFmpegPathField.getText(); | |
1334 | - String vhook = VhookPathField.getText(); | |
1335 | - String ext = ExtOptionField.getText(); | |
1336 | - String main = MainOptionField.getText(); | |
1337 | - String in = CommandLineInOptionField.getText(); | |
1338 | - String out = CommandLineOutOptionField.getText(); | |
1364 | + String ffmpeg = ffmpegPathField.getText(); | |
1365 | + String vhook = vhookPathField.getText(); | |
1366 | + String ext = extOptionField.getText(); | |
1367 | + String main = mainOptionField.getText(); | |
1368 | + String in = inputOptionField.getText(); | |
1369 | + String out = outputOptionField.getText(); | |
1339 | 1370 | File optionFile = FFmpegOptionModel.getSelectedFile(); |
1340 | 1371 | |
1341 | 1372 | FfmpegOption opt = new FfmpegOption(ext, main, in, out); |
@@ -1343,19 +1374,19 @@ public class MainFrame extends JFrame { | ||
1343 | 1374 | } |
1344 | 1375 | |
1345 | 1376 | private ConvertSetting getConvertSetting() { |
1346 | - boolean vhookDisabled = NotUseVhookCheckBox.isSelected(); | |
1377 | + boolean vhookDisabled = disableVhookCheckBox.isSelected(); | |
1347 | 1378 | int maxComment = 30; |
1348 | 1379 | try { |
1349 | - maxComment = Integer.parseInt(ViewCommentField.getText()); | |
1380 | + maxComment = Integer.parseInt(viewCommentField.getText()); | |
1350 | 1381 | } catch (NumberFormatException ex) { |
1351 | 1382 | } |
1352 | - File font = new File(FontPathField.getText()); | |
1353 | - int fontIndex = Integer.parseInt(FontIndexField.getText()); | |
1354 | - int shadowIndex = ShadowComboBox.getSelectedIndex(); | |
1355 | - boolean showConv = ShowConvVideoCheckBox.isSelected(); | |
1356 | - boolean adjustFont = FixFontSizeCheckBox.isSelected(); | |
1357 | - boolean commentOpaque = OpaqueCommentCheckBox.isSelected(); | |
1358 | - NgSetting ngSetting = new NgSetting(NGWordTextField.getText(), NGIDTextField.getText()); | |
1383 | + File font = new File(fontPathField.getText()); | |
1384 | + int fontIndex = Integer.parseInt(fontIndexField.getText()); | |
1385 | + int shadowIndex = shadowComboBox.getSelectedIndex(); | |
1386 | + boolean showConv = showConvVideoCheckBox.isSelected(); | |
1387 | + boolean adjustFont = fixFontSizeCheckBox.isSelected(); | |
1388 | + boolean commentOpaque = opaqueCommentCheckBox.isSelected(); | |
1389 | + NgSetting ngSetting = new NgSetting(ngWordTextField.getText(), ngIdTextField.getText()); | |
1359 | 1390 | |
1360 | 1391 | return new ConvertSetting(vhookDisabled, maxComment, font, fontIndex, shadowIndex, showConv, adjustFont, |
1361 | 1392 | commentOpaque, ngSetting); |
@@ -1406,7 +1437,7 @@ public class MainFrame extends JFrame { | ||
1406 | 1437 | field = savePanel.getCommentSavedFolderField(); |
1407 | 1438 | isSave = true; |
1408 | 1439 | isDir = true; |
1409 | - } else if (source == savePanel.getShowSavingCommentFolderDialogButton()) { | |
1440 | + } else if (source == savePanel.getShowSavingCommentFileDialogButton()) { | |
1410 | 1441 | title = "コメントの保存先(ファイル)"; |
1411 | 1442 | field = savePanel.getCommentSavedFileField(); |
1412 | 1443 | isSave = true; |
@@ -9,9 +9,6 @@ | ||
9 | 9 | <Component class="javax.swing.ButtonGroup" name="inputTcommentSaveGroup"> |
10 | 10 | </Component> |
11 | 11 | </NonVisualComponents> |
12 | - <SyntheticProperties> | |
13 | - <SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,41,0,0,1,118"/> | |
14 | - </SyntheticProperties> | |
15 | 12 | <AuxValues> |
16 | 13 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> |
17 | 14 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> |
@@ -27,17 +24,20 @@ | ||
27 | 24 | <Layout> |
28 | 25 | <DimensionLayout dim="0"> |
29 | 26 | <Group type="103" groupAlignment="0" attributes="0"> |
30 | - <Component id="jTabbedPane1" alignment="0" pref="374" max="32767" attributes="0"/> | |
27 | + <Component id="saveTabbedPane" alignment="0" pref="374" max="32767" attributes="0"/> | |
31 | 28 | </Group> |
32 | 29 | </DimensionLayout> |
33 | 30 | <DimensionLayout dim="1"> |
34 | 31 | <Group type="103" groupAlignment="0" attributes="0"> |
35 | - <Component id="jTabbedPane1" alignment="0" pref="297" max="32767" attributes="0"/> | |
32 | + <Component id="saveTabbedPane" alignment="0" pref="297" max="32767" attributes="0"/> | |
36 | 33 | </Group> |
37 | 34 | </DimensionLayout> |
38 | 35 | </Layout> |
39 | 36 | <SubComponents> |
40 | - <Container class="javax.swing.JTabbedPane" name="jTabbedPane1"> | |
37 | + <Container class="javax.swing.JTabbedPane" name="saveTabbedPane"> | |
38 | + <Properties> | |
39 | + <Property name="name" type="java.lang.String" value="saveTabbedPane" noResource="true"/> | |
40 | + </Properties> | |
41 | 41 | |
42 | 42 | <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> |
43 | 43 | <SubComponents> |
@@ -87,7 +87,7 @@ | ||
87 | 87 | <Group type="102" alignment="0" attributes="0"> |
88 | 88 | <EmptySpace max="-2" attributes="0"/> |
89 | 89 | <Component id="commentSaveInfoPanel" min="-2" max="-2" attributes="0"/> |
90 | - <EmptySpace pref="27" max="32767" attributes="0"/> | |
90 | + <EmptySpace pref="30" max="32767" attributes="0"/> | |
91 | 91 | </Group> |
92 | 92 | </Group> |
93 | 93 | </DimensionLayout> |
@@ -131,6 +131,7 @@ | ||
131 | 131 | <Component class="javax.swing.JCheckBox" name="savingCommentCheckBox"> |
132 | 132 | <Properties> |
133 | 133 | <Property name="text" type="java.lang.String" value="コメントをダウンロードする"/> |
134 | + <Property name="name" type="java.lang.String" value="savingCommentCheckBox" noResource="true"/> | |
134 | 135 | </Properties> |
135 | 136 | </Component> |
136 | 137 | <Container class="javax.swing.JPanel" name="jPanel7"> |
@@ -153,8 +154,8 @@ | ||
153 | 154 | <Group type="102" alignment="0" attributes="0"> |
154 | 155 | <EmptySpace min="21" pref="21" max="-2" attributes="0"/> |
155 | 156 | <Group type="103" groupAlignment="0" attributes="0"> |
156 | - <Component id="commentSavedFileField" pref="194" max="32767" attributes="1"/> | |
157 | - <Component id="commentSavedFolderField" alignment="0" pref="194" max="32767" attributes="1"/> | |
157 | + <Component id="commentSavedFileField" pref="197" max="32767" attributes="1"/> | |
158 | + <Component id="commentSavedFolderField" alignment="0" pref="197" max="32767" attributes="1"/> | |
158 | 159 | </Group> |
159 | 160 | <EmptySpace max="-2" attributes="0"/> |
160 | 161 | <Group type="103" groupAlignment="1" attributes="0"> |
@@ -202,11 +203,13 @@ | ||
202 | 203 | <Component class="javax.swing.JCheckBox" name="delCommentCheckBox"> |
203 | 204 | <Properties> |
204 | 205 | <Property name="text" type="java.lang.String" value="変換後にコメントファイルを削除する"/> |
206 | + <Property name="name" type="java.lang.String" value="delCommentCheckBox" noResource="true"/> | |
205 | 207 | </Properties> |
206 | 208 | </Component> |
207 | 209 | <Component class="javax.swing.JCheckBox" name="fixCommentNumCheckBox"> |
208 | 210 | <Properties> |
209 | 211 | <Property name="text" type="java.lang.String" value="コメント取得数は自動で調整する"/> |
212 | + <Property name="name" type="java.lang.String" value="fixCommentNumCheckBox" noResource="true"/> | |
210 | 213 | </Properties> |
211 | 214 | </Component> |
212 | 215 | <Component class="javax.swing.JLabel" name="jLabel1"> |
@@ -215,6 +218,9 @@ | ||
215 | 218 | </Properties> |
216 | 219 | </Component> |
217 | 220 | <Component class="javax.swing.JTextField" name="commentNumField"> |
221 | + <Properties> | |
222 | + <Property name="name" type="java.lang.String" value="commentNumField" noResource="true"/> | |
223 | + </Properties> | |
218 | 224 | </Component> |
219 | 225 | <Component class="javax.swing.JRadioButton" name="commentSaveFolderRadioButton"> |
220 | 226 | <Properties> |
@@ -222,13 +228,18 @@ | ||
222 | 228 | <ComponentRef name="inputCommentSaveGroup"/> |
223 | 229 | </Property> |
224 | 230 | <Property name="text" type="java.lang.String" value="保存するフォルダを指定し、ファイル名は自動で決定する"/> |
231 | + <Property name="name" type="java.lang.String" value="commentSaveFolderRadioButton" noResource="true"/> | |
225 | 232 | </Properties> |
226 | 233 | </Component> |
227 | 234 | <Component class="javax.swing.JTextField" name="commentSavedFolderField"> |
235 | + <Properties> | |
236 | + <Property name="name" type="java.lang.String" value="commentSavedFolderField" noResource="true"/> | |
237 | + </Properties> | |
228 | 238 | </Component> |
229 | 239 | <Component class="javax.swing.JButton" name="showSavingCommentFolderDialogButton"> |
230 | 240 | <Properties> |
231 | 241 | <Property name="text" type="java.lang.String" value="参照..."/> |
242 | + <Property name="name" type="java.lang.String" value="showSavingCommentFolderDialogButton" noResource="true"/> | |
232 | 243 | </Properties> |
233 | 244 | </Component> |
234 | 245 | <Component class="javax.swing.JRadioButton" name="commentSaveFileRadioButton"> |
@@ -237,13 +248,18 @@ | ||
237 | 248 | <ComponentRef name="inputCommentSaveGroup"/> |
238 | 249 | </Property> |
239 | 250 | <Property name="text" type="java.lang.String" value="保存するファイル名を指定する"/> |
251 | + <Property name="name" type="java.lang.String" value="commentSaveFileRadioButton" noResource="true"/> | |
240 | 252 | </Properties> |
241 | 253 | </Component> |
242 | 254 | <Component class="javax.swing.JTextField" name="commentSavedFileField"> |
255 | + <Properties> | |
256 | + <Property name="name" type="java.lang.String" value="commentSavedFileField" noResource="true"/> | |
257 | + </Properties> | |
243 | 258 | </Component> |
244 | 259 | <Component class="javax.swing.JButton" name="showSavingCommentFileDialogButton"> |
245 | 260 | <Properties> |
246 | 261 | <Property name="text" type="java.lang.String" value="参照..."/> |
262 | + <Property name="name" type="java.lang.String" value="showSavingCommentFileDialogButton" noResource="true"/> | |
247 | 263 | </Properties> |
248 | 264 | </Component> |
249 | 265 | </SubComponents> |
@@ -276,7 +292,7 @@ | ||
276 | 292 | <Group type="102" alignment="0" attributes="0"> |
277 | 293 | <EmptySpace max="-2" attributes="0"/> |
278 | 294 | <Component id="tcommentSaveInfoPanel" min="-2" max="-2" attributes="0"/> |
279 | - <EmptySpace pref="71" max="32767" attributes="0"/> | |
295 | + <EmptySpace pref="74" max="32767" attributes="0"/> | |
280 | 296 | </Group> |
281 | 297 | </Group> |
282 | 298 | </DimensionLayout> |
@@ -320,6 +336,7 @@ | ||
320 | 336 | <Component class="javax.swing.JCheckBox" name="needDownloadTcomment"> |
321 | 337 | <Properties> |
322 | 338 | <Property name="text" type="java.lang.String" value="コメントをダウンロードする"/> |
339 | + <Property name="name" type="java.lang.String" value="needDownloadTcomment" noResource="true"/> | |
323 | 340 | </Properties> |
324 | 341 | </Component> |
325 | 342 | <Container class="javax.swing.JPanel" name="jPanel8"> |
@@ -331,27 +348,22 @@ | ||
331 | 348 | <Group type="103" groupAlignment="0" attributes="0"> |
332 | 349 | <Component id="delTcomment" alignment="0" min="-2" max="-2" attributes="0"/> |
333 | 350 | <Component id="tcommentSaveInFolder" alignment="0" min="-2" max="-2" attributes="0"/> |
351 | + <Group type="102" alignment="0" attributes="0"> | |
352 | + <EmptySpace max="-2" attributes="0"/> | |
353 | + <Component id="tcommentFolder" pref="206" max="32767" attributes="1"/> | |
354 | + <EmptySpace min="-2" max="-2" attributes="0"/> | |
355 | + <Component id="tcoomentFolderChooserButton" min="-2" max="-2" attributes="0"/> | |
356 | + </Group> | |
357 | + <Component id="tcommentSaveToFile" alignment="0" min="-2" max="-2" attributes="0"/> | |
358 | + <Group type="102" alignment="0" attributes="0"> | |
359 | + <EmptySpace max="-2" attributes="0"/> | |
360 | + <Component id="tcommentFile" pref="206" max="32767" attributes="1"/> | |
361 | + <EmptySpace min="-2" max="-2" attributes="0"/> | |
362 | + <Component id="tcommentFileChooserButton" min="-2" max="-2" attributes="0"/> | |
363 | + </Group> | |
334 | 364 | </Group> |
335 | 365 | <EmptySpace max="-2" attributes="0"/> |
336 | 366 | </Group> |
337 | - <Group type="102" alignment="0" attributes="0"> | |
338 | - <EmptySpace max="-2" attributes="0"/> | |
339 | - <Component id="tcommentFolder" pref="202" max="32767" attributes="1"/> | |
340 | - <EmptySpace min="-2" max="-2" attributes="0"/> | |
341 | - <Component id="tcoomentFolderChooserButton" min="-2" max="-2" attributes="0"/> | |
342 | - <EmptySpace min="-2" max="-2" attributes="0"/> | |
343 | - </Group> | |
344 | - <Group type="102" alignment="0" attributes="0"> | |
345 | - <Component id="tcommentSaveToFile" min="-2" max="-2" attributes="0"/> | |
346 | - <EmptySpace max="-2" attributes="0"/> | |
347 | - </Group> | |
348 | - <Group type="102" alignment="0" attributes="0"> | |
349 | - <EmptySpace max="-2" attributes="0"/> | |
350 | - <Component id="tcommentFile" pref="202" max="32767" attributes="1"/> | |
351 | - <EmptySpace min="-2" max="-2" attributes="0"/> | |
352 | - <Component id="tcommentFileChooserButton" min="-2" max="-2" attributes="0"/> | |
353 | - <EmptySpace min="-2" max="-2" attributes="0"/> | |
354 | - </Group> | |
355 | 367 | </Group> |
356 | 368 | </DimensionLayout> |
357 | 369 | <DimensionLayout dim="1"> |
@@ -382,6 +394,7 @@ | ||
382 | 394 | <Component class="javax.swing.JCheckBox" name="delTcomment"> |
383 | 395 | <Properties> |
384 | 396 | <Property name="text" type="java.lang.String" value="変換後にコメントファイルを削除する"/> |
397 | + <Property name="name" type="java.lang.String" value="delTcomment" noResource="true"/> | |
385 | 398 | </Properties> |
386 | 399 | </Component> |
387 | 400 | <Component class="javax.swing.JRadioButton" name="tcommentSaveInFolder"> |
@@ -390,14 +403,22 @@ | ||
390 | 403 | <ComponentRef name="inputTcommentSaveGroup"/> |
391 | 404 | </Property> |
392 | 405 | <Property name="text" type="java.lang.String" value="保存するフォルダを指定し、ファイル名は自動で決定する"/> |
406 | + <Property name="name" type="java.lang.String" value="tcommentSaveInFolder" noResource="true"/> | |
393 | 407 | </Properties> |
394 | 408 | </Component> |
395 | 409 | <Component class="javax.swing.JTextField" name="tcommentFolder"> |
410 | + <Properties> | |
411 | + <Property name="name" type="java.lang.String" value="tcommentFolder" noResource="true"/> | |
412 | + </Properties> | |
396 | 413 | </Component> |
397 | 414 | <Component class="javax.swing.JButton" name="tcoomentFolderChooserButton"> |
398 | 415 | <Properties> |
399 | 416 | <Property name="text" type="java.lang.String" value="参照..."/> |
417 | + <Property name="name" type="java.lang.String" value="tcoomentFolderChooserButton" noResource="true"/> | |
400 | 418 | </Properties> |
419 | + <Events> | |
420 | + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tcoomentFolderChooserButtonActionPerformed"/> | |
421 | + </Events> | |
401 | 422 | </Component> |
402 | 423 | <Component class="javax.swing.JRadioButton" name="tcommentSaveToFile"> |
403 | 424 | <Properties> |
@@ -405,14 +426,22 @@ | ||
405 | 426 | <ComponentRef name="inputTcommentSaveGroup"/> |
406 | 427 | </Property> |
407 | 428 | <Property name="text" type="java.lang.String" value="保存するファイル名を指定する"/> |
429 | + <Property name="name" type="java.lang.String" value="tcommentSaveToFile" noResource="true"/> | |
408 | 430 | </Properties> |
409 | 431 | </Component> |
410 | 432 | <Component class="javax.swing.JTextField" name="tcommentFile"> |
433 | + <Properties> | |
434 | + <Property name="name" type="java.lang.String" value="tcommentFile" noResource="true"/> | |
435 | + </Properties> | |
411 | 436 | </Component> |
412 | 437 | <Component class="javax.swing.JButton" name="tcommentFileChooserButton"> |
413 | 438 | <Properties> |
414 | 439 | <Property name="text" type="java.lang.String" value="参照..."/> |
440 | + <Property name="name" type="java.lang.String" value="tcommentFileChooserButton" noResource="true"/> | |
415 | 441 | </Properties> |
442 | + <Events> | |
443 | + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tcommentFileChooserButtonActionPerformed"/> | |
444 | + </Events> | |
416 | 445 | </Component> |
417 | 446 | </SubComponents> |
418 | 447 | </Container> |
@@ -435,7 +464,7 @@ | ||
435 | 464 | <Group type="102" alignment="0" attributes="0"> |
436 | 465 | <EmptySpace max="-2" attributes="0"/> |
437 | 466 | <Component id="jPanel3" min="-2" max="-2" attributes="0"/> |
438 | - <EmptySpace max="32767" attributes="0"/> | |
467 | + <EmptySpace pref="15" max="32767" attributes="0"/> | |
439 | 468 | </Group> |
440 | 469 | </Group> |
441 | 470 | </DimensionLayout> |
@@ -444,7 +473,7 @@ | ||
444 | 473 | <Group type="102" alignment="0" attributes="0"> |
445 | 474 | <EmptySpace max="-2" attributes="0"/> |
446 | 475 | <Component id="jPanel3" min="-2" max="-2" attributes="0"/> |
447 | - <EmptySpace pref="35" max="32767" attributes="0"/> | |
476 | + <EmptySpace pref="38" max="32767" attributes="0"/> | |
448 | 477 | </Group> |
449 | 478 | </Group> |
450 | 479 | </DimensionLayout> |
@@ -489,6 +518,7 @@ | ||
489 | 518 | <Component class="javax.swing.JCheckBox" name="savingConvertedVideoCheckBox"> |
490 | 519 | <Properties> |
491 | 520 | <Property name="text" type="java.lang.String" value="動画を変換する"/> |
521 | + <Property name="name" type="java.lang.String" value="savingConvertedVideoCheckBox" noResource="true"/> | |
492 | 522 | </Properties> |
493 | 523 | </Component> |
494 | 524 | <Container class="javax.swing.JPanel" name="jPanel5"> |
@@ -555,11 +585,13 @@ | ||
555 | 585 | <Component class="javax.swing.JCheckBox" name="addComment"> |
556 | 586 | <Properties> |
557 | 587 | <Property name="text" type="java.lang.String" value="コメントをつける"/> |
588 | + <Property name="name" type="java.lang.String" value="addComment" noResource="true"/> | |
558 | 589 | </Properties> |
559 | 590 | </Component> |
560 | 591 | <Component class="javax.swing.JCheckBox" name="addTcomment"> |
561 | 592 | <Properties> |
562 | 593 | <Property name="text" type="java.lang.String" value="投稿者コメントをつける"/> |
594 | + <Property name="name" type="java.lang.String" value="addTcomment" noResource="true"/> | |
563 | 595 | </Properties> |
564 | 596 | </Component> |
565 | 597 | <Component class="javax.swing.JRadioButton" name="convSaveFolderRadioButton"> |
@@ -568,14 +600,19 @@ | ||
568 | 600 | <ComponentRef name="outputVideoSaveGroup"/> |
569 | 601 | </Property> |
570 | 602 | <Property name="text" type="java.lang.String" value="保存するフォルダを指定し、ファイル名は自動で決定する"/> |
603 | + <Property name="name" type="java.lang.String" value="convSaveFolderRadioButton" noResource="true"/> | |
571 | 604 | </Properties> |
572 | 605 | </Component> |
573 | 606 | <Component class="javax.swing.JCheckBox" name="notAddVideoIdConvVideoCheckBox"> |
574 | 607 | <Properties> |
575 | 608 | <Property name="text" type="java.lang.String" value="ファイル名に動画IDを付加しない"/> |
609 | + <Property name="name" type="java.lang.String" value="notAddVideoIdConvVideoCheckBox" noResource="true"/> | |
576 | 610 | </Properties> |
577 | 611 | </Component> |
578 | 612 | <Component class="javax.swing.JTextField" name="convertedVideoSavedFolderField"> |
613 | + <Properties> | |
614 | + <Property name="name" type="java.lang.String" value="convertedVideoSavedFolderField" noResource="true"/> | |
615 | + </Properties> | |
579 | 616 | </Component> |
580 | 617 | <Component class="javax.swing.JButton" name="showSavingConvertedVideoFolderDialogButton"> |
581 | 618 | <Properties> |
@@ -588,9 +625,13 @@ | ||
588 | 625 | <ComponentRef name="outputVideoSaveGroup"/> |
589 | 626 | </Property> |
590 | 627 | <Property name="text" type="java.lang.String" value="保存するファイル名を指定する"/> |
628 | + <Property name="name" type="java.lang.String" value="convSaveFileRadioButton" noResource="true"/> | |
591 | 629 | </Properties> |
592 | 630 | </Component> |
593 | 631 | <Component class="javax.swing.JTextField" name="convertedVideoSavedFileField"> |
632 | + <Properties> | |
633 | + <Property name="name" type="java.lang.String" value="convertedVideoSavedFileField" noResource="true"/> | |
634 | + </Properties> | |
594 | 635 | </Component> |
595 | 636 | <Component class="javax.swing.JButton" name="showSavingConvertedVideoFileDialogButton"> |
596 | 637 | <Properties> |
@@ -11,8 +11,10 @@ | ||
11 | 11 | package saccubus; |
12 | 12 | |
13 | 13 | import java.awt.GridLayout; |
14 | +import java.io.File; | |
14 | 15 | import javax.swing.JButton; |
15 | 16 | import javax.swing.JCheckBox; |
17 | +import javax.swing.JFileChooser; | |
16 | 18 | import javax.swing.JRadioButton; |
17 | 19 | import javax.swing.JTextField; |
18 | 20 |
@@ -43,7 +45,7 @@ public class SavePanel extends javax.swing.JPanel { | ||
43 | 45 | inputCommentSaveGroup = new javax.swing.ButtonGroup(); |
44 | 46 | outputVideoSaveGroup = new javax.swing.ButtonGroup(); |
45 | 47 | inputTcommentSaveGroup = new javax.swing.ButtonGroup(); |
46 | - jTabbedPane1 = new javax.swing.JTabbedPane(); | |
48 | + saveTabbedPane = new javax.swing.JTabbedPane(); | |
47 | 49 | inputVideoTab = new javax.swing.JPanel(); |
48 | 50 | inputCommentTab = new javax.swing.JPanel(); |
49 | 51 | commentSaveInfoPanel = new javax.swing.JPanel(); |
@@ -84,6 +86,8 @@ public class SavePanel extends javax.swing.JPanel { | ||
84 | 86 | convertedVideoSavedFileField = new javax.swing.JTextField(); |
85 | 87 | showSavingConvertedVideoFileDialogButton = new javax.swing.JButton(); |
86 | 88 | |
89 | + saveTabbedPane.setName("saveTabbedPane"); // NOI18N | |
90 | + | |
87 | 91 | javax.swing.GroupLayout inputVideoTabLayout = new javax.swing.GroupLayout(inputVideoTab); |
88 | 92 | inputVideoTab.setLayout(inputVideoTabLayout); |
89 | 93 | inputVideoTabLayout.setHorizontalGroup( |
@@ -95,27 +99,40 @@ public class SavePanel extends javax.swing.JPanel { | ||
95 | 99 | .addGap(0, 270, Short.MAX_VALUE) |
96 | 100 | ); |
97 | 101 | |
98 | - jTabbedPane1.addTab("入力動画", inputVideoTab); | |
102 | + saveTabbedPane.addTab("入力動画", inputVideoTab); | |
99 | 103 | |
100 | 104 | commentSaveInfoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("コメント保存設定")); |
101 | 105 | |
102 | 106 | savingCommentCheckBox.setText("コメントをダウンロードする"); |
107 | + savingCommentCheckBox.setName("savingCommentCheckBox"); // NOI18N | |
103 | 108 | |
104 | 109 | delCommentCheckBox.setText("変換後にコメントファイルを削除する"); |
110 | + delCommentCheckBox.setName("delCommentCheckBox"); // NOI18N | |
105 | 111 | |
106 | 112 | fixCommentNumCheckBox.setText("コメント取得数は自動で調整する"); |
113 | + fixCommentNumCheckBox.setName("fixCommentNumCheckBox"); // NOI18N | |
107 | 114 | |
108 | 115 | jLabel1.setText("取得コメント数"); |
109 | 116 | |
117 | + commentNumField.setName("commentNumField"); // NOI18N | |
118 | + | |
110 | 119 | inputCommentSaveGroup.add(commentSaveFolderRadioButton); |
111 | 120 | commentSaveFolderRadioButton.setText("保存するフォルダを指定し、ファイル名は自動で決定する"); |
121 | + commentSaveFolderRadioButton.setName("commentSaveFolderRadioButton"); // NOI18N | |
122 | + | |
123 | + commentSavedFolderField.setName("commentSavedFolderField"); // NOI18N | |
112 | 124 | |
113 | 125 | showSavingCommentFolderDialogButton.setText("参照..."); |
126 | + showSavingCommentFolderDialogButton.setName("showSavingCommentFolderDialogButton"); // NOI18N | |
114 | 127 | |
115 | 128 | inputCommentSaveGroup.add(commentSaveFileRadioButton); |
116 | 129 | commentSaveFileRadioButton.setText("保存するファイル名を指定する"); |
130 | + commentSaveFileRadioButton.setName("commentSaveFileRadioButton"); // NOI18N | |
131 | + | |
132 | + commentSavedFileField.setName("commentSavedFileField"); // NOI18N | |
117 | 133 | |
118 | 134 | showSavingCommentFileDialogButton.setText("参照..."); |
135 | + showSavingCommentFileDialogButton.setName("showSavingCommentFileDialogButton"); // NOI18N | |
119 | 136 | |
120 | 137 | javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); |
121 | 138 | jPanel7.setLayout(jPanel7Layout); |
@@ -135,8 +152,8 @@ public class SavePanel extends javax.swing.JPanel { | ||
135 | 152 | .addGroup(jPanel7Layout.createSequentialGroup() |
136 | 153 | .addGap(21, 21, 21) |
137 | 154 | .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
138 | - .addComponent(commentSavedFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE) | |
139 | - .addComponent(commentSavedFolderField, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)) | |
155 | + .addComponent(commentSavedFileField, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE) | |
156 | + .addComponent(commentSavedFolderField, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)) | |
140 | 157 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
141 | 158 | .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) |
142 | 159 | .addComponent(showSavingCommentFolderDialogButton) |
@@ -204,26 +221,46 @@ public class SavePanel extends javax.swing.JPanel { | ||
204 | 221 | .addGroup(inputCommentTabLayout.createSequentialGroup() |
205 | 222 | .addContainerGap() |
206 | 223 | .addComponent(commentSaveInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) |
207 | - .addContainerGap(27, Short.MAX_VALUE)) | |
224 | + .addContainerGap(30, Short.MAX_VALUE)) | |
208 | 225 | ); |
209 | 226 | |
210 | - jTabbedPane1.addTab("入力コメント", inputCommentTab); | |
227 | + saveTabbedPane.addTab("入力コメント", inputCommentTab); | |
211 | 228 | |
212 | 229 | tcommentSaveInfoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("投稿者コメント保存設定")); |
213 | 230 | |
214 | 231 | needDownloadTcomment.setText("コメントをダウンロードする"); |
232 | + needDownloadTcomment.setName("needDownloadTcomment"); // NOI18N | |
215 | 233 | |
216 | 234 | delTcomment.setText("変換後にコメントファイルを削除する"); |
235 | + delTcomment.setName("delTcomment"); // NOI18N | |
217 | 236 | |
218 | 237 | inputTcommentSaveGroup.add(tcommentSaveInFolder); |
219 | 238 | tcommentSaveInFolder.setText("保存するフォルダを指定し、ファイル名は自動で決定する"); |
239 | + tcommentSaveInFolder.setName("tcommentSaveInFolder"); // NOI18N | |
240 | + | |
241 | + tcommentFolder.setName("tcommentFolder"); // NOI18N | |
220 | 242 | |
221 | 243 | tcoomentFolderChooserButton.setText("参照..."); |
244 | + tcoomentFolderChooserButton.setName("tcoomentFolderChooserButton"); // NOI18N | |
245 | + tcoomentFolderChooserButton.addActionListener(new java.awt.event.ActionListener() { | |
246 | + public void actionPerformed(java.awt.event.ActionEvent evt) { | |
247 | + tcoomentFolderChooserButtonActionPerformed(evt); | |
248 | + } | |
249 | + }); | |
222 | 250 | |
223 | 251 | inputTcommentSaveGroup.add(tcommentSaveToFile); |
224 | 252 | tcommentSaveToFile.setText("保存するファイル名を指定する"); |
253 | + tcommentSaveToFile.setName("tcommentSaveToFile"); // NOI18N | |
254 | + | |
255 | + tcommentFile.setName("tcommentFile"); // NOI18N | |
225 | 256 | |
226 | 257 | tcommentFileChooserButton.setText("参照..."); |
258 | + tcommentFileChooserButton.setName("tcommentFileChooserButton"); // NOI18N | |
259 | + tcommentFileChooserButton.addActionListener(new java.awt.event.ActionListener() { | |
260 | + public void actionPerformed(java.awt.event.ActionEvent evt) { | |
261 | + tcommentFileChooserButtonActionPerformed(evt); | |
262 | + } | |
263 | + }); | |
227 | 264 | |
228 | 265 | javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8); |
229 | 266 | jPanel8.setLayout(jPanel8Layout); |
@@ -232,22 +269,18 @@ public class SavePanel extends javax.swing.JPanel { | ||
232 | 269 | .addGroup(jPanel8Layout.createSequentialGroup() |
233 | 270 | .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
234 | 271 | .addComponent(delTcomment) |
235 | - .addComponent(tcommentSaveInFolder)) | |
236 | - .addContainerGap()) | |
237 | - .addGroup(jPanel8Layout.createSequentialGroup() | |
238 | - .addContainerGap() | |
239 | - .addComponent(tcommentFolder, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE) | |
240 | - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
241 | - .addComponent(tcoomentFolderChooserButton) | |
242 | - .addContainerGap()) | |
243 | - .addGroup(jPanel8Layout.createSequentialGroup() | |
244 | - .addComponent(tcommentSaveToFile) | |
245 | - .addContainerGap()) | |
246 | - .addGroup(jPanel8Layout.createSequentialGroup() | |
247 | - .addContainerGap() | |
248 | - .addComponent(tcommentFile, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE) | |
249 | - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
250 | - .addComponent(tcommentFileChooserButton) | |
272 | + .addComponent(tcommentSaveInFolder) | |
273 | + .addGroup(jPanel8Layout.createSequentialGroup() | |
274 | + .addContainerGap() | |
275 | + .addComponent(tcommentFolder, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE) | |
276 | + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
277 | + .addComponent(tcoomentFolderChooserButton)) | |
278 | + .addComponent(tcommentSaveToFile) | |
279 | + .addGroup(jPanel8Layout.createSequentialGroup() | |
280 | + .addContainerGap() | |
281 | + .addComponent(tcommentFile, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE) | |
282 | + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | |
283 | + .addComponent(tcommentFileChooserButton))) | |
251 | 284 | .addContainerGap()) |
252 | 285 | ); |
253 | 286 | jPanel8Layout.setVerticalGroup( |
@@ -305,28 +338,38 @@ public class SavePanel extends javax.swing.JPanel { | ||
305 | 338 | .addGroup(inputTcommentTabLayout.createSequentialGroup() |
306 | 339 | .addContainerGap() |
307 | 340 | .addComponent(tcommentSaveInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) |
308 | - .addContainerGap(71, Short.MAX_VALUE)) | |
341 | + .addContainerGap(74, Short.MAX_VALUE)) | |
309 | 342 | ); |
310 | 343 | |
311 | - jTabbedPane1.addTab("入力投稿者コメント", inputTcommentTab); | |
344 | + saveTabbedPane.addTab("入力投稿者コメント", inputTcommentTab); | |
312 | 345 | |
313 | 346 | jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("コメント付き動画保存設定")); |
314 | 347 | |
315 | 348 | savingConvertedVideoCheckBox.setText("動画を変換する"); |
349 | + savingConvertedVideoCheckBox.setName("savingConvertedVideoCheckBox"); // NOI18N | |
316 | 350 | |
317 | 351 | addComment.setText("コメントをつける"); |
352 | + addComment.setName("addComment"); // NOI18N | |
318 | 353 | |
319 | 354 | addTcomment.setText("投稿者コメントをつける"); |
355 | + addTcomment.setName("addTcomment"); // NOI18N | |
320 | 356 | |
321 | 357 | outputVideoSaveGroup.add(convSaveFolderRadioButton); |
322 | 358 | convSaveFolderRadioButton.setText("保存するフォルダを指定し、ファイル名は自動で決定する"); |
359 | + convSaveFolderRadioButton.setName("convSaveFolderRadioButton"); // NOI18N | |
323 | 360 | |
324 | 361 | notAddVideoIdConvVideoCheckBox.setText("ファイル名に動画IDを付加しない"); |
362 | + notAddVideoIdConvVideoCheckBox.setName("notAddVideoIdConvVideoCheckBox"); // NOI18N | |
363 | + | |
364 | + convertedVideoSavedFolderField.setName("convertedVideoSavedFolderField"); // NOI18N | |
325 | 365 | |
326 | 366 | showSavingConvertedVideoFolderDialogButton.setText("参照..."); |
327 | 367 | |
328 | 368 | outputVideoSaveGroup.add(convSaveFileRadioButton); |
329 | 369 | convSaveFileRadioButton.setText("保存するファイル名を指定する"); |
370 | + convSaveFileRadioButton.setName("convSaveFileRadioButton"); // NOI18N | |
371 | + | |
372 | + convertedVideoSavedFileField.setName("convertedVideoSavedFileField"); // NOI18N | |
330 | 373 | |
331 | 374 | showSavingConvertedVideoFileDialogButton.setText("参照..."); |
332 | 375 |
@@ -406,29 +449,37 @@ public class SavePanel extends javax.swing.JPanel { | ||
406 | 449 | .addGroup(outputVideoTabLayout.createSequentialGroup() |
407 | 450 | .addContainerGap() |
408 | 451 | .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) |
409 | - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) | |
452 | + .addContainerGap(15, Short.MAX_VALUE)) | |
410 | 453 | ); |
411 | 454 | outputVideoTabLayout.setVerticalGroup( |
412 | 455 | outputVideoTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
413 | 456 | .addGroup(outputVideoTabLayout.createSequentialGroup() |
414 | 457 | .addContainerGap() |
415 | 458 | .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) |
416 | - .addContainerGap(35, Short.MAX_VALUE)) | |
459 | + .addContainerGap(38, Short.MAX_VALUE)) | |
417 | 460 | ); |
418 | 461 | |
419 | - jTabbedPane1.addTab("出力コメント付き動画", outputVideoTab); | |
462 | + saveTabbedPane.addTab("出力コメント付き動画", outputVideoTab); | |
420 | 463 | |
421 | 464 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); |
422 | 465 | this.setLayout(layout); |
423 | 466 | layout.setHorizontalGroup( |
424 | 467 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
425 | - .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 374, Short.MAX_VALUE) | |
468 | + .addComponent(saveTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 374, Short.MAX_VALUE) | |
426 | 469 | ); |
427 | 470 | layout.setVerticalGroup( |
428 | 471 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
429 | - .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE) | |
472 | + .addComponent(saveTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE) | |
430 | 473 | ); |
431 | 474 | }// </editor-fold>//GEN-END:initComponents |
475 | + | |
476 | + private void tcoomentFolderChooserButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tcoomentFolderChooserButtonActionPerformed | |
477 | + showSaveDialog("投稿者コメントの保存先(フォルダ)", tcommentFolder, true, true); | |
478 | + }//GEN-LAST:event_tcoomentFolderChooserButtonActionPerformed | |
479 | + | |
480 | + private void tcommentFileChooserButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tcommentFileChooserButtonActionPerformed | |
481 | + showSaveDialog("投稿者コメントの保存先(ファイル)", tcommentFile, true, false); | |
482 | + }//GEN-LAST:event_tcommentFileChooserButtonActionPerformed | |
432 | 483 | // Variables declaration - do not modify//GEN-BEGIN:variables |
433 | 484 | private javax.swing.JCheckBox addComment; |
434 | 485 | private javax.swing.JCheckBox addTcomment; |
@@ -455,11 +506,11 @@ public class SavePanel extends javax.swing.JPanel { | ||
455 | 506 | private javax.swing.JPanel jPanel5; |
456 | 507 | private javax.swing.JPanel jPanel7; |
457 | 508 | private javax.swing.JPanel jPanel8; |
458 | - private javax.swing.JTabbedPane jTabbedPane1; | |
459 | 509 | private javax.swing.JCheckBox needDownloadTcomment; |
460 | 510 | private javax.swing.JCheckBox notAddVideoIdConvVideoCheckBox; |
461 | 511 | private javax.swing.ButtonGroup outputVideoSaveGroup; |
462 | 512 | private javax.swing.JPanel outputVideoTab; |
513 | + private javax.swing.JTabbedPane saveTabbedPane; | |
463 | 514 | private javax.swing.JCheckBox savingCommentCheckBox; |
464 | 515 | private javax.swing.JCheckBox savingConvertedVideoCheckBox; |
465 | 516 | private javax.swing.JButton showSavingCommentFileDialogButton; |
@@ -629,4 +680,23 @@ public class SavePanel extends javax.swing.JPanel { | ||
629 | 680 | void setTcommentFileName(String t) { |
630 | 681 | tcommentFile.setText(t); |
631 | 682 | } |
683 | + | |
684 | + private void showSaveDialog(String title, JTextField field, boolean isSave, | |
685 | + boolean isDir) { | |
686 | + File current = new File(field.getText()); | |
687 | + JFileChooser chooser = new JFileChooser(current); | |
688 | + chooser.setDialogTitle(title); | |
689 | + int code = 0; | |
690 | + if (isDir) { | |
691 | + chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); | |
692 | + } | |
693 | + if (isSave) { | |
694 | + code = chooser.showSaveDialog(this); | |
695 | + } else { | |
696 | + code = chooser.showOpenDialog(this); | |
697 | + } | |
698 | + if (code == JFileChooser.APPROVE_OPTION) { | |
699 | + field.setText(chooser.getSelectedFile().getAbsolutePath()); | |
700 | + } | |
701 | + } | |
632 | 702 | } |
@@ -14,9 +14,6 @@ | ||
14 | 14 | </Border> |
15 | 15 | </Property> |
16 | 16 | </Properties> |
17 | - <SyntheticProperties> | |
18 | - <SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-6,0,0,1,89"/> | |
19 | - </SyntheticProperties> | |
20 | 17 | <AuxValues> |
21 | 18 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> |
22 | 19 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> |
@@ -76,6 +73,7 @@ | ||
76 | 73 | <ComponentRef name="videoSavingGroup"/> |
77 | 74 | </Property> |
78 | 75 | <Property name="text" type="java.lang.String" value="動画をダウンロードしない"/> |
76 | + <Property name="name" type="java.lang.String" value="videoNoSaveButton" noResource="true"/> | |
79 | 77 | </Properties> |
80 | 78 | </Component> |
81 | 79 | <Component class="javax.swing.JRadioButton" name="videoSaveButton"> |
@@ -84,6 +82,7 @@ | ||
84 | 82 | <ComponentRef name="videoSavingGroup"/> |
85 | 83 | </Property> |
86 | 84 | <Property name="text" type="java.lang.String" value="動画をダウンロードする"/> |
85 | + <Property name="name" type="java.lang.String" value="videoSaveButton" noResource="true"/> | |
87 | 86 | </Properties> |
88 | 87 | </Component> |
89 | 88 | <Container class="javax.swing.JPanel" name="basicSetting"> |
@@ -140,6 +139,7 @@ | ||
140 | 139 | <Component class="javax.swing.JCheckBox" name="delVideoCheckBox"> |
141 | 140 | <Properties> |
142 | 141 | <Property name="text" type="java.lang.String" value="変換後に動画ファイルを削除する"/> |
142 | + <Property name="name" type="java.lang.String" value="delVideoCheckBox" noResource="true"/> | |
143 | 143 | </Properties> |
144 | 144 | </Component> |
145 | 145 | <Component class="javax.swing.JRadioButton" name="saveFolderRadioButton"> |
@@ -148,13 +148,18 @@ | ||
148 | 148 | <ComponentRef name="videoNamingGroup"/> |
149 | 149 | </Property> |
150 | 150 | <Property name="text" type="java.lang.String" value="保存するフォルダを指定し、ファイル名は自動で決定する"/> |
151 | + <Property name="name" type="java.lang.String" value="saveFolderRadioButton" noResource="true"/> | |
151 | 152 | </Properties> |
152 | 153 | </Component> |
153 | 154 | <Component class="javax.swing.JTextField" name="videoSavedFolderField"> |
155 | + <Properties> | |
156 | + <Property name="name" type="java.lang.String" value="videoSavedFolderField" noResource="true"/> | |
157 | + </Properties> | |
154 | 158 | </Component> |
155 | 159 | <Component class="javax.swing.JButton" name="showSavingVideoFolderDialogButton"> |
156 | 160 | <Properties> |
157 | 161 | <Property name="text" type="java.lang.String" value="参照..."/> |
162 | + <Property name="name" type="java.lang.String" value="showSavingVideoFolderDialogButton" noResource="true"/> | |
158 | 163 | </Properties> |
159 | 164 | </Component> |
160 | 165 | <Component class="javax.swing.JRadioButton" name="saveFileRadioButton"> |
@@ -163,13 +168,18 @@ | ||
163 | 168 | <ComponentRef name="videoNamingGroup"/> |
164 | 169 | </Property> |
165 | 170 | <Property name="text" type="java.lang.String" value="保存するファイル名を指定する"/> |
171 | + <Property name="name" type="java.lang.String" value="saveFileRadioButton" noResource="true"/> | |
166 | 172 | </Properties> |
167 | 173 | </Component> |
168 | 174 | <Component class="javax.swing.JTextField" name="videoSavedFileField"> |
175 | + <Properties> | |
176 | + <Property name="name" type="java.lang.String" value="videoSavedFileField" noResource="true"/> | |
177 | + </Properties> | |
169 | 178 | </Component> |
170 | 179 | <Component class="javax.swing.JButton" name="showSavingVideoFileDialogButton"> |
171 | 180 | <Properties> |
172 | 181 | <Property name="text" type="java.lang.String" value="参照..."/> |
182 | + <Property name="name" type="java.lang.String" value="showSavingVideoFileDialogButton" noResource="true"/> | |
173 | 183 | </Properties> |
174 | 184 | </Component> |
175 | 185 | </SubComponents> |
@@ -180,6 +190,7 @@ | ||
180 | 190 | <ComponentRef name="videoSavingGroup"/> |
181 | 191 | </Property> |
182 | 192 | <Property name="text" type="java.lang.String" value="NicoBrowserダウンロードファイルを用いる"/> |
193 | + <Property name="name" type="java.lang.String" value="videoUseNiBrButton" noResource="true"/> | |
183 | 194 | </Properties> |
184 | 195 | </Component> |
185 | 196 | <Container class="javax.swing.JPanel" name="nibrExtendSetting"> |
@@ -206,6 +217,9 @@ | ||
206 | 217 | </Layout> |
207 | 218 | <SubComponents> |
208 | 219 | <Component class="javax.swing.JTextField" name="nibrFileField"> |
220 | + <Properties> | |
221 | + <Property name="name" type="java.lang.String" value="nibrFileField" noResource="true"/> | |
222 | + </Properties> | |
209 | 223 | </Component> |
210 | 224 | <Component class="javax.swing.JButton" name="nibrFileChooserButton"> |
211 | 225 | <Properties> |
@@ -50,21 +50,32 @@ class VideoSaveInfoPanel extends javax.swing.JPanel { | ||
50 | 50 | |
51 | 51 | videoSavingGroup.add(videoNoSaveButton); |
52 | 52 | videoNoSaveButton.setText("動画をダウンロードしない"); |
53 | + videoNoSaveButton.setName("videoNoSaveButton"); // NOI18N | |
53 | 54 | |
54 | 55 | videoSavingGroup.add(videoSaveButton); |
55 | 56 | videoSaveButton.setText("動画をダウンロードする"); |
57 | + videoSaveButton.setName("videoSaveButton"); // NOI18N | |
56 | 58 | |
57 | 59 | delVideoCheckBox.setText("変換後に動画ファイルを削除する"); |
60 | + delVideoCheckBox.setName("delVideoCheckBox"); // NOI18N | |
58 | 61 | |
59 | 62 | videoNamingGroup.add(saveFolderRadioButton); |
60 | 63 | saveFolderRadioButton.setText("保存するフォルダを指定し、ファイル名は自動で決定する"); |
64 | + saveFolderRadioButton.setName("saveFolderRadioButton"); // NOI18N | |
65 | + | |
66 | + videoSavedFolderField.setName("videoSavedFolderField"); // NOI18N | |
61 | 67 | |
62 | 68 | showSavingVideoFolderDialogButton.setText("参照..."); |
69 | + showSavingVideoFolderDialogButton.setName("showSavingVideoFolderDialogButton"); // NOI18N | |
63 | 70 | |
64 | 71 | videoNamingGroup.add(saveFileRadioButton); |
65 | 72 | saveFileRadioButton.setText("保存するファイル名を指定する"); |
73 | + saveFileRadioButton.setName("saveFileRadioButton"); // NOI18N | |
74 | + | |
75 | + videoSavedFileField.setName("videoSavedFileField"); // NOI18N | |
66 | 76 | |
67 | 77 | showSavingVideoFileDialogButton.setText("参照..."); |
78 | + showSavingVideoFileDialogButton.setName("showSavingVideoFileDialogButton"); // NOI18N | |
68 | 79 | |
69 | 80 | javax.swing.GroupLayout basicSettingLayout = new javax.swing.GroupLayout(basicSetting); |
70 | 81 | basicSetting.setLayout(basicSettingLayout); |
@@ -108,6 +119,9 @@ class VideoSaveInfoPanel extends javax.swing.JPanel { | ||
108 | 119 | |
109 | 120 | videoSavingGroup.add(videoUseNiBrButton); |
110 | 121 | videoUseNiBrButton.setText("NicoBrowserダウンロードファイルを用いる"); |
122 | + videoUseNiBrButton.setName("videoUseNiBrButton"); // NOI18N | |
123 | + | |
124 | + nibrFileField.setName("nibrFileField"); // NOI18N | |
111 | 125 | |
112 | 126 | nibrFileChooserButton.setText("参照..."); |
113 | 127 |
@@ -105,7 +105,7 @@ public class FileInstanciator { | ||
105 | 105 | */ |
106 | 106 | public final File getVideoFile(TextProgressListener listener) throws IOException { |
107 | 107 | File file = new FileLocator(videoType.isAutoFileName(), videoType.getInitFile(), getVideoIdWithBracket(), |
108 | - getVideoTitle(), ".flv").getFile(); | |
108 | + getVideoTitle(), ".flv", ".mp4", ".swf").getFile(); | |
109 | 109 | file = videoFileGetter.get(file, listener); |
110 | 110 | return file; |
111 | 111 | } |
@@ -131,7 +131,7 @@ public class FileInstanciator { | ||
131 | 131 | */ |
132 | 132 | public final File getTcommFile(TextProgressListener listener) throws IOException { |
133 | 133 | File file = new FileLocator(tcommType.isAutoFileName(), tcommType.getInitFile(), getVideoIdWithBracket(), |
134 | - getVideoTitle(), ".xml").getFile(); | |
134 | + getVideoTitle(), ".txml").getFile(); | |
135 | 135 | file = tcommFileGetter.get(file, listener); |
136 | 136 | return file; |
137 | 137 | } |
@@ -3,6 +3,7 @@ package saccubus.converter.filegetter; | ||
3 | 3 | |
4 | 4 | import java.io.File; |
5 | 5 | import java.io.FilenameFilter; |
6 | +import org.apache.commons.io.FilenameUtils; | |
6 | 7 | |
7 | 8 | /** |
8 | 9 | * |
@@ -14,22 +15,23 @@ class FileLocator { | ||
14 | 15 | private final File initFile; |
15 | 16 | private final String prefix; |
16 | 17 | private final String title; |
17 | - private final String suffix; | |
18 | + private final String[] suffixes; | |
18 | 19 | |
19 | - FileLocator(boolean autoFileName, File initFile, String prefix, String title, String suffix) { | |
20 | + FileLocator(boolean autoFileName, File initFile, String prefix, String title, String... suffixes) { | |
20 | 21 | this.autoFileName = autoFileName; |
21 | 22 | this.initFile = initFile; |
22 | 23 | this.prefix = prefix; |
23 | 24 | this.title = title; |
24 | - this.suffix = suffix; | |
25 | + this.suffixes = suffixes; | |
25 | 26 | } |
26 | 27 | |
27 | 28 | /** |
28 | 29 | * コンストラクタで指定した条件でファイルを検索する。 |
29 | 30 | * autoFileNameがfalseの場合、直接名前指定であるため指定されたファイルをそのまま返す。 |
30 | - * autoFileNameがtrueの場合、initFileディレクトリにprefixで始まるファイルが存在するか検索し | |
31 | + * autoFileNameがtrueの場合、initFileディレクトリにprefixで始まりsuffixで終わるファイルが存在するか検索し | |
31 | 32 | * あればそれを返す。 |
32 | 33 | * このファイルも無い場合、指定されたパラメータに従ったファイル名を返す。 |
34 | + * このとき拡張子(suffixes)が複数指定されていた場合は最初のものを返す。 | |
33 | 35 | * @return 所望のファイル。ファイルは存在する場合もあり、存在しない場合もあることに注意。 |
34 | 36 | */ |
35 | 37 | File getFile() { |
@@ -40,7 +42,7 @@ class FileLocator { | ||
40 | 42 | if (res != null) { |
41 | 43 | return res; |
42 | 44 | } |
43 | - return new File(initFile, prefix + title + suffix); | |
45 | + return new File(initFile, prefix + title + suffixes[0]); | |
44 | 46 | } |
45 | 47 | } |
46 | 48 |
@@ -48,13 +50,23 @@ class FileLocator { | ||
48 | 50 | FilenameFilter filter = new FilenameFilter() { |
49 | 51 | |
50 | 52 | public boolean accept(File dir, String name) { |
51 | - return (name.startsWith(prefix)) ? true : false; | |
53 | + if (name.startsWith(prefix)) { | |
54 | + for (String suffix : suffixes) { | |
55 | + if (name.endsWith(suffix)) { | |
56 | + return true; | |
57 | + } | |
58 | + } | |
59 | + } | |
60 | + return false; | |
52 | 61 | } |
53 | 62 | }; |
54 | 63 | File[] res = initFile.listFiles(filter); |
55 | 64 | if (res == null || res.length == 0) { |
56 | 65 | return null; |
57 | 66 | } |
67 | + if (res.length > 1) { | |
68 | + System.out.println("複数の候補ファイルがヒットしました. 意図しないファイルが選択されている可能性があります:" + res[0]); | |
69 | + } | |
58 | 70 | return res[0]; |
59 | 71 | } |
60 | 72 |
@@ -337,7 +337,7 @@ public class NicoClient { | ||
337 | 337 | } |
338 | 338 | |
339 | 339 | private OfficialOption getOfficialOption(String threadId) throws IOException { |
340 | - String url = "http://www.nicovideo.jp/api/getthreadkey?thread="+threadId; | |
340 | + String url = "http://flapi.nicovideo.jp/api/getthreadkey?thread="+threadId; | |
341 | 341 | Map<String,String> map = new NicoApiRequest(url).get(); |
342 | 342 | return new OfficialOption(map.get("threadkey"), map.get("force_184")); |
343 | 343 | } |
@@ -375,7 +375,7 @@ public class NicoClient { | ||
375 | 375 | } |
376 | 376 | } |
377 | 377 | System.out.print("Getting wayback key..."); |
378 | - String url = "http://www.nicovideo.jp/api/getwaybackkey?thread=" | |
378 | + String url = "http://flapi.nicovideo.jp/api/getwaybackkey?thread=" | |
379 | 379 | + vi.getThreadId(); |
380 | 380 | String ret = ""; |
381 | 381 | try { |
@@ -10,13 +10,20 @@ import java.util.Properties; | ||
10 | 10 | */ |
11 | 11 | public class InputCommentSetting extends InputFileSetting<Boolean> { |
12 | 12 | |
13 | - private static final String PROP_COMMENT_FILE = "CommentFile"; | |
14 | - private static final String PROP_BACK_COMMENT = "BackComment"; | |
13 | + /** コメントをダウンロードする. */ | |
14 | + private static final String PROP_SAVE_COMMENT = "SaveCommentFile"; | |
15 | + /** 変換後にコメントファイルを削除する. */ | |
15 | 16 | private static final String PROP_DEL_COMMENT_AFTER_CONV = "DeleteCommentAfterConv"; |
16 | - private static final String PROP_COMMENT_FIX_FILE_NAME = "CommentFixFileName"; | |
17 | - private static final String PROP_COMMENT_FIX_FILE_NAME_FOLDER = "CommentFixFileNameFolder"; | |
17 | + /** コメント取得数は自動で調整する. */ | |
18 | 18 | private static final String PROP_FIX_COMMENT_NUM = "FixCommentSize"; |
19 | - private static final String PROP_SAVE_COMMENT = "SaveCommentFile"; | |
19 | + /** 取得コメント数. */ | |
20 | + private static final String PROP_BACK_COMMENT = "BackComment"; | |
21 | + /** フォルダ/ファイル保存選択ラジオボタン. */ | |
22 | + private static final String PROP_COMMENT_FIX_FILE_NAME = "CommentFixFileName"; | |
23 | + /** フォルダ名. */ | |
24 | + private static final String PROP_COMMENT_FOLDER = "CommentFixFileNameFolder"; | |
25 | + /** ファイル名. */ | |
26 | + private static final String PROP_COMMENT_FILE = "CommentFile"; | |
20 | 27 | private final boolean selfAdjustNumOfComment; |
21 | 28 | private final int numOfComment; |
22 | 29 |
@@ -28,25 +35,24 @@ public class InputCommentSetting extends InputFileSetting<Boolean> { | ||
28 | 35 | } |
29 | 36 | |
30 | 37 | public void save(Properties prop) { |
31 | - prop.setProperty(PROP_COMMENT_FILE, getFile().getPath()); | |
32 | - prop.setProperty(PROP_BACK_COMMENT, Integer.toString(getNumOfComment())); | |
38 | + prop.setProperty(PROP_SAVE_COMMENT, getProcessKind().toString()); | |
33 | 39 | prop.setProperty(PROP_DEL_COMMENT_AFTER_CONV, Boolean.toString(isDeleteAfterConvert())); |
34 | - prop.setProperty(PROP_COMMENT_FIX_FILE_NAME, Boolean.toString(isAutoNaming())); | |
35 | - prop.setProperty(PROP_COMMENT_FIX_FILE_NAME_FOLDER, getFolder().getPath()); | |
36 | 40 | prop.setProperty(PROP_FIX_COMMENT_NUM, Boolean.toString(isSelfAdjustNumOfComment())); |
37 | - prop.setProperty(PROP_SAVE_COMMENT, getProcessKind().toString()); | |
41 | + prop.setProperty(PROP_BACK_COMMENT, Integer.toString(getNumOfComment())); | |
42 | + prop.setProperty(PROP_COMMENT_FIX_FILE_NAME, Boolean.toString(isAutoNaming())); | |
43 | + prop.setProperty(PROP_COMMENT_FOLDER, getFolder().getPath()); | |
44 | + prop.setProperty(PROP_COMMENT_FILE, getFile().getPath()); | |
38 | 45 | |
39 | 46 | } |
40 | 47 | |
41 | 48 | public static InputCommentSetting load(Properties prop) { |
42 | - | |
43 | - String file = prop.getProperty(PROP_COMMENT_FILE, "comment.xml"); | |
44 | - String numOfComment = prop.getProperty(PROP_BACK_COMMENT, "500"); | |
45 | - boolean delete = Boolean.parseBoolean(prop.getProperty(PROP_DEL_COMMENT_AFTER_CONV, "false")); | |
46 | - boolean adjustNumOfComment = Boolean.parseBoolean(prop.getProperty(PROP_COMMENT_FIX_FILE_NAME, "true")); | |
47 | - String folder = prop.getProperty(PROP_COMMENT_FIX_FILE_NAME_FOLDER, "[out]comment"); | |
48 | - boolean autoNaming = Boolean.parseBoolean(prop.getProperty(PROP_FIX_COMMENT_NUM, "true")); | |
49 | 49 | boolean download = Boolean.parseBoolean(prop.getProperty(PROP_SAVE_COMMENT, "true")); |
50 | + boolean delete = Boolean.parseBoolean(prop.getProperty(PROP_DEL_COMMENT_AFTER_CONV, "false")); | |
51 | + boolean adjustNumOfComment = Boolean.parseBoolean(prop.getProperty(PROP_FIX_COMMENT_NUM, "true")); | |
52 | + String numOfComment = prop.getProperty(PROP_BACK_COMMENT, "500"); | |
53 | + boolean autoNaming = Boolean.parseBoolean(prop.getProperty(PROP_COMMENT_FIX_FILE_NAME, "true")); | |
54 | + String folder = prop.getProperty(PROP_COMMENT_FOLDER, "[out]comment"); | |
55 | + String file = prop.getProperty(PROP_COMMENT_FILE, "comment.xml"); | |
50 | 56 | |
51 | 57 | return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete, |
52 | 58 | adjustNumOfComment, |
@@ -37,7 +37,7 @@ public class InputTcommentSetting extends InputFileSetting<Boolean> { | ||
37 | 37 | |
38 | 38 | public void save(Properties prop) { |
39 | 39 | prop.setProperty(PROP_DOWNLOAD, getProcessKind().toString()); |
40 | - prop.setProperty(PROP_DELETE, getProcessKind().toString()); | |
40 | + prop.setProperty(PROP_DELETE, Boolean.toString(isDeleteAfterConvert())); | |
41 | 41 | prop.setProperty(PROP_AUTOFILENAME, Boolean.toString(isAutoNaming())); |
42 | 42 | prop.setProperty(PROP_DIRECTORYNAME, getFolder().toString()); |
43 | 43 | prop.setProperty(PROP_FILENAME, getFile().toString()); |
@@ -0,0 +1,643 @@ | ||
1 | +/*$Id$*/ | |
2 | +package saccubus; | |
3 | + | |
4 | +import java.io.File; | |
5 | +import java.io.FileOutputStream; | |
6 | +import java.io.IOException; | |
7 | +import java.io.OutputStream; | |
8 | +import java.util.HashMap; | |
9 | +import java.util.Map; | |
10 | +import java.util.Properties; | |
11 | +import javax.swing.JFrame; | |
12 | +import mockit.Mock; | |
13 | +import mockit.MockClass; | |
14 | +import mockit.Mockit; | |
15 | +import mockit.integration.junit4.JMockit; | |
16 | +import static org.fest.assertions.Assertions.*; | |
17 | +import org.fest.reflect.core.Reflection; | |
18 | +import org.fest.swing.fixture.JFileChooserFixture; | |
19 | +import org.fest.swing.keystroke.KeyStrokeMappingProvider; | |
20 | +import static org.fest.swing.launcher.ApplicationLauncher.application; | |
21 | +import org.fest.swing.core.BasicRobot; | |
22 | +import org.fest.swing.core.Robot; | |
23 | +import org.fest.swing.finder.JFileChooserFinder; | |
24 | +import org.fest.swing.finder.WindowFinder; | |
25 | +import org.fest.swing.fixture.FrameFixture; | |
26 | +import org.fest.swing.keystroke.KeyStrokeMap; | |
27 | +import org.fest.swing.keystroke.KeyStrokeMappingsParser; | |
28 | +import org.junit.After; | |
29 | +import org.junit.Before; | |
30 | +import org.junit.Test; | |
31 | +import org.junit.runner.RunWith; | |
32 | +import saccubus.properties.SProperties; | |
33 | +import static org.junit.Assert.*; | |
34 | + | |
35 | +/** | |
36 | + * | |
37 | + * @author yuki | |
38 | + */ | |
39 | +@RunWith(JMockit.class) | |
40 | +public class SaccubusTest { | |
41 | + | |
42 | + private static Robot robot; | |
43 | + private static FrameFixture window; | |
44 | + | |
45 | + @Before | |
46 | + public void setUp() throws IOException { | |
47 | + KeyStrokeMappingsParser parser = new KeyStrokeMappingsParser(); | |
48 | + KeyStrokeMappingProvider provider = parser.parse("fest-swing_mapping.txt"); | |
49 | + KeyStrokeMap.addKeyStrokesFrom(provider); | |
50 | + | |
51 | + robot = BasicRobot.robotWithNewAwtHierarchy(); | |
52 | + application(saccubus.Saccubus.class).start(); | |
53 | + window = WindowFinder.findFrame(JFrame.class).using(robot); | |
54 | + } | |
55 | + | |
56 | + @After | |
57 | + public void tearDown() { | |
58 | + robot.cleanUp(); | |
59 | + } | |
60 | + | |
61 | + private SProperties getProperties() { | |
62 | + return Reflection.method("getSetting").withReturnType(SProperties.class).in(window.component()).invoke(); | |
63 | + } | |
64 | + | |
65 | + @Test | |
66 | + public void testConfigSave() throws Exception { | |
67 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
68 | + | |
69 | + SProperties.saveSetting(getProperties()); | |
70 | + } | |
71 | + | |
72 | + @Test | |
73 | + public void testMailAddress() { | |
74 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
75 | + | |
76 | + window.tabbedPane("mainTabbedPane").selectTab("基本設定"); | |
77 | + window.textBox("mailAddressField").enterText("mail@example.com"); | |
78 | + SProperties.saveSetting(getProperties()); | |
79 | + } | |
80 | + | |
81 | + @Test | |
82 | + public void testPassword() { | |
83 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
84 | + | |
85 | + window.tabbedPane("mainTabbedPane").selectTab("基本設定"); | |
86 | + window.textBox("passwordField").enterText("pass word input"); | |
87 | + SProperties.saveSetting(getProperties()); | |
88 | + } | |
89 | + | |
90 | + @Test | |
91 | + public void testUseProxy() { | |
92 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
93 | + | |
94 | + window.tabbedPane("mainTabbedPane").selectTab("基本設定"); | |
95 | + window.checkBox("useProxyCheckBox").check(); | |
96 | + SProperties.saveSetting(getProperties()); | |
97 | + | |
98 | + window.tabbedPane("mainTabbedPane").selectTab("基本設定"); | |
99 | + window.checkBox("useProxyCheckBox").uncheck(); | |
100 | + SProperties.saveSetting(getProperties()); | |
101 | + } | |
102 | + | |
103 | + @Test | |
104 | + public void testProxyHost() { | |
105 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
106 | + | |
107 | + window.tabbedPane("mainTabbedPane").selectTab("基本設定"); | |
108 | + window.textBox("proxyTextField").enterText("proxy.example.com"); | |
109 | + SProperties.saveSetting(getProperties()); | |
110 | + } | |
111 | + | |
112 | + @Test | |
113 | + public void testProxyPort() { | |
114 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
115 | + | |
116 | + window.tabbedPane("mainTabbedPane").selectTab("基本設定"); | |
117 | + window.textBox("proxyPortTextField").enterText("8090"); | |
118 | + SProperties.saveSetting(getProperties()); | |
119 | + } | |
120 | + | |
121 | + @Test | |
122 | + public void testMovieSouce() { | |
123 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
124 | + | |
125 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
126 | + window.tabbedPane("saveTabbedPane").selectTab("入力動画"); | |
127 | + window.radioButton("videoUseNiBrButton").check(); | |
128 | + window.textBox("nibrFileField").enterText("nibr_file.mp4"); | |
129 | + window.radioButton("videoNoSaveButton").check(); | |
130 | + window.checkBox("delVideoCheckBox").click(); | |
131 | + window.textBox("videoSavedFolderField").selectAll().enterText("C:\\works\\"); | |
132 | + window.textBox("videoSavedFileField").selectAll().enterText("C:\\movie_file.flv"); | |
133 | + SProperties.saveSetting(getProperties()); | |
134 | + | |
135 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
136 | + window.tabbedPane("saveTabbedPane").selectTab("入力動画"); | |
137 | + window.radioButton("videoSaveButton").check(); | |
138 | + window.checkBox("delVideoCheckBox").click(); | |
139 | + window.textBox("videoSavedFolderField").selectAll().enterText("C:\\works\\movie"); | |
140 | + window.textBox("videoSavedFileField").selectAll().enterText("C:\\movie_file\\file.flv"); | |
141 | + SProperties.saveSetting(getProperties()); | |
142 | + | |
143 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
144 | + window.tabbedPane("saveTabbedPane").selectTab("入力動画"); | |
145 | + window.checkBox("delVideoCheckBox").click(); | |
146 | + window.textBox("videoSavedFolderField").deleteText(); | |
147 | + window.textBox("videoSavedFileField").deleteText(); | |
148 | + window.radioButton("videoUseNiBrButton").check(); | |
149 | + SProperties.saveSetting(getProperties()); | |
150 | + } | |
151 | + | |
152 | + @Test | |
153 | + public void testMovieSouce2() { | |
154 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
155 | + | |
156 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
157 | + window.tabbedPane("saveTabbedPane").selectTab("入力動画"); | |
158 | + window.radioButton("saveFolderRadioButton").check(); | |
159 | + window.textBox("videoSavedFolderField").selectAll().enterText("folder\\"); | |
160 | + window.textBox("videoSavedFileField").selectAll().enterText("file.flv"); | |
161 | + SProperties.saveSetting(getProperties()); | |
162 | + | |
163 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
164 | + window.tabbedPane("saveTabbedPane").selectTab("入力動画"); | |
165 | + window.radioButton("saveFileRadioButton").check(); | |
166 | + window.textBox("videoSavedFolderField").selectAll().enterText("folder1\\folder2\\"); | |
167 | + window.textBox("videoSavedFileField").selectAll().enterText("folder\\file.flv"); | |
168 | + SProperties.saveSetting(getProperties()); | |
169 | + } | |
170 | + | |
171 | + @Test | |
172 | + public void testMovieSourceFolderButton() { | |
173 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
174 | + | |
175 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
176 | + window.tabbedPane("saveTabbedPane").selectTab("入力動画"); | |
177 | + window.button("showSavingVideoFolderDialogButton").click(); | |
178 | + JFileChooserFixture chooser = JFileChooserFinder.findFileChooser().using(robot); | |
179 | + File folder = new File("F:\\docs\\NetBeansProjects"); | |
180 | + chooser.selectFile(folder).approve(); | |
181 | + assertThat(folder.getAbsolutePath()).isEqualTo(window.textBox("videoSavedFolderField").text()); | |
182 | + } | |
183 | + | |
184 | + @Test | |
185 | + public void testMovieSourceFileButton() { | |
186 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
187 | + | |
188 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
189 | + window.tabbedPane("saveTabbedPane").selectTab("入力動画"); | |
190 | + window.button("showSavingVideoFileDialogButton").click(); | |
191 | + JFileChooserFixture chooser = JFileChooserFinder.findFileChooser().using(robot); | |
192 | + File folder = new File("F:\\docs\\NetBeansProjects\\saccubus_frontend\\[out]video\\aa.flv"); | |
193 | + chooser.selectFile(folder).approve(); | |
194 | + assertThat(folder.getAbsolutePath()).isEqualTo(window.textBox("videoSavedFileField").text()); | |
195 | + } | |
196 | + | |
197 | + @Test | |
198 | + public void testDownloadComment() { | |
199 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
200 | + | |
201 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
202 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
203 | + window.checkBox("savingCommentCheckBox").check(); | |
204 | + SProperties.saveSetting(getProperties()); | |
205 | + | |
206 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
207 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
208 | + window.checkBox("savingCommentCheckBox").uncheck(); | |
209 | + SProperties.saveSetting(getProperties()); | |
210 | + } | |
211 | + | |
212 | + @Test | |
213 | + public void testDeleteComment() { | |
214 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
215 | + | |
216 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
217 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
218 | + window.checkBox("delCommentCheckBox").check(); | |
219 | + SProperties.saveSetting(getProperties()); | |
220 | + | |
221 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
222 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
223 | + window.checkBox("delCommentCheckBox").uncheck(); | |
224 | + SProperties.saveSetting(getProperties()); | |
225 | + } | |
226 | + | |
227 | + @Test | |
228 | + public void testCommentDownloadNum() { | |
229 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
230 | + | |
231 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
232 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
233 | + window.checkBox("fixCommentNumCheckBox").check(); | |
234 | + window.textBox("commentNumField").selectAll().enterText("100"); | |
235 | + SProperties.saveSetting(getProperties()); | |
236 | + | |
237 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
238 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
239 | + window.checkBox("fixCommentNumCheckBox").uncheck(); | |
240 | + window.radioButton("commentSaveFolderRadioButton").check(); | |
241 | + window.textBox("commentNumField").deleteText(); | |
242 | + SProperties.saveSetting(getProperties()); | |
243 | + | |
244 | + } | |
245 | + | |
246 | + @Test | |
247 | + public void testCommentDownloadFolder() { | |
248 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
249 | + | |
250 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
251 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
252 | + window.radioButton("commentSaveFolderRadioButton").check(); | |
253 | + window.textBox("commentSavedFolderField").selectAll().enterText("c:\\comment\\"); | |
254 | + window.textBox("commentSavedFileField").selectAll().enterText("c:\\comment\\file.xml"); | |
255 | + SProperties.saveSetting(getProperties()); | |
256 | + | |
257 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
258 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
259 | + window.radioButton("commentSaveFileRadioButton").check(); | |
260 | + window.textBox("commentSavedFolderField").selectAll().enterText("comment"); | |
261 | + window.textBox("commentSavedFileField").selectAll().enterText("file.xml"); | |
262 | + SProperties.saveSetting(getProperties()); | |
263 | + | |
264 | + } | |
265 | + | |
266 | + @Test | |
267 | + public void testCommentFolderButton() { | |
268 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
269 | + | |
270 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
271 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
272 | + window.button("showSavingCommentFolderDialogButton").click(); | |
273 | + JFileChooserFixture chooser = JFileChooserFinder.findFileChooser().using(robot); | |
274 | + File folder = new File("F:\\docs\\NetBeansProjects"); | |
275 | + chooser.selectFile(folder).approve(); | |
276 | + assertThat(folder.getAbsolutePath()).isEqualTo(window.textBox("commentSavedFolderField").text()); | |
277 | + } | |
278 | + | |
279 | + @Test | |
280 | + public void testCommentFileButton() { | |
281 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
282 | + | |
283 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
284 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
285 | + window.button("showSavingCommentFileDialogButton").click(); | |
286 | + JFileChooserFixture chooser = JFileChooserFinder.findFileChooser().using(robot); | |
287 | + File folder = new File("F:\\docs\\NetBeansProjects\\comment.xml"); | |
288 | + chooser.selectFile(folder).approve(); | |
289 | + assertThat(folder.getAbsolutePath()).isEqualTo(window.textBox("commentSavedFileField").text()); | |
290 | + } | |
291 | + | |
292 | + @Test | |
293 | + public void testDownloadTcomment() { | |
294 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
295 | + | |
296 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
297 | + window.tabbedPane("saveTabbedPane").selectTab("入力投稿者コメント"); | |
298 | + window.checkBox("needDownloadTcomment").check(); | |
299 | + SProperties.saveSetting(getProperties()); | |
300 | + | |
301 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
302 | + window.tabbedPane("saveTabbedPane").selectTab("入力投稿者コメント"); | |
303 | + window.checkBox("needDownloadTcomment").uncheck(); | |
304 | + SProperties.saveSetting(getProperties()); | |
305 | + } | |
306 | + | |
307 | + @Test | |
308 | + public void testDeleteTcomment() { | |
309 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
310 | + | |
311 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
312 | + window.tabbedPane("saveTabbedPane").selectTab("入力投稿者コメント"); | |
313 | + window.checkBox("delTcomment").check(); | |
314 | + SProperties.saveSetting(getProperties()); | |
315 | + | |
316 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
317 | + window.tabbedPane("saveTabbedPane").selectTab("入力投稿者コメント"); | |
318 | + window.checkBox("delTcomment").uncheck(); | |
319 | + SProperties.saveSetting(getProperties()); | |
320 | + } | |
321 | + | |
322 | + @Test | |
323 | + public void testTcommentDownloadFolder() { | |
324 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
325 | + | |
326 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
327 | + window.tabbedPane("saveTabbedPane").selectTab("入力投稿者コメント"); | |
328 | + window.radioButton("tcommentSaveInFolder").check(); | |
329 | + window.textBox("tcommentFolder").selectAll().enterText("c:\\comment\\"); | |
330 | + window.textBox("tcommentFile").selectAll().enterText("c:\\comment\\file.xml"); | |
331 | + SProperties.saveSetting(getProperties()); | |
332 | + | |
333 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
334 | + window.tabbedPane("saveTabbedPane").selectTab("入力投稿者コメント"); | |
335 | + window.radioButton("tcommentSaveToFile").check(); | |
336 | + window.textBox("tcommentFolder").selectAll().enterText("comment"); | |
337 | + window.textBox("tcommentFile").selectAll().enterText("file.xml"); | |
338 | + SProperties.saveSetting(getProperties()); | |
339 | + | |
340 | + } | |
341 | + | |
342 | + @Test | |
343 | + public void testTcommentFolderButton() { | |
344 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
345 | + | |
346 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
347 | + window.tabbedPane("saveTabbedPane").selectTab("入力投稿者コメント"); | |
348 | + window.button("tcoomentFolderChooserButton").click(); | |
349 | + JFileChooserFixture chooser = JFileChooserFinder.findFileChooser().using(robot); | |
350 | + File folder = new File("F:\\docs\\NetBeansProjects\\saccubus_frontend\\src"); | |
351 | + chooser.selectFile(folder).approve(); | |
352 | + assertThat(folder.getAbsolutePath()).isEqualTo(window.textBox("tcommentFolder").text()); | |
353 | + } | |
354 | + | |
355 | + @Test | |
356 | + public void testTcommentFileButton() { | |
357 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
358 | + | |
359 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
360 | + window.tabbedPane("saveTabbedPane").selectTab("入力投稿者コメント"); | |
361 | + window.button("tcommentFileChooserButton").click(); | |
362 | + JFileChooserFixture chooser = JFileChooserFinder.findFileChooser().using(robot); | |
363 | + File folder = new File("F:\\docs\\NetBeansProjects\\tcomment.xml"); | |
364 | + chooser.selectFile(folder).approve(); | |
365 | + assertThat(folder.getAbsolutePath()).isEqualTo(window.textBox("tcommentFile").text()); | |
366 | + } | |
367 | + | |
368 | + @Test | |
369 | + public void testConvertVideo() { | |
370 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
371 | + | |
372 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
373 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
374 | + window.checkBox("savingConvertedVideoCheckBox").uncheck(); | |
375 | + SProperties.saveSetting(getProperties()); | |
376 | + | |
377 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
378 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
379 | + window.checkBox("savingConvertedVideoCheckBox").check(); | |
380 | + SProperties.saveSetting(getProperties()); | |
381 | + } | |
382 | + | |
383 | + @Test | |
384 | + public void testAddComment() { | |
385 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
386 | + | |
387 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
388 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
389 | + window.checkBox("addComment").uncheck(); | |
390 | + SProperties.saveSetting(getProperties()); | |
391 | + | |
392 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
393 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
394 | + window.checkBox("addComment").check(); | |
395 | + SProperties.saveSetting(getProperties()); | |
396 | + } | |
397 | + | |
398 | + @Test | |
399 | + public void testAddTcomment() { | |
400 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
401 | + | |
402 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
403 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
404 | + window.checkBox("addTcomment").uncheck(); | |
405 | + SProperties.saveSetting(getProperties()); | |
406 | + | |
407 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
408 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
409 | + window.checkBox("addTcomment").check(); | |
410 | + SProperties.saveSetting(getProperties()); | |
411 | + } | |
412 | + | |
413 | + @Test | |
414 | + public void testNoAddId() { | |
415 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
416 | + | |
417 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
418 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
419 | + window.checkBox("notAddVideoIdConvVideoCheckBox").uncheck(); | |
420 | + SProperties.saveSetting(getProperties()); | |
421 | + | |
422 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
423 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
424 | + window.checkBox("notAddVideoIdConvVideoCheckBox").check(); | |
425 | + SProperties.saveSetting(getProperties()); | |
426 | + } | |
427 | + | |
428 | + @Test | |
429 | + public void testConvertedVideoSavePlace() { | |
430 | + Mockit.setUpMocks(new MockProperties(), new MockFileOutputStream()); | |
431 | + | |
432 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
433 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
434 | + window.radioButton("convSaveFolderRadioButton").check(); | |
435 | + window.textBox("convertedVideoSavedFolderField").setText("folder"); | |
436 | + window.textBox("convertedVideoSavedFileField").setText("converted.avi"); | |
437 | + SProperties.saveSetting(getProperties()); | |
438 | + | |
439 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
440 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
441 | + window.radioButton("convSaveFileRadioButton").check(); | |
442 | + window.textBox("convertedVideoSavedFolderField").setText("folder\\folder2"); | |
443 | + window.textBox("convertedVideoSavedFileField").setText("folder\\converted.avi"); | |
444 | + SProperties.saveSetting(getProperties()); | |
445 | + } | |
446 | + | |
447 | + @MockClass(realClass = FileOutputStream.class) | |
448 | + public static class MockFileOutputStream { | |
449 | + | |
450 | + public MockFileOutputStream() { | |
451 | + } | |
452 | + | |
453 | + @Mock | |
454 | + public MockFileOutputStream(String name) { | |
455 | + System.out.println("FileOutputStream constructor mocked."); | |
456 | + } | |
457 | + } | |
458 | + | |
459 | + @MockClass(realClass = Properties.class) | |
460 | + public static class MockProperties { | |
461 | + | |
462 | + private Map<String, String> map = new HashMap<String, String>(); | |
463 | + | |
464 | + @Mock | |
465 | + public void storeToXML(OutputStream os, String comment) { | |
466 | + System.out.println("storeToXML mocked."); | |
467 | + | |
468 | + // 基本設定 | |
469 | + window.tabbedPane("mainTabbedPane").selectTab("基本設定"); | |
470 | + // ユーザ設定 | |
471 | + assertThat(map.get("MailAddress")).isEqualTo(window.textBox("mailAddressField").text()); | |
472 | + assertThat(map.get("Password")).isEqualTo(window.textBox("passwordField").text()); | |
473 | + // プロキシ設定 | |
474 | + assertThat(Boolean.parseBoolean(map.get("UseProxy"))).isEqualTo(window.checkBox("useProxyCheckBox"). | |
475 | + component().isSelected()); | |
476 | + assertThat(map.get("Proxy")).isEqualTo(window.textBox("proxyTextField").text()); | |
477 | + final String port = window.textBox("proxyPortTextField").text(); | |
478 | + if (!"".equals(port)) { | |
479 | + assertThat(map.get("ProxyPort")).isEqualTo(port); | |
480 | + } else { | |
481 | + assertThat(map.get("ProxyPort")).as("ポートが空の場合には-1(無効な番号)を設定する").isEqualTo("-1"); | |
482 | + } | |
483 | + | |
484 | + // 保存設定 - 入力動画 | |
485 | + window.tabbedPane("mainTabbedPane").selectTab("保存設定"); | |
486 | + window.tabbedPane("saveTabbedPane").selectTab("入力動画"); | |
487 | + | |
488 | + final VideoSaveKind saveVideo = VideoSaveKind.valueOf(map.get("SaveVideoFile")); | |
489 | + switch (saveVideo) { | |
490 | + case NO_SAVE: | |
491 | + window.radioButton("videoNoSaveButton").requireSelected(); | |
492 | + window.radioButton("videoSaveButton").requireNotSelected(); | |
493 | + window.radioButton("videoUseNiBrButton").requireNotSelected(); | |
494 | + break; | |
495 | + case SAVE: | |
496 | + window.radioButton("videoNoSaveButton").requireNotSelected(); | |
497 | + window.radioButton("videoSaveButton").requireSelected(); | |
498 | + window.radioButton("videoUseNiBrButton").requireNotSelected(); | |
499 | + break; | |
500 | + case NICOBROWSER: | |
501 | + window.radioButton("videoNoSaveButton").requireNotSelected(); | |
502 | + window.radioButton("videoSaveButton").requireNotSelected(); | |
503 | + window.radioButton("videoUseNiBrButton").requireSelected(); | |
504 | + break; | |
505 | + default: | |
506 | + fail(); | |
507 | + } | |
508 | + | |
509 | + final boolean videoAutoNaming = Boolean.parseBoolean(map.get("VideoFixFileName")); | |
510 | + if (videoAutoNaming) { | |
511 | + window.radioButton("saveFolderRadioButton").requireSelected(); | |
512 | + window.radioButton("saveFileRadioButton").requireNotSelected(); | |
513 | + } else { | |
514 | + window.radioButton("saveFolderRadioButton").requireNotSelected(); | |
515 | + window.radioButton("saveFileRadioButton").requireSelected(); | |
516 | + } | |
517 | + | |
518 | + assertThat(Boolean.parseBoolean(map.get("DeleteVideoAfterConv"))).isEqualTo(window.checkBox( | |
519 | + "delVideoCheckBox").component().isSelected()); | |
520 | + assertThat(map.get("VideoFixFileNameFolder")).isEqualTo(new File(window.textBox("videoSavedFolderField"). | |
521 | + text()).getPath()); | |
522 | + assertThat(map.get("VideoFile")).isEqualTo(window.textBox("videoSavedFileField").text()); | |
523 | + | |
524 | + assertThat(map.get("NicoBrowserFileName")).isEqualTo(window.textBox("nibrFileField").text()); | |
525 | + | |
526 | + | |
527 | + // 保存設定 - 入力コメント | |
528 | + window.tabbedPane("saveTabbedPane").selectTab("入力コメント"); | |
529 | + | |
530 | + assertThat(Boolean.parseBoolean(map.get("SaveCommentFile"))).isEqualTo(window.checkBox( | |
531 | + "savingCommentCheckBox").component().isSelected()); | |
532 | + assertThat(Boolean.parseBoolean(map.get("DeleteCommentAfterConv"))).isEqualTo(window.checkBox( | |
533 | + "delCommentCheckBox").component().isSelected()); | |
534 | + assertThat(Boolean.parseBoolean(map.get("FixCommentSize"))).isEqualTo(window.checkBox( | |
535 | + "fixCommentNumCheckBox").component().isSelected()); | |
536 | + // 空だったらデフォルト値500を設定する | |
537 | + String backComment = (window.textBox("commentNumField").text().isEmpty()) ? "500" : window.textBox( | |
538 | + "commentNumField").text(); | |
539 | + assertThat(map.get("BackComment")).isEqualTo(backComment); | |
540 | + | |
541 | + final boolean commentAutoNaming = Boolean.parseBoolean(map.get("CommentFixFileName")); | |
542 | + if (commentAutoNaming) { | |
543 | + window.radioButton("commentSaveFolderRadioButton").requireSelected(); | |
544 | + window.radioButton("commentSaveFileRadioButton").requireNotSelected(); | |
545 | + } else { | |
546 | + window.radioButton("commentSaveFolderRadioButton").requireNotSelected(); | |
547 | + window.radioButton("commentSaveFileRadioButton").requireSelected(); | |
548 | + } | |
549 | + | |
550 | + assertThat(map.get("CommentFixFileNameFolder")).isEqualTo(new File(window.textBox("commentSavedFolderField"). | |
551 | + text()).getPath()); | |
552 | + assertThat(map.get("CommentFile")).isEqualTo(window.textBox("commentSavedFileField").text()); | |
553 | + | |
554 | + | |
555 | + // 保存設定 - 入力投稿者コメント | |
556 | + window.tabbedPane("saveTabbedPane").selectTab("入力投稿者コメント"); | |
557 | + | |
558 | + assertThat(Boolean.parseBoolean(map.get("TCDownload"))).isEqualTo(window.checkBox("needDownloadTcomment"). | |
559 | + component().isSelected()); | |
560 | + assertThat(Boolean.parseBoolean(map.get("TCDelete"))).isEqualTo(window.checkBox("delTcomment").component(). | |
561 | + isSelected()); | |
562 | + | |
563 | + final boolean tcommAutoNaming = Boolean.parseBoolean(map.get("TCAutoNaming")); | |
564 | + if (tcommAutoNaming) { | |
565 | + window.radioButton("tcommentSaveInFolder").requireSelected(); | |
566 | + window.radioButton("tcommentSaveToFile").requireNotSelected(); | |
567 | + } else { | |
568 | + window.radioButton("tcommentSaveInFolder").requireNotSelected(); | |
569 | + window.radioButton("tcommentSaveToFile").requireSelected(); | |
570 | + } | |
571 | + | |
572 | + assertThat(map.get("TCDirectory")).isEqualTo(window.textBox("tcommentFolder").text()); | |
573 | + assertThat(map.get("TCFileName")).isEqualTo(window.textBox("tcommentFile").text()); | |
574 | + | |
575 | + | |
576 | + // 保存設定 - 出力コメント付き動画 | |
577 | + window.tabbedPane("saveTabbedPane").selectTab("出力コメント付き動画"); | |
578 | + | |
579 | + assertThat(Boolean.parseBoolean(map.get("SaveConvertedFile"))).isEqualTo(window.checkBox( | |
580 | + "savingConvertedVideoCheckBox").component().isSelected()); | |
581 | + assertThat(Boolean.parseBoolean(map.get("AddComment"))).isEqualTo(window.checkBox("addComment").component(). | |
582 | + isSelected()); | |
583 | + assertThat(Boolean.parseBoolean(map.get("AddTcomment"))).isEqualTo(window.checkBox("addTcomment").component(). | |
584 | + isSelected()); | |
585 | + | |
586 | + final boolean convertedAutoNaming = Boolean.parseBoolean(map.get("ConvFixFileName")); | |
587 | + if (convertedAutoNaming) { | |
588 | + window.radioButton("convSaveFolderRadioButton").requireSelected(); | |
589 | + window.radioButton("convSaveFileRadioButton").requireNotSelected(); | |
590 | + } else { | |
591 | + window.radioButton("convSaveFolderRadioButton").requireNotSelected(); | |
592 | + window.radioButton("convSaveFileRadioButton").requireSelected(); | |
593 | + } | |
594 | + | |
595 | + assertThat(Boolean.parseBoolean(map.get("NotAddVideoIDtoConverted"))).isEqualTo(window.checkBox( | |
596 | + "notAddVideoIdConvVideoCheckBox").component().isSelected()); | |
597 | + assertThat(map.get("ConvFixFileNameFolder")).isEqualTo( | |
598 | + window.textBox("convertedVideoSavedFolderField").text()); | |
599 | + assertThat(map.get("ConvertedFile")).isEqualTo(window.textBox("convertedVideoSavedFileField").text()); | |
600 | + | |
601 | + | |
602 | + // 基本設定 | |
603 | + window.tabbedPane("mainTabbedPane").selectTab("動画設定"); | |
604 | + | |
605 | + assertThat(map.get("FFnpegPath")).isEqualTo(window.textBox("ffmpegPathField").text()); | |
606 | + assertThat(map.get("VhookPath")).isEqualTo(window.textBox("vhookPathField").text()); | |
607 | + | |
608 | + assertThat(map.get("CMD_EXT")).isEqualTo(window.textBox("extOptionField").text()); | |
609 | + assertThat(map.get("CMD_MAIN")).isEqualTo(window.textBox("mainOptionField").text()); | |
610 | + assertThat(map.get("CMD_IN")).isEqualTo(window.textBox("inputOptionField").text()); | |
611 | + assertThat(map.get("CMD_OUT")).isEqualTo(window.textBox("outputOptionField").text()); | |
612 | + | |
613 | + | |
614 | + // 変換設定 | |
615 | + window.tabbedPane("mainTabbedPane").selectTab("変換設定"); | |
616 | + assertThat(Boolean.parseBoolean(map.get("VhookDisabled"))).isEqualTo(window.checkBox("disableVhookCheckBox"). | |
617 | + component().isSelected()); | |
618 | + assertThat(map.get("ShowCommentNum")).isEqualTo(window.textBox("viewCommentField").text()); | |
619 | + assertThat(map.get("FontPath")).isEqualTo(window.textBox("fontPathField").text()); | |
620 | + assertThat(map.get("FontIndex")).isEqualTo(window.textBox("fontIndexField").text()); | |
621 | + window.comboBox("shadowComboBox").requireSelection(Integer.parseInt(map.get("ShadowIndex"))); | |
622 | + assertThat(Boolean.parseBoolean(map.get("ShowVideo"))).isEqualTo(window.checkBox("showConvVideoCheckBox"). | |
623 | + component().isSelected()); | |
624 | + assertThat(Boolean.parseBoolean(map.get("FixFontSize"))).isEqualTo(window.checkBox("fixFontSizeCheckBox"). | |
625 | + component().isSelected()); | |
626 | + assertThat(Boolean.parseBoolean(map.get("OpaqueComment"))).isEqualTo(window.checkBox("opaqueCommentCheckBox"). | |
627 | + component().isSelected()); | |
628 | + | |
629 | + assertThat(map.get("NG_Word")).isEqualTo(window.textBox("ngWordTextField").text()); | |
630 | + assertThat(map.get("NG_ID")).isEqualTo(window.textBox("ngIdTextField").text()); | |
631 | + | |
632 | + | |
633 | +//assertThat(map.get("TempDir")).isEqualTo(window. | |
634 | + } | |
635 | + | |
636 | + @Mock | |
637 | + public Object setProperty(String key, String value) { | |
638 | + String prev = map.put(key, value); | |
639 | +// assertNull(prev); | |
640 | + return prev; | |
641 | + } | |
642 | + } | |
643 | +} |