-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdbfe96
commit 39553c1
Showing
104 changed files
with
5,058 additions
and
674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="lib" path="lib/mysql-connector-java-5.1.39-bin.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
/bin/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>PTS2-G3</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Options> | ||
<thematiqueDefaut>chimieFacile</thematiqueDefaut> | ||
<resolution>1680x1050</resolution> | ||
<urlBDD></urlBDD> | ||
<user></user> | ||
<password></password> | ||
</Options> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import controller.Controller; | ||
import model.Model; | ||
import view.Window; | ||
|
||
public class Main { | ||
|
||
public static void main(String[] args) { | ||
|
||
// http://www.developpez.net/forums/d881330/java/interfaces-graphiques-java/awt-swing/fenetres-dialogues/question-cardlayout-changement-panel/ | ||
// http://thebadprogrammer.com/swing-uimanager-keys/ | ||
// http://www.duncanjauncey.com/java/ui/uimanager/UIDefaults_Java1.7.0_Linux_2.6.38-11-server_CDE_Motif.html | ||
|
||
/* | ||
* Faire des listener sur le model dans le controlleur pour quae quand | ||
* le model change la vue soit notifier et change aussi | ||
*/ | ||
|
||
// https://github.com/koppelbw/TicTacToe/tree/master/src | ||
|
||
|
||
Model model = new Model(); | ||
Window vue = new Window(); | ||
Controller controller = new Controller(model, vue); | ||
|
||
vue.setVisible(true); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package controller; | ||
|
||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
import javax.swing.JButton; | ||
import javax.swing.JTable; | ||
|
||
import model.ModelTableClassement; | ||
import model.dao.ScoreDAO; | ||
import view.AccueilPanel; | ||
import view.Panels; | ||
|
||
public class AccueilController extends Controller implements PanelControllerInterface { | ||
|
||
private Controller mC; | ||
private AccueilPanel accueilPanel; | ||
|
||
public AccueilController(Controller mC) { | ||
|
||
this.mC = mC; | ||
this.accueilPanel = mC.view.getAccueilPanel(); | ||
this.accueilPanel.addButtonListener(new ButtonListener()); | ||
|
||
} | ||
|
||
private class ButtonListener implements ActionListener{ | ||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) { | ||
JButton optionsJeuButton = accueilPanel.getOptionsJeuButton(); | ||
JButton optionsButton = accueilPanel.getOptionsButton(); | ||
JButton classementButton = accueilPanel.getClassementButton(); | ||
|
||
if (e.getSource() == optionsJeuButton) | ||
mC.panelController.changeView(Panels.OPTIONS_JEU); | ||
else if (e.getSource() == optionsButton) | ||
mC.panelController.changeView(Panels.OPTIONS); | ||
else if (e.getSource() == classementButton) | ||
mC.panelController.changeView(Panels.CLASSEMENT); | ||
|
||
} | ||
} | ||
|
||
@Override | ||
public void initPanel() { | ||
JTable scoreTable = accueilPanel.getScoreTable(); | ||
scoreTable.setModel(new ModelTableClassement(10)); | ||
|
||
System.out.println(scoreTable.getModel().getRowCount() +" test"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package controller; | ||
|
||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
|
||
import javax.swing.JButton; | ||
import javax.swing.JTable; | ||
|
||
import model.ModelTableClassement; | ||
import view.AccueilPanel; | ||
import view.ClassementPanel; | ||
import view.Panels; | ||
|
||
public class ClassementController extends Controller implements PanelControllerInterface { | ||
|
||
private Controller mC; | ||
private ClassementPanel classementPanel; | ||
|
||
public ClassementController(Controller mC) { | ||
|
||
this.mC = mC; | ||
this.classementPanel = mC.view.getClassementPanel(); | ||
this.classementPanel.addButtonListener(new ButtonListener()); | ||
|
||
} | ||
|
||
private class ButtonListener implements ActionListener{ | ||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) { | ||
|
||
JButton accueilButton = classementPanel.getAccueilButton(); | ||
|
||
if (e.getSource() == accueilButton) | ||
mC.panelController.changeView(Panels.ACCUEIL); | ||
} | ||
} | ||
|
||
@Override | ||
public void initPanel() { | ||
JTable scoreTable = classementPanel.getScoreTable(); | ||
scoreTable.setModel(new ModelTableClassement(100)); | ||
|
||
System.out.println(scoreTable.getModel().getRowCount() +" test"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package controller; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
|
||
import model.Model; | ||
import view.AccueilPanel; | ||
import view.Panels; | ||
import view.Window; | ||
|
||
public class Controller { | ||
|
||
protected Window view; | ||
protected Model model; | ||
protected HashMap<Panels, PanelControllerInterface> controllers = new HashMap<>(); | ||
protected PanelController panelController; | ||
|
||
public Controller() { | ||
|
||
} | ||
|
||
public Controller(Model gameModel, Window view) { | ||
this(); | ||
this.view = view; | ||
this.model = gameModel; | ||
|
||
controllers.put(Panels.ACCUEIL, new AccueilController(this)); | ||
controllers.put(Panels.OPTIONS_JEU, new OptionsJeuController(this)); | ||
controllers.put(Panels.OPTIONS, new OptionsController(this)); | ||
controllers.put(Panels.JEU, new JeuController(this)); | ||
controllers.put(Panels.CLASSEMENT, new ClassementController(this)); | ||
|
||
panelController = new PanelController(this); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.