Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
NicolasFau | 9aee02f16c | 6 years ago |
@ -1,23 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="lib" path="/home/nicolas/eclipse-workspace/Projet_Java/JAVA/PROJET-PMT_STRI1A/src/jdbc.jar">
|
||||
<classpathentry exported="true" kind="lib" path="/home/nicolas/Bureau/jdbc-support-1.0.23-sources.jar">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/nicolas/eclipse-workspace/Projet_Java/JAVA/PROJET-PMT_STRI1A/src/gson-2.6.2.jar">
|
||||
<classpathentry exported="true" kind="lib" path="/home/nicolas/Téléchargements/gson-2.8.5.jar">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/nicolas/eclipse-workspace/Projet_Java/JAVA/PROJET-PMT_STRI1A/src/javatuples-1.2.jar"/>
|
||||
<classpathentry kind="lib" path="/home/nicolas/Téléchargements/swt-linux-gtk-x64.jar/swt-linux-gtk-x64.jar"/>
|
||||
<classpathentry kind="lib" path="swing2swt.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
@ -1,12 +1,12 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=11
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
org.eclipse.jdt.core.compiler.source=11
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 939 KiB |
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="src" path=""/>
|
||||
<classpathentry kind="output" path=""/>
|
||||
</classpath>
|
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>src</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>
|
Binary file not shown.
@ -1,33 +0,0 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package gui;
|
||||
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.GridBagLayout;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
/**
|
||||
* @author nicolas
|
||||
*
|
||||
*/
|
||||
public class Background extends JPanel{
|
||||
private ImageIcon image;
|
||||
public Background(String path) {
|
||||
super();
|
||||
//this.setLayout(new FlowLayout());
|
||||
this.image=new ImageIcon(path);
|
||||
}
|
||||
public void setBackground(ImageIcon back) {
|
||||
this.image=back;
|
||||
}
|
||||
public void paintComponent(Graphics gr) {
|
||||
super.paintComponent(gr);
|
||||
gr.drawImage(image.getImage(),0,0,this);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package gui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.FlowLayout;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.SwingConstants;
|
||||
|
||||
/**
|
||||
* @author nicolas
|
||||
*
|
||||
*/
|
||||
public class Boutton extends JButton {
|
||||
public Boutton(String txt) {
|
||||
super(txt);
|
||||
//this.setLayout(new FlowLayout());
|
||||
setForeground(Color.WHITE);
|
||||
setOpaque(true);
|
||||
setContentAreaFilled(false);
|
||||
setBorderPainted(true);
|
||||
setFocusPainted(false);
|
||||
setHorizontalAlignment(SwingConstants.CENTER);
|
||||
setVerticalAlignment(SwingConstants.CENTER);
|
||||
|
||||
}
|
||||
}
|
@ -1,114 +0,0 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package gui;
|
||||
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
|
||||
import modeles.Labyrinthe;
|
||||
import modeles.Menu;
|
||||
import modeles.Salle;
|
||||
|
||||
/**
|
||||
* @author nicolas
|
||||
*
|
||||
*/
|
||||
public class JeuSalle extends JFrame implements KeyListener,ActionListener{
|
||||
public int nb;
|
||||
public Menu menu;
|
||||
public Labyrinthe lab = null;
|
||||
public JeuSalle() {
|
||||
setTitle("Labyrinthe");
|
||||
setSize(1200,600);
|
||||
setLocationRelativeTo(null);
|
||||
setResizable(false);
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
this.setVisible(true);
|
||||
|
||||
|
||||
}
|
||||
/*Méthode permettant d'écrire du texte dans la fenetre de jeu*/
|
||||
public JPanel ecrire(String str) {
|
||||
JPanel panel = new JPanel();
|
||||
panel.setLayout(new FlowLayout());
|
||||
JLabel label = new JLabel(str);
|
||||
panel.add(label);
|
||||
this.setFocusable(true);
|
||||
this.setContentPane(panel);
|
||||
this.addKeyListener(this);
|
||||
this.requestFocus();
|
||||
this.setVisible(true);
|
||||
return panel;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent)
|
||||
*/
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
|
||||
*/
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
|
||||
Entrer du clavier
|
||||
*/
|
||||
@Override
|
||||
public void keyTyped(KeyEvent e) {
|
||||
nb = e.getKeyChar();
|
||||
System.out.println(nb);
|
||||
|
||||
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
||||
*/
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
|
||||
}
|
||||
/*Méthode qui récupère les entrés de type int du clavier*/
|
||||
public int toucheint() {
|
||||
System.out.println("sortie"+nb);
|
||||
return nb;
|
||||
}
|
||||
/*Méthode que permet de cacher un texte affiché dans la fenetre*/
|
||||
public void cacher(JPanel panel) {
|
||||
panel.setVisible(false);
|
||||
}
|
||||
/**
|
||||
* @return the lab
|
||||
*/
|
||||
public Labyrinthe getLab() {
|
||||
return lab;
|
||||
}
|
||||
/**
|
||||
* @param lab the lab to set
|
||||
*/
|
||||
public void setLab(Labyrinthe lab) {
|
||||
this.lab = lab;
|
||||
}
|
||||
|
||||
}
|
@ -1,135 +0,0 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package gui;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
|
||||
import gui.Boutton;
|
||||
import modeles.Labyrinthe;
|
||||
import modeles.Marche;
|
||||
import modeles.Menu;
|
||||
import modeles.Objet;
|
||||
import modeles.Personnage;
|
||||
import gui.Background;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.HeadlessException;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.attribute.AclEntry.Builder;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
|
||||
/**
|
||||
* @author nicolas
|
||||
*
|
||||
*/
|
||||
public class jeu extends JFrame implements ActionListener {
|
||||
JButton continuer =new JButton("Continuer");
|
||||
JButton nouvelle = new JButton("Nouvelle Partie");
|
||||
|
||||
public JPanel panel;
|
||||
|
||||
public Menu menu;
|
||||
|
||||
public jeu() throws IOException {
|
||||
super();
|
||||
build();
|
||||
this.menu=new Menu();
|
||||
}
|
||||
|
||||
public void build() throws IOException{
|
||||
setTitle("Jeu");
|
||||
setSize(593,283);
|
||||
setLocationRelativeTo(null);
|
||||
setResizable(false);
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
//Création du JLabel pour l'image
|
||||
JLabel container = new JLabel(new ImageIcon(this.image()));
|
||||
|
||||
//Création du layout des boutons
|
||||
container.setLayout(new GridBagLayout());
|
||||
|
||||
|
||||
nouvelle.addActionListener(this);
|
||||
continuer.addActionListener(this);
|
||||
GridBagConstraints c = new GridBagConstraints();
|
||||
c.gridx = 0;
|
||||
c.gridy = 0;
|
||||
container.add(nouvelle);
|
||||
|
||||
c.gridx = 1;
|
||||
c.gridy=0;
|
||||
container.add(continuer);
|
||||
|
||||
this.setContentPane(container);
|
||||
this.setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
public BufferedImage image() throws IOException {
|
||||
BufferedImage image = ImageIO.read(new File("/home/nicolas/eclipse-workspace/Projet_Java/JAVA/PROJET-PMT_STRI1A/test.jpg"));
|
||||
return image;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
||||
Récupération des évènements des boutons Nouvelle Partie et Contnuer
|
||||
*/
|
||||
@Override
|
||||
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
Object source=arg0.getSource();
|
||||
choix(source);
|
||||
|
||||
|
||||
}
|
||||
/*Méthode de traitement des actions sur les boutons*/
|
||||
public void choix(Object source) {
|
||||
|
||||
if(source==nouvelle) {
|
||||
System.out.println("1");
|
||||
|
||||
//menu =new Menu();
|
||||
//Création du Labyrinthe
|
||||
Labyrinthe lab =new Labyrinthe();
|
||||
|
||||
//
|
||||
this.menu.getJs().setLab(lab);
|
||||
//Appel de la méthode menuSelection()
|
||||
this.menu.menuSelection(this.menu.getJs().getLab());
|
||||
}
|
||||
if(source==continuer) {
|
||||
System.out.println("2");
|
||||
//menu = new Menu();
|
||||
//recupMenu(menu);
|
||||
//lab = menu.continuer();
|
||||
//return lab;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Menu getMenu() {
|
||||
return menu;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,52 +0,0 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package gui;
|
||||
|
||||
import java.awt.Dialog;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import modeles.Labyrinthe;
|
||||
import modeles.Menu;
|
||||
|
||||
/**
|
||||
* @author nicolas
|
||||
*
|
||||
*/
|
||||
public class main {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public jeu fenetre;
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
SwingUtilities.invokeLater(new Runnable(){
|
||||
public void run(){
|
||||
//On crée une nouvelle instance de notre JDialog
|
||||
jeu fenetre = null;
|
||||
|
||||
try {
|
||||
|
||||
fenetre = new jeu();
|
||||
//Menu menu =fenetre.glob;
|
||||
/*if(fenetre.menu.getJs().getLab()!=null) {
|
||||
System.out.println("passer");
|
||||
fenetre.menu.menuSelection(fenetre.menu.getJs().getLab());
|
||||
//Menu menu =fenetre.creersalle();
|
||||
}*/
|
||||
|
||||
//fenetre.salle.ecrire(fenetre.menu.textePerso(fenetre.lab));
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
fenetre.setVisible(true);//On la rend visible
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 32 KiB |
Loading…
Reference in New Issue