OSDN Git Service

プロファイルインタフェースメソッド名変更
authoryukihane <yukihane.feather@gmail.com>
Thu, 25 Aug 2011 00:34:14 +0000 (09:34 +0900)
committeryukihane <yukihane.feather@gmail.com>
Thu, 25 Aug 2011 00:34:14 +0000 (09:34 +0900)
frontend/src/saccubus/worker/Download.java
frontend/src/saccubus/worker/TestFrame.java
frontend/src/saccubus/worker/classic/profile/Profile.java
frontend/src/saccubus/worker/profile/DownloadProfile.java
frontend/src/yukihane/inqubus/gui/MainFrame.java

index b042604..c10d0a3 100644 (file)
@@ -84,43 +84,43 @@ public class Download extends SwingWorker<DownloadResult, DownloadProgress> impl
             client = createClientAndLogin();
             vi = client.getVideoInfo(videoId);
 
             client = createClientAndLogin();
             vi = client.getVideoInfo(videoId);
 
-            final String name = profile.getVideoSetting().getFileName();
-            final String replaceFrom = profile.getGeneralSetting().getReplaceFrom();
-            final String replaceTo = profile.getGeneralSetting().getReplaceTo();
+            final String name = profile.getVideoProfile().getFileName();
+            final String replaceFrom = profile.getGeneralProfile().getReplaceFrom();
+            final String replaceTo = profile.getGeneralProfile().getReplaceTo();
             videoNamePattern = new NamePattern(name, replaceFrom, replaceTo, vi.getTitleInWatchPage());
 
             if (needsBackLog()) {
                 final String key = client.getWayBackKey(vi);
             videoNamePattern = new NamePattern(name, replaceFrom, replaceTo, vi.getTitleInWatchPage());
 
             if (needsBackLog()) {
                 final String key = client.getWayBackKey(vi);
-                wbi = new WayBackInfo(key, profile.getCommentSetting().getBackLogPoint());
+                wbi = new WayBackInfo(key, profile.getCommentProfile().getBackLogPoint());
             }
         }
 
         checkStop();
 
         File commentFile;
             }
         }
 
         checkStop();
 
         File commentFile;
-        if (profile.getCommentSetting().isDownload()) {
-            final CommentProfile prof = profile.getCommentSetting();
-            final GeneralProfile gene = profile.getGeneralSetting();
+        if (profile.getCommentProfile().isDownload()) {
+            final CommentProfile prof = profile.getCommentProfile();
+            final GeneralProfile gene = profile.getGeneralProfile();
 
             final NamePattern pattern = new NamePattern(prof.getFileName(), gene.getReplaceFrom(), gene.getReplaceTo(),
                     vi.getTitleInWatchPage());
             // TODO コメントファイルに{low}は使えないことをどこかに書くべきか
             final String name = pattern.createFileName(videoId, true);
 
             final NamePattern pattern = new NamePattern(prof.getFileName(), gene.getReplaceFrom(), gene.getReplaceTo(),
                     vi.getTitleInWatchPage());
             // TODO コメントファイルに{low}は使えないことをどこかに書くべきか
             final String name = pattern.createFileName(videoId, true);
-            final File file = new File(profile.getCommentSetting().getDir(), name);
+            final File file = new File(profile.getCommentProfile().getDir(), name);
 
 
-            commentFile = client.getCommentFile(vi, file.getPath(), wbi, profile.getCommentSetting().
+            commentFile = client.getCommentFile(vi, file.getPath(), wbi, profile.getCommentProfile().
                     getLengthRelatedCommentSize(),
                     getLengthRelatedCommentSize(),
-                    profile.getCommentSetting().isDisablePerMinComment());
+                    profile.getCommentProfile().isDisablePerMinComment());
         } else {
         } else {
-            commentFile = profile.getCommentSetting().getLocalFile();
+            commentFile = profile.getCommentProfile().getLocalFile();
         }
 
         checkStop();
 
         File videoFile;
         GetFlvResult vf;
         }
 
         checkStop();
 
         File videoFile;
         GetFlvResult vf;
