OSDN Git Service

refactor: refactoring manual updates
authorhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Thu, 17 Feb 2022 02:23:30 +0000 (11:23 +0900)
committerhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Thu, 17 Feb 2022 02:23:30 +0000 (11:23 +0900)
generated/database.json
src/com/ranfa/main/DelesteRandomSelector.java

index 469c41d..429b79e 100644 (file)
   }, {
     "attribute" : "キュート",
     "name" : "かぼちゃ姫",
-    "difficulty" : "MASTER+",
+    "difficulty" : "MASTER+",
     "level" : 29,
     "notes" : 953,
-    "albumType" : "Not-implemented"
+    "albumType" : "ALBUM A"
   }, {
     "attribute" : "クール",
     "name" : "レッド・ソール",
   }, {
     "attribute" : "クール",
     "name" : "堕ちる果実",
-    "difficulty" : "MASTER+",
+    "difficulty" : "MASTER+",
     "level" : 31,
     "notes" : 734,
-    "albumType" : "Not-implemented"
+    "albumType" : "ALBUM B"
   }, {
     "attribute" : "キュート",
     "name" : "Halloween♥Code",
     "level" : 30,
     "notes" : 964,
     "albumType" : "ALBUM C"
+  }, {
+    "attribute" : "キュート",
+    "name" : "cherry*merry*cherry",
+    "difficulty" : "DEBUT",
+    "level" : 8,
+    "notes" : 126,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "キュート",
+    "name" : "cherry*merry*cherry",
+    "difficulty" : "REGULAR",
+    "level" : 12,
+    "notes" : 178,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "キュート",
+    "name" : "cherry*merry*cherry",
+    "difficulty" : "PRO",
+    "level" : 17,
+    "notes" : 344,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "キュート",
+    "name" : "cherry*merry*cherry",
+    "difficulty" : "MASTER",
+    "level" : 25,
+    "notes" : 605,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "スパイスパラダイス",
+    "difficulty" : "WITCH",
+    "level" : 27,
+    "notes" : 566,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "トロピカルガール",
+    "difficulty" : "DEBUT",
+    "level" : 8,
+    "notes" : 104,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "トロピカルガール",
+    "difficulty" : "REGULAR",
+    "level" : 14,
+    "notes" : 203,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "トロピカルガール",
+    "difficulty" : "PRO",
+    "level" : 18,
+    "notes" : 408,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "トロピカルガール",
+    "difficulty" : "MASTER",
+    "level" : 26,
+    "notes" : 694,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "トロピカルガール",
+    "difficulty" : "MASTER+",
+    "level" : 29,
+    "notes" : 988,
+    "albumType" : "Not-implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "あこがれステッチ",
+    "difficulty" : "LIGHT",
+    "level" : 6,
+    "notes" : 133,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "あこがれステッチ",
+    "difficulty" : "TRICK",
+    "level" : 15,
+    "notes" : 319,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "双翼の独奏歌",
+    "difficulty" : "LIGHT",
+    "level" : 8,
+    "notes" : 172,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "双翼の独奏歌",
+    "difficulty" : "TRICK",
+    "level" : 17,
+    "notes" : 372,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "キュート",
+    "name" : "かぼちゃ姫",
+    "difficulty" : "MASTER+",
+    "level" : 29,
+    "notes" : 963,
+    "albumType" : "ALBUM A"
+  }, {
+    "attribute" : "全タイプ",
+    "name" : "つぼみ",
+    "difficulty" : "MASTER+",
+    "level" : 28,
+    "notes" : 688,
+    "albumType" : "ALBUM A"
+  }, {
+    "attribute" : "パッション",
+    "name" : "CoCo夏夏夏 Holiday",
+    "difficulty" : "DEBUT",
+    "level" : 8,
+    "notes" : 127,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "CoCo夏夏夏 Holiday",
+    "difficulty" : "REGULAR",
+    "level" : 14,
+    "notes" : 250,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "CoCo夏夏夏 Holiday",
+    "difficulty" : "PRO",
+    "level" : 19,
+    "notes" : 468,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "CoCo夏夏夏 Holiday",
+    "difficulty" : "MASTER",
+    "level" : 27,
+    "notes" : 819,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "パッション",
+    "name" : "CoCo夏夏夏 Holiday",
+    "difficulty" : "MASTER+",
+    "level" : 30,
+    "notes" : 999,
+    "albumType" : "Not-implemented"
+  }, {
+    "attribute" : "クール",
+    "name" : "堕ちる果実",
+    "difficulty" : "MASTER+",
+    "level" : 31,
+    "notes" : 734,
+    "albumType" : "ALBUM B"
+  }, {
+    "attribute" : "全タイプ",
+    "name" : "心もよう",
+    "difficulty" : "MASTER+",
+    "level" : 26,
+    "notes" : 500,
+    "albumType" : "ALBUM B"
+  }, {
+    "attribute" : "キュート",
+    "name" : "スローライフ・ファンタジー",
+    "difficulty" : "DEBUT",
+    "level" : 6,
+    "notes" : 80,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "キュート",
+    "name" : "スローライフ・ファンタジー",
+    "difficulty" : "REGULAR",
+    "level" : 12,
+    "notes" : 152,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "キュート",
+    "name" : "スローライフ・ファンタジー",
+    "difficulty" : "PRO",
+    "level" : 17,
+    "notes" : 304,
+    "albumType" : "Not-Implemented"
+  }, {
+    "attribute" : "キュート",
+    "name" : "スローライフ・ファンタジー",
+    "difficulty" : "MASTER",
+    "level" : 25,
+    "notes" : 579,
+    "albumType" : "Not-Implemented"
   } ]
 }
