OSDN Git Service

画面でプロファイル作成処理
authoryukihane <yukihane.feather@gmail.com>
Thu, 25 Aug 2011 01:17:04 +0000 (10:17 +0900)
committeryukihane <yukihane.feather@gmail.com>
Thu, 25 Aug 2011 01:17:04 +0000 (10:17 +0900)
frontend/src/yukihane/inqubus/gui/MainFrame.java

index e985f49..963ae4a 100644 (file)
@@ -572,10 +572,16 @@ public class MainFrame extends JFrame {
 
         private final LoginProfile loginProfile;
         private final ProxyProfile proxyProfile;
+        private final VideoProfile videoProfile;
+        private final CommentProfile commentProfile;
+        private final GeneralProfile generalProfile;
 
         private InqubusDownloadProfile() {
             this.loginProfile = new InqubusLoginProfile();
             this.proxyProfile = new InqubusProxyProfile();
+            this.videoProfile = new InqubusVideoProfile();
+            this.commentProfile = new InqubusCommentProfile();
+            this.generalProfile = new InqubusGeneralProfile();
         }
 
         @Override
@@ -590,17 +596,17 @@ public class MainFrame extends JFrame {
 
         @Override
         public VideoProfile getVideoProfile() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return this.videoProfile;
         }
 
         @Override
         public CommentProfile getCommentProfile() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return this.commentProfile;
         }
 
         @Override
         public GeneralProfile getGeneralProfile() {
-            throw new UnsupportedOperationException("Not supported yet.");
+            return this.generalProfile;
         }
     }
 
@@ -653,4 +659,110 @@ public class MainFrame extends JFrame {
             return this.port;
         }
     }
+
+    private class InqubusVideoProfile implements VideoProfile {
+        private final boolean download;
+        private final File dir;
+        private final String fileName;
+        private final File localFile;
+
+        private InqubusVideoProfile(){
+            this.download = !cbVideoLocal.isSelected();
+            if (this.download) {
+                this.dir = new File(fldVideo.getText());
+                // TODO ディレクトリとファイル名の入力欄を分ける
+                this.fileName = "{id}_{title}";
+                this.localFile = null;
+            } else {
+                this.dir = null;
+                this.fileName = null;
+                this.localFile = new File(fldVideo.getText());
+            }
+        }
+
+        @Override
+        public boolean isDownload() {
+            return this.download;
+        }
+
+        @Override
+        public File getDir() {
+            return this.dir;
+        }
+
+        @Override
+        public String getFileName() {
+            return this.fileName;
+        }
+
+        @Override
+        public File getLocalFile() {
+            return this.localFile;
+        }
+    }
+
+    private class InqubusCommentProfile implements CommentProfile {
+
+        @Override
+        public int getLengthRelatedCommentSize() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public boolean isDisablePerMinComment() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public int getPerMinCommentSize() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public long getBackLogPoint() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public boolean isDownload() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public File getDir() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public String getFileName() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public File getLocalFile() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+    }
+
+    private class InqubusGeneralProfile implements GeneralProfile {
+//        private final String replaceFrom;
+        private InqubusGeneralProfile() {
+            final Config p = Config.INSTANCE;
+            // TODO 置換文字設定コンフィグが無い
+//            this.replaceFrom = p.get
+        }
+
+        @Override
+        public String getReplaceFrom() {
+//            return this.replaceFrom;
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public String getReplaceTo() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+    }
 }