From 1470a143efb294aaeb677018f05ec4d6272c18dd Mon Sep 17 00:00:00 2001 From: galaxyoyo Date: Wed, 7 Jan 2015 17:55:38 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=C3=A9=20fen=C3=AAtre=20principale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../galaxyoyo/unknown/frame/MainFrame.java | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/main/java/galaxyoyo/unknown/frame/MainFrame.java diff --git a/src/main/java/galaxyoyo/unknown/frame/MainFrame.java b/src/main/java/galaxyoyo/unknown/frame/MainFrame.java new file mode 100644 index 0000000..70e8df3 --- /dev/null +++ b/src/main/java/galaxyoyo/unknown/frame/MainFrame.java @@ -0,0 +1,63 @@ +/** + * @author galaxyoyo + */ +package galaxyoyo.unknown.frame; + +import java.awt.Dimension; + +import javax.swing.JFrame; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.core.Logger; + +/** + * Fenêtre principale du jeu + * @author galaxyoyo + */ +public class MainFrame extends JFrame +{ + /** + * ID de sé + * @see {@link JFrame} + */ + private static final long serialVersionUID = -3168760121879418534L; + + /** + * Instance unique principale + * @see #MainFrame() + * @see #getInstance() + */ + private static MainFrame INSTANCE; + + private static Logger LOGGER = (Logger) LogManager.getLogger("MainFrame"); + + /** + * Constructeur + * @see galaxyoyo.unknown.client.main.Main#launchFrame() + */ + private MainFrame() + { + super (); + LOGGER.info("D\u00e9marrage du jeu ..."); + this.setTitle("WHAT IS THE NAME PLEASE"); + this.setPreferredSize(new Dimension(1000, 800)); + this.setSize(800, 700); + this.setLocationRelativeTo(null); + this.setExtendedState(JFrame.MAXIMIZED_BOTH); + this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + } + + /** + * Cet accesseur renvoie l'accesseur unique de la classe + * @see #INSTANCE + * @see #MainFrame() + * @return l'instance unique de la classe + */ + public static MainFrame getInstance() + { + if (INSTANCE == null) + return INSTANCE = new MainFrame(); + + return INSTANCE; + } +}