Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
286a005a
Commit
286a005a
authored
Jan 06, 2016
by
Bogdan
Browse files
A graphicmaster with compiler errors for ingameprogramming- sorry for commiting the wrong file!
parent
63eb0613
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graphics/guiSkeleton/GraphicsMaster.java
View file @
286a005a
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment