OSDN Git Service

過去ログ取得時点をConverterコンストラクタ引数からProfileに移動
[coroid/inqubus.git] / frontend / src / saccubus / properties / InputCommentSetting.java
index d6b1e01..69b7eb4 100644 (file)
@@ -5,52 +5,63 @@ import java.io.File;
 import java.util.Properties;
 
 /**
- * \93ü\97Í\83R\83\81\83\93\83g\90Ý\92è.
+ * 入力コメント設定.
  * @author yuki
  */
 public class InputCommentSetting extends InputFileSetting<Boolean> {
 
-    private static final String PROP_COMMENT_FILE = "CommentFile";
-    private static final String PROP_BACK_COMMENT = "BackComment";
+    /** コメントをダウンロードする. */
+    private static final String PROP_SAVE_COMMENT = "SaveCommentFile";
+    /** 変換後にコメントファイルを削除する. */
     private static final String PROP_DEL_COMMENT_AFTER_CONV = "DeleteCommentAfterConv";
-    private static final String PROP_COMMENT_FIX_FILE_NAME = "CommentFixFileName";
-    private static final String PROP_COMMENT_FIX_FILE_NAME_FOLDER = "CommentFixFileNameFolder";
+    /** コメント取得数は自動で調整する. */
     private static final String PROP_FIX_COMMENT_NUM = "FixCommentSize";
-    private static final String PROP_SAVE_COMMENT = "SaveCommentFile";
+    /** 取得コメント数. */
+    private static final String PROP_BACK_COMMENT = "BackComment";
+    /** フォルダ/ファイル保存選択ラジオボタン. */
+    private static final String PROP_COMMENT_FIX_FILE_NAME = "CommentFixFileName";
+    /** フォルダ名. */
+    private static final String PROP_COMMENT_FOLDER = "CommentFixFileNameFolder";
+    /** ファイル名. */
+    private static final String PROP_COMMENT_FILE = "CommentFile";
     private final boolean selfAdjustNumOfComment;
     private final int numOfComment;
+    private final boolean reduceComment;
+    private final String backLogPoint;
 
     public InputCommentSetting(boolean download, boolean autoNaming, File folder, File file, boolean deleteAfterConvert,
-            boolean adjust, int numOfCom) {
+            boolean adjust, int numOfCom, boolean reduceComment, String backLogPoint) {
         super(Boolean.valueOf(download), autoNaming, folder, file, deleteAfterConvert);
         this.selfAdjustNumOfComment = adjust;
         this.numOfComment = numOfCom;
+        this.reduceComment = reduceComment;
+        this.backLogPoint = backLogPoint;
     }
 
+    @Override
     public void save(Properties prop) {
-        prop.setProperty(PROP_COMMENT_FILE, getFile().getPath());
-        prop.setProperty(PROP_BACK_COMMENT, Integer.toString(getNumOfComment()));
+        prop.setProperty(PROP_SAVE_COMMENT, getProcessKind().toString());
         prop.setProperty(PROP_DEL_COMMENT_AFTER_CONV, Boolean.toString(isDeleteAfterConvert()));
-        prop.setProperty(PROP_COMMENT_FIX_FILE_NAME, Boolean.toString(isAutoNaming()));
-        prop.setProperty(PROP_COMMENT_FIX_FILE_NAME_FOLDER, getFolder().getPath());
         prop.setProperty(PROP_FIX_COMMENT_NUM, Boolean.toString(isSelfAdjustNumOfComment()));
-        prop.setProperty(PROP_SAVE_COMMENT, getProcessKind().toString());
+        prop.setProperty(PROP_BACK_COMMENT, Integer.toString(getNumOfComment()));
+        prop.setProperty(PROP_COMMENT_FIX_FILE_NAME, Boolean.toString(isAutoNaming()));
+        prop.setProperty(PROP_COMMENT_FOLDER, getFolder().getPath());
+        prop.setProperty(PROP_COMMENT_FILE, getFile().getPath());
 
     }
 
     public static InputCommentSetting load(Properties prop) {
-
-        String file = prop.getProperty(PROP_COMMENT_FILE, "comment.xml");
-        String numOfComment = prop.getProperty(PROP_BACK_COMMENT, "500");
-        boolean delete = Boolean.parseBoolean(prop.getProperty(PROP_DEL_COMMENT_AFTER_CONV, "false"));
-        boolean adjustNumOfComment = Boolean.parseBoolean(prop.getProperty(PROP_COMMENT_FIX_FILE_NAME, "true"));
-        String folder = prop.getProperty(PROP_COMMENT_FIX_FILE_NAME_FOLDER, "[out]comment");
-        boolean autoNaming = Boolean.parseBoolean(prop.getProperty(PROP_FIX_COMMENT_NUM, "true"));
         boolean download = Boolean.parseBoolean(prop.getProperty(PROP_SAVE_COMMENT, "true"));
+        boolean delete = Boolean.parseBoolean(prop.getProperty(PROP_DEL_COMMENT_AFTER_CONV, "false"));
+        boolean adjustNumOfComment = Boolean.parseBoolean(prop.getProperty(PROP_FIX_COMMENT_NUM, "true"));
+        String numOfComment = prop.getProperty(PROP_BACK_COMMENT, "500");
+        boolean autoNaming = Boolean.parseBoolean(prop.getProperty(PROP_COMMENT_FIX_FILE_NAME, "true"));
+        String folder = prop.getProperty(PROP_COMMENT_FOLDER, "out/comment");
+        String file = prop.getProperty(PROP_COMMENT_FILE, "comment.xml");
 
         return new InputCommentSetting(download, autoNaming, new File(folder), new File(file), delete,
                 adjustNumOfComment,
-                Integer.parseInt(numOfComment));
+                Integer.parseInt(numOfComment), false, "");
     }
 
     public final boolean isSelfAdjustNumOfComment() {
@@ -60,4 +71,12 @@ public class InputCommentSetting extends InputFileSetting<Boolean> {
     public final int getNumOfComment() {
         return numOfComment;
     }
+
+    public boolean isReduceComment(){
+        return reduceComment;
+    }
+
+    public String getBackLogPoint() {
+        return backLogPoint;
+    }
 }