\ No newline at end of file
index e893ed4..5c855f6 100644 (file)
@@ -14,6 +14,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.function.BiConsumer;
 
+import javax.swing.DefaultComboBoxModel;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
@@ -58,7 +59,6 @@ public class DelesteRandomSelector extends JFrame {
     private String albumType = Messages.MSGAlbumTypeBeingCalculated.toString();
     private Logger logger = LoggerFactory.getLogger(DelesteRandomSelector.class);
     private ManualUpdateThreadImpl impl;
-    private Thread manualUpdateThread;
     private Easter easter;
     private JPanel panelMain;
     private JPanel panelNorth;
@@ -232,10 +232,12 @@ public class DelesteRandomSelector extends JFrame {
        panelWest.add(labelDifficulty, "2, 2, center, center");
        
        comboDifficultySelect = new JComboBox();
+       comboDifficultySelect.setModel(new DefaultComboBoxModel(new String[] {Messages.MSGNonSelected.toString(), "DEBUT", "REGULAR", "PRO", "MASTER", "MASTER+", "ⓁMASTER+", "LIGHT", "TRICK", "PIANO", "FORTE", "WITCH"}));
        comboDifficultySelect.setFont(new Font("Dialog", Font.BOLD, 12));
        panelWest.add(comboDifficultySelect, "2, 4, fill, fill");
        
        comboAttribute = new JComboBox();
+       comboAttribute.setModel(new DefaultComboBoxModel(new String[] {Messages.MSGNonSelected.toString(), "全タイプ", "キュート", "クール", "パッション"}));
        comboAttribute.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
        panelWest.add(comboAttribute, "2, 6, fill, top");
        
@@ -333,7 +335,12 @@ public class DelesteRandomSelector extends JFrame {
        btnManualUpdate = new JButton(Messages.MSGManualUpdate.toString());
        btnManualUpdate.addActionListener(e -> {
                impl = new ManualUpdateThreadImpl();
-               es.submit(impl);
+               CompletableFuture.runAsync(impl, es).whenCompleteAsync((t, u) -> {
+                       if(u != null) {
+                               logger.warn("Exception while processing update manually.", e);
+                               JOptionPane.showMessageDialog(null, "There was a problem during processing library update manually.\nIf this appears repeatedly, please contact developer with your app log.");
+                       }
+               }, es);
        });
        panelEast.add(btnManualUpdate, "2, 8, fill, fill");