Browse Source

HA10 Login Window

master
Jannik Niebuhr 2 years ago
parent
commit
c1b92a6ef1
  1. 1
      spaceinvaders/GameProject/bin/.gitignore
  2. BIN
      spaceinvaders/GameProject/bin/ui/GameUI.class
  3. 130
      spaceinvaders/GameProject/log/log4j.log
  4. 2
      spaceinvaders/GameProject/src/ui/GameUI.java
  5. 17
      spaceinvaders/GameProject/src/ui/GameUIWithLogin.java
  6. 52
      spaceinvaders/GameProject/src/ui/LoginWindow.java

1
spaceinvaders/GameProject/bin/.gitignore

@ -1,2 +1 @@
/ui/
/base/

BIN
spaceinvaders/GameProject/bin/ui/GameUI.class

130
spaceinvaders/GameProject/log/log4j.log

@ -5284,3 +5284,133 @@
2022-06-29 17:25:24,400 INFO playground.BreakoutLevel2 - ball created.
2022-06-29 17:25:24,402 INFO playground.BreakoutLevelBaseAdvanced - level preperation succeeded.
2022-06-29 17:25:28,344 INFO base.GameLoop - GUI PAUSE
2022-06-29 18:17:55,062 INFO base.GameLoop - GUI starts
2022-06-29 18:17:57,165 INFO base.GameLoop - GUI NEW
2022-06-29 18:17:57,166 INFO playground.SpaceInvadersLevel - PREPARE
2022-06-29 18:17:57,289 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-06-29 18:17:57,312 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-06-29 18:17:57,320 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-06-29 18:17:57,333 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-06-29 18:17:57,347 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-06-29 18:17:57,360 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-06-29 18:17:57,371 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-06-29 18:17:57,379 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-06-29 18:17:57,413 INFO playground.Animation - img added .\video/heart0.png
2022-06-29 18:17:57,423 INFO playground.Animation - img added .\video/heart1.png
2022-06-29 18:17:57,436 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-06-29 18:20:19,262 INFO base.GameLoop - GUI starts
2022-06-29 18:20:20,873 INFO base.GameLoop - GUI NEW
2022-06-29 18:20:20,874 INFO playground.SpaceInvadersLevel - PREPARE
2022-06-29 18:20:20,998 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-06-29 18:20:21,020 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-06-29 18:20:21,029 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-06-29 18:20:21,042 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-06-29 18:20:21,055 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-06-29 18:20:21,068 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-06-29 18:20:21,079 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-06-29 18:20:21,087 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-06-29 18:20:21,120 INFO playground.Animation - img added .\video/heart0.png
2022-06-29 18:20:21,129 INFO playground.Animation - img added .\video/heart1.png
2022-06-29 18:20:21,143 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-06-29 18:20:42,123 INFO base.GameLoop - GUI starts
2022-06-29 18:20:43,791 INFO base.GameLoop - GUI NEW
2022-06-29 18:20:43,793 INFO playground.SpaceInvadersLevel - PREPARE
2022-06-29 18:20:43,918 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-06-29 18:20:43,943 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-06-29 18:20:43,953 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-06-29 18:20:43,966 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-06-29 18:20:43,981 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-06-29 18:20:43,995 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-06-29 18:20:44,005 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-06-29 18:20:44,015 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-06-29 18:20:44,049 INFO playground.Animation - img added .\video/heart0.png
2022-06-29 18:20:44,058 INFO playground.Animation - img added .\video/heart1.png
2022-06-29 18:20:44,072 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-06-29 18:27:11,118 INFO base.GameLoop - GUI starts
2022-06-29 18:27:12,907 INFO base.GameLoop - GUI NEW
2022-06-29 18:27:12,908 INFO playground.SpaceInvadersLevel - PREPARE
2022-06-29 18:27:13,036 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-06-29 18:27:13,059 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-06-29 18:27:13,067 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-06-29 18:27:13,080 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-06-29 18:27:13,094 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-06-29 18:27:13,107 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-06-29 18:27:13,118 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-06-29 18:27:13,126 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-06-29 18:27:13,160 INFO playground.Animation - img added .\video/heart0.png
2022-06-29 18:27:13,169 INFO playground.Animation - img added .\video/heart1.png
2022-06-29 18:27:13,182 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-06-29 18:56:24,856 INFO base.GameLoop - GUI starts
2022-06-29 18:56:26,796 INFO base.GameLoop - GUI NEW
2022-06-29 18:56:26,797 INFO playground.SpaceInvadersLevel - PREPARE
2022-06-29 18:56:26,930 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-06-29 18:56:26,952 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-06-29 18:56:26,961 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-06-29 18:56:26,974 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-06-29 18:56:26,988 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-06-29 18:56:27,001 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-06-29 18:56:27,011 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-06-29 18:56:27,020 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-06-29 18:56:27,056 INFO playground.Animation - img added .\video/heart0.png
2022-06-29 18:56:27,065 INFO playground.Animation - img added .\video/heart1.png
2022-06-29 18:56:27,080 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-06-29 19:22:13,351 INFO base.GameLoop - GUI starts
2022-06-29 19:22:15,693 INFO base.GameLoop - GUI NEW
2022-06-29 19:22:15,695 INFO playground.SpaceInvadersLevel - PREPARE
2022-06-29 19:22:15,833 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-06-29 19:22:15,855 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-06-29 19:22:15,864 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-06-29 19:22:15,876 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-06-29 19:22:15,890 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-06-29 19:22:15,903 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-06-29 19:22:15,913 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-06-29 19:22:15,922 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-06-29 19:22:15,956 INFO playground.Animation - img added .\video/heart0.png
2022-06-29 19:22:15,966 INFO playground.Animation - img added .\video/heart1.png
2022-06-29 19:22:15,979 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-06-29 19:22:37,948 INFO base.GameLoop - GUI starts
2022-06-29 19:22:39,920 INFO base.GameLoop - GUI NEW
2022-06-29 19:22:39,921 INFO playground.SpaceInvadersLevel - PREPARE
2022-06-29 19:22:40,042 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-06-29 19:22:40,065 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-06-29 19:22:40,073 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-06-29 19:22:40,087 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-06-29 19:22:40,101 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-06-29 19:22:40,114 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-06-29 19:22:40,124 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-06-29 19:22:40,133 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-06-29 19:22:40,166 INFO playground.Animation - img added .\video/heart0.png
2022-06-29 19:22:40,174 INFO playground.Animation - img added .\video/heart1.png
2022-06-29 19:22:40,187 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-06-29 19:27:55,604 INFO playground.SpaceInvadersLevel - no enemies left, level done.
2022-06-29 19:27:55,607 INFO base.GameLoop - reached end of levels
2022-06-29 19:27:55,609 INFO base.GameLoop - Game ends. Bye.
2022-06-29 21:20:56,637 INFO base.GameLoop - GUI starts
2022-06-29 21:20:59,149 INFO base.GameLoop - GUI NEW
2022-06-29 21:20:59,150 INFO playground.SpaceInvadersLevel - PREPARE
2022-06-29 21:20:59,322 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-06-29 21:20:59,346 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-06-29 21:20:59,355 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-06-29 21:20:59,369 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-06-29 21:20:59,383 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-06-29 21:20:59,396 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-06-29 21:20:59,407 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-06-29 21:20:59,417 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-06-29 21:20:59,457 INFO playground.Animation - img added .\video/heart0.png
2022-06-29 21:20:59,468 INFO playground.Animation - img added .\video/heart1.png
2022-06-29 21:20:59,496 INFO playground.SpaceInvadersLevel - HIGHSCORE17200
2022-06-29 21:29:23,641 INFO base.GameLoop - GUI starts
2022-06-29 21:47:06,509 INFO base.GameLoop - GUI starts
2022-06-29 21:47:08,568 INFO base.GameLoop - GUI NEW
2022-06-29 21:47:08,570 INFO playground.SpaceInvadersLevel - PREPARE
2022-06-29 21:47:08,710 INFO playground.Animation - img added .\video/sweetAlien0.png
2022-06-29 21:47:08,733 INFO playground.Animation - img added .\video/sweetAlien1.png
2022-06-29 21:47:08,742 INFO playground.Animation - img added .\video/sweetAlien2.png
2022-06-29 21:47:08,756 INFO playground.Animation - img added .\video/sweetAlien3.png
2022-06-29 21:47:08,770 INFO playground.Animation - img added .\video/sweetAlien4.png
2022-06-29 21:47:08,783 INFO playground.Animation - img added .\video/sweetAlien5.png
2022-06-29 21:47:08,794 INFO playground.Animation - img added .\video/sweetAlien6.png
2022-06-29 21:47:08,803 INFO playground.Animation - img added .\video/sweetAlien7.png
2022-06-29 21:47:08,839 INFO playground.Animation - img added .\video/heart0.png
2022-06-29 21:47:08,850 INFO playground.Animation - img added .\video/heart1.png
2022-06-29 21:47:08,864 INFO playground.SpaceInvadersLevel - HIGHSCORE17200

