1 package com.ranfa.main;
3 import java.awt.BorderLayout;
4 import java.awt.EventQueue;
5 import java.util.ArrayList;
7 import javax.swing.JFrame;
8 import javax.swing.JPanel;
9 import javax.swing.border.EmptyBorder;
11 import com.ranfa.lib.Scraping;
12 import com.ranfa.lib.Song;
13 import com.ranfa.lib.Version;
15 @Version(major = 1, minor = 0, patch = 0)
16 public class DelesteRandomSelector extends JFrame {
18 private JPanel contentPane;
21 * Launch the application.
23 public static void main(String[] args) {
24 EventQueue.invokeLater(new Runnable() {
27 DelesteRandomSelector frame = new DelesteRandomSelector();
28 frame.setVisible(true);
29 } catch (Exception e) {
39 public DelesteRandomSelector() {
40 System.out.println(getVersion());
41 ArrayList<Song> tmp = Scraping.getWholeData();
42 for(int i = 0; i < tmp.size(); i++) {
43 System.out.println(tmp.get(i).toString());
45 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
46 setBounds(100, 100, 450, 300);
47 contentPane = new JPanel();
48 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
49 contentPane.setLayout(new BorderLayout(0, 0));
50 setContentPane(contentPane);
55 * アノテーションで記載されているバージョンを取得します
57 * @return アノテーションで定義されているバージョン
59 public static String getVersion() {
61 + getMajorVersion() + "."
62 + getMinorVersion() + "."
67 public static int getMajorVersion() {
68 Version version = (Version) DelesteRandomSelector.class.getAnnotation(Version.class);
69 return version.major();
72 public static int getMinorVersion() {
73 Version version = (Version) DelesteRandomSelector.class.getAnnotation(Version.class);
74 return version.minor();
77 public static int getPatchVersion() {
78 Version version = (Version) DelesteRandomSelector.class.getAnnotation(Version.class);
79 return version.patch();