From: yukihane Date: Mon, 22 Aug 2011 01:34:11 +0000 (+0900) Subject: ConvertStopFlag, TextProgressListenerクラス削除 X-Git-Tag: test20110903_ver2.a.0~181 X-Git-Url: http://git.sourceforge.jp/view?p=coroid%2Finqubus.git;a=commitdiff_plain;h=3d2cd2b8f260c14575c7886bf4dbd4ed22f2fe05;ds=sidebyside ConvertStopFlag, TextProgressListenerクラス削除 --- diff --git a/frontend/src/saccubus/ConvertStopFlag.java b/frontend/src/saccubus/ConvertStopFlag.java deleted file mode 100644 index 27cea8e..0000000 --- a/frontend/src/saccubus/ConvertStopFlag.java +++ /dev/null @@ -1,68 +0,0 @@ -package saccubus; - -/** - *

- * タイトル: さきゅばす - *

- * - *

- * 説明: ニコニコ動画の動画をコメントつきで保存 - *

- * - *

- * 著作権: Copyright (c) 2007 PSI - *

- * - *

- * 会社名: - *

- * - * @author 未入力 - * @version 1.0 - */ -// TODO 不要になる予定 -public class ConvertStopFlag { - - public interface StateChangeListener { - - void changeState(State s); - /** - * StateChangeListenerの何もしないバージョンの実装. - */ - static final ConvertStopFlag.StateChangeListener EMPTY_LISTENER = new ConvertStopFlag.StateChangeListener() { - - public void changeState(State s) { - } - }; - } - - public enum State { - - STOPPING, FINISHED; - } - private volatile boolean needStop = false; - private volatile boolean finished = false; - private final StateChangeListener listener; - - public ConvertStopFlag(StateChangeListener listener) { - this.listener = listener; - } - - public void requestStop() { - needStop = true; - listener.changeState(State.STOPPING); - } - - public boolean needStop() { - return needStop; - } - - public boolean isFinished() { - return finished; - } - - public void finished() { - finished = true; - listener.changeState(State.FINISHED); - } -} diff --git a/frontend/src/saccubus/converter/Converter.java b/frontend/src/saccubus/converter/Converter.java index 04fbbfe..a208b8b 100644 --- a/frontend/src/saccubus/converter/Converter.java +++ b/frontend/src/saccubus/converter/Converter.java @@ -13,8 +13,6 @@ import nicobrowser.ProgressListener; import nicobrowser.WayBackInfo; import nicobrowser.entity.NicoContent.Status; import org.apache.http.HttpException; -import saccubus.ConvertStopFlag; -import saccubus.net.TextProgressListener; import saccubus.converter.profile.CommentProfile; import saccubus.converter.profile.FfmpegProfile; import saccubus.converter.profile.GeneralProfile; @@ -34,7 +32,7 @@ import saccubus.converter.profile.ProxyProfile; * @author 未入力 * @version 1.0 */ -public abstract class Converter extends SwingWorker implements Callable { +public class Converter extends SwingWorker implements Callable { private static final Logger logger = Logger.getLogger(Converter.class.getName()); private final Profile profile; @@ -48,8 +46,7 @@ public abstract class Converter extends SwingWorker @@ -59,11 +48,6 @@ public class Prompt { } public void execute(String[] args) throws IOException { - execute(args, TextProgressListener.EMPTY_LISTENER, ConvertStopFlag.StateChangeListener.EMPTY_LISTENER); - } - - public void execute(String[] args, TextProgressListener tpl, ConvertStopFlag.StateChangeListener scl) throws - IOException { Options options = createOptions(args); Profile profile; try { @@ -77,7 +61,7 @@ public class Prompt { throw new IOException(e); } - Converter conv = new Converter("dummy0", profile, tpl, new ConvertStopFlag(scl)); + Converter conv = new Converter("dummy0", profile); ExecutorService es = Executors.newSingleThreadExecutor(); Future future = es.submit((Callable) conv); try { @@ -167,8 +151,7 @@ public class Prompt { // SProperties setting = SProperties.loadSetting(mail, pass); // Converter conv = new Converter(tag, setting.toProfile(), TextProgressListener.EMPTY_LISTENER, new ConvertStopFlag( // ConvertStopFlag.StateChangeListener.EMPTY_LISTENER)); - Converter conv = new Converter(tag, null/*この部分*/, TextProgressListener.EMPTY_LISTENER, new ConvertStopFlag( - ConvertStopFlag.StateChangeListener.EMPTY_LISTENER)); + Converter conv = new Converter(tag, null/*この部分*/); System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); System.out.println("Saccubus on CUI"); System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); diff --git a/frontend/test/saccubus/converter/ConverterTest.java b/frontend/test/saccubus/converter/ConverterTest.java index 6b2459c..67fb228 100644 --- a/frontend/test/saccubus/converter/ConverterTest.java +++ b/frontend/test/saccubus/converter/ConverterTest.java @@ -9,8 +9,6 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import saccubus.ConvertStopFlag; -import saccubus.net.TextProgressListener; /** * @@ -36,16 +34,7 @@ public class ConverterTest { @Test public void testConverter() throws Exception { - TextProgressListener listener = new TextProgressListener() { - - @Override - public void setText(String text) { - System.out.println(text); - } - }; - ConvertStopFlag flag = new ConvertStopFlag(ConvertStopFlag.StateChangeListener.EMPTY_LISTENER); - - Converter conv = new Converter("sm7139747", null, listener, flag); + Converter conv = new Converter("sm7139747", null); conv.call(); } // /**