1
0

LS03-02-2 | Vollbildmodus implementiert

This commit is contained in:
2021-05-28 10:34:31 +02:00
parent 39b80c1bf7
commit d860a7d797
5 changed files with 52 additions and 15 deletions
@@ -2,7 +2,7 @@
<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">
<constraints>
<xy x="20" y="20" width="501" height="400"/>
<xy x="20" y="20" width="584" height="400"/>
</constraints>
<properties>
<background color="-16777216"/>
@@ -18,6 +18,12 @@
</properties>
<border type="none"/>
<children>
<component id="a4374" class="javax.swing.JButton" binding="btnBack">
<constraints/>
<properties>
<text value="zurück"/>
</properties>
</component>
<component id="cdd2d" class="javax.swing.JButton" binding="btnPlay">
<constraints/>
<properties>
@@ -22,6 +22,7 @@ public class LevelChoice {
private JButton btnDeleteLevel;
private JButton btnPlay;
private JScrollPane scrollPane;
private JButton btnBack;
private final LevelController lvlControl;
private final LeveldesignWindow leveldesignWindow;
@@ -77,6 +78,12 @@ public class LevelChoice {
tblLevels.getTableHeader().setOpaque(false);
tblLevels.getTableHeader().setBackground(Color.BLACK);
tblLevels.getTableHeader().setForeground(Color.YELLOW);
btnBack.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
leveldesignWindow.dispose();
}
});
}
private String[][] getLevelsAsTableModel() {
@@ -49,6 +49,8 @@ public class LeveldesignWindow extends JFrame {
this.showLevelChooser();
this.setLocationRelativeTo(null);
this.setUndecorated(true);
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setVisible(true);
}
@@ -1,6 +1,6 @@
<?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">
<grid id="27dc6" binding="main" layout-manager="GridLayoutManager" row-count="11" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<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">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="326" height="715"/>
@@ -15,8 +15,8 @@
<children>
<component id="c5b1d" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="177" height="9"/>
<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">
<preferred-size width="177" height="100"/>
</grid>
</constraints>
<properties>
@@ -27,8 +27,8 @@
</component>
<component id="8961e" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="1" use-parent-layout="false">
<preferred-size width="200" height="103"/>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="0" indent="1" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
@@ -40,7 +40,7 @@
</component>
<component id="965b" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<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"/>
</constraints>
<properties>
<font size="14" style="1"/>
@@ -50,7 +50,7 @@
</component>
<component id="14947" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" 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="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font size="14" style="1"/>
@@ -60,7 +60,7 @@
</component>
<component id="b84a7" class="javax.swing.JPasswordField" binding="passwordTextField">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" 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="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -68,7 +68,7 @@
</component>
<component id="39eaf" class="javax.swing.JButton" binding="playButton">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" 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="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<actionCommand value=""/>
@@ -77,7 +77,7 @@
</component>
<component id="6cda2" class="javax.swing.JButton" binding="testButton">
<constraints>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<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"/>
</constraints>
<properties>
<text value="Testen"/>
@@ -85,7 +85,7 @@
</component>
<component id="9d215" class="javax.swing.JTextField" binding="loginTextField">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" 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="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -93,7 +93,7 @@
</component>
<component id="e66c9" class="javax.swing.JButton" binding="highscoreButton" default-binding="true">
<constraints>
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" 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>
<properties>
<text value="Highscore"/>
@@ -101,7 +101,7 @@
</component>
<component id="7ae73" class="javax.swing.JButton" binding="levelEditorButton" default-binding="true">
<constraints>
<grid row="9" column="0" 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="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-256"/>
@@ -111,7 +111,7 @@
</component>
<component id="ef1af" class="javax.swing.JButton" binding="exitButton">
<constraints>
<grid row="10" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" 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>
<properties>
<background color="-3552823"/>
@@ -119,6 +119,26 @@
<text value="Beenden"/>
</properties>
</component>
<hspacer id="abee9">
<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"/>
</constraints>
</hspacer>
<hspacer id="da8b7">
<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"/>
</constraints>
</hspacer>
<vspacer id="c33be">
<constraints>
<grid row="0" 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="8c4ad">
<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"/>
</constraints>
</vspacer>
</children>
</grid>
</form>
@@ -103,10 +103,12 @@ public class MainMenu {
public static void show(AlienDefenceController alienDefenceController) {
JFrame frame = new JFrame("AlienDefence");
frame.setUndecorated(true);
frame.setContentPane(new MainMenu(alienDefenceController).main);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setVisible(true);
}
}