private final static String URI = "https://imascg-slstage-wiki.gamerch.com/%E6%A5%BD%E6%9B%B2%E8%A9%B3%E7%B4%B0%E4%B8%80%E8%A6%A7";
private final static String DBPATH = "database.json";
+ public final static String NONSELECTED = "指定なし";
public final static String ALL = "全タイプ";
public final static String CUTE = "キュート";
public final static String COOL = "クール";
if(!attribute.equals(ALL)
&& !attribute.equals(CUTE)
&& !attribute.equals(COOL)
- && !attribute.equals(PASSION))
+ && !attribute.equals(PASSION)
+ && !attribute.equals(NONSELECTED))
throw new IllegalArgumentException("Illegal attribute value: " + attribute);
if(data.isEmpty()) {
JOptionPane.showMessageDialog(null, "指定された属性の曲は存在しません。\n条件を変えてみてください");
throw new IllegalArgumentException("ArrayList must not empty.");
}
ArrayList<Song> res = new ArrayList<Song>();
- for(int i = 0; i < data.size(); i ++) {
- if(data.get(i).getAttribute().equals(attribute))
- res.add(data.get(i));
+ if(attribute.equals(NONSELECTED)) {
+ res = data;
+ } else {
+ for(int i = 0; i < data.size(); i ++) {
+ if(data.get(i).getAttribute().equals(attribute))
+ res.add(data.get(i));
+ }
}
return res;
}
&& !difficulty.equals(TRICK)
&& !difficulty.equals(PIANO)
&& !difficulty.equals(FORTE)
- && !difficulty.equals(WITCH))
+ && !difficulty.equals(WITCH)
+ && !difficulty.equals(NONSELECTED))
throw new IllegalArgumentException("Illegal difficulty value.");
if(data.isEmpty())
throw new IllegalArgumentException("ArrayList must not empty.");
ArrayList<Song> res = new ArrayList<Song>();
- for(int i = 0; i < data.size(); i++) {
- if(data.get(i).getDifficulty().equals(difficulty))
- res.add(data.get(i));
+ if(difficulty.equals(NONSELECTED)) {
+ res = data;
+ } else {
+ for(int i = 0; i < data.size(); i++) {
+ if(data.get(i).getDifficulty().equals(difficulty))
+ res.add(data.get(i));
+ }
}
return res;
}
import com.ranfa.lib.Song;
import com.ranfa.lib.Version;
-@Version(major = 0, minor = 1, patch = 1)
+@Version(major = 0, minor = 2, patch = 0)
public class DelesteRandomSelector extends JFrame {
private static ArrayList<Song> selectedSongsList = new ArrayList<Song>();
panelWest.add(labelDifficulty, "2, 2, center, default");
comboDifficultySelect = new JComboBox();
- comboDifficultySelect.setModel(new DefaultComboBoxModel(new String[] {"DEBUT", "REGULAR", "PRO", "MASTER", "MASTER+", "ⓁMASTER+", "LIGHT", "TRICK", "PIANO", "FORTE", "WITCH"}));
+ comboDifficultySelect.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
+ comboDifficultySelect.setModel(new DefaultComboBoxModel(new String[] {"指定なし", "DEBUT", "REGULAR", "PRO", "MASTER", "MASTER+", "ⓁMASTER+", "LIGHT", "TRICK", "PIANO", "FORTE", "WITCH"}));
panelWest.add(comboDifficultySelect, "2, 4, fill, default");
comboAttribute = new JComboBox();
comboAttribute.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
- comboAttribute.setModel(new DefaultComboBoxModel(new String[] {"全タイプ", "キュート", "クール", "パッション"}));
+ comboAttribute.setModel(new DefaultComboBoxModel(new String[] {"指定なし", "全タイプ", "キュート", "クール", "パッション"}));
panelWest.add(comboAttribute, "2, 6, fill, default");
labelLevel = new JLabel("楽曲Lv");
String[] tmp = new String[property.getSongLimit()];
for(int i = 0; i < property.getSongLimit(); i++) {
int randomInt = random.nextInt(selectedSongsList.size());
- tmp[i] = (i + 1) + "曲目:[" + selectedSongsList.get(randomInt).getDifficulty() + "]「" + selectedSongsList.get(randomInt).getName() + "」!\n\n";
+ tmp[i] = (i + 1) + "曲目: " + selectedSongsList.get(randomInt).getAttribute() + " [" + selectedSongsList.get(randomInt).getDifficulty() + "]「" + selectedSongsList.get(randomInt).getName() + "」!(Lv:" + selectedSongsList.get(randomInt).getLevel() + ")\n\n";
}
String paneString = "";
for (int i = 0; i < tmp.length; i++) {