EOS 2  1.1.0
Einfache Objektbasierte Sprache
GameFrame.java
gehe zur Dokumentation dieser Datei
1 package de.lathanda.eos.game;
2 
3 import java.awt.BorderLayout;
4 import java.awt.event.WindowEvent;
5 import java.awt.event.WindowListener;
6 
7 import javax.swing.JFrame;
8 
9 import de.lathanda.eos.base.MutableColor;
15 /*package*/ class GameFrame extends JFrame implements WindowListener{
16  private static final long serialVersionUID = -7729801117398028803L;
17 
26  protected GameFrame(double width, double height, MutableColor back, Game game, String title) {
27  super(title);
28 
29  setLocation(0, 0);
30  // layout
31  setLayout(new BorderLayout());
32  add(new GamePanel(game, 30, back, width, height), BorderLayout.CENTER);
33  setResizable(false);
34  pack();
35  setVisible(true);
36  addWindowListener(this);
37  }
38 
39  public void windowActivated(WindowEvent we) {}
40  public void windowClosed(WindowEvent we) {
41  System.exit(0);
42  }
43  public void windowClosing(WindowEvent we) {
44  dispose();
45  }
46  public void windowDeactivated(WindowEvent we) {}
47  public void windowDeiconified(WindowEvent we) {}
48  public void windowIconified(WindowEvent we) {}
49  public void windowOpened(WindowEvent we) {}
50 }
Impressum