aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2014-03-03 19:27:27 +0100
committerPacien TRAN-GIRARD2014-03-03 19:27:27 +0100
commit12a0686cb3fa183aa8e4829ad4cab25798bc7cf5 (patch)
treef9388e4b064d2b60a68171e1e0e57c1ffb404500
parentc5d0945eb63c0a7537ba85ba088f33639f703520 (diff)
downloadesieequest-12a0686cb3fa183aa8e4829ad4cab25798bc7cf5.tar.gz
Add web interface and clean project dir
-rw-r--r--.classpath5
-rw-r--r--.gitignore15
-rw-r--r--.project17
-rwxr-xr-xsrc/esieequest/Main.java22
-rw-r--r--src/esieequest/controller/GameEngine.java17
-rw-r--r--src/esieequest/controller/Interpreter.java6
-rw-r--r--src/esieequest/controller/Parser.java19
-rw-r--r--src/esieequest/controller/Performer.java25
-rw-r--r--src/esieequest/controller/package-info.java8
-rw-r--r--src/esieequest/esieequest.gwt.xml35
-rw-r--r--src/esieequest/model/Game.java9
-rw-r--r--src/esieequest/model/command/package-info.java8
-rw-r--r--src/esieequest/model/package-info.java8
-rw-r--r--src/esieequest/package-info.java11
-rw-r--r--src/esieequest/view/Console.java61
-rw-r--r--src/esieequest/view/View.java16
-rw-r--r--src/esieequest/view/app/Applet.java (renamed from src/esieequest/view/Applet.java)10
-rw-r--r--src/esieequest/view/app/UserInterface.java (renamed from src/esieequest/view/UserInterface.java)56
-rw-r--r--src/esieequest/view/app/Window.java (renamed from src/esieequest/view/Window.java)8
-rw-r--r--src/esieequest/view/console/Console.java59
-rw-r--r--src/esieequest/view/package-info.java8
-rw-r--r--src/esieequest/view/web/Main.java18
-rw-r--r--src/esieequest/view/web/WebInterface.java123
-rw-r--r--src/esieequest/view/web/WebInterface.ui.xml97
-rw-r--r--src/net/homelinux/nikiroo/utils/gui/JBackgroundPanel.java308
-rw-r--r--war/WEB-INF/web.xml13
-rw-r--r--war/esieequest.css53
-rw-r--r--war/esieequest.html37
28 files changed, 563 insertions, 509 deletions
diff --git a/.classpath b/.classpath
index 32d0130..8836eed 100644
--- a/.classpath
+++ b/.classpath
@@ -2,6 +2,7 @@
2<classpath> 2<classpath>
3 <classpathentry kind="src" path="src"/> 3 <classpathentry kind="src" path="src"/>
4 <classpathentry kind="src" path="res"/> 4 <classpathentry kind="src" path="res"/>
5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6 <classpathentry kind="output" path="bin"/> 6 <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
7 <classpathentry kind="output" path="war/WEB-INF/classes"/>
7</classpath> 8</classpath>
diff --git a/.gitignore b/.gitignore
index a819b04..315195b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,7 +9,7 @@ target/
9*.class 9*.class
10 10
11# Package Files # 11# Package Files #
12*.jar 12#*.jar
13*.war 13*.war
14*.ear 14*.ear
15*.db 15*.db
@@ -83,4 +83,15 @@ local.properties
83###################### 83######################
84 84
85report/out/** 85report/out/**
86report/tmp/** \ No newline at end of file 86report/tmp/**
87
88######################
89# GWT
90######################
91
92.gwt
93gwt-unitCache
94war/esieequest
95war/WEB-INF/classes
96war/WEB-INF/deploy
97war/WEB-INF/lib
diff --git a/.project b/.project
index fb4b1d7..6b191a9 100644
--- a/.project
+++ b/.project
@@ -11,13 +11,30 @@
11 </arguments> 11 </arguments>
12 </buildCommand> 12 </buildCommand>
13 <buildCommand> 13 <buildCommand>
14 <name>org.eclipse.wst.common.project.facet.core.builder</name>
15 <arguments>
16 </arguments>
17 </buildCommand>
18 <buildCommand>
14 <name>org.eclipse.jdt.core.javabuilder</name> 19 <name>org.eclipse.jdt.core.javabuilder</name>
15 <arguments> 20 <arguments>
16 </arguments> 21 </arguments>
17 </buildCommand> 22 </buildCommand>
23 <buildCommand>
24 <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
25 <arguments>
26 </arguments>
27 </buildCommand>
28 <buildCommand>
29 <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
30 <arguments>
31 </arguments>
32 </buildCommand>
18 </buildSpec> 33 </buildSpec>
19 <natures> 34 <natures>
20 <nature>net.sourceforge.texlipse.builder.TexlipseNature</nature> 35 <nature>net.sourceforge.texlipse.builder.TexlipseNature</nature>
21 <nature>org.eclipse.jdt.core.javanature</nature> 36 <nature>org.eclipse.jdt.core.javanature</nature>
37 <nature>com.google.gwt.eclipse.core.gwtNature</nature>
38 <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
22 </natures> 39 </natures>
23</projectDescription> 40</projectDescription>
diff --git a/src/esieequest/Main.java b/src/esieequest/Main.java
index add0fb1..5a08f1d 100755
--- a/src/esieequest/Main.java
+++ b/src/esieequest/Main.java
@@ -1,13 +1,15 @@
1package esieequest; 1package esieequest;
2 2
3import java.util.Arrays;
4
3import javax.swing.JApplet; 5import javax.swing.JApplet;
4 6
5import esieequest.controller.GameEngine; 7import esieequest.controller.GameEngine;
6import esieequest.model.Game; 8import esieequest.model.Game;
7import esieequest.view.Applet;
8import esieequest.view.Console;
9import esieequest.view.View; 9import esieequest.view.View;
10import esieequest.view.Window; 10import esieequest.view.app.Applet;
11import esieequest.view.app.Window;
12import esieequest.view.console.Console;
11 13
12/** 14/**
13 * This class instantiates the game and makes it possible to run it via the 15 * This class instantiates the game and makes it possible to run it via the
@@ -28,9 +30,8 @@ public class Main extends JApplet {
28 public void init() { 30 public void init() {
29 // applet 31 // applet
30 Game vGame = new Game(); 32 Game vGame = new Game();
31 Applet vApplet = new Applet(vGame, this); 33 Applet vApplet = new Applet(this);
32 vGame.addObserver(vApplet); 34 new GameEngine(vGame, vApplet);
33 GameEngine vGameEngine = new GameEngine(vGame, vApplet);
34 } 35 }
35 36
36 public static void main(final String[] pArgs) { 37 public static void main(final String[] pArgs) {
@@ -38,15 +39,14 @@ public class Main extends JApplet {
38 Game vGame = new Game(); 39 Game vGame = new Game();
39 View vView; 40 View vView;
40 41
41 if (pArgs.length != 0) { 42 if (Arrays.asList(pArgs).contains("--nogui")) {
42 vView = new Console(vGame); 43 vView = new Console();
43 44
44 } else { 45 } else {
45 vView = new Window(vGame); 46 vView = new Window();
46 } 47 }
47 48
48 vGame.addObserver(vView); 49 new GameEngine(vGame, vView);
49 GameEngine vGameEngine = new GameEngine(vGame, vView);
50 } 50 }
51 51
52} 52}
diff --git a/src/esieequest/controller/GameEngine.java b/src/esieequest/controller/GameEngine.java
index 72de63a..3999cd0 100644
--- a/src/esieequest/controller/GameEngine.java
+++ b/src/esieequest/controller/GameEngine.java
@@ -1,8 +1,5 @@
1package esieequest.controller; 1package esieequest.controller;
2 2
3import java.awt.event.ActionEvent;
4import java.awt.event.ActionListener;
5
6import esieequest.model.Game; 3import esieequest.model.Game;
7import esieequest.view.View; 4import esieequest.view.View;
8 5
@@ -15,7 +12,7 @@ import esieequest.view.View;
15 * 12 *
16 * @version February 2014 13 * @version February 2014
17 */ 14 */
18public class GameEngine implements ActionListener { 15public class GameEngine {
19 16
20 private Game aGame; 17 private Game aGame;
21 private View aView; 18 private View aView;
@@ -26,9 +23,10 @@ public class GameEngine implements ActionListener {
26 this.aGame = pGame; 23 this.aGame = pGame;
27 this.aView = pView; 24 this.aView = pView;
28 25
29 this.aInterpreter = new Interpreter(this.aGame, this.aView); 26 this.aView.setModel(pGame);
27 this.aView.setController(this);
30 28
31 this.aView.setActionListener(this); 29 this.aInterpreter = new Interpreter(this.aGame, this.aView);
32 30
33 this.startGame(); 31 this.startGame();
34 this.startView(); 32 this.startView();
@@ -40,12 +38,11 @@ public class GameEngine implements ActionListener {
40 } 38 }
41 39
42 private void startView() { 40 private void startView() {
43 this.aView.start(); 41 this.aView.enable();
44 } 42 }
45 43
46 @Override 44 public void interpret(final String pCommandString) {
47 public void actionPerformed(final ActionEvent pActionEvent) { 45 this.aInterpreter.interpret(pCommandString);