• R/O
  • HTTP
  • SSH
  • HTTPS

inqubus: Commit

いんきゅばす(仮称; 旧名: さきゅばすのNicoBrowser拡張版)


Commit MetaInfo

Révisionbaf6bb4a00e3e2935993cd0c8c07fb61a3f10c64 (tree)
l'heure2011-05-28 03:44:06
Auteuryuki <yuki@c066...>
Commiteryuki

Message de Log

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

Change Summary

Modification

--- a/frontend/README.html
+++ b/frontend/README.html
@@ -1,16 +1,10 @@
11 <!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&amp;o=9&amp;p=15&amp;l=st1&amp;mode=toys-jp&amp;search=%E5%88%9D%E9%9F%B3%E3%83%9F%E3%82%AF&amp;fc1=000000&amp;lt1=&amp;lc1=3366FF&amp;bg1=FFFFFF&amp;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&amp;o=9&amp;p=15&amp;l=st1&amp;mode=toys-jp&amp;search=%E5%88%9D%E9%9F%B3%E3%83%9F%E3%82%AF&amp;fc1=000000&amp;lt1=&amp;lc1=3366FF&amp;bg1=FFFFFF&amp;f=ifr" marginwidth="0" frameborder="0" height="240" scrolling="no" width="468"></iframe></p>
116 <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>で
148 ダウンロードしたコンテンツを<a href="http://saccubus.sourceforge.jp/">さきゅばす</a>ver.1.22r
159 に処理させることができるよう拡張したものです。</p>
1610 <h3>&nbsp;改正著作権法に関して留意事項<br>
@@ -26,8 +20,7 @@
2620 <li>投稿者コメントのダウンロード、動画への付与。</li>
2721 <li>公式動画(soで始まる動画)のコメントダウンロード、変換。</li>
2822 <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>
3124 でなく <a href="http://www.nicovideo.jp/watch/1259333700">http://www.nicovideo.jp/watch/1259333700</a>
3225 と入力する必要がある。<br>
3326 </li>
@@ -55,8 +48,7 @@
5548 <p>また、Linuxで動作させる場合には、上記以外にSDL, SDL_ttf, SDL_gfxの導入が必要です。<br>
5649 </p>
5750 <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">こ
6052 ちら</a>を参考にして、binディレクトリにあるffmpeg.exeをDEP対象から外して下さい。</p>
6153 <p>&nbsp;</p>
6254 <h3>本プログラムの導入方法</h3>
@@ -69,25 +61,29 @@
6961 <p></p>
7062 <p>&nbsp;</p>
7163 <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>
7865 <p>さきゅばすを起動し、上図枠内のラジオボタン「NicoBrowserダウンロードファイルを用いる」をクリックし、<strong>テキスト
7966 フィールドにファイルをドラッグ&amp;ドロップ</strong>、あるいは直接入力する。</p>
8067 <p>&nbsp;</p>
8168 <h3>注意点</h3>
8269 <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
8571 との同時起動は行えない。 </li>
8672 <li>Windows Vistaや7ではさきゅばすの変換処理が進まない場合があるらしい。対処方法は前述「動作環境」を参照。</li>
8773 </ul>
8874 <p><br>
8975 </p>
90-<h3>&nbsp;更新履歴</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>
9187 <p>2010/05/13 ver.1.4.2<br>
9288 サービスのアクセスURL変更に対応。<br>
9389 </p>
@@ -140,5 +136,4 @@ UIの見直し。<br>
140136 <p>2009/12/03 ver.0.0.0<br>
141137 初版<br>
142138 </p>
143-</body>
144-</html>
139+</body></html>
\ No newline at end of file
--- /dev/null
+++ b/frontend/fest-swing_mapping.txt
@@ -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
--- a/frontend/nbproject/project.properties
+++ b/frontend/nbproject/project.properties
@@ -22,6 +22,7 @@ dist.jar=${dist.dir}/Saccubus.jar
2222 dist.javadoc.dir=${dist.dir}/javadoc
2323 endorsed.classpath=
2424 excludes=
25+file.reference.jmockit.jar=F:\\data\\java\\jmockit-0.998\\jmockit.jar
2526 includes=**
2627 jar.compress=false
2728 javac.classpath=\
@@ -44,7 +45,9 @@ javac.target=1.5
4445 javac.test.classpath=\
4546 ${javac.classpath}:\
4647 ${build.classes.dir}:\
47- ${libs.junit_4.classpath}
48+ ${libs.junit_4.classpath}:\
49+ ${libs.FEST-Swing.classpath}:\
50+ ${file.reference.jmockit.jar}
4851 javadoc.additionalparam=
4952 javadoc.author=false
5053 javadoc.encoding=${source.encoding}
--- a/frontend/src/saccubus/MainFrame.java
+++ b/frontend/src/saccubus/MainFrame.java
@@ -77,7 +77,7 @@ import yukihane.nicovideo.NicoDBFinder;
7777 public class MainFrame extends JFrame {
7878
7979 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";
8181 public static final Image WinIcon = Toolkit.getDefaultToolkit().createImage(saccubus.MainFrame.class.getResource(
8282 "icon32.png"));
8383 // TODO GUIが無いためフィールドに保持.
@@ -90,7 +90,7 @@ public class MainFrame extends JFrame {
9090 JMenu jMenuHelp = new JMenu();
9191 JMenuItem jMenuHelpAbout = new JMenuItem();
9292 JLabel statusBar = new JLabel();
93- JTabbedPane MainTabbedPane = new JTabbedPane();
93+ JTabbedPane mainTabbedPane = new JTabbedPane();
9494 JPanel SavingInfoTabPanel = new JPanel();
9595 JPanel FFMpegTabPanel = new JPanel();
9696 JPanel VideoInfoPanel = new JPanel();
@@ -101,16 +101,37 @@ public class MainFrame extends JFrame {
101101 public static final String DoButtonWaitString = "待機";
102102 JPanel UserInfoPanel = new JPanel();
103103 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();
108109 GridBagLayout gridBagLayout4 = new GridBagLayout();
109110 GridBagLayout gridBagLayout6 = new GridBagLayout();
110111 ButtonGroup CommentSaveButtonGroup = new ButtonGroup();
111112 ButtonGroup ConvSaveButtonGroup = new ButtonGroup();
112113
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+
113132 public MainFrame() {
133+ setNames();
134+
114135 videoSaveInfoPanel = savePanel.getVideoSaveInfoPanel();
115136
116137 try {
@@ -368,8 +389,8 @@ public class MainFrame extends JFrame {
368389 SavingInfoTabPanel.setLayout(new GridLayout());
369390 UserInfoPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "ユーザ設定"));
370391 UserInfoPanel.setLayout(gridBagLayout3);
371- MailAddrLabel.setText("メールアドレス");
372- PasswordLabel.setText("パスワード");
392+ mailAddressLabel.setText("メールアドレス");
393+ passwordLabel.setText("パスワード");
373394
374395 setListenerToSavePanelButton();
375396
@@ -395,10 +416,10 @@ public class MainFrame extends JFrame {
395416 SettingFontPathButton.setText("参照");
396417 SettingFontPathButton.addActionListener(new MainFrame_SettingFontPathButton_actionAdapter(
397418 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("メインオプション");
402423 FontIndexLabel.setText("フォント番号");
403424 VideoID_Label.setText("URL/ID");
404425 WayBackLabel.setText("過去ログ");
@@ -412,40 +433,40 @@ public class MainFrame extends JFrame {
412433 setJMenuBar(jMenuBar1);
413434
414435 contentPane.add(statusBar, BorderLayout.SOUTH);
415- contentPane.add(MainTabbedPane, java.awt.BorderLayout.CENTER);
436+ contentPane.add(mainTabbedPane, java.awt.BorderLayout.CENTER);
416437 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,
418439 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
419440 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,
421442 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
422443 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,
424445 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
425446 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,
427448 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
428449 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,
430451 1, 1.0, 0.0, GridBagConstraints.CENTER,
431452 GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 0));
432453 PathSettingPanel.add(SettingFFmpegPathButton, gridBagConstraints74);
433454 PathSettingPanel.add(FFmpegPathLabel, new GridBagConstraints(0, 0, 2,
434455 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
435456 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,
437458 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
438459 new Insets(0, 5, 5, 5), 0, 0));
439460 PathSettingPanel.add(SettingVhookPathButton, new GridBagConstraints(1,
440461 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
441462 GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0));
442463 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);
449470 FFmpegSettingPanel.add(getFFmpegOptionComboBoxPanel(),
450471 gridBagConstraints55);
451472 FFmpegSettingPanel.add(ExtOptionLabel, gridBagConstraints56);
@@ -459,17 +480,17 @@ public class MainFrame extends JFrame {
459480 OpPanel.add(WayBackLabel, gridBagConstraints69);
460481 OpPanel.add(WayBackField, gridBagConstraints70);
461482
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);
466487 SavingInfoTabPanel.add(savePanel);
467488 BasicInfoTabPanel.add(UserInfoPanel, gridBagConstraints7);
468489 BasicInfoTabPanel.add(getProxyInfoPanel(), gridBagConstraints6);
469490 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);
473494 VhookSettingPanel.add(FontIndexLabel, gridBagConstraints61);
474495 VhookSettingPanel.add(SettingFontPathButton, gridBagConstraints64);
475496 VhookSettingPanel.add(getFixFontSizeCheckBox(), gridBagConstraints14);
@@ -511,12 +532,12 @@ public class MainFrame extends JFrame {
511532 }
512533
513534 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));
520541 savePanel.getCommentNumField().addMouseListener(new PopupRightClick(
521542 savePanel.getCommentNumField()));
522543
@@ -537,27 +558,27 @@ public class MainFrame extends JFrame {
537558 videoSaveInfoPanel.getNibrFileField().addMouseListener(
538559 new PopupRightClick(videoSaveInfoPanel.getNibrFileField()));
539560
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));
543564 VideoID_TextField.addMouseListener(new PopupRightClick(
544565 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));
550571 WayBackField.addMouseListener(new PopupRightClick(this.WayBackField));
551572
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));
555576
556- FontIndexField.addMouseListener(new PopupRightClick(this.FontIndexField));
577+ fontIndexField.addMouseListener(new PopupRightClick(this.fontIndexField));
557578
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));
561582 }
562583
563584 private void setDropTarget() {
@@ -571,9 +592,9 @@ public class MainFrame extends JFrame {
571592 addTarget(savePanel.getConvertedVideoSavedFileField(), false);
572593 addTarget(savePanel.getConvertedVideoSavedFolderField(), true);
573594
574- addTarget(FFmpegPathField, false);
575- addTarget(VhookPathField, false);
576- addTarget(FontPathField, false);
595+ addTarget(ffmpegPathField, false);
596+ addTarget(vhookPathField, false);
597+ addTarget(fontPathField, false);
577598
578599 }
579600
@@ -588,23 +609,22 @@ public class MainFrame extends JFrame {
588609 c, isDir), true);
589610 }
590611 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();
608628
609629 private void showSaveDialog(String title, JTextField field, boolean isSave,
610630 boolean isDir) {
@@ -621,7 +641,7 @@ public class MainFrame extends JFrame {
621641 }
622642 if (code == JFileChooser.APPROVE_OPTION) {
623643 if (isDir) {
624- CurrentDir = chooser.getCurrentDirectory();
644+ CurrentDir = chooser.getSelectedFile();
625645 field.setText(CurrentDir.getAbsolutePath());
626646 } else {
627647 File selected = chooser.getSelectedFile();
@@ -651,16 +671,16 @@ public class MainFrame extends JFrame {
651671 // 基本設定
652672 final BasicSetting basic = setting.getBasicSetting();
653673 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());
656676 // プロキシ関連
657- UseProxyCheckBox.setSelected(basic.isProxyUse());
658- ProxyTextField.setText(basic.getProxyHost());
677+ useProxyCheckBox.setSelected(basic.isProxyUse());
678+ proxyTextField.setText(basic.getProxyHost());
659679 int proxy_port = basic.getProxyPort();
660680 if (proxy_port >= 0 && proxy_port <= 65535) {
661- ProxyPortTextField.setText(Integer.toString(proxy_port));
681+ proxyPortTextField.setText(Integer.toString(proxy_port));
662682 } else {
663- ProxyPortTextField.setText("");
683+ proxyPortTextField.setText("");
664684 }
665685
666686 // 保存設定 - 入力動画
@@ -722,26 +742,26 @@ public class MainFrame extends JFrame {
722742
723743 // 動画設定
724744 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());
731751 FFmpegOptionModel.reload(movie.getOptionFile());
732752
733753 // 変換設定
734754 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());
745765 }
746766
747767 /**
@@ -770,38 +790,38 @@ public class MainFrame extends JFrame {
770790 }
771791
772792 /* 変換・保存する */
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();
791809 private JPanel ConvertingSettingPanel = null;
792810 private JPanel NGWordSettingPanel = null;
793811 private JLabel NGWordLavel = null;
794- private JTextField NGWordTextField = null;
812+ private JTextField ngWordTextField = null;
795813 private JLabel NGIDLabel = null;
796- private JTextField NGIDTextField = null;
814+ private JTextField ngIdTextField = null;
815+ // プロキシ設定
797816 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;
805825 private final SavePanel savePanel = new SavePanel();
806826 private final VideoSaveInfoPanel videoSaveInfoPanel;
807827 private JComboBox FFmpegOptionComboBox = null;
@@ -889,15 +909,15 @@ public class MainFrame extends JFrame {
889909
890910 /* FFmpegへのパス */
891911 public void SettingFFmpegPathButton_actionPerformed(ActionEvent e) {
892- showSaveDialog("FFmpegへのパス", FFmpegPathField, false, false);
912+ showSaveDialog("FFmpegへのパス", ffmpegPathField, false, false);
893913 }
894914
895915 public void SettingVhookPathButton_actionPerformed(ActionEvent e) {
896- showSaveDialog("拡張vhookライブラリへのパス", VhookPathField, false, false);
916+ showSaveDialog("拡張vhookライブラリへのパス", vhookPathField, false, false);
897917 }
898918
899919 public void SettingFontPathButton_actionPerformed(ActionEvent e) {
900- showSaveDialog("フォントへのパス", FontPathField, false, false);
920+ showSaveDialog("フォントへのパス", fontPathField, false, false);
901921 }
902922
903923 public void this_windowClosing(WindowEvent e) {
@@ -985,10 +1005,11 @@ public class MainFrame extends JFrame {
9851005 * @return javax.swing.JTextField
9861006 */
9871007 private JTextField getNGWordTextField() {
988- if (NGWordTextField == null) {
989- NGWordTextField = new JTextField();
1008+ if (ngWordTextField == null) {
1009+ ngWordTextField = new JTextField();
1010+ ngWordTextField.setName("ngWordTextField");
9901011 }
991- return NGWordTextField;
1012+ return ngWordTextField;
9921013 }
9931014
9941015 /**
@@ -997,10 +1018,11 @@ public class MainFrame extends JFrame {
9971018 * @return javax.swing.JTextField
9981019 */
9991020 private JTextField getNGIDTextField() {
1000- if (NGIDTextField == null) {
1001- NGIDTextField = new JTextField();
1021+ if (ngIdTextField == null) {
1022+ ngIdTextField = new JTextField();
1023+ ngIdTextField.setName("ngIdTextField");
10021024 }
1003- return NGIDTextField;
1025+ return ngIdTextField;
10041026 }
10051027
10061028 /**
@@ -1027,8 +1049,8 @@ public class MainFrame extends JFrame {
10271049 gridBagConstraints10.gridx = 0;
10281050 gridBagConstraints10.insets = new Insets(5, 5, 5, 5);
10291051 gridBagConstraints10.gridy = 2;
1030- ProxyPortLabel = new JLabel();
1031- ProxyPortLabel.setText("ポート番号");
1052+ proxyPortLabel = new JLabel();
1053+ proxyPortLabel.setText("ポート番号");
10321054 GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
10331055 gridBagConstraints9.fill = GridBagConstraints.BOTH;
10341056 gridBagConstraints9.gridy = 1;
@@ -1041,15 +1063,15 @@ public class MainFrame extends JFrame {
10411063 gridBagConstraints8.fill = GridBagConstraints.NONE;
10421064 gridBagConstraints8.anchor = GridBagConstraints.EAST;
10431065 gridBagConstraints8.gridy = 1;
1044- ProxyLabel = new JLabel();
1045- ProxyLabel.setText("プロキシ");
1066+ proxyLabel = new JLabel();
1067+ proxyLabel.setText("プロキシ");
10461068 ProxyInfoPanel = new JPanel();
10471069 ProxyInfoPanel.setLayout(new GridBagLayout());
10481070 ProxyInfoPanel.setBorder(BorderFactory.createTitledBorder(null,
10491071 "プロキシ設定"));
1050- ProxyInfoPanel.add(ProxyLabel, gridBagConstraints8);
1072+ ProxyInfoPanel.add(proxyLabel, gridBagConstraints8);
10511073 ProxyInfoPanel.add(getProxyTextField(), gridBagConstraints9);
1052- ProxyInfoPanel.add(ProxyPortLabel, gridBagConstraints10);
1074+ ProxyInfoPanel.add(proxyPortLabel, gridBagConstraints10);
10531075 ProxyInfoPanel.add(getProxyPortTextField(), gridBagConstraints12);
10541076 ProxyInfoPanel.add(getUseProxyCheckBox(), gridBagConstraints13);
10551077 }
@@ -1062,10 +1084,11 @@ public class MainFrame extends JFrame {
10621084 * @return javax.swing.JTextField
10631085 */
10641086 private JTextField getProxyTextField() {
1065- if (ProxyTextField == null) {
1066- ProxyTextField = new JTextField();
1087+ if (proxyTextField == null) {
1088+ proxyTextField = new JTextField();
1089+ proxyTextField.setName("proxyTextField");
10671090 }
1068- return ProxyTextField;
1091+ return proxyTextField;
10691092 }
10701093
10711094 /**
@@ -1074,10 +1097,11 @@ public class MainFrame extends JFrame {
10741097 * @return javax.swing.JTextField
10751098 */
10761099 private JTextField getProxyPortTextField() {
1077- if (ProxyPortTextField == null) {
1078- ProxyPortTextField = new JTextField();
1100+ if (proxyPortTextField == null) {
1101+ proxyPortTextField = new JTextField();
1102+ proxyPortTextField.setName("proxyPortTextField");
10791103 }
1080- return ProxyPortTextField;
1104+ return proxyPortTextField;
10811105 }
10821106
10831107 /**
@@ -1086,11 +1110,12 @@ public class MainFrame extends JFrame {
10861110 * @return javax.swing.JCheckBox
10871111 */
10881112 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");
10921117 }
1093- return UseProxyCheckBox;
1118+ return useProxyCheckBox;
10941119 }
10951120
10961121 /**
@@ -1099,11 +1124,12 @@ public class MainFrame extends JFrame {
10991124 * @return javax.swing.JCheckBox
11001125 */
11011126 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");
11051131 }
1106- return FixFontSizeCheckBox;
1132+ return fixFontSizeCheckBox;
11071133 }
11081134
11091135 /**
@@ -1112,11 +1138,12 @@ public class MainFrame extends JFrame {
11121138 * @return javax.swing.JCheckBox
11131139 */
11141140 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");
11181145 }
1119- return OpaqueCommentCheckBox;
1146+ return opaqueCommentCheckBox;
11201147 }
11211148 /**
11221149 * This method initializes FFmpegOptionComboBox
@@ -1125,12 +1152,12 @@ public class MainFrame extends JFrame {
11251152 */
11261153 private final OptionComboBoxModel FFmpegOptionModel = new OptionComboBoxModel();
11271154 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;
11311158 private JLabel ViewCommentLabel = null;
11321159 private JLabel ShadowKindLabel = null;
1133- private JComboBox ShadowComboBox = null;
1160+ private JComboBox shadowComboBox = null;
11341161
11351162 private JComboBox getFFmpegOptionComboBox() {
11361163 if (FFmpegOptionComboBox == null) {
@@ -1139,15 +1166,15 @@ public class MainFrame extends JFrame {
11391166
11401167 public void actionPerformed(java.awt.event.ActionEvent e) {
11411168 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);
11461173 } 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);
11511178 }
11521179 }
11531180 });
@@ -1209,10 +1236,11 @@ public class MainFrame extends JFrame {
12091236 * @return javax.swing.JTextField
12101237 */
12111238 private JTextField getExtOptionField() {
1212- if (ExtOptionField == null) {
1213- ExtOptionField = new JTextField();
1239+ if (extOptionField == null) {
1240+ extOptionField = new JTextField();
1241+ extOptionField.setName("extOptionField");
12141242 }
1215- return ExtOptionField;
1243+ return extOptionField;
12161244 }
12171245
12181246 /**
@@ -1221,11 +1249,12 @@ public class MainFrame extends JFrame {
12211249 * @return javax.swing.JCheckBox
12221250 */
12231251 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");
12271256 }
1228- return NotUseVhookCheckBox;
1257+ return disableVhookCheckBox;
12291258 }
12301259
12311260 /**
@@ -1234,10 +1263,11 @@ public class MainFrame extends JFrame {
12341263 * @return javax.swing.JTextField
12351264 */
12361265 private JTextField getViewCommentField() {
1237- if (ViewCommentField == null) {
1238- ViewCommentField = new JTextField();
1266+ if (viewCommentField == null) {
1267+ viewCommentField = new JTextField();
1268+ viewCommentField.setName("viewCommentField");
12391269 }
1240- return ViewCommentField;
1270+ return viewCommentField;
12411271 }
12421272
12431273 /**
@@ -1246,20 +1276,21 @@ public class MainFrame extends JFrame {
12461276 * @return javax.swing.JComboBox
12471277 */
12481278 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");
12511282 }
1252- return ShadowComboBox;
1283+ return shadowComboBox;
12531284 }
12541285
12551286 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();
12601291 int proxyPort;
12611292 try {
1262- proxyPort = Integer.parseInt(ProxyPortTextField.getText());
1293+ proxyPort = Integer.parseInt(proxyPortTextField.getText());
12631294 } catch (NumberFormatException e) {
12641295 proxyPort = -1;
12651296 }
@@ -1330,12 +1361,12 @@ public class MainFrame extends JFrame {
13301361 }
13311362
13321363 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();
13391370 File optionFile = FFmpegOptionModel.getSelectedFile();
13401371
13411372 FfmpegOption opt = new FfmpegOption(ext, main, in, out);
@@ -1343,19 +1374,19 @@ public class MainFrame extends JFrame {
13431374 }
13441375
13451376 private ConvertSetting getConvertSetting() {
1346- boolean vhookDisabled = NotUseVhookCheckBox.isSelected();
1377+ boolean vhookDisabled = disableVhookCheckBox.isSelected();
13471378 int maxComment = 30;
13481379 try {
1349- maxComment = Integer.parseInt(ViewCommentField.getText());
1380+ maxComment = Integer.parseInt(viewCommentField.getText());
13501381 } catch (NumberFormatException ex) {
13511382 }
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());
13591390
13601391 return new ConvertSetting(vhookDisabled, maxComment, font, fontIndex, shadowIndex, showConv, adjustFont,
13611392 commentOpaque, ngSetting);
@@ -1406,7 +1437,7 @@ public class MainFrame extends JFrame {
14061437 field = savePanel.getCommentSavedFolderField();
14071438 isSave = true;
14081439 isDir = true;
1409- } else if (source == savePanel.getShowSavingCommentFolderDialogButton()) {
1440+ } else if (source == savePanel.getShowSavingCommentFileDialogButton()) {
14101441 title = "コメントの保存先(ファイル)";
14111442 field = savePanel.getCommentSavedFileField();
14121443 isSave = true;
--- a/frontend/src/saccubus/SavePanel.form
+++ b/frontend/src/saccubus/SavePanel.form
@@ -9,9 +9,6 @@
99 <Component class="javax.swing.ButtonGroup" name="inputTcommentSaveGroup">
1010 </Component>
1111 </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>
1512 <AuxValues>
1613 <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
1714 <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@@ -27,17 +24,20 @@
2724 <Layout>
2825 <DimensionLayout dim="0">
2926 <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"/>
3128 </Group>
3229 </DimensionLayout>
3330 <DimensionLayout dim="1">
3431 <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"/>
3633 </Group>
3734 </DimensionLayout>
3835 </Layout>
3936 <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>
4141
4242 <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
4343 <SubComponents>
@@ -87,7 +87,7 @@
8787 <Group type="102" alignment="0" attributes="0">
8888 <EmptySpace max="-2" attributes="0"/>
8989 <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"/>
9191 </Group>
9292 </Group>
9393 </DimensionLayout>
@@ -131,6 +131,7 @@
131131 <Component class="javax.swing.JCheckBox" name="savingCommentCheckBox">
132132 <Properties>
133133 <Property name="text" type="java.lang.String" value="&#x30b3;&#x30e1;&#x30f3;&#x30c8;&#x3092;&#x30c0;&#x30a6;&#x30f3;&#x30ed;&#x30fc;&#x30c9;&#x3059;&#x308b;"/>
134+ <Property name="name" type="java.lang.String" value="savingCommentCheckBox" noResource="true"/>
134135 </Properties>
135136 </Component>
136137 <Container class="javax.swing.JPanel" name="jPanel7">
@@ -153,8 +154,8 @@
153154 <Group type="102" alignment="0" attributes="0">
154155 <EmptySpace min="21" pref="21" max="-2" attributes="0"/>
155156 <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"/>
158159 </Group>
159160 <EmptySpace max="-2" attributes="0"/>
160161 <Group type="103" groupAlignment="1" attributes="0">
@@ -202,11 +203,13 @@
202203 <Component class="javax.swing.JCheckBox" name="delCommentCheckBox">
203204 <Properties>
204205 <Property name="text" type="java.lang.String" value="&#x5909;&#x63db;&#x5f8c;&#x306b;&#x30b3;&#x30e1;&#x30f3;&#x30c8;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x3092;&#x524a;&#x9664;&#x3059;&#x308b;"/>
206+ <Property name="name" type="java.lang.String" value="delCommentCheckBox" noResource="true"/>
205207 </Properties>
206208 </Component>
207209 <Component class="javax.swing.JCheckBox" name="fixCommentNumCheckBox">
208210 <Properties>
209211 <Property name="text" type="java.lang.String" value="&#x30b3;&#x30e1;&#x30f3;&#x30c8;&#x53d6;&#x5f97;&#x6570;&#x306f;&#x81ea;&#x52d5;&#x3067;&#x8abf;&#x6574;&#x3059;&#x308b;"/>
212+ <Property name="name" type="java.lang.String" value="fixCommentNumCheckBox" noResource="true"/>
210213 </Properties>
211214 </Component>
212215 <Component class="javax.swing.JLabel" name="jLabel1">
@@ -215,6 +218,9 @@
215218 </Properties>
216219 </Component>
217220 <Component class="javax.swing.JTextField" name="commentNumField">
221+ <Properties>
222+ <Property name="name" type="java.lang.String" value="commentNumField" noResource="true"/>
223+ </Properties>
218224 </Component>
219225 <Component class="javax.swing.JRadioButton" name="commentSaveFolderRadioButton">
220226 <Properties>
@@ -222,13 +228,18 @@
222228 <ComponentRef name="inputCommentSaveGroup"/>
223229 </Property>
224230 <Property name="text" type="java.lang.String" value="&#x4fdd;&#x5b58;&#x3059;&#x308b;&#x30d5;&#x30a9;&#x30eb;&#x30c0;&#x3092;&#x6307;&#x5b9a;&#x3057;&#x3001;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x540d;&#x306f;&#x81ea;&#x52d5;&#x3067;&#x6c7a;&#x5b9a;&#x3059;&#x308b;"/>
231+ <Property name="name" type="java.lang.String" value="commentSaveFolderRadioButton" noResource="true"/>
225232 </Properties>
226233 </Component>
227234 <Component class="javax.swing.JTextField" name="commentSavedFolderField">
235+ <Properties>
236+ <Property name="name" type="java.lang.String" value="commentSavedFolderField" noResource="true"/>
237+ </Properties>
228238 </Component>
229239 <Component class="javax.swing.JButton" name="showSavingCommentFolderDialogButton">
230240 <Properties>
231241 <Property name="text" type="java.lang.String" value="&#x53c2;&#x7167;..."/>
242+ <Property name="name" type="java.lang.String" value="showSavingCommentFolderDialogButton" noResource="true"/>
232243 </Properties>
233244 </Component>
234245 <Component class="javax.swing.JRadioButton" name="commentSaveFileRadioButton">
@@ -237,13 +248,18 @@
237248 <ComponentRef name="inputCommentSaveGroup"/>
238249 </Property>
239250 <Property name="text" type="java.lang.String" value="&#x4fdd;&#x5b58;&#x3059;&#x308b;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x540d;&#x3092;&#x6307;&#x5b9a;&#x3059;&#x308b;"/>
251+ <Property name="name" type="java.lang.String" value="commentSaveFileRadioButton" noResource="true"/>
240252 </Properties>
241253 </Component>
242254 <Component class="javax.swing.JTextField" name="commentSavedFileField">
255+ <Properties>
256+ <Property name="name" type="java.lang.String" value="commentSavedFileField" noResource="true"/>
257+ </Properties>
243258 </Component>
244259 <Component class="javax.swing.JButton" name="showSavingCommentFileDialogButton">
245260 <Properties>
246261 <Property name="text" type="java.lang.String" value="&#x53c2;&#x7167;..."/>
262+ <Property name="name" type="java.lang.String" value="showSavingCommentFileDialogButton" noResource="true"/>
247263 </Properties>
248264 </Component>
249265 </SubComponents>
@@ -276,7 +292,7 @@
276292 <Group type="102" alignment="0" attributes="0">
277293 <EmptySpace max="-2" attributes="0"/>
278294 <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"/>
280296 </Group>
281297 </Group>
282298 </DimensionLayout>
@@ -320,6 +336,7 @@
320336 <Component class="javax.swing.JCheckBox" name="needDownloadTcomment">
321337 <Properties>
322338 <Property name="text" type="java.lang.String" value="&#x30b3;&#x30e1;&#x30f3;&#x30c8;&#x3092;&#x30c0;&#x30a6;&#x30f3;&#x30ed;&#x30fc;&#x30c9;&#x3059;&#x308b;"/>
339+ <Property name="name" type="java.lang.String" value="needDownloadTcomment" noResource="true"/>
323340 </Properties>
324341 </Component>
325342 <Container class="javax.swing.JPanel" name="jPanel8">
@@ -331,27 +348,22 @@
331348 <Group type="103" groupAlignment="0" attributes="0">
332349 <Component id="delTcomment" alignment="0" min="-2" max="-2" attributes="0"/>
333350 <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>
334364 </Group>
335365 <EmptySpace max="-2" attributes="0"/>
336366 </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>
355367 </Group>
356368 </DimensionLayout>
357369 <DimensionLayout dim="1">
@@ -382,6 +394,7 @@
382394 <Component class="javax.swing.JCheckBox" name="delTcomment">
383395 <Properties>
384396 <Property name="text" type="java.lang.String" value="&#x5909;&#x63db;&#x5f8c;&#x306b;&#x30b3;&#x30e1;&#x30f3;&#x30c8;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x3092;&#x524a;&#x9664;&#x3059;&#x308b;"/>
397+ <Property name="name" type="java.lang.String" value="delTcomment" noResource="true"/>
385398 </Properties>
386399 </Component>
387400 <Component class="javax.swing.JRadioButton" name="tcommentSaveInFolder">
@@ -390,14 +403,22 @@
390403 <ComponentRef name="inputTcommentSaveGroup"/>
391404 </Property>
392405 <Property name="text" type="java.lang.String" value="&#x4fdd;&#x5b58;&#x3059;&#x308b;&#x30d5;&#x30a9;&#x30eb;&#x30c0;&#x3092;&#x6307;&#x5b9a;&#x3057;&#x3001;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x540d;&#x306f;&#x81ea;&#x52d5;&#x3067;&#x6c7a;&#x5b9a;&#x3059;&#x308b;"/>
406+ <Property name="name" type="java.lang.String" value="tcommentSaveInFolder" noResource="true"/>
393407 </Properties>
394408 </Component>
395409 <Component class="javax.swing.JTextField" name="tcommentFolder">
410+ <Properties>
411+ <Property name="name" type="java.lang.String" value="tcommentFolder" noResource="true"/>
412+ </Properties>
396413 </Component>
397414 <Component class="javax.swing.JButton" name="tcoomentFolderChooserButton">
398415 <Properties>
399416 <Property name="text" type="java.lang.String" value="&#x53c2;&#x7167;..."/>
417+ <Property name="name" type="java.lang.String" value="tcoomentFolderChooserButton" noResource="true"/>
400418 </Properties>
419+ <Events>
420+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tcoomentFolderChooserButtonActionPerformed"/>
421+ </Events>
401422 </Component>
402423 <Component class="javax.swing.JRadioButton" name="tcommentSaveToFile">
403424 <Properties>
@@ -405,14 +426,22 @@
405426 <ComponentRef name="inputTcommentSaveGroup"/>
406427 </Property>
407428 <Property name="text" type="java.lang.String" value="&#x4fdd;&#x5b58;&#x3059;&#x308b;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x540d;&#x3092;&#x6307;&#x5b9a;&#x3059;&#x308b;"/>
429+ <Property name="name" type="java.lang.String" value="tcommentSaveToFile" noResource="true"/>
408430 </Properties>
409431 </Component>
410432 <Component class="javax.swing.JTextField" name="tcommentFile">
433+ <Properties>
434+ <Property name="name" type="java.lang.String" value="tcommentFile" noResource="true"/>
435+ </Properties>
411436 </Component>
412437 <Component class="javax.swing.JButton" name="tcommentFileChooserButton">
413438 <Properties>
414439 <Property name="text" type="java.lang.String" value="&#x53c2;&#x7167;..."/>
440+ <Property name="name" type="java.lang.String" value="tcommentFileChooserButton" noResource="true"/>
415441 </Properties>
442+ <Events>
443+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tcommentFileChooserButtonActionPerformed"/>
444+ </Events>
416445 </Component>
417446 </SubComponents>
418447 </Container>
@@ -435,7 +464,7 @@
435464 <Group type="102" alignment="0" attributes="0">
436465 <EmptySpace max="-2" attributes="0"/>
437466 <Component id="jPanel3" min="-2" max="-2" attributes="0"/>
438- <EmptySpace max="32767" attributes="0"/>
467+ <EmptySpace pref="15" max="32767" attributes="0"/>
439468 </Group>
440469 </Group>
441470 </DimensionLayout>
@@ -444,7 +473,7 @@
444473 <Group type="102" alignment="0" attributes="0">
445474 <EmptySpace max="-2" attributes="0"/>
446475 <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"/>
448477 </Group>
449478 </Group>
450479 </DimensionLayout>
@@ -489,6 +518,7 @@
489518 <Component class="javax.swing.JCheckBox" name="savingConvertedVideoCheckBox">
490519 <Properties>
491520 <Property name="text" type="java.lang.String" value="&#x52d5;&#x753b;&#x3092;&#x5909;&#x63db;&#x3059;&#x308b;"/>
521+ <Property name="name" type="java.lang.String" value="savingConvertedVideoCheckBox" noResource="true"/>
492522 </Properties>
493523 </Component>
494524 <Container class="javax.swing.JPanel" name="jPanel5">
@@ -555,11 +585,13 @@
555585 <Component class="javax.swing.JCheckBox" name="addComment">
556586 <Properties>
557587 <Property name="text" type="java.lang.String" value="&#x30b3;&#x30e1;&#x30f3;&#x30c8;&#x3092;&#x3064;&#x3051;&#x308b;"/>
588+ <Property name="name" type="java.lang.String" value="addComment" noResource="true"/>
558589 </Properties>
559590 </Component>
560591 <Component class="javax.swing.JCheckBox" name="addTcomment">
561592 <Properties>
562593 <Property name="text" type="java.lang.String" value="&#x6295;&#x7a3f;&#x8005;&#x30b3;&#x30e1;&#x30f3;&#x30c8;&#x3092;&#x3064;&#x3051;&#x308b;"/>
594+ <Property name="name" type="java.lang.String" value="addTcomment" noResource="true"/>
563595 </Properties>
564596 </Component>
565597 <Component class="javax.swing.JRadioButton" name="convSaveFolderRadioButton">
@@ -568,14 +600,19 @@
568600 <ComponentRef name="outputVideoSaveGroup"/>
569601 </Property>
570602 <Property name="text" type="java.lang.String" value="&#x4fdd;&#x5b58;&#x3059;&#x308b;&#x30d5;&#x30a9;&#x30eb;&#x30c0;&#x3092;&#x6307;&#x5b9a;&#x3057;&#x3001;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x540d;&#x306f;&#x81ea;&#x52d5;&#x3067;&#x6c7a;&#x5b9a;&#x3059;&#x308b;"/>
603+ <Property name="name" type="java.lang.String" value="convSaveFolderRadioButton" noResource="true"/>
571604 </Properties>
572605 </Component>
573606 <Component class="javax.swing.JCheckBox" name="notAddVideoIdConvVideoCheckBox">
574607 <Properties>
575608 <Property name="text" type="java.lang.String" value="&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x540d;&#x306b;&#x52d5;&#x753b;ID&#x3092;&#x4ed8;&#x52a0;&#x3057;&#x306a;&#x3044;"/>
609+ <Property name="name" type="java.lang.String" value="notAddVideoIdConvVideoCheckBox" noResource="true"/>
576610 </Properties>
577611 </Component>
578612 <Component class="javax.swing.JTextField" name="convertedVideoSavedFolderField">
613+ <Properties>
614+ <Property name="name" type="java.lang.String" value="convertedVideoSavedFolderField" noResource="true"/>
615+ </Properties>
579616 </Component>
580617 <Component class="javax.swing.JButton" name="showSavingConvertedVideoFolderDialogButton">
581618 <Properties>
@@ -588,9 +625,13 @@
588625 <ComponentRef name="outputVideoSaveGroup"/>
589626 </Property>
590627 <Property name="text" type="java.lang.String" value="&#x4fdd;&#x5b58;&#x3059;&#x308b;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x540d;&#x3092;&#x6307;&#x5b9a;&#x3059;&#x308b;"/>
628+ <Property name="name" type="java.lang.String" value="convSaveFileRadioButton" noResource="true"/>
591629 </Properties>
592630 </Component>
593631 <Component class="javax.swing.JTextField" name="convertedVideoSavedFileField">
632+ <Properties>
633+ <Property name="name" type="java.lang.String" value="convertedVideoSavedFileField" noResource="true"/>
634+ </Properties>
594635 </Component>
595636 <Component class="javax.swing.JButton" name="showSavingConvertedVideoFileDialogButton">
596637 <Properties>
--- a/frontend/src/saccubus/SavePanel.java
+++ b/frontend/src/saccubus/SavePanel.java
@@ -11,8 +11,10 @@
1111 package saccubus;
1212
1313 import java.awt.GridLayout;
14+import java.io.File;
1415 import javax.swing.JButton;
1516 import javax.swing.JCheckBox;
17+import javax.swing.JFileChooser;
1618 import javax.swing.JRadioButton;
1719 import javax.swing.JTextField;
1820
@@ -43,7 +45,7 @@ public class SavePanel extends javax.swing.JPanel {
4345 inputCommentSaveGroup = new javax.swing.ButtonGroup();
4446 outputVideoSaveGroup = new javax.swing.ButtonGroup();
4547 inputTcommentSaveGroup = new javax.swing.ButtonGroup();
46- jTabbedPane1 = new javax.swing.JTabbedPane();
48+ saveTabbedPane = new javax.swing.JTabbedPane();
4749 inputVideoTab = new javax.swing.JPanel();
4850 inputCommentTab = new javax.swing.JPanel();
4951 commentSaveInfoPanel = new javax.swing.JPanel();
@@ -84,6 +86,8 @@ public class SavePanel extends javax.swing.JPanel {
8486 convertedVideoSavedFileField = new javax.swing.JTextField();
8587 showSavingConvertedVideoFileDialogButton = new javax.swing.JButton();
8688
89+ saveTabbedPane.setName("saveTabbedPane"); // NOI18N
90+
8791 javax.swing.GroupLayout inputVideoTabLayout = new javax.swing.GroupLayout(inputVideoTab);
8892 inputVideoTab.setLayout(inputVideoTabLayout);
8993 inputVideoTabLayout.setHorizontalGroup(
@@ -95,27 +99,40 @@ public class SavePanel extends javax.swing.JPanel {
9599 .addGap(0, 270, Short.MAX_VALUE)
96100 );
97101
98- jTabbedPane1.addTab("入力動画", inputVideoTab);
102+ saveTabbedPane.addTab("入力動画", inputVideoTab);
99103
100104 commentSaveInfoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("コメント保存設定"));
101105
102106 savingCommentCheckBox.setText("コメントをダウンロードする");
107+ savingCommentCheckBox.setName("savingCommentCheckBox"); // NOI18N
103108
104109 delCommentCheckBox.setText("変換後にコメントファイルを削除する");
110+ delCommentCheckBox.setName("delCommentCheckBox"); // NOI18N
105111
106112 fixCommentNumCheckBox.setText("コメント取得数は自動で調整する");
113+ fixCommentNumCheckBox.setName("fixCommentNumCheckBox"); // NOI18N
107114
108115 jLabel1.setText("取得コメント数");
109116
117+ commentNumField.setName("commentNumField"); // NOI18N
118+
110119 inputCommentSaveGroup.add(commentSaveFolderRadioButton);
111120 commentSaveFolderRadioButton.setText("保存するフォルダを指定し、ファイル名は自動で決定する");
121+ commentSaveFolderRadioButton.setName("commentSaveFolderRadioButton"); // NOI18N
122+
123+ commentSavedFolderField.setName("commentSavedFolderField"); // NOI18N
112124
113125 showSavingCommentFolderDialogButton.setText("参照...");
126+ showSavingCommentFolderDialogButton.setName("showSavingCommentFolderDialogButton"); // NOI18N
114127
115128 inputCommentSaveGroup.add(commentSaveFileRadioButton);
116129 commentSaveFileRadioButton.setText("保存するファイル名を指定する");
130+ commentSaveFileRadioButton.setName("commentSaveFileRadioButton"); // NOI18N
131+
132+ commentSavedFileField.setName("commentSavedFileField"); // NOI18N
117133
118134 showSavingCommentFileDialogButton.setText("参照...");
135+ showSavingCommentFileDialogButton.setName("showSavingCommentFileDialogButton"); // NOI18N
119136
120137 javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
121138 jPanel7.setLayout(jPanel7Layout);
@@ -135,8 +152,8 @@ public class SavePanel extends javax.swing.JPanel {
135152 .addGroup(jPanel7Layout.createSequentialGroup()
136153 .addGap(21, 21, 21)
137154 .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))
140157 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
141158 .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
142159 .addComponent(showSavingCommentFolderDialogButton)
@@ -204,26 +221,46 @@ public class SavePanel extends javax.swing.JPanel {
204221 .addGroup(inputCommentTabLayout.createSequentialGroup()
205222 .addContainerGap()
206223 .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))
208225 );
209226
210- jTabbedPane1.addTab("入力コメント", inputCommentTab);
227+ saveTabbedPane.addTab("入力コメント", inputCommentTab);
211228
212229 tcommentSaveInfoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("投稿者コメント保存設定"));
213230
214231 needDownloadTcomment.setText("コメントをダウンロードする");
232+ needDownloadTcomment.setName("needDownloadTcomment"); // NOI18N
215233
216234 delTcomment.setText("変換後にコメントファイルを削除する");
235+ delTcomment.setName("delTcomment"); // NOI18N
217236
218237 inputTcommentSaveGroup.add(tcommentSaveInFolder);
219238 tcommentSaveInFolder.setText("保存するフォルダを指定し、ファイル名は自動で決定する");
239+ tcommentSaveInFolder.setName("tcommentSaveInFolder"); // NOI18N
240+
241+ tcommentFolder.setName("tcommentFolder"); // NOI18N
220242
221243 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+ });
222250
223251 inputTcommentSaveGroup.add(tcommentSaveToFile);
224252 tcommentSaveToFile.setText("保存するファイル名を指定する");
253+ tcommentSaveToFile.setName("tcommentSaveToFile"); // NOI18N
254+
255+ tcommentFile.setName("tcommentFile"); // NOI18N
225256
226257 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+ });
227264
228265 javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
229266 jPanel8.setLayout(jPanel8Layout);
@@ -232,22 +269,18 @@ public class SavePanel extends javax.swing.JPanel {
232269 .addGroup(jPanel8Layout.createSequentialGroup()
233270 .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
234271 .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)))
251284 .addContainerGap())
252285 );
253286 jPanel8Layout.setVerticalGroup(
@@ -305,28 +338,38 @@ public class SavePanel extends javax.swing.JPanel {
305338 .addGroup(inputTcommentTabLayout.createSequentialGroup()
306339 .addContainerGap()
307340 .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))
309342 );
310343
311- jTabbedPane1.addTab("入力投稿者コメント", inputTcommentTab);
344+ saveTabbedPane.addTab("入力投稿者コメント", inputTcommentTab);
312345
313346 jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("コメント付き動画保存設定"));
314347
315348 savingConvertedVideoCheckBox.setText("動画を変換する");
349+ savingConvertedVideoCheckBox.setName("savingConvertedVideoCheckBox"); // NOI18N
316350
317351 addComment.setText("コメントをつける");
352+ addComment.setName("addComment"); // NOI18N
318353
319354 addTcomment.setText("投稿者コメントをつける");
355+ addTcomment.setName("addTcomment"); // NOI18N
320356
321357 outputVideoSaveGroup.add(convSaveFolderRadioButton);
322358 convSaveFolderRadioButton.setText("保存するフォルダを指定し、ファイル名は自動で決定する");
359+ convSaveFolderRadioButton.setName("convSaveFolderRadioButton"); // NOI18N
323360
324361 notAddVideoIdConvVideoCheckBox.setText("ファイル名に動画IDを付加しない");
362+ notAddVideoIdConvVideoCheckBox.setName("notAddVideoIdConvVideoCheckBox"); // NOI18N
363+
364+ convertedVideoSavedFolderField.setName("convertedVideoSavedFolderField"); // NOI18N
325365
326366 showSavingConvertedVideoFolderDialogButton.setText("参照...");
327367
328368 outputVideoSaveGroup.add(convSaveFileRadioButton);
329369 convSaveFileRadioButton.setText("保存するファイル名を指定する");
370+ convSaveFileRadioButton.setName("convSaveFileRadioButton"); // NOI18N
371+
372+ convertedVideoSavedFileField.setName("convertedVideoSavedFileField"); // NOI18N
330373
331374 showSavingConvertedVideoFileDialogButton.setText("参照...");
332375
@@ -406,29 +449,37 @@ public class SavePanel extends javax.swing.JPanel {
406449 .addGroup(outputVideoTabLayout.createSequentialGroup()
407450 .addContainerGap()
408451 .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))
410453 );
411454 outputVideoTabLayout.setVerticalGroup(
412455 outputVideoTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
413456 .addGroup(outputVideoTabLayout.createSequentialGroup()
414457 .addContainerGap()
415458 .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))
417460 );
418461
419- jTabbedPane1.addTab("出力コメント付き動画", outputVideoTab);
462+ saveTabbedPane.addTab("出力コメント付き動画", outputVideoTab);
420463
421464 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
422465 this.setLayout(layout);
423466 layout.setHorizontalGroup(
424467 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)
426469 );
427470 layout.setVerticalGroup(
428471 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)
430473 );
431474 }// </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
432483 // Variables declaration - do not modify//GEN-BEGIN:variables
433484 private javax.swing.JCheckBox addComment;
434485 private javax.swing.JCheckBox addTcomment;
@@ -455,11 +506,11 @@ public class SavePanel extends javax.swing.JPanel {
455506 private javax.swing.JPanel jPanel5;
456507 private javax.swing.JPanel jPanel7;
457508 private javax.swing.JPanel jPanel8;
458- private javax.swing.JTabbedPane jTabbedPane1;
459509 private javax.swing.JCheckBox needDownloadTcomment;
460510 private javax.swing.JCheckBox notAddVideoIdConvVideoCheckBox;
461511 private javax.swing.ButtonGroup outputVideoSaveGroup;
462512 private javax.swing.JPanel outputVideoTab;
513+ private javax.swing.JTabbedPane saveTabbedPane;
463514 private javax.swing.JCheckBox savingCommentCheckBox;
464515 private javax.swing.JCheckBox savingConvertedVideoCheckBox;
465516 private javax.swing.JButton showSavingCommentFileDialogButton;
@@ -629,4 +680,23 @@ public class SavePanel extends javax.swing.JPanel {
629680 void setTcommentFileName(String t) {
630681 tcommentFile.setText(t);
631682 }
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+ }
632702 }
--- a/frontend/src/saccubus/VideoSaveInfoPanel.form
+++ b/frontend/src/saccubus/VideoSaveInfoPanel.form
@@ -14,9 +14,6 @@
1414 </Border>
1515 </Property>
1616 </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>
2017 <AuxValues>
2118 <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
2219 <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@@ -76,6 +73,7 @@
7673 <ComponentRef name="videoSavingGroup"/>
7774 </Property>
7875 <Property name="text" type="java.lang.String" value="&#x52d5;&#x753b;&#x3092;&#x30c0;&#x30a6;&#x30f3;&#x30ed;&#x30fc;&#x30c9;&#x3057;&#x306a;&#x3044;"/>
76+ <Property name="name" type="java.lang.String" value="videoNoSaveButton" noResource="true"/>
7977 </Properties>
8078 </Component>
8179 <Component class="javax.swing.JRadioButton" name="videoSaveButton">
@@ -84,6 +82,7 @@
8482 <ComponentRef name="videoSavingGroup"/>
8583 </Property>
8684 <Property name="text" type="java.lang.String" value="&#x52d5;&#x753b;&#x3092;&#x30c0;&#x30a6;&#x30f3;&#x30ed;&#x30fc;&#x30c9;&#x3059;&#x308b;"/>
85+ <Property name="name" type="java.lang.String" value="videoSaveButton" noResource="true"/>
8786 </Properties>
8887 </Component>
8988 <Container class="javax.swing.JPanel" name="basicSetting">
@@ -140,6 +139,7 @@
140139 <Component class="javax.swing.JCheckBox" name="delVideoCheckBox">
141140 <Properties>
142141 <Property name="text" type="java.lang.String" value="&#x5909;&#x63db;&#x5f8c;&#x306b;&#x52d5;&#x753b;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x3092;&#x524a;&#x9664;&#x3059;&#x308b;"/>
142+ <Property name="name" type="java.lang.String" value="delVideoCheckBox" noResource="true"/>
143143 </Properties>
144144 </Component>
145145 <Component class="javax.swing.JRadioButton" name="saveFolderRadioButton">
@@ -148,13 +148,18 @@
148148 <ComponentRef name="videoNamingGroup"/>
149149 </Property>
150150 <Property name="text" type="java.lang.String" value="&#x4fdd;&#x5b58;&#x3059;&#x308b;&#x30d5;&#x30a9;&#x30eb;&#x30c0;&#x3092;&#x6307;&#x5b9a;&#x3057;&#x3001;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x540d;&#x306f;&#x81ea;&#x52d5;&#x3067;&#x6c7a;&#x5b9a;&#x3059;&#x308b;"/>
151+ <Property name="name" type="java.lang.String" value="saveFolderRadioButton" noResource="true"/>
151152 </Properties>
152153 </Component>
153154 <Component class="javax.swing.JTextField" name="videoSavedFolderField">
155+ <Properties>
156+ <Property name="name" type="java.lang.String" value="videoSavedFolderField" noResource="true"/>
157+ </Properties>
154158 </Component>
155159 <Component class="javax.swing.JButton" name="showSavingVideoFolderDialogButton">
156160 <Properties>
157161 <Property name="text" type="java.lang.String" value="&#x53c2;&#x7167;..."/>
162+ <Property name="name" type="java.lang.String" value="showSavingVideoFolderDialogButton" noResource="true"/>
158163 </Properties>
159164 </Component>
160165 <Component class="javax.swing.JRadioButton" name="saveFileRadioButton">
@@ -163,13 +168,18 @@
163168 <ComponentRef name="videoNamingGroup"/>
164169 </Property>
165170 <Property name="text" type="java.lang.String" value="&#x4fdd;&#x5b58;&#x3059;&#x308b;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x540d;&#x3092;&#x6307;&#x5b9a;&#x3059;&#x308b;"/>
171+ <Property name="name" type="java.lang.String" value="saveFileRadioButton" noResource="true"/>
166172 </Properties>
167173 </Component>
168174 <Component class="javax.swing.JTextField" name="videoSavedFileField">
175+ <Properties>
176+ <Property name="name" type="java.lang.String" value="videoSavedFileField" noResource="true"/>
177+ </Properties>
169178 </Component>
170179 <Component class="javax.swing.JButton" name="showSavingVideoFileDialogButton">
171180 <Properties>
172181 <Property name="text" type="java.lang.String" value="&#x53c2;&#x7167;..."/>
182+ <Property name="name" type="java.lang.String" value="showSavingVideoFileDialogButton" noResource="true"/>
173183 </Properties>
174184 </Component>
175185 </SubComponents>
@@ -180,6 +190,7 @@
180190 <ComponentRef name="videoSavingGroup"/>
181191 </Property>
182192 <Property name="text" type="java.lang.String" value="NicoBrowser&#x30c0;&#x30a6;&#x30f3;&#x30ed;&#x30fc;&#x30c9;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x3092;&#x7528;&#x3044;&#x308b;"/>
193+ <Property name="name" type="java.lang.String" value="videoUseNiBrButton" noResource="true"/>
183194 </Properties>
184195 </Component>
185196 <Container class="javax.swing.JPanel" name="nibrExtendSetting">
@@ -206,6 +217,9 @@
206217 </Layout>
207218 <SubComponents>
208219 <Component class="javax.swing.JTextField" name="nibrFileField">
220+ <Properties>
221+ <Property name="name" type="java.lang.String" value="nibrFileField" noResource="true"/>
222+ </Properties>
209223 </Component>
210224 <Component class="javax.swing.JButton" name="nibrFileChooserButton">
211225 <Properties>
--- a/frontend/src/saccubus/VideoSaveInfoPanel.java
+++ b/frontend/src/saccubus/VideoSaveInfoPanel.java
@@ -50,21 +50,32 @@ class VideoSaveInfoPanel extends javax.swing.JPanel {
5050
5151 videoSavingGroup.add(videoNoSaveButton);
5252 videoNoSaveButton.setText("動画をダウンロードしない");
53+ videoNoSaveButton.setName("videoNoSaveButton"); // NOI18N
5354
5455 videoSavingGroup.add(videoSaveButton);
5556 videoSaveButton.setText("動画をダウンロードする");
57+ videoSaveButton.setName("videoSaveButton"); // NOI18N
5658
5759 delVideoCheckBox.setText("変換後に動画ファイルを削除する");
60+ delVideoCheckBox.setName("delVideoCheckBox"); // NOI18N
5861
5962 videoNamingGroup.add(saveFolderRadioButton);
6063 saveFolderRadioButton.setText("保存するフォルダを指定し、ファイル名は自動で決定する");
64+ saveFolderRadioButton.setName("saveFolderRadioButton"); // NOI18N
65+
66+ videoSavedFolderField.setName("videoSavedFolderField"); // NOI18N
6167
6268 showSavingVideoFolderDialogButton.setText("参照...");
69+ showSavingVideoFolderDialogButton.setName("showSavingVideoFolderDialogButton"); // NOI18N
6370
6471 videoNamingGroup.add(saveFileRadioButton);
6572 saveFileRadioButton.setText("保存するファイル名を指定する");
73+ saveFileRadioButton.setName("saveFileRadioButton"); // NOI18N
74+
75+ videoSavedFileField.setName("videoSavedFileField"); // NOI18N
6676
6777 showSavingVideoFileDialogButton.setText("参照...");
78+ showSavingVideoFileDialogButton.setName("showSavingVideoFileDialogButton"); // NOI18N
6879
6980 javax.swing.GroupLayout basicSettingLayout = new javax.swing.GroupLayout(basicSetting);
7081 basicSetting.setLayout(basicSettingLayout);
@@ -108,6 +119,9 @@ class VideoSaveInfoPanel extends javax.swing.JPanel {
108119
109120 videoSavingGroup.add(videoUseNiBrButton);
110121 videoUseNiBrButton.setText("NicoBrowserダウンロードファイルを用いる");
122+ videoUseNiBrButton.setName("videoUseNiBrButton"); // NOI18N
123+
124+ nibrFileField.setName("nibrFileField"); // NOI18N
111125
112126 nibrFileChooserButton.setText("参照...");
113127
--- a/frontend/src/saccubus/converter/filegetter/FileInstanciator.java
+++ b/frontend/src/saccubus/converter/filegetter/FileInstanciator.java
@@ -105,7 +105,7 @@ public class FileInstanciator {
105105 */
106106 public final File getVideoFile(TextProgressListener listener) throws IOException {
107107 File file = new FileLocator(videoType.isAutoFileName(), videoType.getInitFile(), getVideoIdWithBracket(),
108- getVideoTitle(), ".flv").getFile();
108+ getVideoTitle(), ".flv", ".mp4", ".swf").getFile();
109109 file = videoFileGetter.get(file, listener);
110110 return file;
111111 }
@@ -131,7 +131,7 @@ public class FileInstanciator {
131131 */
132132 public final File getTcommFile(TextProgressListener listener) throws IOException {
133133 File file = new FileLocator(tcommType.isAutoFileName(), tcommType.getInitFile(), getVideoIdWithBracket(),
134- getVideoTitle(), ".xml").getFile();
134+ getVideoTitle(), ".txml").getFile();
135135 file = tcommFileGetter.get(file, listener);
136136 return file;
137137 }
--- a/frontend/src/saccubus/converter/filegetter/FileLocator.java
+++ b/frontend/src/saccubus/converter/filegetter/FileLocator.java
@@ -3,6 +3,7 @@ package saccubus.converter.filegetter;
33
44 import java.io.File;
55 import java.io.FilenameFilter;
6+import org.apache.commons.io.FilenameUtils;
67
78 /**
89 *
@@ -14,22 +15,23 @@ class FileLocator {
1415 private final File initFile;
1516 private final String prefix;
1617 private final String title;
17- private final String suffix;
18+ private final String[] suffixes;
1819
19- FileLocator(boolean autoFileName, File initFile, String prefix, String title, String suffix) {
20+ FileLocator(boolean autoFileName, File initFile, String prefix, String title, String... suffixes) {
2021 this.autoFileName = autoFileName;
2122 this.initFile = initFile;
2223 this.prefix = prefix;
2324 this.title = title;
24- this.suffix = suffix;
25+ this.suffixes = suffixes;
2526 }
2627
2728 /**
2829 * コンストラクタで指定した条件でファイルを検索する。
2930 * autoFileNameがfalseの場合、直接名前指定であるため指定されたファイルをそのまま返す。
30- * autoFileNameがtrueの場合、initFileディレクトリにprefixで始まるファイルが存在するか検索し
31+ * autoFileNameがtrueの場合、initFileディレクトリにprefixで始まりsuffixで終わるファイルが存在するか検索し
3132 * あればそれを返す。
3233 * このファイルも無い場合、指定されたパラメータに従ったファイル名を返す。
34+ * このとき拡張子(suffixes)が複数指定されていた場合は最初のものを返す。
3335 * @return 所望のファイル。ファイルは存在する場合もあり、存在しない場合もあることに注意。
3436 */
3537 File getFile() {
@@ -40,7 +42,7 @@ class FileLocator {
4042 if (res != null) {
4143 return res;
4244 }
43- return new File(initFile, prefix + title + suffix);
45+ return new File(initFile, prefix + title + suffixes[0]);
4446 }
4547 }
4648
@@ -48,13 +50,23 @@ class FileLocator {
4850 FilenameFilter filter = new FilenameFilter() {
4951
5052 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;
5261 }
5362 };
5463 File[] res = initFile.listFiles(filter);
5564 if (res == null || res.length == 0) {
5665 return null;
5766 }
67+ if (res.length > 1) {
68+ System.out.println("複数の候補ファイルがヒットしました. 意図しないファイルが選択されている可能性があります:" + res[0]);
69+ }
5870 return res[0];
5971 }
6072
--- a/frontend/src/saccubus/net/NicoClient.java
+++ b/frontend/src/saccubus/net/NicoClient.java
@@ -337,7 +337,7 @@ public class NicoClient {
337337 }
338338
339339 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;
341341 Map<String,String> map = new NicoApiRequest(url).get();
342342 return new OfficialOption(map.get("threadkey"), map.get("force_184"));
343343 }
@@ -375,7 +375,7 @@ public class NicoClient {
375375 }
376376 }
377377 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="
379379 + vi.getThreadId();
380380 String ret = "";
381381 try {
--- a/frontend/src/saccubus/properties/InputCommentSetting.java
+++ b/frontend/src/saccubus/properties/InputCommentSetting.java
@@ -10,13 +10,20 @@ import java.util.Properties;
1010 */
1111 public class InputCommentSetting extends InputFileSetting<Boolean> {
1212
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+ /** 変換後にコメントファイルを削除する. */
1516 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+ /** コメント取得数は自動で調整する. */
1818 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";
2027 private final boolean selfAdjustNumOfComment;
2128 private final int numOfComment;
2229
@@ -28,25 +35,24 @@ public class InputCommentSetting extends InputFileSetting<Boolean> {
2835 }
2936
3037 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());
3339 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());
3640 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());
3845
3946 }
4047
4148 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"));
4949 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");
5056
5157 return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete,
5258 adjustNumOfComment,
--- a/frontend/src/saccubus/properties/InputTcommentSetting.java
+++ b/frontend/src/saccubus/properties/InputTcommentSetting.java
@@ -37,7 +37,7 @@ public class InputTcommentSetting extends InputFileSetting<Boolean> {
3737
3838 public void save(Properties prop) {
3939 prop.setProperty(PROP_DOWNLOAD, getProcessKind().toString());
40- prop.setProperty(PROP_DELETE, getProcessKind().toString());
40+ prop.setProperty(PROP_DELETE, Boolean.toString(isDeleteAfterConvert()));
4141 prop.setProperty(PROP_AUTOFILENAME, Boolean.toString(isAutoNaming()));
4242 prop.setProperty(PROP_DIRECTORYNAME, getFolder().toString());
4343 prop.setProperty(PROP_FILENAME, getFile().toString());
--- /dev/null
+++ b/frontend/test/saccubus/SaccubusTest.java
@@ -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+}
Afficher sur ancien navigateur de dépôt.