-        if (profile.getVideoSetting().isDownload()) {
-            vf = client.getFlvFile(vi, profile.getVideoSetting().getDir(), videoNamePattern,
+        if (profile.getVideoProfile().isDownload()) {
+            vf = client.getFlvFile(vi, profile.getVideoProfile().getDir(), videoNamePattern,
                     Status.GET_INFO, true, new ProgressListener() {
 
                 @Override
                     Status.GET_INFO, true, new ProgressListener() {
 
                 @Override
@@ -132,7 +132,7 @@ public class Download extends SwingWorker<DownloadResult, DownloadProgress> impl
 
             videoFile = vf.getFile();
         } else {
 
             videoFile = vf.getFile();
         } else {
-            videoFile = profile.getVideoSetting().getLocalFile();
+            videoFile = profile.getVideoProfile().getLocalFile();
         }
         return new DownloadResult(true, videoFile, commentFile);
 
         }
         return new DownloadResult(true, videoFile, commentFile);
 
@@ -167,7 +167,7 @@ public class Download extends SwingWorker<DownloadResult, DownloadProgress> impl
 
     /** @return 何かダウンロードするものがあればtrue. */
     private static boolean needsDownload(DownloadProfile profile) {
 
     /** @return 何かダウンロードするものがあればtrue. */
     private static boolean needsDownload(DownloadProfile profile) {
-        return (profile.getVideoSetting().isDownload() || profile.getCommentSetting().isDownload());
+        return (profile.getVideoProfile().isDownload() || profile.getCommentProfile().isDownload());
     }
 
     // TODO どこかに処理を移す必要がある.
     }
 
     // TODO どこかに処理を移す必要がある.
@@ -203,7 +203,7 @@ public class Download extends SwingWorker<DownloadResult, DownloadProgress> impl
      */
     // TODO HttpException を投げるのをやめたい. コンパイル時にHttpComponentが必要になるので.
     private NicoHttpClient createClientAndLogin() throws IOException, InterruptedException, HttpException {
      */
     // TODO HttpException を投げるのをやめたい. コンパイル時にHttpComponentが必要になるので.
     private NicoHttpClient createClientAndLogin() throws IOException, InterruptedException, HttpException {
-        final NicoHttpClient client = createClient(profile.getProxySetting());
+        final NicoHttpClient client = createClient(profile.getProxyProfile());
         final boolean hasLogin;
         try {
             hasLogin = client.login(profile.getLoginInfo().getMail(), profile.getLoginInfo().getPassword());
         final boolean hasLogin;
         try {
             hasLogin = client.login(profile.getLoginInfo().getMail(), profile.getLoginInfo().getPassword());
@@ -226,12 +226,12 @@ public class Download extends SwingWorker<DownloadResult, DownloadProgress> impl
 
     /** @return ログインする必要があればtrue. */
     private boolean needsLogin() {
 
     /** @return ログインする必要があればtrue. */
     private boolean needsLogin() {
-        return profile.getVideoSetting().isDownload() || profile.getCommentSetting().isDownload();
+        return profile.getVideoProfile().isDownload() || profile.getCommentProfile().isDownload();
     }
 
     /** @return 過去ログ取得の必要があればtrue. */
     private boolean needsBackLog() {
     }
 
     /** @return 過去ログ取得の必要があればtrue. */
     private boolean needsBackLog() {
-        return profile.getCommentSetting().getBackLogPoint() >= 0L;
+        return profile.getCommentProfile().getBackLogPoint() >= 0L;
     }
 
     private void checkStop() throws InterruptedException {
     }
 
     private void checkStop() throws InterruptedException {
index 8e80277..aaf1c1f 100644 (file)
@@ -185,7 +185,7 @@ public class TestFrame extends JFrame {
         }
 
         @Override
         }
 
         @Override
-        public ProxyProfile getProxySetting() {
+        public ProxyProfile getProxyProfile() {
             return new ProxyProfile() {
 
                 @Override
             return new ProxyProfile() {
 
                 @Override
@@ -206,7 +206,7 @@ public class TestFrame extends JFrame {
         }
 
         @Override
         }
 
         @Override
-        public VideoProfile getVideoSetting() {
+        public VideoProfile getVideoProfile() {
             return new VideoProfile() {
 
                 @Override
             return new VideoProfile() {
 
                 @Override
@@ -232,7 +232,7 @@ public class TestFrame extends JFrame {
         }
 
         @Override
         }
 
         @Override
-        public CommentProfile getCommentSetting() {
+        public CommentProfile getCommentProfile() {
             return new CommentProfile() {
 
                 @Override
             return new CommentProfile() {
 
                 @Override
@@ -303,7 +303,7 @@ public class TestFrame extends JFrame {
 //            };
 //        }
         @Override
 //            };
 //        }
         @Override
-        public GeneralProfile getGeneralSetting() {
+        public GeneralProfile getGeneralProfile() {
             return new GeneralProfile() {
 
                 @Override
             return new GeneralProfile() {
 
                 @Override
index 0793fe9..1a4cf86 100644 (file)
@@ -44,17 +44,17 @@ public class Profile implements saccubus.worker.profile.DownloadProfile {
     }
 
     @Override
     }
 
     @Override
-    public Proxy getProxySetting(){
+    public Proxy getProxyProfile(){
         return loginInfo.getProxy();
     }
 
     @Override
         return loginInfo.getProxy();
     }
 
     @Override
-    public VideoProfile getVideoSetting() {
+    public VideoProfile getVideoProfile() {
         return videoSetting;
     }
 
     @Override
         return videoSetting;
     }
 
     @Override
-    public CommentProfile getCommentSetting() {
+    public CommentProfile getCommentProfile() {
         return commentSetting;
     }
 
         return commentSetting;
     }
 
@@ -75,7 +75,7 @@ public class Profile implements saccubus.worker.profile.DownloadProfile {
     }
 
     @Override
     }
 
     @Override
-    public GeneralSetting getGeneralSetting() {
+    public GeneralSetting getGeneralProfile() {
         return generalSetting;
     }
 }
         return generalSetting;
     }
 }
index 948e327..1d4cfa9 100644 (file)
@@ -10,11 +10,11 @@ public interface DownloadProfile {
 
     LoginProfile getLoginInfo();
 
 
     LoginProfile getLoginInfo();
 
-    ProxyProfile getProxySetting();
+    ProxyProfile getProxyProfile();
 
 
-    VideoProfile getVideoSetting();
+    VideoProfile getVideoProfile();
 
 
-    CommentProfile getCommentSetting();
+    CommentProfile getCommentProfile();
 
 
-    GeneralProfile getGeneralSetting();
+    GeneralProfile getGeneralProfile();
 }
 }
index c701682..e985f49 100644 (file)
@@ -584,22 +584,22 @@ public class MainFrame extends JFrame {
         }
 
         @Override
         }
 
         @Override
-        public ProxyProfile getProxySetting() {
+        public ProxyProfile getProxyProfile() {
             return this.proxyProfile;
         }
 
         @Override
             return this.proxyProfile;
         }
 
         @Override
-        public VideoProfile getVideoSetting() {
+        public VideoProfile getVideoProfile() {
             throw new UnsupportedOperationException("Not supported yet.");
         }
 
         @Override
             throw new UnsupportedOperationException("Not supported yet.");
         }
 
         @Override
-        public CommentProfile getCommentSetting() {
+        public CommentProfile getCommentProfile() {
             throw new UnsupportedOperationException("Not supported yet.");
         }
 
         @Override
             throw new UnsupportedOperationException("Not supported yet.");
         }
 
         @Override
-        public GeneralProfile getGeneralSetting() {
+        public GeneralProfile getGeneralProfile() {
             throw new UnsupportedOperationException("Not supported yet.");
         }
     }
             throw new UnsupportedOperationException("Not supported yet.");
         }
     }