LS03-02-2 | Highscore jetzt über die Levelauswahl
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="de.oszimt.ls.aliendefence.view.menue.LevelChoice">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="de.oszimt.ls.aliendefence.view.menue.LevelChoice">
|
||||||
<grid id="27dc6" binding="panel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
<grid id="27dc6" binding="panel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="584" height="400"/>
|
<xy x="20" y="20" width="677" height="400"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<background color="-16777216"/>
|
<background color="-16777216"/>
|
||||||
@@ -30,6 +30,12 @@
|
|||||||
<text value="Spielen"/>
|
<text value="Spielen"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
|
<component id="a6b5c" class="javax.swing.JButton" binding="btnHighscore">
|
||||||
|
<constraints/>
|
||||||
|
<properties>
|
||||||
|
<text value="Highscore"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
<component id="c85bc" class="javax.swing.JButton" binding="btnNewLevel">
|
<component id="c85bc" class="javax.swing.JButton" binding="btnNewLevel">
|
||||||
<constraints/>
|
<constraints/>
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public class LevelChoice {
|
|||||||
private JButton btnPlay;
|
private JButton btnPlay;
|
||||||
private JScrollPane scrollPane;
|
private JScrollPane scrollPane;
|
||||||
private JButton btnBack;
|
private JButton btnBack;
|
||||||
|
private JButton btnHighscore;
|
||||||
|
|
||||||
private final LevelController lvlControl;
|
private final LevelController lvlControl;
|
||||||
private final LeveldesignWindow leveldesignWindow;
|
private final LeveldesignWindow leveldesignWindow;
|
||||||
@@ -67,6 +68,7 @@ public class LevelChoice {
|
|||||||
|
|
||||||
if (source == LeveldesignWindow.LEVELEDITOR) {
|
if (source == LeveldesignWindow.LEVELEDITOR) {
|
||||||
btnPlay.setVisible(false);
|
btnPlay.setVisible(false);
|
||||||
|
btnHighscore.setVisible(false);
|
||||||
}
|
}
|
||||||
else if (source == LeveldesignWindow.TESTEN) {
|
else if (source == LeveldesignWindow.TESTEN) {
|
||||||
btnNewLevel.setVisible(false);
|
btnNewLevel.setVisible(false);
|
||||||
@@ -84,6 +86,12 @@ public class LevelChoice {
|
|||||||
leveldesignWindow.dispose();
|
leveldesignWindow.dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
btnHighscore.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
btnHighscore_Clicked(controller);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[][] getLevelsAsTableModel() {
|
private String[][] getLevelsAsTableModel() {
|
||||||
@@ -132,6 +140,14 @@ public class LevelChoice {
|
|||||||
t.start();
|
t.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void btnHighscore_Clicked(AlienDefenceController alienDefenceController) {
|
||||||
|
//Level_id des selektierten Elements auslesen
|
||||||
|
int level_id = Integer
|
||||||
|
.parseInt((String) this.tblLevels.getModel().getValueAt(this.tblLevels.getSelectedRow(), 0));
|
||||||
|
|
||||||
|
new Highscore(alienDefenceController.getAttemptController(), alienDefenceController.getLevelController().readLevel(level_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public JPanel getPanel() {
|
public JPanel getPanel() {
|
||||||
return panel;
|
return panel;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="de.oszimt.ls.aliendefence.view.menue.MainMenu">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="de.oszimt.ls.aliendefence.view.menue.MainMenu">
|
||||||
<grid id="27dc6" binding="main" layout-manager="GridLayoutManager" row-count="13" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="27dc6" binding="main" layout-manager="GridLayoutManager" row-count="14" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="326" height="715"/>
|
<xy x="20" y="20" width="326" height="715"/>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<children>
|
<children>
|
||||||
<component id="c5b1d" class="javax.swing.JLabel">
|
<component id="c5b1d" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="0" indent="0" use-parent-layout="false">
|
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="177" height="100"/>
|
<preferred-size width="177" height="100"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="965b" class="javax.swing.JLabel">
|
<component id="965b" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<font size="14" style="1"/>
|
<font size="14" style="1"/>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="14947" class="javax.swing.JLabel">
|
<component id="14947" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<font size="14" style="1"/>
|
<font size="14" style="1"/>
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="b84a7" class="javax.swing.JPasswordField" binding="passwordTextField">
|
<component id="b84a7" class="javax.swing.JPasswordField" binding="passwordTextField">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="150" height="-1"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="39eaf" class="javax.swing.JButton" binding="playButton">
|
<component id="39eaf" class="javax.swing.JButton" binding="playButton">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<actionCommand value=""/>
|
<actionCommand value=""/>
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="6cda2" class="javax.swing.JButton" binding="testButton">
|
<component id="6cda2" class="javax.swing.JButton" binding="testButton">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Testen"/>
|
<text value="Testen"/>
|
||||||
@@ -85,23 +85,15 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="9d215" class="javax.swing.JTextField" binding="loginTextField">
|
<component id="9d215" class="javax.swing.JTextField" binding="loginTextField">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||||
<preferred-size width="150" height="-1"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
</component>
|
</component>
|
||||||
<component id="e66c9" class="javax.swing.JButton" binding="highscoreButton" default-binding="true">
|
|
||||||
<constraints>
|
|
||||||
<grid row="9" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<text value="Highscore"/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="7ae73" class="javax.swing.JButton" binding="levelEditorButton" default-binding="true">
|
<component id="7ae73" class="javax.swing.JButton" binding="levelEditorButton" default-binding="true">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="10" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<background color="-256"/>
|
<background color="-256"/>
|
||||||
@@ -111,7 +103,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="ef1af" class="javax.swing.JButton" binding="exitButton">
|
<component id="ef1af" class="javax.swing.JButton" binding="exitButton">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="11" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="12" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<background color="-3552823"/>
|
<background color="-3552823"/>
|
||||||
@@ -121,12 +113,12 @@
|
|||||||
</component>
|
</component>
|
||||||
<hspacer id="abee9">
|
<hspacer id="abee9">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</hspacer>
|
</hspacer>
|
||||||
<hspacer id="da8b7">
|
<hspacer id="da8b7">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</hspacer>
|
</hspacer>
|
||||||
<vspacer id="c33be">
|
<vspacer id="c33be">
|
||||||
@@ -136,7 +128,25 @@
|
|||||||
</vspacer>
|
</vspacer>
|
||||||
<vspacer id="8c4ad">
|
<vspacer id="8c4ad">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="12" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
<grid row="13" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<vspacer id="109a4">
|
||||||
|
<constraints>
|
||||||
|
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false">
|
||||||
|
<minimum-size width="-1" height="30"/>
|
||||||
|
<preferred-size width="-1" height="30"/>
|
||||||
|
<maximum-size width="-1" height="30"/>
|
||||||
|
</grid>
|
||||||
|
</constraints>
|
||||||
|
</vspacer>
|
||||||
|
<vspacer id="99842">
|
||||||
|
<constraints>
|
||||||
|
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false">
|
||||||
|
<minimum-size width="-1" height="30"/>
|
||||||
|
<preferred-size width="-1" height="30"/>
|
||||||
|
<maximum-size width="-1" height="30"/>
|
||||||
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
</vspacer>
|
</vspacer>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ public class MainMenu {
|
|||||||
private JTextField loginTextField;
|
private JTextField loginTextField;
|
||||||
private JButton playButton;
|
private JButton playButton;
|
||||||
private JButton testButton;
|
private JButton testButton;
|
||||||
private JButton highscoreButton;
|
|
||||||
private JButton levelEditorButton;
|
private JButton levelEditorButton;
|
||||||
private JButton exitButton;
|
private JButton exitButton;
|
||||||
private JPasswordField passwordTextField;
|
private JPasswordField passwordTextField;
|
||||||
@@ -65,14 +64,6 @@ public class MainMenu {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Button Highscore
|
|
||||||
highscoreButton.addActionListener(new ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
new Highscore(alienDefenceController.getAttemptController(), arrLevel.get(1));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Button Leveleditor
|
// Button Leveleditor
|
||||||
levelEditorButton.addActionListener(new ActionListener() {
|
levelEditorButton.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user