OSDN Git Service

コマンドライン実行用のクラスをパッケージ移動
authoryukihane <yukihane.feather@gmail.com>
Mon, 5 Sep 2011 23:26:27 +0000 (08:26 +0900)
committeryukihane <yukihane.feather@gmail.com>
Fri, 9 Sep 2011 11:42:34 +0000 (20:42 +0900)
frontend/src/saccubus/Saccubus.java
frontend/src/saccubus/prompt/DownloadProfileImpl.java [deleted file]
frontend/src/yukihane/inqubus/saccubus/prompt/DownloadProfileImpl.java [new file with mode: 0644]
frontend/src/yukihane/inqubus/saccubus/prompt/Prompt.java [moved from frontend/src/saccubus/prompt/Prompt.java with 99% similarity]

index f1d3b47..e26b2f9 100644 (file)
@@ -6,7 +6,7 @@ import java.util.logging.Logger;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 
-import saccubus.prompt.Prompt;
+import yukihane.inqubus.saccubus.prompt.Prompt;
 import yukihane.inqubus.gui.MainFrame;
 
 /**
diff --git a/frontend/src/saccubus/prompt/DownloadProfileImpl.java b/frontend/src/saccubus/prompt/DownloadProfileImpl.java
deleted file mode 100644 (file)
index ec720f6..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package saccubus.prompt;
-
-import java.io.File;
-import saccubus.worker.profile.CommentProfile;
-import saccubus.worker.profile.DownloadProfile;
-import saccubus.worker.profile.GeneralProfile;
-import saccubus.worker.profile.LoginProfile;
-import saccubus.worker.profile.ProxyProfile;
-import saccubus.worker.profile.VideoProfile;
-import yukihane.inqubus.config.Config;
-
-/**
- *
- * @author user
- */
-public class DownloadProfileImpl implements DownloadProfile {
-
-    private final LoginProfile loginProfile;
-    private final ProxyProfile proxyProfile;
-    private final VideoProfile videoProfile;
-    private final CommentProfile commentProfile;
-    private final GeneralProfile generalProfile;
-
-    DownloadProfileImpl(final String mail, final String pass, final long time) {
-        this.loginProfile = new LoginProfile() {
-
-            @Override
-            public String getMail() {
-                return mail;
-            }
-
-            @Override
-            public String getPassword() {
-                return pass;
-            }
-        };
-
-        this.proxyProfile = new ProxyProfileImpl();
-        this.videoProfile = new VideoProfileImpl();
-        this.commentProfile = new CommentProfileImpl(time);
-        this.generalProfile = new GeneralProfileImpl();
-    }
-
-    @Override
-    public LoginProfile getLoginProfile() {
-        return loginProfile;
-    }
-
-    @Override
-    public ProxyProfile getProxyProfile() {
-        return this.proxyProfile;
-    }
-
-    @Override
-    public VideoProfile getVideoProfile() {
-        return this.videoProfile;
-    }
-
-    @Override
-    public CommentProfile getCommentProfile() {
-        return this.commentProfile;
-    }
-
-    @Override
-    public GeneralProfile getGeneralProfile() {
-        return this.generalProfile;
-    }
-}
-
-class ProxyProfileImpl implements ProxyProfile {
-
-    private final boolean use;
-    private final String host;
-    private final int port;
-
-    ProxyProfileImpl() {
-        final Config p = Config.INSTANCE;
-        use = p.getProxyUse();
-        host = p.getProxyHost();
-        port = Integer.parseInt(p.getProxyPort());
-    }
-
-    @Override
-    public boolean use() {
-        return use;
-    }
-
-    @Override
-    public String getHost() {
-        return host;
-    }
-
-    @Override
-    public int getPort() {
-        return port;
-    }
-}
-
-class VideoProfileImpl implements VideoProfile {
-
-    private final boolean download;
-    private final File dir;
-    private final String fileName;
-
-    VideoProfileImpl() {
-        final Config p = Config.INSTANCE;
-        this.download = !p.getVideoUseLocal();
-        this.dir = new File(p.getVideoDir());
-        this.fileName = p.getVideoFileNamePattern();
-    }
-
-    @Override
-    public boolean isDownload() {
-        return download;
-    }
-
-    @Override
-    public File getDir() {
-        return dir;
-    }
-
-    @Override
-    public String getFileName() {
-        return fileName;
-    }
-
-    @Override
-    public File getLocalFile() {
-        return getDir();
-    }
-}
-
-class CommentProfileImpl implements CommentProfile {
-
-    private final int lengthRelatedCommentSize;
-    private final int perMinCommentSize;
-    private final boolean disablePerMinComment;
-    private final long backLogPoint;
-    private final boolean download;
-    private final File dir;
-    private final String fileName;
-
-    CommentProfileImpl(final long backLogPoint) {
-        final Config p = Config.INSTANCE;
-        this.lengthRelatedCommentSize = (p.getCommentSizeAutosize()) ? -1 : Integer.parseInt(p.getCommentSizeManual());
-        this.perMinCommentSize = (p.getCommentMinSizeAutosize()) ? -1 : Integer.parseInt(p.getCommentMinSizeManual());
-        // TODO disablePerMinComment がデフォルト設定値に無い
-        this.disablePerMinComment = false;
-        this.backLogPoint = backLogPoint;
-        this.download = !p.getCommentUseLocal();
-        this.dir = new File(p.getCommentDir());
-        this.fileName = p.getCommentFileNamePattern();
-    }
-
-    @Override
-    public int getLengthRelatedCommentSize() {
-        return lengthRelatedCommentSize;
-    }
-
-    @Override
-    public boolean isDisablePerMinComment() {
-        return disablePerMinComment;
-    }
-
-    @Override
-    public int getPerMinCommentSize() {
-        return perMinCommentSize;
-    }
-
-    @Override
-    public long getBackLogPoint() {
-        return backLogPoint;
-    }
-
-    @Override
-    public boolean isDownload() {
-        return download;
-    }
-
-    @Override
-    public File getDir() {
-        return dir;
-    }
-
-    @Override
-    public String getFileName() {
-        return fileName;
-    }
-
-    @Override
-    public File getLocalFile() {
-        return getDir();
-    }
-}
-
-class GeneralProfileImpl implements GeneralProfile {
-
-    private final String replaceFrom;
-    private final String replaceTo;
-
-    GeneralProfileImpl() {
-        final Config p = Config.INSTANCE;
-        this.replaceFrom = p.getReplaceFrom();
-        this.replaceTo = p.getReplaceTo();
-    }
-
-    @Override
-    public String getReplaceFrom() {
-        return replaceFrom;
-    }
-
-    @Override
-    public String getReplaceTo() {
-        return replaceTo;
-    }
-}
diff --git a/frontend/src/yukihane/inqubus/saccubus/prompt/DownloadProfileImpl.java b/frontend/src/yukihane/inqubus/saccubus/prompt/DownloadProfileImpl.java
new file mode 100644 (file)
index 0000000..e76119e
--- /dev/null
@@ -0,0 +1,49 @@
+package yukihane.inqubus.saccubus.prompt;
+
+import saccubus.worker.profile.CommentProfile;
+import saccubus.worker.profile.LoginProfile;
+import yukihane.inqubus.config.ConfigCommentProfile;
+import yukihane.inqubus.config.ConfigDownloadProfile;
+
+/**
+ * さきゅばすのコマンドプロンプト仕様にあわせるためのDownloadProfile実装
+ * @author user
+ */
+class DownloadProfileImpl extends ConfigDownloadProfile {
+
+    private final LoginProfile loginProfile;
+    private final CommentProfile commentProfile;
+
+    DownloadProfileImpl(final String mail, final String pass, final long time) {
+        this.loginProfile = new LoginProfile() {
+
+            @Override
+            public String getMail() {
+                return mail;
+            }
+
+            @Override
+            public String getPassword() {
+                return pass;
+            }
+        };
+
+        this.commentProfile = new ConfigCommentProfile() {
+
+            @Override
+            public long getBackLogPoint() {
+                return time;
+            }
+        };
+    }
+
+    @Override
+    public LoginProfile getLoginProfile() {
+        return loginProfile;
+    }
+
+    @Override
+    public CommentProfile getCommentProfile() {
+        return this.commentProfile;
+    }
+}
@@ -1,4 +1,4 @@
-package saccubus.prompt;
+package yukihane.inqubus.saccubus.prompt;
 
 import java.io.File;
 import java.io.IOException;