Commit 286a005a authored by Bogdan's avatar Bogdan

A graphicmaster with compiler errors for ingameprogramming- sorry for commiting the wrong file!

parent 63eb0613
......@@ -12,10 +12,8 @@ import graphics.guiSkeleton.guiPanel.menuPanel.gameCreation.SinglePlayer_GameCre
import graphics.guiSkeleton.guiPanel.menuPanel.gameLoad.SinglePlayer_LoadGamePanel;
import graphics.guiSkeleton.guiPanel.menuPanel.loungePanel.LoungePanel;
import graphics.guiSkeleton.guiPanel.menuPanel.multiPlayer_MenuPanel.MultiPlayer_MenuPanel;
import graphics.guiSkeleton.guiPanel.menuPanel.multiPlayer_MenuPanel.SeverCreatedPanel;
import graphics.guiSkeleton.inputManagement.MainFrameKeyListener;
import graphics.ingame_input_listener.InputConfiguration;
//import ingame_programming.IGPpanel;
import ingame_programming.IGPpanel;
import javax.swing.*;
......@@ -36,19 +34,19 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
/** Singleton pattern implementation **/
//private static GraphicsMaster thisGraphicsMaster
//protected MainFrame mainFrame;
//protected MainFrame mainFrame;
//protected static GraphicsMasterAbstraction thisGraphicsMaster = new GraphicsMaster();
private GraphicsMaster() {
//this.thisGraphicsMaster = new GraphicsMaster();
//this.thisGraphicsMaster = new GraphicsMaster();
mapGUIStatesToGUIPanel.put(GUIStates.UNINITIALISED, new UnitialisedGUIPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.MAIN_MENU, new MainMenuPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.GAME_PANEL, new GamePanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.SINGLEPLAYER_MENU, new SinglePlayer_MenuPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.MULTIPLAYER_MENU, new MultiPlayer_MenuPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.INPUT_CONFIG_PANEL, new ConfigurationPanel(this));
// mapGUIStatesToGUIPanel.put(GUIStates.IGP_PANEL, new IGPpanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.IGP_PANEL, new IGPpanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.LOUNGE, new LoungePanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.MULTIPLAYER_GAME_CREATION, new MultiPlayer_GameCreationPanel(this));
......@@ -61,7 +59,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
mapGUIStatesToGUIPanel.put(GUIStates.PLEASE_WAIT, new PleaseWaitPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.SERVER_ADDRESS_PANEL, new ServerAddressPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.SERVER_CREATED_PANEL, new SeverCreatedPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.GAME_OVER, new GameOverPanel(this));
}
......@@ -88,10 +85,10 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
mainFrame = new MainFrame();
mainFrame.init(mainFrameKeyListener);
//MainFrame mf = (MainFrame)mainFrame;
//mf.setFocusable(true); //For the keyListener to work
//mf.addKeyListener(mainFrameKeyListener);
//mf.revalidate();
//mf.setVisible(true);
//mf.setFocusable(true); //For the keyListener to work
//mf.addKeyListener(mainFrameKeyListener);
//mf.revalidate();
//mf.setVisible(true);
changeGUIStateTo(GUIStates.MAIN_MENU);
}
......@@ -109,10 +106,9 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
*/
@Override
public void exitGUI() {
((MainFrame)mainFrame).setVisible(false);
((MainFrame)mainFrame).setVisible(false);
//Maybe "dispose" is not as definitive as the method exitGUI() should be
((MainFrame)mainFrame).dispose();
InputConfiguration.UpdateConfigurationWhenGameLeaves();
((MainFrame)mainFrame).dispose();
//TODO: make it terminates the program
}
......@@ -136,9 +132,9 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
*/
private void setGUIStateTo(GUIStates arg_guiState) {
PanelAbstraction guiPanelToDisplay = mapGUIStatesToGUIPanel.get(arg_guiState);
mainFrame.add(guiPanelToDisplay);
//mainFrame.revalidate();
//mainFrame.repaint();
mainFrame.add(guiPanelToDisplay);
//mainFrame.revalidate();
//mainFrame.repaint();
guiPanelToDisplay.initialise();
guiState = arg_guiState;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment