OSDN Git Service

feat: add components
authorhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Thu, 17 Mar 2022 05:49:21 +0000 (14:49 +0900)
committerhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Thu, 17 Mar 2022 05:49:21 +0000 (14:49 +0900)
Crash-Report/2022-03-16-21-59-45.txt [new file with mode: 0644]
Crash-Report/2022-03-17-12-33-52.txt [new file with mode: 0644]
src/com/ranfa/lib/io/FileIO.java
src/com/ranfa/lib/io/OutputDataStructure.java
src/com/ranfa/main/DelesteRandomSelector.java
src/test/ObjectIOTest.java [deleted file]
src/test/mock/ObjectWriteMock.java [deleted file]

diff --git a/Crash-Report/2022-03-16-21-59-45.txt b/Crash-Report/2022-03-16-21-59-45.txt
new file mode 100644 (file)
index 0000000..ec50e8b
--- /dev/null
@@ -0,0 +1,52 @@
+---- DelesteRandomSelector Crash Report ----
+// This is also adventure!, isn't it?
+
+
+Time: 22/03/16 21:59
+Description: Unexpected Error
+
+
+These are simplified stack trace. (shown up to 5 lines. Full Stack trace is below.)
+java.lang.IllegalStateException: java.util.concurrent.CompletionException: java.lang.NullPointerException
+       at com.ranfa.main.DelesteRandomSelector.lambda$37(DelesteRandomSelector.java:662)
+       at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
+       at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
+       at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+
+
+A detailed walkthrough of the error, its code path and all known details is as follows:
+---------------------------------------------------------------------------------------
+
+
+Stacktrace:
+       at com.ranfa.main.DelesteRandomSelector.lambda$37(DelesteRandomSelector.java:662)
+       at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
+       at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
+       at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
+       at java.base/java.lang.Thread.run(Thread.java:829)
+Caused by: java.util.concurrent.CompletionException: java.lang.NullPointerException
+       at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
+       at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
+       at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
+       at java.base/java.lang.Thread.run(Thread.java:829)
+Caused by: java.lang.NullPointerException
+       at com.ranfa.main.DelesteRandomSelector.lambda$36(DelesteRandomSelector.java:621)
+       at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
+       at java.base/java.lang.Thread.run(Thread.java:829)
+
+
+-- System Details --
+Details:
+       DelesteRandomSelector Version: v4.0.1-Beta
+       Operating System: Windows 10 (amd64) version 10.0
+       Java Version: 11, Eclipse Adoptium
+       Java VM Version: OpenJDK 64-Bit Server VM, version 11.0.13+8
+       Memory: 56134976 bytes / 268435456 bytes up to 4273995776 bytes
+       JVM Flags: 1 total: [-Dfile.encoding=UTF-8]
diff --git a/Crash-Report/2022-03-17-12-33-52.txt b/Crash-Report/2022-03-17-12-33-52.txt
new file mode 100644 (file)
index 0000000..e0c89a1
--- /dev/null
@@ -0,0 +1,53 @@
+---- DelesteRandomSelector Crash Report ----
+// These Easter sentences were inspired by Minecraft Crash Report!
+
+
+Time: 22/03/17 12:33
+Description: Unexpected Error
+
+
+These are simplified stack trace. (shown up to 5 lines. Full Stack trace is below.)
+java.lang.IllegalStateException: java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Level must not negative.
+       at com.ranfa.main.DelesteRandomSelector.lambda$20(DelesteRandomSelector.java:435)
+       at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
+       at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
+       at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+
+
+A detailed walkthrough of the error, its code path and all known details is as follows:
+---------------------------------------------------------------------------------------
+
+
+Stacktrace:
+       at com.ranfa.main.DelesteRandomSelector.lambda$20(DelesteRandomSelector.java:435)
+       at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
+       at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
+       at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
+       at java.base/java.lang.Thread.run(Thread.java:829)
+Caused by: java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Level must not negative.
+       at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
+       at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
+       at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
+       at java.base/java.lang.Thread.run(Thread.java:829)
+Caused by: java.lang.IllegalArgumentException: Level must not negative.
+       at com.ranfa.lib.database.Scraping.getSpecificLevelSongs(Scraping.java:176)
+       at com.ranfa.main.DelesteRandomSelector.lambda$19(DelesteRandomSelector.java:422)
+       at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
+       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
+       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
+       at java.base/java.lang.Thread.run(Thread.java:829)
+
+
+-- System Details --
+Details:
+       DelesteRandomSelector Version: v4.0.1-Beta
+       Operating System: Windows 10 (amd64) version 10.0
+       Java Version: 11, Eclipse Adoptium
+       Java VM Version: OpenJDK 64-Bit Server VM, version 11.0.13+8
+       Memory: 56237536 bytes / 268435456 bytes up to 4273995776 bytes
+       JVM Flags: 1 total: [-Dfile.encoding=UTF-8]
index b87f2e4..1396003 100644 (file)
@@ -7,8 +7,6 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.text.SimpleDateFormat;
 import java.util.Date;
-import java.util.List;
-import java.util.Map;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -29,15 +27,11 @@ public class FileIO {
         * attribute
         * score
         */
-       List<Map<String, String>> songList;
+       private OutputDataStructure data;
        
        
-       public FileIO(List<Map<String, String>> songList) {
-               this.songList = songList;
-       }
-       
-       public FileIO() {
-               this.songList = null;
+       public FileIO(OutputDataStructure data) {
+               this.data = data;
        }
        
        public boolean write() {
@@ -45,9 +39,7 @@ public class FileIO {
                builder.append(FILE_EXTENSION);
                try {
                        ObjectOutputStream outStream = new ObjectOutputStream(new FileOutputStream(builder.toString()));
-                       OutputDataStructure structure = new OutputDataStructure(songList);
-                       outStream.writeObject(structure);
-                       outStream.flush();
+                       outStream.writeObject(data);
                        outStream.close();
                        return true;
                } catch (IOException e) {
index 1d5a2da..4197867 100644 (file)
@@ -1,45 +1,98 @@
 package com.ranfa.lib.io;
 
 import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
 
 public class OutputDataStructure implements Serializable {
        
        private static final long serialVersionUID = 1L;
        
        // fields
-       List<Map<String, String>> songList;
+       private String songname;
+       private int level;
+       private String difficulty;
+       private String attribute;
+       private int score;
        
-       public OutputDataStructure(List<Map<String, String>> songList) {
-               this.songList = songList;
+       public OutputDataStructure() {
+               this(null, -1, null, null, -1);
+       }
+       
+       public OutputDataStructure(String songname, int level, String difficulty, String attribute, int score) {
+               this.songname = songname;
+               this.level = level;
+               this.difficulty = difficulty;
+               this.attribute = attribute;
+               this.score = score;
+       }
+
+       /**
+        * @return songname
+        */
+       public String getSongname() {
+               return songname;
        }
 
-       public static long getSerialversionuid() {
-               return serialVersionUID;
+       /**
+        * @param songname セットする songname
+        */
+       public void setSongname(String songname) {
+               this.songname = songname;
        }
 
-       public List<Map<String, String>> getSongList() {
-               return songList;
+       /**
+        * @return level
+        */
+       public int getLevel() {
+               return level;
        }
 
+       /**
+        * @param level セットする level
+        */
+       public void setLevel(int level) {
+               this.level = level;
+       }
+
+       /**
+        * @return difficulty
+        */
+       public String getDifficulty() {
+               return difficulty;
+       }
+
+       /**
+        * @param difficulty セットする difficulty
+        */
+       public void setDifficulty(String difficulty) {
+               this.difficulty = difficulty;
+       }
+
+       /**
+        * @return attribute
+        */
+       public String getAttribute() {
+               return attribute;
+       }
+
+       /**
+        * @param attribute セットする attribute
+        */
+       public void setAttribute(String attribute) {
+               this.attribute = attribute;
+       }
 
-       @Override
-       public int hashCode() {
-               return Objects.hash(songList);
+       /**
+        * @return score
+        */
+       public int getScore() {
+               return score;
        }
 
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj) {
-                       return true;
-               }
-               if (!(obj instanceof OutputDataStructure)) {
-                       return false;
-               }
-               OutputDataStructure other = (OutputDataStructure) obj;
-               return Objects.equals(songList, other.songList);
+       /**
+        * @param score セットする score
+        */
+       public void setScore(int score) {
+               this.score = score;
        }
        
        
index e9abfbf..39b867f 100644 (file)
@@ -5,6 +5,8 @@ import java.awt.CardLayout;
 import java.awt.Desktop;
 import java.awt.EventQueue;
 import java.awt.Font;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -35,6 +37,7 @@ import javax.swing.JScrollPane;
 import javax.swing.JSpinner;
 import javax.swing.JTabbedPane;
 import javax.swing.JTextArea;
+import javax.swing.JTextField;
 import javax.swing.border.EmptyBorder;
 
 import org.slf4j.Logger;
@@ -59,7 +62,7 @@ import com.ranfa.lib.database.Song;
 import com.ranfa.lib.handler.CrashHandler;
 import com.ranfa.lib.songinfo.FetchFromAPI;
 
-@Version(major = 4, minor = 0, patch = 1, suffix = Suffix.BETA)
+@Version(major = 4, minor = 0, patch = 2, suffix = Suffix.BETA)
 public class DelesteRandomSelector extends JFrame {
 
     private static ArrayList<Song> selectedSongsList = new ArrayList<>();
@@ -162,6 +165,25 @@ public class DelesteRandomSelector extends JFrame {
        private JPanel panelScoreCenter;
        private JLabel labelScoreTitle;
        private JLabel labelScoreVersion;
+       private JLabel labelScoreUserPlayed;
+       private JTextField fieldScoreUserPlayed;
+       private JLabel labelScoreEstimatedFan;
+       private JTextField fieldScoreEstimatedFan;
+       private JLabel lblSongname;
+       private JLabel labelScoreAttribute;
+       private JLabel labelScoreDifficulty;
+       private JLabel labelScoreLevel;
+       private JLabel labelScoreNotes;
+       private JLabel labelScoreSongnameDynamic;
+       private JLabel labelScoreAttributeDynamic;
+       private JLabel labelScoreDifficultyDynamic;
+       private JLabel labelScoreLevelDynamic;
+       private JLabel labelScoreNotesDynamic;
+       private JButton btnScorePrev;
+       private JButton btnScoreNext;
+       private JLabel labelScoreCurrentSongOrder;
+       private JLabel labelScoreSlash;
+       private JLabel labelScoreOrderMax;
 
     /**
      * Launch the application.
@@ -288,7 +310,7 @@ public class DelesteRandomSelector extends JFrame {
        }, es);
        this.logger.debug("Version: {}", CheckVersion.getVersion());
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-       // this.setBounds(100, 100, 960, 643);
+       this.setBounds(100, 100, 960, 643);
        this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        this.setContentPane(this.contentPane);
        contentPane.setLayout(new CardLayout(0, 0));
@@ -623,6 +645,18 @@ public class DelesteRandomSelector extends JFrame {
                                labelArrangeToolTip.setText(fetchMap.get("arrange"));
                                labelMemberToolTip.setText("<html><body>" + fetchMap.get("member") + "</html></body>");
                        }
+                       if(currentTabName.equals("Scores") && labelScoreCurrentSongOrder.getText().equals("null")) {
+                               logger.info("Detected switching score tab");
+                               if(toolIntegrateList == null)
+                                       return;
+                               Song firstSong = toolIntegrateList.get(0);
+                               labelScoreCurrentSongOrder.setText("1");
+                               labelScoreSongnameDynamic.setText("<html><body>" + firstSong.getName() + "</body></html>");
+                               labelScoreAttributeDynamic.setText(firstSong.getAttribute());
+                               labelScoreDifficultyDynamic.setText(firstSong.getDifficulty());
+                               labelScoreLevelDynamic.setText(String.valueOf(firstSong.getLevel()));
+                               labelScoreNotesDynamic.setText(String.valueOf(firstSong.getNotes()));
+                       }
                }, es).whenCompleteAsync((ret, ex) -> {
                        labelToolProgress.setText("Information parse Complete.");
                        if(ex != null) {
@@ -958,6 +992,161 @@ public class DelesteRandomSelector extends JFrame {
        
        panelScoreCenter = new JPanel();
        panelScore.add(panelScoreCenter, BorderLayout.CENTER);
+       panelScoreCenter.setLayout(new FormLayout(new ColumnSpec[] {
+                       FormSpecs.RELATED_GAP_COLSPEC,
+                       ColumnSpec.decode("max(60dlu;default)"),
+                       FormSpecs.RELATED_GAP_COLSPEC,
+                       ColumnSpec.decode("max(60dlu;default)"),
+                       FormSpecs.RELATED_GAP_COLSPEC,
+                       ColumnSpec.decode("max(60dlu;default)"),
+                       FormSpecs.RELATED_GAP_COLSPEC,
+                       ColumnSpec.decode("max(68dlu;default)"),
+                       FormSpecs.RELATED_GAP_COLSPEC,
+                       ColumnSpec.decode("max(59dlu;default)"),
+                       FormSpecs.RELATED_GAP_COLSPEC,
+                       ColumnSpec.decode("center:max(97dlu;default)"),
+                       FormSpecs.RELATED_GAP_COLSPEC,
+                       ColumnSpec.decode("max(25dlu;default)"),
+                       FormSpecs.RELATED_GAP_COLSPEC,
+                       ColumnSpec.decode("max(9dlu;default)"),
+                       FormSpecs.RELATED_GAP_COLSPEC,
+                       ColumnSpec.decode("max(25dlu;default)"),
+                       FormSpecs.RELATED_GAP_COLSPEC,
+                       ColumnSpec.decode("40dlu:grow"),},
+               new RowSpec[] {
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       FormSpecs.DEFAULT_ROWSPEC,
+                       FormSpecs.RELATED_GAP_ROWSPEC,
+                       RowSpec.decode("default:grow"),}));
+       
+       labelScoreUserPlayed = new JLabel("Your score");
+       panelScoreCenter.add(labelScoreUserPlayed, "2, 10, center, default");
+       
+       labelScoreEstimatedFan = new JLabel("Estimated Fan");
+       panelScoreCenter.add(labelScoreEstimatedFan, "6, 10, center, default");
+       
+       fieldScoreUserPlayed = new JTextField();
+       panelScoreCenter.add(fieldScoreUserPlayed, "2, 12, fill, default");
+       fieldScoreUserPlayed.setColumns(10);
+       
+       fieldScoreEstimatedFan = new JTextField();
+       panelScoreCenter.add(fieldScoreEstimatedFan, "6, 12, center, default");
+       fieldScoreEstimatedFan.setColumns(10);
+       
+       lblSongname = new JLabel("Songname");
+       panelScoreCenter.add(lblSongname, "10, 12, center, default");
+       
+       labelScoreSongnameDynamic = new JLabel("<dynamic>");
+       panelScoreCenter.add(labelScoreSongnameDynamic, "12, 12, center, default");
+       
+       labelScoreAttribute = new JLabel("Attribute");
+       panelScoreCenter.add(labelScoreAttribute, "10, 16, center, default");
+       
+       labelScoreAttributeDynamic = new JLabel("<dynamic>");
+       panelScoreCenter.add(labelScoreAttributeDynamic, "12, 16");
+       
+       labelScoreDifficulty = new JLabel("Difficulty");
+       panelScoreCenter.add(labelScoreDifficulty, "10, 20, center, default");
+       
+       labelScoreDifficultyDynamic = new JLabel("<dynamic>");
+       panelScoreCenter.add(labelScoreDifficultyDynamic, "12, 20");
+       
+       labelScoreLevel = new JLabel("Level");
+       panelScoreCenter.add(labelScoreLevel, "10, 24, center, default");
+       
+       labelScoreLevelDynamic = new JLabel("<dynamic>");
+       panelScoreCenter.add(labelScoreLevelDynamic, "12, 24");
+       
+       labelScoreNotes = new JLabel("Notes");
+       panelScoreCenter.add(labelScoreNotes, "10, 28, center, default");
+       
+       labelScoreNotesDynamic = new JLabel("<dynamic>");
+       panelScoreCenter.add(labelScoreNotesDynamic, "12, 28");
+       
+       labelScoreCurrentSongOrder = new JLabel("null");
+       panelScoreCenter.add(labelScoreCurrentSongOrder, "14, 28, center, default");
+       
+       labelScoreSlash = new JLabel("/");
+       panelScoreCenter.add(labelScoreSlash, "16, 28, center, default");
+       
+       labelScoreOrderMax = new JLabel(String.valueOf(property.getSongLimit()));
+       panelScoreCenter.add(labelScoreOrderMax, "18, 28, center, default");
+       
+       btnScorePrev = new JButton("Prev");
+       btnScorePrev.addActionListener(new ActionListener() {
+               @Override
+               public void actionPerformed(ActionEvent e) {
+                       CompletableFuture.runAsync(() -> {
+                               int currentIndex = Integer.parseInt(labelScoreCurrentSongOrder.getText()) - 1;
+                               if(currentIndex != 0) {
+                                       Song prevSong = toolIntegrateList.get(currentIndex - 1);
+                                       logger.info("currently : {} Next: {}", currentIndex + 1, currentIndex);
+                                       logger.info("prevSong: {}", prevSong);
+                                       labelScoreSongnameDynamic.setText("<html><body>" + prevSong.getName() + "</body></html>");
+                                       labelScoreAttributeDynamic.setText(prevSong.getAttribute());
+                                       labelScoreDifficultyDynamic.setText(prevSong.getDifficulty());
+                                       labelScoreLevelDynamic.setText(String.valueOf(prevSong.getLevel()));
+                                       labelScoreNotesDynamic.setText(String.valueOf(prevSong.getNotes()));
+                                       labelScoreCurrentSongOrder.setText(String.valueOf(currentIndex));
+                               }
+                       }, es);
+               }
+       });
+       panelScoreCenter.add(btnScorePrev, "14, 30");
+       
+       btnScoreNext = new JButton("Next");
+       btnScoreNext.addActionListener(new ActionListener() {
+               @Override
+               public void actionPerformed(ActionEvent e) {
+                       CompletableFuture.runAsync(() -> {
+                               int currentIndex = Integer.parseInt(labelScoreCurrentSongOrder.getText()) - 1;
+                               if(currentIndex != property.getSongLimit() - 1) {
+                                       Song nextSong = toolIntegrateList.get(currentIndex + 1);
+                                       logger.info("currently : {} Next: {}", currentIndex + 1, currentIndex + 2);
+                                       logger.info("nextSong: {}", nextSong);
+                                       labelScoreSongnameDynamic.setText("<html><body>" + nextSong.getName() + "</body></html>");
+                                       labelScoreAttributeDynamic.setText(nextSong.getAttribute());
+                                       labelScoreDifficultyDynamic.setText(nextSong.getDifficulty());
+                                       labelScoreLevelDynamic.setText(String.valueOf(nextSong.getLevel()));
+                                       labelScoreNotesDynamic.setText(String.valueOf(nextSong.getNotes()));
+                                       labelScoreCurrentSongOrder.setText(String.valueOf(currentIndex + 2));
+                               }
+                       }, es);
+               }
+       });
+       panelScoreCenter.add(btnScoreNext, "18, 30");
        if(isFirst || !this.property.isCheckLibraryUpdates()) {
            setEnabled.run();
        }
diff --git a/src/test/ObjectIOTest.java b/src/test/ObjectIOTest.java
deleted file mode 100644 (file)
index 3623925..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-package test;
-
-import static org.junit.Assert.*;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.ranfa.lib.io.FileIO;
-import com.ranfa.lib.io.OutputDataStructure;
-
-import test.mock.ObjectWriteMock;
-
-/**
- * songname
- * level
- * difficulty
- * attribute
- * score
- */
-public class ObjectIOTest {
-       
-       private static final String filename = "test.drs";
-       private static Map<String, String> testMap;
-       private static List<Map<String, String>> testList;
-       
-       @BeforeClass
-       public static void init() {
-               testMap = new LinkedHashMap<>();
-               testMap.put("songname", "testname001");
-               testMap.put("level", "28");
-               testMap.put("difficulty", "MASTER");
-               testMap.put("attribute", "キュート");
-               testMap.put("score", "1200000");
-               testList = new ArrayList<>();
-               testList.add(testMap);
-       }
-       
-       
-       @Test
-       public void writeTest() {
-               assertTrue(ObjectWriteMock.write(testList, filename));
-       }
-       
-       @Test
-       public void readNonNullTest() {
-               OutputDataStructure structure = FileIO.read(filename);
-               assertNotNull(structure);
-       }
-       
-       @Test
-       public void readEqualsTest() {
-               OutputDataStructure structure = FileIO.read(filename);
-               if(structure != null) {
-                       assertEquals(new OutputDataStructure(testList), structure);
-               }
-       }
-       
-       @AfterClass
-       public static void del() {
-                       try {
-                               Files.deleteIfExists(Paths.get(filename));
-                       } catch (IOException e) {
-                               e.printStackTrace();
-                       }
-       }
-
-}
diff --git a/src/test/mock/ObjectWriteMock.java b/src/test/mock/ObjectWriteMock.java
deleted file mode 100644 (file)
index 18df96d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package test.mock;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.util.List;
-import java.util.Map;
-
-import com.ranfa.lib.io.OutputDataStructure;
-
-public class ObjectWriteMock {
-       
-       public static boolean write(List<Map<String, String>> songList, String filename) {
-               try {
-                       ObjectOutputStream outStream = new ObjectOutputStream(new FileOutputStream(filename));
-                       OutputDataStructure structure = new OutputDataStructure(songList);
-                       outStream.writeObject(structure);
-                       outStream.flush();
-                       outStream.close();
-                       return true;
-               } catch (IOException e) {
-                       e.printStackTrace();
-                       return false;
-               }
-       }
-
-}