2
spaceinvaders/GameProject/src/ui/GameUI.java

@ -25,7 +25,7 @@ import org.apache.logging.log4j.LogManager;
*/
public class GameUI implements ActionListener {
private static volatile int newAction = -1;
protected static volatile int newAction = -1;
/** the JFrame instance used in this window */
protected JFrame frame = null;

17
spaceinvaders/GameProject/src/ui/GameUIWithLogin.java

@ -2,14 +2,7 @@ package ui;
//einfach erstmal alle Imports der Elternklassse mitgenommen...
import java.util.*;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.WindowConstants;
import javax.swing.*;
import playground.Playground;
import java.awt.event.*;
@ -20,8 +13,10 @@ import org.apache.logging.log4j.LogManager;
public class GameUIWithLogin extends GameUI {
protected JMenuItem loginItem;
public GameUIWithLogin(int sizeX, int sizeY) {
super(sizeX, sizeY);
this.loginItem = new JMenuItem("Login... P E N I S"); // legt den button an (mit String name)
@ -32,12 +27,10 @@ public class GameUIWithLogin extends GameUI {
@Override
public void actionPerformed(ActionEvent ae) {
if(ae.getSource() == this.loginItem) {
System.out.println("testbutton gedrueckt!!!");
}
super.actionPerformed(ae);
if(ae.getSource() == this.loginItem) {
}
}

52
spaceinvaders/GameProject/src/ui/LoginWindow.java

@ -0,0 +1,52 @@
package ui;
import java.util.*;
import javax.swing.*;
import playground.Playground;
import java.awt.event.*;
public class LoginWindow extends GameUIWithLogin {
JFileChooser fc;
JFrame frame = null;
JPanel contentPane = null;
JTextField tf1 = null;
JTextField tf2 = null;
JLabel name = null;
JLabel password = null;
JButton login = null;
public LoginWindow(int sizeX, int sizeY) {
super(sizeX, sizeY);
this.frame = new JFrame("Login");
this.contentPane = new JPanel();
this.frame.setContentPane(this.contentPane);
this.tf1 = new JTextField("",20);
this.tf2 = new JTextField("",20);
this.name = new JLabel("Login: ");
this.password = new JLabel("Passwort: ");
this.contentPane.add(this.name);
this.contentPane.add(this.tf1);
this.contentPane.add(this.password);
this.contentPane.add(this.tf2);
this.login = new JButton("Login");
this.contentPane.add(this.login);
this.tf1.addActionListener(this);
this.tf2.addActionListener(this);
this.login.addActionListener(this);
this.frame.setSize(250, 300);
this.frame.setVisible(true);
}
public static int getNewAction() {
return getNewAction();
}
}
Loading…
Cancel
Save