nicer code
This commit is contained in:
parent
4a69b801e3
commit
a153db2c4c
1 changed files with 17 additions and 57 deletions
|
@ -96,9 +96,7 @@ public class MainGUI {
|
||||||
|
|
||||||
level.setBounds(10, 10, 200, 30);
|
level.setBounds(10, 10, 200, 30);
|
||||||
level.setFont(level.getFont().deriveFont(15f));
|
level.setFont(level.getFont().deriveFont(15f));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
filtercompleted.setBounds(720, 15, 200, 30);
|
filtercompleted.setBounds(720, 15, 200, 30);
|
||||||
|
|
||||||
progress.setBounds(200, 300, 500, 30);
|
progress.setBounds(200, 300, 500, 30);
|
||||||
|
@ -146,9 +144,7 @@ public class MainGUI {
|
||||||
|
|
||||||
show.setBounds(500, 1, 200, 60);
|
show.setBounds(500, 1, 200, 60);
|
||||||
|
|
||||||
|
|
||||||
recordspanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
|
recordspanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
|
||||||
|
|
||||||
|
|
||||||
Thread thread = new Thread(new Runnable() {
|
Thread thread = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -164,9 +160,7 @@ public class MainGUI {
|
||||||
contents.setPreferredSize(new Dimension(600, 50));
|
contents.setPreferredSize(new Dimension(600, 50));
|
||||||
contents.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
|
contents.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
|
||||||
contents.setLayout(null);
|
contents.setLayout(null);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JButton completed = new JButton("x");
|
JButton completed = new JButton("x");
|
||||||
completed.setBounds(640, 17, 17, 17);
|
completed.setBounds(640, 17, 17, 17);
|
||||||
completed.setMargin(new Insets(0,0,0,0));
|
completed.setMargin(new Insets(0,0,0,0));
|
||||||
|
@ -174,19 +168,13 @@ public class MainGUI {
|
||||||
JButton uncompleted = new JButton("\u2713");
|
JButton uncompleted = new JButton("\u2713");
|
||||||
uncompleted.setBounds(640, 17, 17, 17);
|
uncompleted.setBounds(640, 17, 17, 17);
|
||||||
uncompleted.setMargin(new Insets(0,0,0,0));
|
uncompleted.setMargin(new Insets(0,0,0,0));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
File file = new File("C:\\ExtremeDemonList\\completed\\" + fetch.allLevels().get(i)+ ".json");
|
File file = new File("C:\\ExtremeDemonList\\completed\\" + fetch.allLevels().get(i)+ ".json");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
completed.addActionListener(new ActionListener() {
|
|
||||||
|
|
||||||
|
completed.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
contents.setBackground(Color.decode("#cbffbf"));
|
contents.setBackground(Color.decode("#cbffbf"));
|
||||||
|
|
||||||
completed.setVisible(false);
|
completed.setVisible(false);
|
||||||
uncompleted.setVisible(true);
|
uncompleted.setVisible(true);
|
||||||
|
|
||||||
|
@ -196,22 +184,17 @@ public class MainGUI {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
|
||||||
|
|
||||||
uncompleted.addActionListener(new ActionListener() {
|
uncompleted.addActionListener(new ActionListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
contents.setBackground(Color.WHITE);
|
contents.setBackground(Color.WHITE);
|
||||||
|
|
||||||
uncompleted.setVisible(false);
|
uncompleted.setVisible(false);
|
||||||
completed.setVisible(true);
|
completed.setVisible(true);
|
||||||
|
|
||||||
file.delete();
|
file.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if(new File("C:\\ExtremeDemonList\\completed\\" + fetch.allLevels().get(i)+ ".json").exists()) {
|
if(new File("C:\\ExtremeDemonList\\completed\\" + fetch.allLevels().get(i)+ ".json").exists()) {
|
||||||
|
@ -223,7 +206,6 @@ public class MainGUI {
|
||||||
contents.addMouseListener(new MouseListener() {
|
contents.addMouseListener(new MouseListener() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseClicked(MouseEvent e) {
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
|
||||||
showinfos.addActionListener(new ActionListener() {
|
showinfos.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
@ -232,10 +214,6 @@ public class MainGUI {
|
||||||
ver.showInfo(url);
|
ver.showInfo(url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
level.setText(data.getLocalLevels().get(index));
|
level.setText(data.getLocalLevels().get(index));
|
||||||
verifier.setText("Verifier: " + data.getVerifier().get(index));
|
verifier.setText("Verifier: " + data.getVerifier().get(index));
|
||||||
|
@ -246,7 +224,6 @@ public class MainGUI {
|
||||||
|
|
||||||
FetchData fetchData = new FetchData();
|
FetchData fetchData = new FetchData();
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
recordspanel.setLayout(new GridLayout(GuiData.allVictors(fetchData.allLevels().get(index)).size(), 1));
|
recordspanel.setLayout(new GridLayout(GuiData.allVictors(fetchData.allLevels().get(index)).size(), 1));
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
|
@ -285,24 +262,17 @@ public class MainGUI {
|
||||||
}
|
}
|
||||||
|
|
||||||
recordspanel.revalidate();
|
recordspanel.revalidate();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
copyid.addActionListener(new ActionListener() {
|
copyid.addActionListener(new ActionListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
|
||||||
StringSelection stringSelection = new StringSelection(data.getId().get(index));
|
StringSelection stringSelection = new StringSelection(data.getId().get(index));
|
||||||
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
|
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
|
||||||
clipboard.setContents(stringSelection, null);
|
clipboard.setContents(stringSelection, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void mousePressed(MouseEvent e) {
|
public void mousePressed(MouseEvent e) {
|
||||||
|
@ -325,7 +295,6 @@ public class MainGUI {
|
||||||
rank.setName(i + "");
|
rank.setName(i + "");
|
||||||
|
|
||||||
show.addActionListener(new ActionListener() {
|
show.addActionListener(new ActionListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
levelpanel.add(contents, 0);
|
levelpanel.add(contents, 0);
|
||||||
|
@ -367,9 +336,7 @@ public class MainGUI {
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
levelname = new JLabel();
|
levelname = new JLabel();
|
||||||
levelname.setText(data.getLocalLevels().get(i));
|
levelname.setText(data.getLocalLevels().get(i));
|
||||||
levelname.setBounds(290, 10, 300, 30);
|
levelname.setBounds(290, 10, 300, 30);
|
||||||
|
@ -418,9 +385,7 @@ public class MainGUI {
|
||||||
levelpanel.revalidate();
|
levelpanel.revalidate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contents.add(levelname);
|
contents.add(levelname);
|
||||||
contents.add(rank);
|
contents.add(rank);
|
||||||
contents.add(completed);
|
contents.add(completed);
|
||||||
|
@ -428,9 +393,7 @@ public class MainGUI {
|
||||||
levelpanel.add(contents);
|
levelpanel.add(contents);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
scroll.setVisible(true);
|
scroll.setVisible(true);
|
||||||
elements.infopanel().setVisible(true);
|
elements.infopanel().setVisible(true);
|
||||||
progress.setVisible(false);
|
progress.setVisible(false);
|
||||||
|
@ -453,10 +416,8 @@ public class MainGUI {
|
||||||
elements.infopanel().add(idshow);
|
elements.infopanel().add(idshow);
|
||||||
elements.infopanel().add(qualify);
|
elements.infopanel().add(qualify);
|
||||||
elements.infopanel().add(victor);
|
elements.infopanel().add(victor);
|
||||||
// elements.infopanel().add(ytthumbnail);
|
|
||||||
elements.infopanel().add(showinfos);
|
elements.infopanel().add(showinfos);
|
||||||
|
|
||||||
|
|
||||||
main.add(search);
|
main.add(search);
|
||||||
main.add(currentLevel);
|
main.add(currentLevel);
|
||||||
main.add(info);
|
main.add(info);
|
||||||
|
@ -467,5 +428,4 @@ public class MainGUI {
|
||||||
main.add(elements.infopanel());
|
main.add(elements.infopanel());
|
||||||
main.setVisible(true);
|
main.setVisible(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
Loading…
Reference in a new issue