Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
3f45dc9cfa | |||
20f4e5a236 | |||
2e6e772c8b | |||
2dea86f195 | |||
0227942584 | |||
3024a370c3 | |||
efbc5f81dd |
@@ -1,9 +1,10 @@
|
|||||||
annotation.processing.enabled=true
|
annotation.processing.enabled=true
|
||||||
annotation.processing.enabled.in.editor=false
|
annotation.processing.enabled.in.editor=false
|
||||||
annotation.processing.processor.options=
|
|
||||||
annotation.processing.processors.list=
|
annotation.processing.processors.list=
|
||||||
annotation.processing.run.all.processors=true
|
annotation.processing.run.all.processors=true
|
||||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||||
|
application.title=JDR
|
||||||
|
application.vendor=emile.lalorcey
|
||||||
build.classes.dir=${build.dir}/classes
|
build.classes.dir=${build.dir}/classes
|
||||||
build.classes.excludes=**/*.java,**/*.form
|
build.classes.excludes=**/*.java,**/*.form
|
||||||
# This directory is removed when the project is cleaned:
|
# This directory is removed when the project is cleaned:
|
||||||
@@ -32,12 +33,14 @@ dist.jar=${dist.dir}/JDR.jar
|
|||||||
dist.javadoc.dir=${dist.dir}/javadoc
|
dist.javadoc.dir=${dist.dir}/javadoc
|
||||||
dist.jlink.dir=${dist.dir}/jlink
|
dist.jlink.dir=${dist.dir}/jlink
|
||||||
dist.jlink.output=${dist.jlink.dir}/JDR
|
dist.jlink.output=${dist.jlink.dir}/JDR
|
||||||
|
endorsed.classpath=
|
||||||
excludes=
|
excludes=
|
||||||
includes=**
|
includes=**
|
||||||
jar.compress=false
|
jar.compress=false
|
||||||
javac.classpath=
|
javac.classpath=\
|
||||||
|
${libs.absolutelayout.classpath}
|
||||||
# Space-separated list of extra javac options
|
# Space-separated list of extra javac options
|
||||||
javac.compilerargs=\ --enable-preview
|
javac.compilerargs=
|
||||||
javac.deprecation=false
|
javac.deprecation=false
|
||||||
javac.external.vm=true
|
javac.external.vm=true
|
||||||
javac.modulepath=
|
javac.modulepath=
|
||||||
@@ -71,7 +74,7 @@ jlink.additionalmodules=
|
|||||||
jlink.additionalparam=
|
jlink.additionalparam=
|
||||||
jlink.launcher=true
|
jlink.launcher=true
|
||||||
jlink.launcher.name=JDR
|
jlink.launcher.name=JDR
|
||||||
main.class=presentation.JFPlateau
|
main.class=Presentation.Plateau_de_jeu
|
||||||
manifest.file=manifest.mf
|
manifest.file=manifest.mf
|
||||||
meta.inf.dir=${src.dir}/META-INF
|
meta.inf.dir=${src.dir}/META-INF
|
||||||
mkdist.disabled=false
|
mkdist.disabled=false
|
||||||
@@ -82,7 +85,7 @@ run.classpath=\
|
|||||||
# Space-separated list of JVM arguments used when running the project.
|
# Space-separated list of JVM arguments used when running the project.
|
||||||
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||||
# To set system properties for unit tests define test-sys-prop.name=value:
|
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||||
run.jvmargs=\ --enable-preview
|
run.jvmargs=
|
||||||
run.modulepath=\
|
run.modulepath=\
|
||||||
${javac.modulepath}
|
${javac.modulepath}
|
||||||
run.test.classpath=\
|
run.test.classpath=\
|
||||||
|
297
JDR/src/Presentation/Ajout_Perso.form
Normal file
297
JDR/src/Presentation/Ajout_Perso.form
Normal file
@@ -0,0 +1,297 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
|
||||||
|
<SubComponents>
|
||||||
|
<Menu class="javax.swing.JMenu" name="jMenuJeu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Jeu"/>
|
||||||
|
</Properties>
|
||||||
|
<SubComponents>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMInewGame">
|
||||||
|
<Properties>
|
||||||
|
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||||
|
<KeyStroke key="Ctrl+N"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="New Game"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMInewGameActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMInewPlayer">
|
||||||
|
<Properties>
|
||||||
|
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||||
|
<KeyStroke key="ADD"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="New Player"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMInewPlayerActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMIopenGame">
|
||||||
|
<Properties>
|
||||||
|
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||||
|
<KeyStroke key="Ctrl+O"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Open Game"/>
|
||||||
|
</Properties>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMIsave">
|
||||||
|
<Properties>
|
||||||
|
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||||
|
<KeyStroke key="Ctrl+S"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Save"/>
|
||||||
|
</Properties>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMIquit">
|
||||||
|
<Properties>
|
||||||
|
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||||
|
<KeyStroke key="Ctrl+Q"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Exit"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIquitActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="jMenu2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Edit"/>
|
||||||
|
</Properties>
|
||||||
|
</Menu>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="66" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" pref="40" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="17" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jTFnomPerso" alignment="0" min="-2" pref="86" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jCBoximagePerso" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jCBoxChoixType" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="57" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jSptsEnergie" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jSptsVie" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jTFarme" alignment="0" min="-2" pref="113" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="100" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLnewPlayer" min="-2" pref="114" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="93" max="-2" attributes="0"/>
|
||||||
|
<Component id="jBcreer" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace pref="47" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLnewPlayer" min="-2" pref="16" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jCBoxChoixType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jTFarme" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="23" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jTFnomPerso" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jSptsVie" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jCBoximagePerso" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jSptsEnergie" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="jBcreer" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="25" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLnewPlayer">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="New Player"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JComboBox" name="jCBoxChoixType">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||||
|
<StringArray count="4">
|
||||||
|
<StringItem index="0" value="Item 1"/>
|
||||||
|
<StringItem index="1" value="Item 2"/>
|
||||||
|
<StringItem index="2" value="Item 3"/>
|
||||||
|
<StringItem index="3" value="Item 4"/>
|
||||||
|
</StringArray>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCBoxChoixTypeActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="jTFnomPerso">
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTFnomPersoActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Type"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Nom"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JComboBox" name="jCBoximagePerso">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||||
|
<StringArray count="4">
|
||||||
|
<StringItem index="0" value="Item 1"/>
|
||||||
|
<StringItem index="1" value="Item 2"/>
|
||||||
|
<StringItem index="2" value="Item 3"/>
|
||||||
|
<StringItem index="3" value="Item 4"/>
|
||||||
|
</StringArray>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Image"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JSpinner" name="jSptsVie">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="poits de vie"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="componentAdded" listener="java.awt.event.ContainerListener" parameters="java.awt.event.ContainerEvent" handler="jLabel4ComponentAdded"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JSpinner" name="jSptsEnergie">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="poits d'énergie"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Arme"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="jTFarme">
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTFarmeActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="jBcreer">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="create"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBcreerActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
382
JDR/src/Presentation/Ajout_Perso.java
Normal file
382
JDR/src/Presentation/Ajout_Perso.java
Normal file
@@ -0,0 +1,382 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||||
|
*/
|
||||||
|
package Presentation;
|
||||||
|
|
||||||
|
import java.util.Vector;
|
||||||
|
import javax.swing.DefaultComboBoxModel;
|
||||||
|
import metier.Guerrier;
|
||||||
|
import metier.Jeu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author emile.lalorcey
|
||||||
|
*/
|
||||||
|
public class Ajout_Perso extends javax.swing.JFrame {
|
||||||
|
Jeu leJeu;
|
||||||
|
/**
|
||||||
|
* Creates new form Ajout_Perso
|
||||||
|
*/
|
||||||
|
public Ajout_Perso(Jeu jeu) {
|
||||||
|
initComponents();
|
||||||
|
jCBoxChoixType.setModel(new DefaultComboBoxModel(typePerso ()));
|
||||||
|
jCBoximagePerso.setModel(new DefaultComboBoxModel(imagePerso()));
|
||||||
|
leJeu = jeu;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called from within the constructor to initialize the form.
|
||||||
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
|
* regenerated by the Form Editor.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
jPanel1 = new javax.swing.JPanel();
|
||||||
|
jLnewPlayer = new javax.swing.JLabel();
|
||||||
|
jCBoxChoixType = new javax.swing.JComboBox<>();
|
||||||
|
jTFnomPerso = new javax.swing.JTextField();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
jLabel2 = new javax.swing.JLabel();
|
||||||
|
jCBoximagePerso = new javax.swing.JComboBox<>();
|
||||||
|
jLabel3 = new javax.swing.JLabel();
|
||||||
|
jSptsVie = new javax.swing.JSpinner();
|
||||||
|
jLabel4 = new javax.swing.JLabel();
|
||||||
|
jSptsEnergie = new javax.swing.JSpinner();
|
||||||
|
jLabel5 = new javax.swing.JLabel();
|
||||||
|
jLabel6 = new javax.swing.JLabel();
|
||||||
|
jTFarme = new javax.swing.JTextField();
|
||||||
|
jBcreer = new javax.swing.JButton();
|
||||||
|
jMenuBar1 = new javax.swing.JMenuBar();
|
||||||
|
jMenuJeu = new javax.swing.JMenu();
|
||||||
|
jMInewGame = new javax.swing.JMenuItem();
|
||||||
|
jMInewPlayer = new javax.swing.JMenuItem();
|
||||||
|
jMIopenGame = new javax.swing.JMenuItem();
|
||||||
|
jMIsave = new javax.swing.JMenuItem();
|
||||||
|
jMIquit = new javax.swing.JMenuItem();
|
||||||
|
jMenu2 = new javax.swing.JMenu();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
|
jPanel1.setBackground(new java.awt.Color(102, 0, 0));
|
||||||
|
|
||||||
|
jLnewPlayer.setText("New Player");
|
||||||
|
|
||||||
|
jCBoxChoixType.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||||
|
jCBoxChoixType.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jCBoxChoixTypeActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jTFnomPerso.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jTFnomPersoActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jLabel1.setText("Type");
|
||||||
|
|
||||||
|
jLabel2.setText("Nom");
|
||||||
|
|
||||||
|
jCBoximagePerso.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||||
|
|
||||||
|
jLabel3.setText("Image");
|
||||||
|
|
||||||
|
jLabel4.setText("poits de vie");
|
||||||
|
jLabel4.addContainerListener(new java.awt.event.ContainerAdapter() {
|
||||||
|
public void componentAdded(java.awt.event.ContainerEvent evt) {
|
||||||
|
jLabel4ComponentAdded(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jLabel5.setText("poits d'<27>nergie");
|
||||||
|
|
||||||
|
jLabel6.setText("Arme");
|
||||||
|
|
||||||
|
jTFarme.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jTFarmeActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jBcreer.setText("create");
|
||||||
|
jBcreer.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jBcreerActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||||
|
jPanel1.setLayout(jPanel1Layout);
|
||||||
|
jPanel1Layout.setHorizontalGroup(
|
||||||
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addGap(36, 36, 36)
|
||||||
|
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addGap(17, 17, 17)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jTFnomPerso, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addGap(20, 20, 20)
|
||||||
|
.addComponent(jLabel2))
|
||||||
|
.addComponent(jCBoximagePerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jCBoxChoixType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGap(57, 57, 57)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jSptsEnergie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jLabel4)
|
||||||
|
.addComponent(jLabel5)
|
||||||
|
.addComponent(jSptsVie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jLabel6)
|
||||||
|
.addComponent(jTFarme, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addGap(37, 37, 37)
|
||||||
|
.addComponent(jLabel3))
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addGap(100, 100, 100)
|
||||||
|
.addComponent(jLnewPlayer, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addGap(93, 93, 93)
|
||||||
|
.addComponent(jBcreer)))
|
||||||
|
.addContainerGap(47, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
jPanel1Layout.setVerticalGroup(
|
||||||
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addGap(25, 25, 25)
|
||||||
|
.addComponent(jLnewPlayer, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addComponent(jLabel6))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jCBoxChoixType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jTFarme, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGap(23, 23, 23)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jLabel2)
|
||||||
|
.addComponent(jLabel4))
|
||||||
|
.addGap(12, 12, 12)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jTFnomPerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jSptsVie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jLabel3)
|
||||||
|
.addComponent(jLabel5))
|
||||||
|
.addGap(5, 5, 5)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jCBoximagePerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jSptsEnergie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(jBcreer)
|
||||||
|
.addContainerGap(25, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
|
||||||
|
jMenuJeu.setText("Jeu");
|
||||||
|
|
||||||
|
jMInewGame.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||||
|
jMInewGame.setText("New Game");
|
||||||
|
jMInewGame.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jMInewGameActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenuJeu.add(jMInewGame);
|
||||||
|
|
||||||
|
jMInewPlayer.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ADD, 0));
|
||||||
|
jMInewPlayer.setText("New Player");
|
||||||
|
jMInewPlayer.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jMInewPlayerActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenuJeu.add(jMInewPlayer);
|
||||||
|
|
||||||
|
jMIopenGame.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||||
|
jMIopenGame.setText("Open Game");
|
||||||
|
jMenuJeu.add(jMIopenGame);
|
||||||
|
|
||||||
|
jMIsave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||||
|
jMIsave.setText("Save");
|
||||||
|
jMenuJeu.add(jMIsave);
|
||||||
|
|
||||||
|
jMIquit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||||
|
jMIquit.setText("Exit");
|
||||||
|
jMIquit.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jMIquitActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenuJeu.add(jMIquit);
|
||||||
|
|
||||||
|
jMenuBar1.add(jMenuJeu);
|
||||||
|
|
||||||
|
jMenu2.setText("Edit");
|
||||||
|
jMenuBar1.add(jMenu2);
|
||||||
|
|
||||||
|
setJMenuBar(jMenuBar1);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
|
getContentPane().setLayout(layout);
|
||||||
|
layout.setHorizontalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void jMInewGameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMInewGameActionPerformed
|
||||||
|
Plateau_de_jeu bidul = new Plateau_de_jeu();
|
||||||
|
}//GEN-LAST:event_jMInewGameActionPerformed
|
||||||
|
|
||||||
|
private void jMInewPlayerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMInewPlayerActionPerformed
|
||||||
|
// TODO add your handling code here:
|
||||||
|
}//GEN-LAST:event_jMInewPlayerActionPerformed
|
||||||
|
|
||||||
|
private void jMIquitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIquitActionPerformed
|
||||||
|
System.exit(0);
|
||||||
|
}//GEN-LAST:event_jMIquitActionPerformed
|
||||||
|
|
||||||
|
private void jCBoxChoixTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBoxChoixTypeActionPerformed
|
||||||
|
|
||||||
|
}//GEN-LAST:event_jCBoxChoixTypeActionPerformed
|
||||||
|
|
||||||
|
private void jTFnomPersoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTFnomPersoActionPerformed
|
||||||
|
// TODO add your handling code here:
|
||||||
|
}//GEN-LAST:event_jTFnomPersoActionPerformed
|
||||||
|
|
||||||
|
private void jLabel4ComponentAdded(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_jLabel4ComponentAdded
|
||||||
|
// TODO add your handling code here:
|
||||||
|
}//GEN-LAST:event_jLabel4ComponentAdded
|
||||||
|
|
||||||
|
private void jTFarmeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTFarmeActionPerformed
|
||||||
|
// TODO add your handling code here:
|
||||||
|
}//GEN-LAST:event_jTFarmeActionPerformed
|
||||||
|
|
||||||
|
private void jBcreerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBcreerActionPerformed
|
||||||
|
|
||||||
|
switch(jCBoxChoixType.getSelectedItem().toString()){
|
||||||
|
case "Guerrier":
|
||||||
|
leJeu.getmesPersonnages().add(new Guerrier(jTFnomPerso.getText(),
|
||||||
|
("/img/"+jCBoximagePerso.toString()),
|
||||||
|
(Integer) jSptsEnergie.getValue(),
|
||||||
|
(Integer) jSptsVie.getValue(),
|
||||||
|
jTFarme.getText()));
|
||||||
|
break;
|
||||||
|
case "Sorcier":
|
||||||
|
leJeu.getmesPersonnages().add(new Guerrier(jTFnomPerso.getText(),
|
||||||
|
("/img/"+jCBoximagePerso.toString()),
|
||||||
|
(Integer) jSptsEnergie.getValue(),
|
||||||
|
(Integer) jSptsVie.getValue(),
|
||||||
|
jTFarme.getText()));
|
||||||
|
break;
|
||||||
|
case "Voleur":
|
||||||
|
leJeu.getmesPersonnages().add(new Guerrier(jTFnomPerso.getText(),
|
||||||
|
("/img/"+jCBoximagePerso.toString()),
|
||||||
|
(Integer) jSptsEnergie.getValue(),
|
||||||
|
(Integer) jSptsVie.getValue(),
|
||||||
|
jTFarme.getText()));
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
System.out.println(leJeu);
|
||||||
|
}//GEN-LAST:event_jBcreerActionPerformed
|
||||||
|
|
||||||
|
|
||||||
|
//---------Initialisation Combo Box
|
||||||
|
private Vector<String> typePerso (){
|
||||||
|
Vector<String> type = new Vector<>();
|
||||||
|
type.add("Guerrier");
|
||||||
|
type.add("Sorcier");
|
||||||
|
type.add("Voleur");
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Vector<String> imagePerso(){
|
||||||
|
Vector<String> image = new Vector<>();
|
||||||
|
image.add("Barbare04.jpg");
|
||||||
|
image.add("Guerrier05.jpg");
|
||||||
|
image.add("Guerrier08.jpg");
|
||||||
|
image.add("Guerrier10.jpg");
|
||||||
|
image.add("Guerrier12.jpg");
|
||||||
|
image.add("Simone.jpg");
|
||||||
|
image.add("Sorcier02.jpg");
|
||||||
|
image.add("Sorciere1.jpg");
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param args the command line arguments
|
||||||
|
*/
|
||||||
|
public static void main(String args[]) {
|
||||||
|
/* Set the Nimbus look and feel */
|
||||||
|
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
|
||||||
|
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
|
||||||
|
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
|
||||||
|
if ("Nimbus".equals(info.getName())) {
|
||||||
|
javax.swing.UIManager.setLookAndFeel(info.getClassName());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
java.util.logging.Logger.getLogger(Ajout_Perso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
|
} catch (InstantiationException ex) {
|
||||||
|
java.util.logging.Logger.getLogger(Ajout_Perso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
|
} catch (IllegalAccessException ex) {
|
||||||
|
java.util.logging.Logger.getLogger(Ajout_Perso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
|
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||||
|
java.util.logging.Logger.getLogger(Ajout_Perso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
|
/* Create and display the form */
|
||||||
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
Jeu leJeu = new Jeu();
|
||||||
|
new Ajout_Perso(leJeu).setVisible(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JButton jBcreer;
|
||||||
|
private javax.swing.JComboBox<String> jCBoxChoixType;
|
||||||
|
private javax.swing.JComboBox<String> jCBoximagePerso;
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JLabel jLabel2;
|
||||||
|
private javax.swing.JLabel jLabel3;
|
||||||
|
private javax.swing.JLabel jLabel4;
|
||||||
|
private javax.swing.JLabel jLabel5;
|
||||||
|
private javax.swing.JLabel jLabel6;
|
||||||
|
private javax.swing.JLabel jLnewPlayer;
|
||||||
|
private javax.swing.JMenuItem jMInewGame;
|
||||||
|
private javax.swing.JMenuItem jMInewPlayer;
|
||||||
|
private javax.swing.JMenuItem jMIopenGame;
|
||||||
|
private javax.swing.JMenuItem jMIquit;
|
||||||
|
private javax.swing.JMenuItem jMIsave;
|
||||||
|
private javax.swing.JMenu jMenu2;
|
||||||
|
private javax.swing.JMenuBar jMenuBar1;
|
||||||
|
private javax.swing.JMenu jMenuJeu;
|
||||||
|
private javax.swing.JPanel jPanel1;
|
||||||
|
private javax.swing.JSpinner jSptsEnergie;
|
||||||
|
private javax.swing.JSpinner jSptsVie;
|
||||||
|
private javax.swing.JTextField jTFarme;
|
||||||
|
private javax.swing.JTextField jTFnomPerso;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
546
JDR/src/Presentation/Plateau_de_jeu.form
Normal file
546
JDR/src/Presentation/Plateau_de_jeu.form
Normal file
@@ -0,0 +1,546 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
|
||||||
|
<SubComponents>
|
||||||
|
<Menu class="javax.swing.JMenu" name="jMenuJeu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Jeu"/>
|
||||||
|
</Properties>
|
||||||
|
<SubComponents>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMInewGame">
|
||||||
|
<Properties>
|
||||||
|
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||||
|
<KeyStroke key="Ctrl+N"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="New Game"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMInewGameActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMInewPlayer">
|
||||||
|
<Properties>
|
||||||
|
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||||
|
<KeyStroke key="ADD"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="New Player"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMInewPlayerActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMIopenGame">
|
||||||
|
<Properties>
|
||||||
|
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||||
|
<KeyStroke key="Ctrl+O"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Open Game"/>
|
||||||
|
</Properties>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMIsave">
|
||||||
|
<Properties>
|
||||||
|
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||||
|
<KeyStroke key="Ctrl+S"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Save"/>
|
||||||
|
</Properties>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMIquit">
|
||||||
|
<Properties>
|
||||||
|
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||||
|
<KeyStroke key="Ctrl+Q"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Exit"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIquitActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="jMenu2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="??"/>
|
||||||
|
</Properties>
|
||||||
|
<SubComponents>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMIaide">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Aide"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIaideActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMIobjectif">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Objectif"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIobjectifActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMIapropos">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="A propos"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMIaproposActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jPJeu" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="JPFondListePerso" min="-2" pref="226" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="JPFondListePerso" min="-2" pref="484" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jPJeu" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="JPFondListePerso">
|
||||||
|
<Properties>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="66" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||||
|
<Property name="useNullLayout" type="boolean" value="false"/>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLImageListePerso">
|
||||||
|
<Properties>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/img/adj_1.jpg"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="20" y="0" width="190" height="100"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="10" y="110" width="210" height="350"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextArea" name="jTextArea1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="66" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="columns" type="int" value="20"/>
|
||||||
|
<Property name="rows" type="int" value="5"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPJeu">
|
||||||
|
<Properties>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="236" max="-2" attributes="0"/>
|
||||||
|
<Component id="jBGo" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="172" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLChoixPerso" min="-2" pref="239" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="15" max="32767" attributes="0"/>
|
||||||
|
<Component id="jPChoixPerso" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
<Component id="jLChoixPerso" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="jPChoixPerso" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jBGo" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLChoixPerso">
|
||||||
|
<Properties>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/img/famille_1.jpg"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPChoixPerso">
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
<Component id="jPCHoixPersoFond" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLChoixPersoText" min="-2" pref="250" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLChoixPersoText" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="jPCHoixPersoFond" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLChoixPersoText">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Wide Latin" size="12" style="2"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Choix Des personnages"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPCHoixPersoFond">
|
||||||
|
<Properties>
|
||||||
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||||
|
<LineBorder/>
|
||||||
|
</Border>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="101" max="-2" attributes="0"/>
|
||||||
|
<Component id="jCBoxAttaquant" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
<Component id="jCBoxDefenseur" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="107" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||||
|
<Component id="jPAttaquant" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="57" max="32767" attributes="0"/>
|
||||||
|
<Component id="jPDefenseur" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jCBoxAttaquant" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jCBoxDefenseur" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jPAttaquant" max="32767" attributes="0"/>
|
||||||
|
<Component id="jPDefenseur" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JComboBox" name="jCBoxAttaquant">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||||
|
<StringArray count="4">
|
||||||
|
<StringItem index="0" value="Item 1"/>
|
||||||
|
<StringItem index="1" value="Item 2"/>
|
||||||
|
<StringItem index="2" value="Item 3"/>
|
||||||
|
<StringItem index="3" value="Item 4"/>
|
||||||
|
</StringArray>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="inputMethodTextChanged" listener="java.awt.event.InputMethodListener" parameters="java.awt.event.InputMethodEvent" handler="jCBoxAttaquantInputMethodTextChanged"/>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCBoxAttaquantActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JComboBox" name="jCBoxDefenseur">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||||
|
<StringArray count="4">
|
||||||
|
<StringItem index="0" value="Item 1"/>
|
||||||
|
<StringItem index="1" value="Item 2"/>
|
||||||
|
<StringItem index="2" value="Item 3"/>
|
||||||
|
<StringItem index="3" value="Item 4"/>
|
||||||
|
</StringArray>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCBoxDefenseurActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPAttaquant">
|
||||||
|
<Properties>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="66" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane3" pref="0" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace pref="68" max="32767" attributes="0"/>
|
||||||
|
<Component id="jLImageAttaquant" min="-2" pref="99" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="59" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane3" min="-2" pref="92" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLImageAttaquant" min="-2" pref="63" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="15" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLImageAttaquant">
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
||||||
|
<Property name="verticalScrollBarPolicy" type="int" value="21"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextArea" name="jTAAttaquantCaracteristiques">
|
||||||
|
<Properties>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="66" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="columns" type="int" value="20"/>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Showcard Gothic" size="12" style="2"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="rows" type="int" value="5"/>
|
||||||
|
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||||
|
<Color id="Text Cursor"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPDefenseur">
|
||||||
|
<Properties>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="66" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane4" pref="0" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace pref="64" max="32767" attributes="0"/>
|
||||||
|
<Component id="jLImageDefenseur" min="-2" pref="98" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="64" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane4" min="-2" pref="92" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLImageDefenseur" min="-2" pref="53" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLImageDefenseur">
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
||||||
|
<Property name="verticalScrollBarPolicy" type="int" value="21"/>
|
||||||
|
</Properties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextArea" name="jTADefenseurCaracteristiques">
|
||||||
|
<Properties>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="66" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="columns" type="int" value="20"/>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Showcard Gothic" size="12" style="2"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="rows" type="int" value="5"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="jBGo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Go"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBGoActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
562
JDR/src/Presentation/Plateau_de_jeu.java
Normal file
562
JDR/src/Presentation/Plateau_de_jeu.java
Normal file
@@ -0,0 +1,562 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||||
|
*/
|
||||||
|
package Presentation;
|
||||||
|
|
||||||
|
import javax.swing.DefaultComboBoxModel;
|
||||||
|
import javax.swing.Icon;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import metier.Jeu;
|
||||||
|
import metier.Personnage;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author emile.lalorcey
|
||||||
|
*/
|
||||||
|
public class Plateau_de_jeu extends javax.swing.JFrame {
|
||||||
|
/**
|
||||||
|
* Creates new form Plateau_de_jeu
|
||||||
|
*/
|
||||||
|
Jeu leJeu = new Jeu();
|
||||||
|
public Plateau_de_jeu() {
|
||||||
|
initComponents();
|
||||||
|
jCBoxAttaquant.setModel( new DefaultComboBoxModel(leJeu.getLesPersonnagesVivants()));
|
||||||
|
jCBoxDefenseur.setModel( new DefaultComboBoxModel(leJeu.getLesPersonnagesVivants()));
|
||||||
|
majStatistiquesPersos();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called from within the constructor to initialize the form.
|
||||||
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
|
* regenerated by the Form Editor.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
jPanel1 = new javax.swing.JPanel();
|
||||||
|
JPFondListePerso = new javax.swing.JPanel();
|
||||||
|
jLImageListePerso = new javax.swing.JLabel();
|
||||||
|
jScrollPane2 = new javax.swing.JScrollPane();
|
||||||
|
jTextArea1 = new javax.swing.JTextArea();
|
||||||
|
jPJeu = new javax.swing.JPanel();
|
||||||
|
jLChoixPerso = new javax.swing.JLabel();
|
||||||
|
jPChoixPerso = new javax.swing.JPanel();
|
||||||
|
jLChoixPersoText = new javax.swing.JLabel();
|
||||||
|
jPCHoixPersoFond = new javax.swing.JPanel();
|
||||||
|
jCBoxAttaquant = new javax.swing.JComboBox<>();
|
||||||
|
jCBoxDefenseur = new javax.swing.JComboBox<>();
|
||||||
|
jPAttaquant = new javax.swing.JPanel();
|
||||||
|
jLImageAttaquant = new javax.swing.JLabel();
|
||||||
|
jScrollPane3 = new javax.swing.JScrollPane();
|
||||||
|
jTAAttaquantCaracteristiques = new javax.swing.JTextArea();
|
||||||
|
jPDefenseur = new javax.swing.JPanel();
|
||||||
|
jLImageDefenseur = new javax.swing.JLabel();
|
||||||
|
jScrollPane4 = new javax.swing.JScrollPane();
|
||||||
|
jTADefenseurCaracteristiques = new javax.swing.JTextArea();
|
||||||
|
jBGo = new javax.swing.JButton();
|
||||||
|
jMenuBar1 = new javax.swing.JMenuBar();
|
||||||
|
jMenuJeu = new javax.swing.JMenu();
|
||||||
|
jMInewGame = new javax.swing.JMenuItem();
|
||||||
|
jMInewPlayer = new javax.swing.JMenuItem();
|
||||||
|
jMIopenGame = new javax.swing.JMenuItem();
|
||||||
|
jMIsave = new javax.swing.JMenuItem();
|
||||||
|
jMIquit = new javax.swing.JMenuItem();
|
||||||
|
jMenu2 = new javax.swing.JMenu();
|
||||||
|
jMIaide = new javax.swing.JMenuItem();
|
||||||
|
jMIobjectif = new javax.swing.JMenuItem();
|
||||||
|
jMIapropos = new javax.swing.JMenuItem();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
|
JPFondListePerso.setBackground(new java.awt.Color(102, 0, 0));
|
||||||
|
JPFondListePerso.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
|
||||||
|
|
||||||
|
jLImageListePerso.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/adj_1.jpg"))); // NOI18N
|
||||||
|
JPFondListePerso.add(jLImageListePerso, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 0, 190, 100));
|
||||||
|
|
||||||
|
jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
jTextArea1.setBackground(new java.awt.Color(102, 0, 0));
|
||||||
|
jTextArea1.setColumns(20);
|
||||||
|
jTextArea1.setRows(5);
|
||||||
|
jScrollPane2.setViewportView(jTextArea1);
|
||||||
|
|
||||||
|
JPFondListePerso.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, 210, 350));
|
||||||
|
|
||||||
|
jPJeu.setBackground(new java.awt.Color(255, 255, 255));
|
||||||
|
|
||||||
|
jLChoixPerso.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/famille_1.jpg"))); // NOI18N
|
||||||
|
|
||||||
|
jLChoixPersoText.setFont(new java.awt.Font("Wide Latin", 2, 12)); // NOI18N
|
||||||
|
jLChoixPersoText.setText("Choix Des personnages");
|
||||||
|
|
||||||
|
jPCHoixPersoFond.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||||
|
|
||||||
|
jCBoxAttaquant.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||||
|
jCBoxAttaquant.addInputMethodListener(new java.awt.event.InputMethodListener() {
|
||||||
|
public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {
|
||||||
|
}
|
||||||
|
public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
|
||||||
|
jCBoxAttaquantInputMethodTextChanged(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jCBoxAttaquant.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jCBoxAttaquantActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jCBoxDefenseur.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||||
|
jCBoxDefenseur.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jCBoxDefenseurActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jPAttaquant.setBackground(new java.awt.Color(102, 0, 0));
|
||||||
|
|
||||||
|
jScrollPane3.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
jScrollPane3.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
jTAAttaquantCaracteristiques.setBackground(new java.awt.Color(102, 0, 0));
|
||||||
|
jTAAttaquantCaracteristiques.setColumns(20);
|
||||||
|
jTAAttaquantCaracteristiques.setFont(new java.awt.Font("Showcard Gothic", 2, 12)); // NOI18N
|
||||||
|
jTAAttaquantCaracteristiques.setRows(5);
|
||||||
|
jTAAttaquantCaracteristiques.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
|
||||||
|
jScrollPane3.setViewportView(jTAAttaquantCaracteristiques);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout jPAttaquantLayout = new javax.swing.GroupLayout(jPAttaquant);
|
||||||
|
jPAttaquant.setLayout(jPAttaquantLayout);
|
||||||
|
jPAttaquantLayout.setHorizontalGroup(
|
||||||
|
jPAttaquantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPAttaquantLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
|
||||||
|
.addContainerGap())
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPAttaquantLayout.createSequentialGroup()
|
||||||
|
.addContainerGap(68, Short.MAX_VALUE)
|
||||||
|
.addComponent(jLImageAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(59, 59, 59))
|
||||||
|
);
|
||||||
|
jPAttaquantLayout.setVerticalGroup(
|
||||||
|
jPAttaquantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPAttaquantLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(jLImageAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addContainerGap(15, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
|
||||||
|
jPDefenseur.setBackground(new java.awt.Color(102, 0, 0));
|
||||||
|
|
||||||
|
jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
||||||
|
|
||||||
|
jTADefenseurCaracteristiques.setBackground(new java.awt.Color(102, 0, 0));
|
||||||
|
jTADefenseurCaracteristiques.setColumns(20);
|
||||||
|
jTADefenseurCaracteristiques.setFont(new java.awt.Font("Showcard Gothic", 2, 12)); // NOI18N
|
||||||
|
jTADefenseurCaracteristiques.setRows(5);
|
||||||
|
jScrollPane4.setViewportView(jTADefenseurCaracteristiques);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout jPDefenseurLayout = new javax.swing.GroupLayout(jPDefenseur);
|
||||||
|
jPDefenseur.setLayout(jPDefenseurLayout);
|
||||||
|
jPDefenseurLayout.setHorizontalGroup(
|
||||||
|
jPDefenseurLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPDefenseurLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
|
||||||
|
.addContainerGap())
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPDefenseurLayout.createSequentialGroup()
|
||||||
|
.addContainerGap(64, Short.MAX_VALUE)
|
||||||
|
.addComponent(jLImageDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(64, 64, 64))
|
||||||
|
);
|
||||||
|
jPDefenseurLayout.setVerticalGroup(
|
||||||
|
jPDefenseurLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPDefenseurLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(jLImageDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout jPCHoixPersoFondLayout = new javax.swing.GroupLayout(jPCHoixPersoFond);
|
||||||
|
jPCHoixPersoFond.setLayout(jPCHoixPersoFondLayout);
|
||||||
|
jPCHoixPersoFondLayout.setHorizontalGroup(
|
||||||
|
jPCHoixPersoFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPCHoixPersoFondLayout.createSequentialGroup()
|
||||||
|
.addGap(101, 101, 101)
|
||||||
|
.addComponent(jCBoxAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(jCBoxDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(107, 107, 107))
|
||||||
|
.addGroup(jPCHoixPersoFondLayout.createSequentialGroup()
|
||||||
|
.addGap(27, 27, 27)
|
||||||
|
.addComponent(jPAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 57, Short.MAX_VALUE)
|
||||||
|
.addComponent(jPDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(26, 26, 26))
|
||||||
|
);
|
||||||
|
jPCHoixPersoFondLayout.setVerticalGroup(
|
||||||
|
jPCHoixPersoFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPCHoixPersoFondLayout.createSequentialGroup()
|
||||||
|
.addGap(15, 15, 15)
|
||||||
|
.addGroup(jPCHoixPersoFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jCBoxAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jCBoxDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(jPCHoixPersoFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jPAttaquant, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(jPDefenseur, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout jPChoixPersoLayout = new javax.swing.GroupLayout(jPChoixPerso);
|
||||||
|
jPChoixPerso.setLayout(jPChoixPersoLayout);
|
||||||
|
jPChoixPersoLayout.setHorizontalGroup(
|
||||||
|
jPChoixPersoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPChoixPersoLayout.createSequentialGroup()
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(jPCHoixPersoFond, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addContainerGap())
|
||||||
|
.addGroup(jPChoixPersoLayout.createSequentialGroup()
|
||||||
|
.addGap(26, 26, 26)
|
||||||
|
.addComponent(jLChoixPersoText, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
jPChoixPersoLayout.setVerticalGroup(
|
||||||
|
jPChoixPersoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPChoixPersoLayout.createSequentialGroup()
|
||||||
|
.addGap(22, 22, 22)
|
||||||
|
.addComponent(jLChoixPersoText)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(jPCHoixPersoFond, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
|
||||||
|
jBGo.setText("Go");
|
||||||
|
jBGo.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jBGoActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
javax.swing.GroupLayout jPJeuLayout = new javax.swing.GroupLayout(jPJeu);
|
||||||
|
jPJeu.setLayout(jPJeuLayout);
|
||||||
|
jPJeuLayout.setHorizontalGroup(
|
||||||
|
jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPJeuLayout.createSequentialGroup()
|
||||||
|
.addGroup(jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPJeuLayout.createSequentialGroup()
|
||||||
|
.addGroup(jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPJeuLayout.createSequentialGroup()
|
||||||
|
.addGap(236, 236, 236)
|
||||||
|
.addComponent(jBGo))
|
||||||
|
.addGroup(jPJeuLayout.createSequentialGroup()
|
||||||
|
.addGap(172, 172, 172)
|
||||||
|
.addComponent(jLChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||||
|
.addGap(0, 0, Short.MAX_VALUE))
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPJeuLayout.createSequentialGroup()
|
||||||
|
.addGap(0, 15, Short.MAX_VALUE)
|
||||||
|
.addComponent(jPChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
jPJeuLayout.setVerticalGroup(
|
||||||
|
jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPJeuLayout.createSequentialGroup()
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(jLChoixPerso)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(jPChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(jBGo)
|
||||||
|
.addGap(5, 5, 5))
|
||||||
|
);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||||
|
jPanel1.setLayout(jPanel1Layout);
|
||||||
|
jPanel1Layout.setHorizontalGroup(
|
||||||
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jPJeu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(JPFondListePerso, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
jPanel1Layout.setVerticalGroup(
|
||||||
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addComponent(JPFondListePerso, javax.swing.GroupLayout.PREFERRED_SIZE, 484, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(0, 0, Short.MAX_VALUE))
|
||||||
|
.addComponent(jPJeu, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
jMenuJeu.setText("Jeu");
|
||||||
|
|
||||||
|
jMInewGame.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||||
|
jMInewGame.setText("New Game");
|
||||||
|
jMInewGame.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jMInewGameActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenuJeu.add(jMInewGame);
|
||||||
|
|
||||||
|
jMInewPlayer.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ADD, 0));
|
||||||
|
jMInewPlayer.setText("New Player");
|
||||||
|
jMInewPlayer.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jMInewPlayerActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenuJeu.add(jMInewPlayer);
|
||||||
|
|
||||||
|
jMIopenGame.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||||
|
jMIopenGame.setText("Open Game");
|
||||||
|
jMenuJeu.add(jMIopenGame);
|
||||||
|
|
||||||
|
jMIsave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||||
|
jMIsave.setText("Save");
|
||||||
|
jMenuJeu.add(jMIsave);
|
||||||
|
|
||||||
|
jMIquit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||||
|
jMIquit.setText("Exit");
|
||||||
|
jMIquit.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jMIquitActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenuJeu.add(jMIquit);
|
||||||
|
|
||||||
|
jMenuBar1.add(jMenuJeu);
|
||||||
|
|
||||||
|
jMenu2.setText("??");
|
||||||
|
|
||||||
|
jMIaide.setText("Aide");
|
||||||
|
jMIaide.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jMIaideActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenu2.add(jMIaide);
|
||||||
|
|
||||||
|
jMIobjectif.setText("Objectif");
|
||||||
|
jMIobjectif.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jMIobjectifActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenu2.add(jMIobjectif);
|
||||||
|
|
||||||
|
jMIapropos.setText("A propos");
|
||||||
|
jMIapropos.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jMIaproposActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenu2.add(jMIapropos);
|
||||||
|
|
||||||
|
jMenuBar1.add(jMenu2);
|
||||||
|
|
||||||
|
setJMenuBar(jMenuBar1);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
|
getContentPane().setLayout(layout);
|
||||||
|
layout.setHorizontalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
|
||||||
|
private void jBGoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBGoActionPerformed
|
||||||
|
//Attaquant
|
||||||
|
String attaque = (String) jCBoxAttaquant.getSelectedItem();
|
||||||
|
String nomAttaque = attaque.split(":")[1];
|
||||||
|
Personnage attaquant = leJeu.rechercherPerso(nomAttaque);
|
||||||
|
|
||||||
|
//Defenseur
|
||||||
|
String defense = (String) jCBoxDefenseur.getSelectedItem();
|
||||||
|
String nomDefense = defense.split(":")[1];
|
||||||
|
Personnage defenseur = leJeu.rechercherPerso(nomDefense);
|
||||||
|
|
||||||
|
//Combat
|
||||||
|
if(defenseur.equals(attaquant)){
|
||||||
|
combatImpossible(defenseur);
|
||||||
|
}else{
|
||||||
|
attaquant.rencontrer(defenseur);
|
||||||
|
//mise <20> jour ath
|
||||||
|
|
||||||
|
}
|
||||||
|
majStatistiquesPersos();
|
||||||
|
|
||||||
|
}//GEN-LAST:event_jBGoActionPerformed
|
||||||
|
|
||||||
|
private void jCBoxDefenseurActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBoxDefenseurActionPerformed
|
||||||
|
// TODO add your handling code here:
|
||||||
|
String perso = (String) jCBoxDefenseur.getSelectedItem();
|
||||||
|
String nomPerso = perso.split(":")[1];
|
||||||
|
Personnage Perso = leJeu.rechercherPerso(nomPerso);
|
||||||
|
jTADefenseurCaracteristiques.setText(Perso.toString());
|
||||||
|
Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + Perso.getImg()));//getResource("/img/" + this.getImg()));
|
||||||
|
jLImageDefenseur.setIcon(imgPerso);
|
||||||
|
}//GEN-LAST:event_jCBoxDefenseurActionPerformed
|
||||||
|
|
||||||
|
private void jCBoxAttaquantActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBoxAttaquantActionPerformed
|
||||||
|
// TODO add your handling code here:
|
||||||
|
String perso = (String) jCBoxAttaquant.getSelectedItem();
|
||||||
|
String nomPerso = perso.split(":")[1];
|
||||||
|
Personnage Perso = leJeu.rechercherPerso(nomPerso);
|
||||||
|
jTAAttaquantCaracteristiques.setText(Perso.toString());
|
||||||
|
Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + Perso.getImg()));//getResource("/img/" + this.getImg()));
|
||||||
|
jLImageAttaquant.setIcon(imgPerso);
|
||||||
|
}//GEN-LAST:event_jCBoxAttaquantActionPerformed
|
||||||
|
|
||||||
|
private void jCBoxAttaquantInputMethodTextChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_jCBoxAttaquantInputMethodTextChanged
|
||||||
|
|
||||||
|
}//GEN-LAST:event_jCBoxAttaquantInputMethodTextChanged
|
||||||
|
|
||||||
|
private void jMInewPlayerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMInewPlayerActionPerformed
|
||||||
|
Ajout_Perso perso = new Ajout_Perso(leJeu);
|
||||||
|
perso.setVisible(true);
|
||||||
|
}//GEN-LAST:event_jMInewPlayerActionPerformed
|
||||||
|
|
||||||
|
private void jMInewGameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMInewGameActionPerformed
|
||||||
|
Plateau_de_jeu bidul = new Plateau_de_jeu();
|
||||||
|
bidul.setVisible(true);
|
||||||
|
}//GEN-LAST:event_jMInewGameActionPerformed
|
||||||
|
|
||||||
|
private void jMIquitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIquitActionPerformed
|
||||||
|
System.exit(0);
|
||||||
|
}//GEN-LAST:event_jMIquitActionPerformed
|
||||||
|
|
||||||
|
private void jMIobjectifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIobjectifActionPerformed
|
||||||
|
information j = new information();
|
||||||
|
j.objectif();
|
||||||
|
}//GEN-LAST:event_jMIobjectifActionPerformed
|
||||||
|
|
||||||
|
private void jMIaideActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIaideActionPerformed
|
||||||
|
information j = new information();
|
||||||
|
j.aide();
|
||||||
|
}//GEN-LAST:event_jMIaideActionPerformed
|
||||||
|
|
||||||
|
private void jMIaproposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIaproposActionPerformed
|
||||||
|
information j = new information();
|
||||||
|
j.aPropos();
|
||||||
|
}//GEN-LAST:event_jMIaproposActionPerformed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void majStatistiquesPersos(){
|
||||||
|
String persos = "Jeu : "+leJeu.getnomJeu();
|
||||||
|
for(Personnage Perso:leJeu.getmesPersonnages()){
|
||||||
|
persos += "\n";
|
||||||
|
persos += Perso;
|
||||||
|
persos += "\n";
|
||||||
|
persos += "----------------";
|
||||||
|
}
|
||||||
|
jTextArea1.setText(persos);
|
||||||
|
jTAAttaquantCaracteristiques.setText("");
|
||||||
|
jTADefenseurCaracteristiques.setText("");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void combatImpossible(Personnage perso){
|
||||||
|
String message = "Mais vous <20>tes devenu fou";
|
||||||
|
String titre = "Folie Incontestable !!";
|
||||||
|
Icon img = new javax.swing.ImageIcon("/img/folie.png");
|
||||||
|
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, img);
|
||||||
|
perso.varierEnergie(-1);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param args the command line arguments
|
||||||
|
*/
|
||||||
|
public static void main(String args[]) {
|
||||||
|
/* Set the Nimbus look and feel */
|
||||||
|
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
|
||||||
|
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
|
||||||
|
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
|
||||||
|
if ("Nimbus".equals(info.getName())) {
|
||||||
|
javax.swing.UIManager.setLookAndFeel(info.getClassName());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (ClassNotFoundException ex) {
|
||||||
|
java.util.logging.Logger.getLogger(Plateau_de_jeu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
|
} catch (InstantiationException ex) {
|
||||||
|
java.util.logging.Logger.getLogger(Plateau_de_jeu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
|
} catch (IllegalAccessException ex) {
|
||||||
|
java.util.logging.Logger.getLogger(Plateau_de_jeu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
|
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||||
|
java.util.logging.Logger.getLogger(Plateau_de_jeu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
|
/* Create and display the form */
|
||||||
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
new Plateau_de_jeu().setVisible(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//D<>claration variables
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JPanel JPFondListePerso;
|
||||||
|
private javax.swing.JButton jBGo;
|
||||||
|
private javax.swing.JComboBox<String> jCBoxAttaquant;
|
||||||
|
private javax.swing.JComboBox<String> jCBoxDefenseur;
|
||||||
|
private javax.swing.JLabel jLChoixPerso;
|
||||||
|
private javax.swing.JLabel jLChoixPersoText;
|
||||||
|
private javax.swing.JLabel jLImageAttaquant;
|
||||||
|
private javax.swing.JLabel jLImageDefenseur;
|
||||||
|
private javax.swing.JLabel jLImageListePerso;
|
||||||
|
private javax.swing.JMenuItem jMIaide;
|
||||||
|
private javax.swing.JMenuItem jMIapropos;
|
||||||
|
private javax.swing.JMenuItem jMInewGame;
|
||||||
|
private javax.swing.JMenuItem jMInewPlayer;
|
||||||
|
private javax.swing.JMenuItem jMIobjectif;
|
||||||
|
private javax.swing.JMenuItem jMIopenGame;
|
||||||
|
private javax.swing.JMenuItem jMIquit;
|
||||||
|
private javax.swing.JMenuItem jMIsave;
|
||||||
|
private javax.swing.JMenu jMenu2;
|
||||||
|
private javax.swing.JMenuBar jMenuBar1;
|
||||||
|
private javax.swing.JMenu jMenuJeu;
|
||||||
|
private javax.swing.JPanel jPAttaquant;
|
||||||
|
private javax.swing.JPanel jPCHoixPersoFond;
|
||||||
|
private javax.swing.JPanel jPChoixPerso;
|
||||||
|
private javax.swing.JPanel jPDefenseur;
|
||||||
|
private javax.swing.JPanel jPJeu;
|
||||||
|
private javax.swing.JPanel jPanel1;
|
||||||
|
private javax.swing.JScrollPane jScrollPane2;
|
||||||
|
private javax.swing.JScrollPane jScrollPane3;
|
||||||
|
private javax.swing.JScrollPane jScrollPane4;
|
||||||
|
private javax.swing.JTextArea jTAAttaquantCaracteristiques;
|
||||||
|
private javax.swing.JTextArea jTADefenseurCaracteristiques;
|
||||||
|
private javax.swing.JTextArea jTextArea1;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
41
JDR/src/Presentation/information.java
Normal file
41
JDR/src/Presentation/information.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
|
*/
|
||||||
|
package Presentation;
|
||||||
|
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author emile.lalorcey
|
||||||
|
*/
|
||||||
|
public class information {
|
||||||
|
|
||||||
|
public information(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void aide(){
|
||||||
|
String text = "Vous voici dans un jeu\n"
|
||||||
|
+ "Ce jeu se d<>roule comme un battle royal,\n"
|
||||||
|
+ "en effet il ne s'arr<72>te que si 1 seul personnage est encore en vie\n"
|
||||||
|
+ "Amusez-vous bien !";
|
||||||
|
JOptionPane.showMessageDialog(null, text, "Aide envoy<6F>", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void objectif(){
|
||||||
|
String text = "L'objectif est qu'il ne reste plus que 1 seul survivant\n"
|
||||||
|
+ " rien de plus simple, \n"
|
||||||
|
+ "nous avons mis <20> disposition dans le menu une page d'ajout de personnage, amusez-vous";
|
||||||
|
JOptionPane.showMessageDialog(null, text, "Voici votre objectif", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void aPropos(){
|
||||||
|
String text = "Ce jeu vous est propos<6F> par le bon LALORCEY--MALCUIT Emile\n"
|
||||||
|
+ "Cr<EFBFBD>ation dans le cadre du BTS SIO\n"
|
||||||
|
+ "Ce jeu ne peux <20>tre utilis<69> <20> des fin commercials";
|
||||||
|
|
||||||
|
JOptionPane.showMessageDialog(null, text, "Aide envoy<6F>", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
BIN
JDR/src/img/folie.jpg
Normal file
BIN
JDR/src/img/folie.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
21
JDR/src/jdr/JDR.java
Normal file
21
JDR/src/jdr/JDR.java
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
|
||||||
|
*/
|
||||||
|
package jdr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author sio
|
||||||
|
*/
|
||||||
|
public class JDR {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param args the command line arguments
|
||||||
|
*/
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO code application logic here
|
||||||
|
System.out.println("Hello world !");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -4,10 +4,8 @@
|
|||||||
*/
|
*/
|
||||||
package jeuderole;
|
package jeuderole;
|
||||||
|
|
||||||
import metier.Guerrier;
|
import metier.Jeu;
|
||||||
import metier.Personnage;
|
import metier.JeuBaton;
|
||||||
import metier.Sorcier;
|
|
||||||
import metier.Voleur;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test Classe Jeu
|
* Test Classe Jeu
|
||||||
@@ -19,14 +17,15 @@ public class JeuDeRolePolymorphisme {
|
|||||||
* @param args the command line arguments
|
* @param args the command line arguments
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
/**
|
||||||
Personnage mesPersonnages[] = new Personnage[3];
|
|
||||||
mesPersonnages[0] = new Guerrier("Guerrier", "Guerrier05.jpg", 5, 10, "couteau");
|
|
||||||
mesPersonnages[1] = new Voleur("Voleur", "imgVoleur1", 5, 10, "crochet");
|
|
||||||
mesPersonnages[2] = new Sorcier("Sorcier", "Sorcier02.jpg", 5, 10, "bout de bois", 10);
|
|
||||||
|
|
||||||
mesPersonnages[0].saluer(mesPersonnages[1]);
|
mesPersonnages[0].saluer(mesPersonnages[1]);
|
||||||
mesPersonnages[2].saluer(mesPersonnages[0]);
|
mesPersonnages[2].saluer(mesPersonnages[0]);
|
||||||
mesPersonnages[1].saluer(mesPersonnages[2]);
|
mesPersonnages[1].saluer(mesPersonnages[2]);**/
|
||||||
|
|
||||||
|
//Jeu leJeu = new Jeu();
|
||||||
|
//leJeu.rechercherPerso("Yokai").rencontrer("Barbare")
|
||||||
|
JeuBaton baton = new JeuBaton();
|
||||||
|
baton.deroulerJeu();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -1,60 +1,50 @@
|
|||||||
|
package metier;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
*/
|
*/
|
||||||
package metier;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author mohamed.boussemaha
|
* @author emile.lalorcey
|
||||||
*/
|
*/
|
||||||
public class Enigme {
|
public class Enigme {
|
||||||
|
String question;
|
||||||
|
String reponse;
|
||||||
|
|
||||||
private String question;
|
//Constructeurs
|
||||||
private String reponse;
|
/**
|
||||||
|
* Cette fonction est un constructeur de Enigme
|
||||||
public Enigme(String question, String reponse) {
|
* @param Question
|
||||||
this.question = question;
|
* @param Reponse
|
||||||
this.reponse = reponse;
|
*/
|
||||||
|
public Enigme (String Question , String Reponse){
|
||||||
|
this.question = Question;
|
||||||
|
this.reponse = Reponse;
|
||||||
|
}
|
||||||
|
//Getteur
|
||||||
|
/**
|
||||||
|
* Cette fonction permet d'acceder à la variable question
|
||||||
|
* @return la question
|
||||||
|
*/
|
||||||
|
public String Question(){
|
||||||
|
return this.question;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getQuestion() {
|
/**
|
||||||
return question;
|
* Cette fonction permet d'acceder à la variable reponse
|
||||||
|
* @return la reponse
|
||||||
|
*/
|
||||||
|
public String Reponse(){
|
||||||
|
return this.reponse;
|
||||||
|
}
|
||||||
|
//Setteur
|
||||||
|
public void SetQuestion(String Question){
|
||||||
|
this.question = Question;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setQuestion(String question) {
|
public void SetReponse(String Reponse){
|
||||||
this.question = question;
|
this.reponse = Reponse;
|
||||||
}
|
|
||||||
|
|
||||||
public String getReponse() {
|
|
||||||
return reponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReponse(String reponse) {
|
|
||||||
this.reponse = reponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return Objects.hash(question, reponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (this == obj) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (obj == null || getClass() != obj.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Enigme other = (Enigme) obj;
|
|
||||||
return Objects.equals(this.question, other.question) && Objects.equals(this.reponse, other.reponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Enigme{" + "question='" + question + '\'' + ", reponse='" + reponse + '\'' + '}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
101
JDR/src/metier/FeeSombre.java
Normal file
101
JDR/src/metier/FeeSombre.java
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
|
*/
|
||||||
|
package metier;
|
||||||
|
|
||||||
|
import javax.swing.Icon;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author emile.lalorcey
|
||||||
|
*/
|
||||||
|
public class FeeSombre extends Personnage{
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur de la classe FeeSombre
|
||||||
|
* @param nom
|
||||||
|
* @param img
|
||||||
|
* @param energie
|
||||||
|
* @param dureeVie
|
||||||
|
* @param ty
|
||||||
|
*/
|
||||||
|
public FeeSombre(String nom, String img, int energie, int dureeVie, String ty){
|
||||||
|
super(nom, img, energie, dureeVie);
|
||||||
|
this.type = ty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType(){
|
||||||
|
return this.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Methode saluer
|
||||||
|
* @param unPerso
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String saluer(Personnage unPerso){
|
||||||
|
String titre = this.getNom() + " salue " + unPerso.getNom();
|
||||||
|
String message = "Bonjour " + unPerso.getNom() + " Comment allez-vous ajourd'hui";
|
||||||
|
//JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + this.getImg()));
|
||||||
|
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, imgPerso);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Methode rencontrer faisant appelle <20> un mini jeu nomm<6D> jeu baton
|
||||||
|
* @param unPerso
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String rencontrer(Personnage unPerso){
|
||||||
|
String titre = this.getNom() + " rencontre " + unPerso.getNom();
|
||||||
|
String message = "Bonjour " + unPerso.getNom() + " !";
|
||||||
|
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
//Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + this.getImg()));
|
||||||
|
//JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, imgPerso);
|
||||||
|
JeuBaton baton = new JeuBaton();
|
||||||
|
boolean gagner = baton.deroulerJeu();
|
||||||
|
if(gagner){
|
||||||
|
unPerso.varierDureeVie(2);
|
||||||
|
this.varierEnergie(-1);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
unPerso.varierEnergie(-2);
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Methode to string addapter <20> une f<>e sombre
|
||||||
|
* @return les caract<63>ristique d'une F<>e Sombre
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return super.toString()+this.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* D<>termine si l'objet sp<73>cifi<66> est <20>gal <20> l'objet actuel.
|
||||||
|
* @param obj
|
||||||
|
* @return boolean signifiant si oui ou non les objets sont <20>gaux
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj){
|
||||||
|
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getClass() != obj.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return super.equals(obj);
|
||||||
|
}
|
||||||
|
}
|
@@ -2,7 +2,6 @@ package metier;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import static javax.swing.JOptionPane.WARNING_MESSAGE;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classe Guerrier, hérite de la classe Personnage
|
* Classe Guerrier, hérite de la classe Personnage
|
||||||
@@ -34,10 +33,6 @@ public class Guerrier extends Personnage{
|
|||||||
return super.toString() + "\tArme=" + arme;
|
return super.toString() + "\tArme=" + arme;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 7;
|
int hash = 7;
|
||||||
@@ -88,55 +83,45 @@ public class Guerrier extends Personnage{
|
|||||||
this.arme = arme;
|
this.arme = arme;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
*
|
public String saluer(Personnage unPerso){
|
||||||
* @param unPerso
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String saluer(Personnage unPerso) {
|
|
||||||
String titre = this.getNom() + " salue " + unPerso.getNom();
|
String titre = this.getNom() + " salue " + unPerso.getNom();
|
||||||
String message = "Bonjour " + unPerso.getNom() + ", sauve-toi vite avant que je ne te frappe avec mon arme redoutable !";
|
String message ;
|
||||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
/**if(unPerso instanceof Guerrier){
|
||||||
|
message = "Bonjour " + unPerso.getNom() + " Comment allez-vous ajourd'hui";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
}**/
|
||||||
|
message = "Bonjour " + unPerso.getNom() + "Barre toi avant que je n'utilise mon "+ this.arme;
|
||||||
|
//JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + this.getImg()));
|
||||||
|
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, imgPerso);
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param unPerso
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String rencontrer(Personnage unPerso) {
|
public String rencontrer(Personnage unPerso) {
|
||||||
String titre = this.getNom() + " rencontre " + unPerso.getNom() + ": d<>fi d<>s";
|
this.saluer(unPerso); //appelle de la contion saluer
|
||||||
String message = "Es-tu pr<70>t <20><> me combattre " + unPerso.getNom() + "?";
|
int pts_attaque = 0;
|
||||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
int pts_defense = 0;
|
||||||
Icon img = new javax.swing.ImageIcon(getClass().getResource("/img/des.jpg"));
|
do{
|
||||||
JOptionPane.showMessageDialog( null, message, titre, WARNING_MESSAGE, img);
|
pts_attaque = Jeu.genererNbAleatoire(0, 10);
|
||||||
|
pts_defense = Jeu.genererNbAleatoire(0, 10);
|
||||||
|
}while(pts_attaque == pts_defense);
|
||||||
|
|
||||||
int scoreAttaquant = Jeu.genererNbAleatoire(1, 6);
|
if(pts_attaque > pts_defense){
|
||||||
int scoreAttaque = Jeu.genererNbAleatoire(1, 6);
|
unPerso.varierDureeVie(-1);
|
||||||
|
unPerso.varierEnergie(-2);
|
||||||
if (scoreAttaquant == scoreAttaque) {
|
return "Tu as perdu, Tu es maintenant à "+unPerso.getEnergie()+ "energie et "+unPerso.getDureeVie()+ " PV !!";
|
||||||
message = "Egalit<EFBFBD> ! Vous avez tous les deux lanc<6E> " + scoreAttaquant + ". Rejoue vite !";
|
}else{ // pts_defense > pts_attaque
|
||||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.WARNING_MESSAGE);
|
this.varierEnergie(-1);
|
||||||
} else {
|
unPerso.varierEnergie(2);
|
||||||
String gagnant = scoreAttaquant > scoreAttaque ? this.getNom() : unPerso.getNom();
|
return "Mon energie est à "+ this.getEnergie() + "et toi qui m'a vaincu tu es à "+ unPerso.getEnergie();
|
||||||
int degats = Math.abs(scoreAttaquant - scoreAttaque);
|
}
|
||||||
|
|
||||||
if (gagnant.equals(this.getNom())) {
|
|
||||||
this.setEnergie(this.getEnergie() + degats);
|
|
||||||
this.setDureeVie(this.getDureeVie() + degats);
|
|
||||||
message = this.getNom() + " a gagn<67> ! Il inflige " + degats + " points de dommage. " +
|
|
||||||
"Energie: " + this.getEnergie() + ", Dur<75>e de vie: " + this.getDureeVie();
|
|
||||||
} else {
|
|
||||||
unPerso.setEnergie(unPerso.getEnergie() + degats);
|
|
||||||
unPerso.setDureeVie(unPerso.getDureeVie() + degats);
|
|
||||||
message = unPerso.getNom() + " a gagn<67> ! Il inflige " + degats + " points de dommage. " +
|
|
||||||
"Energie: " + unPerso.getEnergie() + ", Dur<75>e de vie: " + unPerso.getDureeVie();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -4,131 +4,117 @@
|
|||||||
*/
|
*/
|
||||||
package metier;
|
package metier;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author mohamed.boussemaha
|
* @author emile.lalorcey
|
||||||
*/
|
*/
|
||||||
public class Jeu {
|
public class Jeu {
|
||||||
/*****Attributs*****/
|
String nomJeu = "Jeu de Role" ;
|
||||||
private final String nomJeu;
|
private ArrayList<Personnage> mesPersonnages;
|
||||||
private Personnage[] lesPersonnages;
|
|
||||||
|
|
||||||
/*****Constructeur*****/
|
/********* Constructeurs ********/
|
||||||
public Jeu(String nomJeu) {
|
|
||||||
this.nomJeu = nomJeu;
|
/**
|
||||||
|
* Constructeur de Jeu
|
||||||
|
*/
|
||||||
|
public Jeu(){
|
||||||
this.chargerLesPersonnages();
|
this.chargerLesPersonnages();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****Accesseur*****/
|
/********* Guetteur ********/
|
||||||
public String getNomJeu() {
|
public String getnomJeu(){
|
||||||
return this.nomJeu;
|
return this.nomJeu;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Getteur de mes personnages
|
||||||
* @return
|
* @return mes personnages
|
||||||
*/
|
*/
|
||||||
public Personnage[] getLesPersonnages() {
|
public ArrayList<Personnage> getmesPersonnages(){
|
||||||
return this.lesPersonnages;
|
return mesPersonnages;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****Mutateurs*****/
|
/********* Setteurs ********/
|
||||||
|
|
||||||
|
|
||||||
|
/********* Fonctions ********/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Crée les personnages
|
||||||
* @param lesPersonnages
|
|
||||||
*/
|
*/
|
||||||
public void setLesPersonnages(Personnage[] lesPersonnages) {
|
private void chargerLesPersonnages(){
|
||||||
this.lesPersonnages = lesPersonnages;
|
mesPersonnages = new ArrayList<Personnage>();
|
||||||
}
|
mesPersonnages.add(new Guerrier("Barbare", "", 6, 4, "Hache"));
|
||||||
|
mesPersonnages.add(new Guerrier("Garren","Guerrier08.jpg" , 2, 8, "Gourdin"));
|
||||||
/*****M<>thodes*****/
|
mesPersonnages.add(new Guerrier("Hellen","Guerrier08.jpg" , 8, 6, "Gourdin"));
|
||||||
private void chargerLesPersonnages() {
|
//mesPersonnages.add(new Personnage("Gaelle", "Barbare04.jpg", 5, 3));
|
||||||
Enigme[] enigmes1 = {
|
//Plus possible car personnage est devenue abstract
|
||||||
new Enigme("Qu?est ce qui est plus grand que la Tour Eiffel, mais infiniment moins lourd ?", "ombre"),
|
mesPersonnages.add(new Voleur("Raptout", "", 2, 4, "Marteau"));
|
||||||
new Enigme("Girafe = 3, <20>l<EFBFBD>phant = 3, Hippopotame = 5, Lion = ? ?", "2"),
|
mesPersonnages.add(new Sorcier("Panoramix", "", 10, 5, "Baguette de laurier"));
|
||||||
new Enigme("Qu'est-ce qui commence la nuit et termine le matin ?", "n"),
|
mesPersonnages.add(new Sorcier("Jinx","Barbare04.jpg",0,0, "Bâton"));
|
||||||
new Enigme("Qu'est-ce qui fait le tour de la maison sans bouger ?", "mur")
|
mesPersonnages.add(new FeeSombre("Yokai","Barbare04.jpg",4,6, "Terre"));
|
||||||
};
|
mesPersonnages.add(new FeeSombre("Shard","Barbare04.jpg",7,5, "Vent"));
|
||||||
|
|
||||||
Enigme[] enigmes2 = {
|
|
||||||
new Enigme("Consid<EFBFBD>rez la suite de chiffre suivante : 0 1 1 2 3 5 8 Quel chiffre suit le 8 ?", "13"),
|
|
||||||
new Enigme("Prenez une pizza et placez-la devant vous. En combien de morceaux maximum pouvez-vous la couper en effectuant seulement six coups de couteau ?", "16"),
|
|
||||||
new Enigme("C'est le jour de la paie. La poule re<72>oit 7 euros. L'abeille re<72>oit 21 euros. L'araign<67>e re<72>oit 28 euros. Combien re<72>oit le chien ?", "14"),
|
|
||||||
new Enigme("Un escargot est au fond d'un puits de 10 m<>tres. Chaque matin il monte de 3 m<>tres et chaque nuit il descend de 2 m<>tres. Combien de jours lui faudra-t-il pour sortir de ce puits ?", "7")
|
|
||||||
};
|
|
||||||
|
|
||||||
Sorcier sorcier1 = new Sorcier("Merlin", "merlin.png", 5, 10, "Baguette de ch<63>ne", 10);
|
|
||||||
for (Enigme e : enigmes1) {
|
|
||||||
sorcier1.ajouterEnigme(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
Sorcier sorcier2 = new Sorcier("Gandalf", "gandalf.png", 5, 10, "Baguette d'if", 10);
|
|
||||||
for (Enigme e : enigmes2) {
|
|
||||||
sorcier2.ajouterEnigme(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
Guerrier guerrier1 = new Guerrier("Guerrier 1", "Guerrier05.jpg", 5, 10, "couteau");
|
|
||||||
Voleur voleur1 = new Voleur("Voleur 1", "imgVoleur1", 5, 10, "crochet");
|
|
||||||
|
|
||||||
this.lesPersonnages = new Personnage[4];
|
|
||||||
this.lesPersonnages[0] = guerrier1;
|
|
||||||
this.lesPersonnages[1] = voleur1;
|
|
||||||
this.lesPersonnages[2] = sorcier1;
|
|
||||||
this.lesPersonnages[3] = sorcier2;
|
|
||||||
|
|
||||||
for (Personnage personnage : this.lesPersonnages) {
|
|
||||||
System.out.println(personnage); // Affiche le sorcier avec le nombre d'<27>nigmes
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Cette méthode sert à affiché les différents personnages avec leurs affectations
|
||||||
* @return
|
* @return String tout les personnages avec leurs capacités
|
||||||
*/
|
|
||||||
public Personnage rechercherPerso(String nom) {
|
|
||||||
boolean trouve = false;
|
|
||||||
int i = 0;
|
|
||||||
while (!trouve && i < lesPersonnages.length) {
|
|
||||||
if (lesPersonnages[i].getNom().equals(nom)) {
|
|
||||||
trouve = true;
|
|
||||||
} else {
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return lesPersonnages[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Vector getLesPersonnagesVivants() {
|
|
||||||
Vector personnageVivant = new Vector();
|
|
||||||
for (Personnage p : lesPersonnages) {
|
|
||||||
if (p.getDureeVie() > 0) {
|
|
||||||
personnageVivant.add(p.getClass().getSimpleName() + ": " + p.getNom());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return personnageVivant;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString(){
|
||||||
String affichage = "";
|
String mesPersos = "";
|
||||||
for (Personnage personnage : this.lesPersonnages) {
|
for (int i = 0; i < mesPersonnages.size(); i++){
|
||||||
affichage += personnage + "\n";
|
mesPersos += mesPersonnages.get(i) + "\n" + "\n";
|
||||||
}
|
}
|
||||||
return affichage;
|
return mesPersos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* recherche un personnage
|
||||||
|
* @param n un entier
|
||||||
|
* @return le personnage recherchés
|
||||||
|
*/
|
||||||
|
public Personnage rechercherPerso(String n){
|
||||||
|
int indice = 0;
|
||||||
|
boolean trouver = false;
|
||||||
|
while(indice < this.mesPersonnages.size() && !trouver){
|
||||||
|
trouver = (this.mesPersonnages.get(indice).getNom().equals(n));
|
||||||
|
indice++;
|
||||||
|
}
|
||||||
|
if(trouver){
|
||||||
|
indice--;
|
||||||
|
return this.mesPersonnages.get(indice);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cette fonction génère un nombre aléatoire
|
||||||
|
* @param min minimum possible pour le nombre
|
||||||
|
* @param max maximum possible pour le nombre
|
||||||
|
* @return le nombre aléatoire
|
||||||
|
*/
|
||||||
public static int genererNbAleatoire(int min, int max) {
|
public static int genererNbAleatoire(int min, int max) {
|
||||||
return min + (int)(Math.random() * ((max - min) + 1));
|
return min + (int)(Math.random() * ((max - min) + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cette Fonction permet d'obtenir la liste des personnages encore en vie
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Vector getLesPersonnagesVivants (){
|
||||||
|
Vector<String> LesPersonnagesVivants = new Vector<>();
|
||||||
|
for(Personnage Perso:mesPersonnages){
|
||||||
|
if(Perso.getDureeVie() > 0){
|
||||||
|
LesPersonnagesVivants.add(Perso.getClass().getSimpleName()+":"+ Perso.getNom());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return LesPersonnagesVivants;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
69
JDR/src/metier/JeuBaton.java
Normal file
69
JDR/src/metier/JeuBaton.java
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
|
*/
|
||||||
|
package metier;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author emile.lalorcey
|
||||||
|
*/
|
||||||
|
public class JeuBaton {
|
||||||
|
private int nbAlea = (int)(Math.random()*100);
|
||||||
|
private int nbCoup = 6;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructeur de la class JeuBaton
|
||||||
|
*/
|
||||||
|
public JeuBaton(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNbAlea(){
|
||||||
|
return this.nbAlea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNbCoup(){
|
||||||
|
return this.nbCoup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean tourPasser(){
|
||||||
|
boolean possible = true;
|
||||||
|
if(this.getNbCoup()>0){
|
||||||
|
this.nbCoup -= 1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
possible = false;
|
||||||
|
}
|
||||||
|
return possible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean deroulerJeu(){
|
||||||
|
boolean gagner = false;
|
||||||
|
Scanner LectureClavier = new Scanner(System.in);
|
||||||
|
int valeur ;
|
||||||
|
System.out.println("Vous allez devoir deviner un nombre al<61>atoire \n"
|
||||||
|
+ "entre 0 et 100 en 6 tentatives maximum!");
|
||||||
|
do{
|
||||||
|
System.out.println("Il vous reste " + this.getNbCoup() + " tentatives.\n"
|
||||||
|
+ "Entrez le prochain nombre <20> tester : ");
|
||||||
|
valeur = LectureClavier.nextInt();
|
||||||
|
if(valeur == this.getNbAlea()){
|
||||||
|
gagner = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(valeur > this.getNbAlea()){
|
||||||
|
System.out.println("Nombre trop grand");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
System.out.println("Nombre trop petit");
|
||||||
|
}
|
||||||
|
this.tourPasser();
|
||||||
|
}
|
||||||
|
}while(!gagner && (this.getNbCoup()>0));
|
||||||
|
|
||||||
|
return gagner;
|
||||||
|
}
|
||||||
|
}
|
@@ -8,7 +8,7 @@ import javax.swing.JOptionPane;
|
|||||||
* @author Dominique_2
|
* @author Dominique_2
|
||||||
* @version 20170215
|
* @version 20170215
|
||||||
*/
|
*/
|
||||||
public class Personnage {
|
public abstract class Personnage {
|
||||||
// Variables membres
|
// Variables membres
|
||||||
private String nom;
|
private String nom;
|
||||||
private String img;
|
private String img;
|
||||||
@@ -28,16 +28,14 @@ public class Personnage {
|
|||||||
this.dureeVie = dureeVie;
|
this.dureeVie = dureeVie;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Personnage() {
|
|
||||||
// throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Permet d'obtenir les valeurs des attributs de l'objet courant
|
* Permet d'obtenir les valeurs des attributs de l'objet courant
|
||||||
* @return liste des attributs avec leurs valeurs
|
* @return liste des attributs avec leurs valeurs
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Nom\t" + nom + "\nEnergie\t" + energie + "\nDuree de vie\t" + dureeVie
|
return "Nom\t" + this.nom + "\nEnergie\t" + this.energie + "\nDuree de vie\t" + this.dureeVie
|
||||||
+ "\n"+this.getClass().getSimpleName();
|
+ "\n"+this.getClass().getSimpleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +75,10 @@ public class Personnage {
|
|||||||
if (!Objects.equals(this.nom, other.nom)) {
|
if (!Objects.equals(this.nom, other.nom)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return Objects.equals(this.img, other.img);
|
if (!Objects.equals(this.img, other.img)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -153,47 +154,33 @@ public class Personnage {
|
|||||||
this.nom = nom;
|
this.nom = nom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract String rencontrer(Personnage unPerso);
|
||||||
|
|
||||||
|
public abstract String saluer(Personnage unPerso);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Cette fonction permet de faire varier l'energie de l'objet émetteur
|
||||||
* @param unPerso
|
* @param nb l'énergie à faire varier de this.energie
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public String rencontrer(Personnage unPerso) {
|
public void varierEnergie(int nb){
|
||||||
String titre = this.getNom() + " rencontre " + unPerso.getNom();
|
if ( (this.energie+ nb) >= 0){
|
||||||
String message = "Bonjour " + unPerso.getNom() + " !";
|
|
||||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
//Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + this.getImg()));
|
|
||||||
//JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, imgPerso);
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String saluer(Personnage unPerso) {
|
|
||||||
String titre = this.getNom() + " salue " + unPerso.getNom();
|
|
||||||
String message = "Bonjour " + unPerso.getNom() + ", je suis content de te revoir !";
|
|
||||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void varierEnergie(int nb) {
|
|
||||||
if(this.energie + nb < 0) {
|
|
||||||
this.energie = 0;
|
|
||||||
JOptionPane.showMessageDialog(null, "Fin",this.getNom() + "est mort", JOptionPane.ABORT);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
this.energie += nb;
|
this.energie += nb;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
JOptionPane.showMessageDialog(null,"Il m'est impossible d'avoir une énergie négative.\n Je dois revenir plus fort","Pouvoir insuffisant !", JOptionPane.INFORMATION_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void varierDureeVie(int nb) {
|
/**
|
||||||
if(this.dureeVie + nb <= 0) {
|
* Cette fonction permet de faire varier la vie de l'objet émetteur
|
||||||
this.dureeVie = 0;
|
* @param nb l'énergie à faire varier de this.dureeVie
|
||||||
JOptionPane.showMessageDialog(null, "Fin", this.getNom() + "est mort", JOptionPane.ABORT);
|
*/
|
||||||
} else {
|
public void varierDureeVie(int nb){
|
||||||
|
if ( (this.dureeVie+ nb) >= 0){
|
||||||
this.dureeVie += nb;
|
this.dureeVie += nb;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
JOptionPane.showMessageDialog(null,"Je me meurt\n Adieu monde cruel","Mortalité !", JOptionPane.INFORMATION_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,7 +1,8 @@
|
|||||||
package metier;
|
package metier;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Random;
|
import java.util.Scanner;
|
||||||
|
import javax.swing.Icon;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11,20 +12,31 @@ import javax.swing.JOptionPane;
|
|||||||
public class Sorcier extends Personnage {
|
public class Sorcier extends Personnage {
|
||||||
|
|
||||||
private String baguette;
|
private String baguette;
|
||||||
private Enigme[] enigmes;
|
private String enigme;
|
||||||
private int nbEnigmes;
|
Enigme[] enigmes1 = {
|
||||||
|
new Enigme("Qu?est ce qui est plus grand que la Tour Eiffel, mais infiniment moins lourd ?","ombre"),
|
||||||
|
new Enigme("Girafe = 3, <20>l<EFBFBD>phant = 3, Hippopotame = 5, Lion = ? ?","2"),
|
||||||
|
new Enigme("Qu'est-ce qui commence la nuit et termine le matin ?","n"),
|
||||||
|
new Enigme("Qu'est-ce qui fait le tour de la maison sans bouger ?","mur")
|
||||||
|
};
|
||||||
|
|
||||||
public Sorcier(String nom, String img, int energie, int dureeVie, String baguette, int par2) {
|
Enigme[] enigmes2 = {
|
||||||
|
new Enigme("Consid<EFBFBD>rez la suite de chiffre suivante : 0 1 1 2 3 5 8 Quel chiffre suit le 8 ?","13"),
|
||||||
|
new Enigme("Prenez une pizza et placez-la devant vous. En combien de morceaux maximum pouvez-vous la couper en effectuant seulement six coups de couteau ?","16"),
|
||||||
|
new Enigme("C'est le jour de la paie. La poule re<72>oit 7 euros. L'abeille re<72>oit 21 euros. L'araign<67>e re<72>oit 28 euros. Combien re<72>oit le chien ?","14"),
|
||||||
|
new Enigme("Un escargot est au fond d'un puits de 10 m<>tres. Chaque matin il monte de 3 m<>tres et chaque nuit il descend de 2 m<>tres. Combien de jours lui faudra-t-il pour sortir de ce puits ?","7")
|
||||||
|
};
|
||||||
|
|
||||||
|
public Sorcier(String nom, String img, int energie, int dureeVie, String baguette) {
|
||||||
super(nom, img, energie, dureeVie);
|
super(nom, img, energie, dureeVie);
|
||||||
this.baguette = baguette;
|
this.baguette = baguette;
|
||||||
int tailleMaxEnigmes = 0;
|
|
||||||
this.enigmes = new Enigme[tailleMaxEnigmes];
|
|
||||||
this.nbEnigmes = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(super.hashCode(), baguette, enigmes, nbEnigmes);
|
int hash = 7;
|
||||||
|
hash = super.hashCode() + (73 * hash + Objects.hashCode(this.baguette));
|
||||||
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -32,56 +44,73 @@ public class Sorcier extends Personnage {
|
|||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (obj == null || getClass() != obj.getClass()) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Sorcier other = (Sorcier) obj;
|
if (getClass() != obj.getClass()) {
|
||||||
return super.equals(obj) && Objects.equals(baguette, other.baguette) && nbEnigmes == other.nbEnigmes;
|
return false;
|
||||||
|
}
|
||||||
|
final Sorcier other = (Sorcier) obj;
|
||||||
|
if (!Objects.equals(this.baguette, other.baguette)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!super.equals(obj)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return super.toString() + "\tBaguette=" + baguette + "\nNb Enigmes=" + nbEnigmes;
|
return super.toString() + "\tBaguette=" + baguette + "\nNb Enigmes";
|
||||||
}
|
}
|
||||||
|
|
||||||
public Enigme[] getEnigmes() {
|
/**
|
||||||
return enigmes;
|
* Get the value of baguette
|
||||||
|
*
|
||||||
|
* @return the value of baguette
|
||||||
|
*/
|
||||||
|
public String getBaguette() {
|
||||||
|
return baguette;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ajouterEnigme(Enigme e) {
|
/**
|
||||||
if (nbEnigmes < enigmes.length) {
|
* Set the value of baguette
|
||||||
enigmes[nbEnigmes] = e;
|
*
|
||||||
nbEnigmes++;
|
* @param baguette new value of baguette
|
||||||
} else {
|
*/
|
||||||
System.out.println("Impossible d'ajouter une <20>nigme. Le tableau est plein.");
|
public void setBaguette(String baguette) {
|
||||||
}
|
this.baguette = baguette;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String saluer(Personnage unPerso) {
|
public String saluer(Personnage unPerso){
|
||||||
String titre = this.getNom() + " saluer " + unPerso.getNom();
|
String titre = this.getNom() + " salue " + unPerso.getNom();
|
||||||
String message = "Bonjour " + unPerso.getNom() + ", je t'ai jet<65> un sort, tu es d<>sormais sous ma d<>pendance !";
|
String message ;
|
||||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
message = "Bonjour " + unPerso.getNom() + " Tu es sous ma dépendance ";
|
||||||
|
//JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + this.getImg()));
|
||||||
|
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, imgPerso);
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String rencontrer(Personnage unPerso) {
|
public String rencontrer(Personnage unPerso){
|
||||||
if (nbEnigmes == 0) {
|
Scanner LectureClavier =new Scanner(System.in);
|
||||||
JOptionPane.showMessageDialog(null, "Je n'ai pas d'<27>nigmes <20> te poser...", "Sorcier " + this.getNom(), JOptionPane.INFORMATION_MESSAGE);
|
String titre = this.getNom() + " rencontre " + unPerso.getNom();
|
||||||
return "";
|
String message = "Je vais te d<>truire";
|
||||||
|
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
//Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + this.getImg()));
|
||||||
|
//JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, imgPerso);
|
||||||
|
Enigme enigm = enigmes1[(int)(Math.random() * 3)];
|
||||||
|
System.out.println(enigm.Question());
|
||||||
|
String reponse = LectureClavier.nextLine();
|
||||||
|
if (reponse.equals(enigm.Reponse())){
|
||||||
|
unPerso.varierDureeVie(1);
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
Random rand = new Random();
|
unPerso.varierDureeVie(-2);
|
||||||
Enigme enigme = enigmes[rand.nextInt(nbEnigmes)];
|
|
||||||
|
|
||||||
String reponseUtilisateur = JOptionPane.showInputDialog(null, enigme.getQuestion(), "R<EFBFBD>pondez <20> l'<27>nigme", JOptionPane.QUESTION_MESSAGE);
|
|
||||||
|
|
||||||
if (reponseUtilisateur != null && reponseUtilisateur.equalsIgnoreCase(enigme.getReponse())) {
|
|
||||||
JOptionPane.showMessageDialog(null, "Bonne r<>ponse !", "Sorcier " + this.getNom(), JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
} else {
|
|
||||||
JOptionPane.showMessageDialog(null, "Mauvaise r<>ponse ! La bonne r<>ponse <20>tait : " + enigme.getReponse(), "Sorcier " + this.getNom(), JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
}
|
}
|
||||||
return null;
|
return message;
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,14 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package metier;
|
package metier;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import static javax.swing.JOptionPane.WARNING_MESSAGE;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -32,11 +31,6 @@ public class Voleur extends Personnage{
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param obj
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
@@ -81,53 +75,47 @@ public class Voleur extends Personnage{
|
|||||||
this.outil = outil;
|
this.outil = outil;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getOutils() {
|
public String rencontrer(Personnage unPerso){
|
||||||
return outils;
|
int choix_unPerso;
|
||||||
|
int reponse;
|
||||||
|
this.saluer(unPerso);
|
||||||
|
|
||||||
|
Icon PierreFeuilleCiseaux = new javax.swing.ImageIcon("/img/pierreFeuilleCiseaux.jpg");
|
||||||
|
String message = "Que choisis-tu " + unPerso.getNom() + " !";
|
||||||
|
String titre = "Pierre Feuille Ciseaux" + unPerso.getNom();
|
||||||
|
|
||||||
|
do{
|
||||||
|
reponse = JOptionPane.showOptionDialog(null, message, titre, JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE,PierreFeuilleCiseaux, outils, 0);
|
||||||
|
System.out.println(reponse);
|
||||||
|
choix_unPerso = Jeu.genererNbAleatoire(0, 2);
|
||||||
|
}while(reponse == choix_unPerso);
|
||||||
|
String voleur = this.outils[reponse];
|
||||||
|
String vole = this.outils[choix_unPerso];
|
||||||
|
|
||||||
|
if((voleur.equals("Pierre")&& vole.equals("Ciseaux"))||
|
||||||
|
(voleur.equals("Feuille")&& vole.equals("Pierre"))||
|
||||||
|
(voleur.equals("Ciseaux")&& vole.equals("Feuille"))){
|
||||||
|
|
||||||
|
this.varierEnergie(1);
|
||||||
|
unPerso.varierEnergie(-1);
|
||||||
|
unPerso.varierDureeVie(-1);
|
||||||
|
return "j'ai gagné wha hahaha !!" ;
|
||||||
|
}else{
|
||||||
|
this.varierEnergie(-1);
|
||||||
|
unPerso.varierEnergie(+1);
|
||||||
|
return "Tu as gagné espèce de fifrelin";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOutils(String[] outils) {
|
|
||||||
this.outils = outils;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public String saluer(Personnage unPerso){
|
||||||
public String rencontrer(Personnage unPerso) {
|
String titre = this.getNom() + " salue " + unPerso.getNom();
|
||||||
String titre = this.getNom() + " rencontre " + unPerso.getNom();
|
String message = "Bonjour " + unPerso.getNom() + " Comment allez-vous ajourd'hui";
|
||||||
String message = "Que choisis-tu, " + unPerso.getNom() + "?";
|
//JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
||||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + this.getImg()));
|
||||||
Icon img = new javax.swing.ImageIcon(getClass().getResource("/img/pierreFeuilleCiseaux.jpg"));
|
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, imgPerso);
|
||||||
|
return message;
|
||||||
|
|
||||||
String resultat = "";
|
|
||||||
String choixJoueur;
|
|
||||||
String choixAdversaire;
|
|
||||||
|
|
||||||
do {
|
|
||||||
int choixUtilisateur = JOptionPane.showOptionDialog(
|
|
||||||
null, message, titre, JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE,
|
|
||||||
null, outils, 0);
|
|
||||||
|
|
||||||
choixJoueur = outils[choixUtilisateur];
|
|
||||||
choixAdversaire = outils[Jeu.genererNbAleatoire(0,2)];
|
|
||||||
if (choixJoueur.equals(choixAdversaire)) {
|
|
||||||
resultat = "<EFBFBD>galit<EFBFBD>, recommencez !";
|
|
||||||
} else if (
|
|
||||||
(choixJoueur.equals("Pierre") && choixAdversaire.equals("Ciseaux")) ||
|
|
||||||
(choixJoueur.equals("Feuille") && choixAdversaire.equals("Pierre")) ||
|
|
||||||
(choixJoueur.equals("Ciseaux") && choixAdversaire.equals("Feuille"))
|
|
||||||
) {
|
|
||||||
resultat = "Vous avez gagn<67> !";
|
|
||||||
} else {
|
|
||||||
resultat = "Vous avez perdu !";
|
|
||||||
}
|
}
|
||||||
JOptionPane.showMessageDialog(null, "Vous avez choisi : " + choixJoueur + "\n"
|
|
||||||
+ unPerso.getNom() + " a choisi : " + choixAdversaire,
|
|
||||||
titre, JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
} while(choixJoueur.equals(choixAdversaire));
|
|
||||||
|
|
||||||
|
|
||||||
JOptionPane.showMessageDialog(null, resultat, titre, JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
|
|
||||||
return resultat;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,353 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
|
||||||
<NonVisualComponents>
|
|
||||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<EmptySpace min="0" pref="100" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<EmptySpace min="0" pref="100" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
</Container>
|
|
||||||
</NonVisualComponents>
|
|
||||||
<Properties>
|
|
||||||
<Property name="defaultCloseOperation" type="int" value="3"/>
|
|
||||||
</Properties>
|
|
||||||
<SyntheticProperties>
|
|
||||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
|
||||||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
|
||||||
</SyntheticProperties>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
|
||||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
|
||||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
|
||||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
|
||||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
|
||||||
</AuxValues>
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" attributes="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" attributes="0">
|
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
|
||||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="-2" pref="222" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" attributes="0">
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
|
||||||
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="-2" pref="78" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<EmptySpace min="-2" pref="232" max="-2" attributes="0"/>
|
|
||||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Group type="103" groupAlignment="1" attributes="0">
|
|
||||||
<Component id="jPanel2" alignment="1" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
|
|
||||||
<Component id="jLabel2" min="-2" pref="118" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
|
||||||
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
|
||||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace pref="33" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
<SubComponents>
|
|
||||||
<Container class="javax.swing.JPanel" name="jPanel2">
|
|
||||||
<Properties>
|
|
||||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
|
||||||
<Color blue="0" green="0" red="33" type="rgb"/>
|
|
||||||
</Property>
|
|
||||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
|
||||||
<Color blue="33" green="33" red="33" type="rgb"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" attributes="0">
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Component id="jLabel1" min="-2" pref="174" max="-2" attributes="0"/>
|
|
||||||
<Component id="jScrollPane4" alignment="0" min="-2" pref="174" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Component id="jLabel1" min="-2" pref="85" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
|
||||||
<Component id="jScrollPane4" pref="387" max="32767" attributes="0"/>
|
|
||||||
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
<SubComponents>
|
|
||||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
|
||||||
<Properties>
|
|
||||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
|
||||||
<Image iconType="3" name="/img/adj_1.jpg"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Container class="javax.swing.JScrollPane" name="jScrollPane4">
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
|
||||||
</AuxValues>
|
|
||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
|
||||||
<SubComponents>
|
|
||||||
<Component class="javax.swing.JTextArea" name="jTextArea4">
|
|
||||||
<Properties>
|
|
||||||
<Property name="editable" type="boolean" value="false"/>
|
|
||||||
<Property name="columns" type="int" value="20"/>
|
|
||||||
<Property name="rows" type="int" value="5"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
</SubComponents>
|
|
||||||
</Container>
|
|
||||||
</SubComponents>
|
|
||||||
</Container>
|
|
||||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
|
||||||
<Properties>
|
|
||||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
|
||||||
<Image iconType="3" name="/img/famille_1.jpg"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Container class="javax.swing.JPanel" name="jPanel3">
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="1" attributes="0">
|
|
||||||
<EmptySpace pref="10" max="32767" attributes="0"/>
|
|
||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
|
||||||
<Group type="102" attributes="0">
|
|
||||||
<Component id="jCPerso1" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
|
||||||
<Component id="jCPerso2" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" attributes="0">
|
|
||||||
<Component id="jPanel4" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
|
||||||
<Component id="jPanel6" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
|
||||||
<Component id="jCPerso1" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="jCPerso2" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
|
||||||
<Component id="jPanel4" max="32767" attributes="0"/>
|
|
||||||
<Component id="jPanel6" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace pref="16" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
<SubComponents>
|
|
||||||
<Component class="javax.swing.JComboBox" name="jCPerso1">
|
|
||||||
<Properties>
|
|
||||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
|
||||||
<StringArray count="4">
|
|
||||||
<StringItem index="0" value="Item 1"/>
|
|
||||||
<StringItem index="1" value="Item 2"/>
|
|
||||||
<StringItem index="2" value="Item 3"/>
|
|
||||||
<StringItem index="3" value="Item 4"/>
|
|
||||||
</StringArray>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCPerso1ActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JComboBox" name="jCPerso2">
|
|
||||||
<Properties>
|
|
||||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
|
||||||
<StringArray count="4">
|
|
||||||
<StringItem index="0" value="Item 1"/>
|
|
||||||
<StringItem index="1" value="Item 2"/>
|
|
||||||
<StringItem index="2" value="Item 3"/>
|
|
||||||
<StringItem index="3" value="Item 4"/>
|
|
||||||
</StringArray>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCPerso2ActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
<Container class="javax.swing.JPanel" name="jPanel4">
|
|
||||||
<Properties>
|
|
||||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
|
||||||
<Color blue="0" green="0" red="66" type="rgb"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" attributes="0">
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Component id="jScrollPane2" max="32767" attributes="0"/>
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Component id="jLabel4" min="-2" pref="100" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="1" attributes="0">
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Component id="jScrollPane2" min="-2" pref="120" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace pref="28" max="32767" attributes="0"/>
|
|
||||||
<Component id="jLabel4" min="-2" pref="90" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
<SubComponents>
|
|
||||||
<Component class="javax.swing.JLabel" name="jLabel4">
|
|
||||||
</Component>
|
|
||||||
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
|
||||||
</AuxValues>
|
|
||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
|
||||||
<SubComponents>
|
|
||||||
<Component class="javax.swing.JTextArea" name="jTextArea2">
|
|
||||||
<Properties>
|
|
||||||
<Property name="editable" type="boolean" value="false"/>
|
|
||||||
<Property name="columns" type="int" value="20"/>
|
|
||||||
<Property name="rows" type="int" value="5"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
</SubComponents>
|
|
||||||
</Container>
|
|
||||||
</SubComponents>
|
|
||||||
</Container>
|
|
||||||
<Container class="javax.swing.JPanel" name="jPanel6">
|
|
||||||
<Properties>
|
|
||||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
|
||||||
<Color blue="0" green="0" red="66" type="rgb"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Component id="jLabel3" min="-2" pref="99" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" alignment="1" attributes="0">
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
|
||||||
<Component id="jScrollPane3" min="-2" pref="234" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="1" attributes="0">
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Component id="jScrollPane3" min="-2" pref="120" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
|
||||||
<Component id="jLabel3" min="-2" pref="90" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
<SubComponents>
|
|
||||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
|
||||||
</Component>
|
|
||||||
<Container class="javax.swing.JScrollPane" name="jScrollPane3">
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
|
||||||
</AuxValues>
|
|
||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
|
||||||
<SubComponents>
|
|
||||||
<Component class="javax.swing.JTextArea" name="jTextArea3">
|
|
||||||
<Properties>
|
|
||||||
<Property name="editable" type="boolean" value="false"/>
|
|
||||||
<Property name="columns" type="int" value="20"/>
|
|
||||||
<Property name="rows" type="int" value="5"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
</SubComponents>
|
|
||||||
</Container>
|
|
||||||
</SubComponents>
|
|
||||||
</Container>
|
|
||||||
</SubComponents>
|
|
||||||
</Container>
|
|
||||||
<Component class="javax.swing.JButton" name="jButton1">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="GO"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
</SubComponents>
|
|
||||||
</Form>
|
|
@@ -1,342 +0,0 @@
|
|||||||
/*
|
|
||||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
||||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
|
||||||
*/
|
|
||||||
package presentation;
|
|
||||||
|
|
||||||
import java.util.Vector;
|
|
||||||
import javax.swing.DefaultComboBoxModel;
|
|
||||||
import metier.Jeu;
|
|
||||||
import metier.Personnage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author mohamed.boussemaha
|
|
||||||
*/
|
|
||||||
public class JFPlateau extends javax.swing.JFrame {
|
|
||||||
/**
|
|
||||||
* Creates new form JFPlateau
|
|
||||||
*/
|
|
||||||
|
|
||||||
Jeu jeu = new Jeu("Mon Jeu");
|
|
||||||
Personnage p1;
|
|
||||||
Personnage p2;
|
|
||||||
|
|
||||||
public JFPlateau() {
|
|
||||||
initComponents();
|
|
||||||
majTF();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void majTF() {
|
|
||||||
jCPerso1.setModel( new DefaultComboBoxModel(jeu.getLesPersonnagesVivants()));
|
|
||||||
jCPerso2.setModel( new DefaultComboBoxModel(jeu.getLesPersonnagesVivants()));
|
|
||||||
jCPerso1.setSelectedIndex(0);
|
|
||||||
jCPerso2.setSelectedIndex(0);
|
|
||||||
String perso = (String) jCPerso1.getSelectedItem();
|
|
||||||
String nomPerso = perso.split(": ")[1];
|
|
||||||
p1 = jeu.rechercherPerso(nomPerso);
|
|
||||||
jTextArea2.setText(p1.toString());
|
|
||||||
perso = (String) jCPerso2.getSelectedItem();
|
|
||||||
nomPerso = perso.split(": ")[1];
|
|
||||||
p2 = jeu.rechercherPerso(nomPerso);
|
|
||||||
jTextArea3.setText(p2.toString());
|
|
||||||
String ttPerso = "";
|
|
||||||
for (Personnage p : jeu.getLesPersonnages()) {
|
|
||||||
ttPerso += p+"\n";
|
|
||||||
}
|
|
||||||
jTextArea4.setText(ttPerso);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* This method is called from within the constructor to initialize the form.
|
|
||||||
* WARNING: Do NOT modify this code. The content of this method is always
|
|
||||||
* regenerated by the Form Editor.
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
|
||||||
private void initComponents() {
|
|
||||||
|
|
||||||
jPanel1 = new javax.swing.JPanel();
|
|
||||||
jPanel2 = new javax.swing.JPanel();
|
|
||||||
jLabel1 = new javax.swing.JLabel();
|
|
||||||
jScrollPane4 = new javax.swing.JScrollPane();
|
|
||||||
jTextArea4 = new javax.swing.JTextArea();
|
|
||||||
jLabel2 = new javax.swing.JLabel();
|
|
||||||
jPanel3 = new javax.swing.JPanel();
|
|
||||||
jCPerso1 = new javax.swing.JComboBox<>();
|
|
||||||
jCPerso2 = new javax.swing.JComboBox<>();
|
|
||||||
jPanel4 = new javax.swing.JPanel();
|
|
||||||
jLabel4 = new javax.swing.JLabel();
|
|
||||||
jScrollPane2 = new javax.swing.JScrollPane();
|
|
||||||
jTextArea2 = new javax.swing.JTextArea();
|
|
||||||
jPanel6 = new javax.swing.JPanel();
|
|
||||||
jLabel3 = new javax.swing.JLabel();
|
|
||||||
jScrollPane3 = new javax.swing.JScrollPane();
|
|
||||||
jTextArea3 = new javax.swing.JTextArea();
|
|
||||||
jButton1 = new javax.swing.JButton();
|
|
||||||
|
|
||||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
|
||||||
jPanel1.setLayout(jPanel1Layout);
|
|
||||||
jPanel1Layout.setHorizontalGroup(
|
|
||||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGap(0, 100, Short.MAX_VALUE)
|
|
||||||
);
|
|
||||||
jPanel1Layout.setVerticalGroup(
|
|
||||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGap(0, 100, Short.MAX_VALUE)
|
|
||||||
);
|
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
|
||||||
|
|
||||||
jPanel2.setBackground(new java.awt.Color(51, 0, 0));
|
|
||||||
jPanel2.setForeground(new java.awt.Color(51, 51, 51));
|
|
||||||
|
|
||||||
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/adj_1.jpg"))); // NOI18N
|
|
||||||
|
|
||||||
jTextArea4.setEditable(false);
|
|
||||||
jTextArea4.setColumns(20);
|
|
||||||
jTextArea4.setRows(5);
|
|
||||||
jScrollPane4.setViewportView(jTextArea4);
|
|
||||||
|
|
||||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
|
||||||
jPanel2.setLayout(jPanel2Layout);
|
|
||||||
jPanel2Layout.setHorizontalGroup(
|
|
||||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
|
||||||
.addContainerGap()
|
|
||||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
||||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
||||||
);
|
|
||||||
jPanel2Layout.setVerticalGroup(
|
|
||||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
|
||||||
.addContainerGap()
|
|
||||||
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
||||||
.addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE)
|
|
||||||
.addGap(12, 12, 12))
|
|
||||||
);
|
|
||||||
|
|
||||||
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/famille_1.jpg"))); // NOI18N
|
|
||||||
|
|
||||||
jCPerso1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
|
||||||
jCPerso1.addActionListener(new java.awt.event.ActionListener() {
|
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
jCPerso1ActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
jCPerso2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
|
||||||
jCPerso2.addActionListener(new java.awt.event.ActionListener() {
|
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
jCPerso2ActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
jPanel4.setBackground(new java.awt.Color(102, 0, 0));
|
|
||||||
|
|
||||||
jTextArea2.setEditable(false);
|
|
||||||
jTextArea2.setColumns(20);
|
|
||||||
jTextArea2.setRows(5);
|
|
||||||
jScrollPane2.setViewportView(jTextArea2);
|
|
||||||
|
|
||||||
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
|
|
||||||
jPanel4.setLayout(jPanel4Layout);
|
|
||||||
jPanel4Layout.setHorizontalGroup(
|
|
||||||
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(jPanel4Layout.createSequentialGroup()
|
|
||||||
.addContainerGap()
|
|
||||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addComponent(jScrollPane2)
|
|
||||||
.addGroup(jPanel4Layout.createSequentialGroup()
|
|
||||||
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addGap(0, 0, Short.MAX_VALUE)))
|
|
||||||
.addContainerGap())
|
|
||||||
);
|
|
||||||
jPanel4Layout.setVerticalGroup(
|
|
||||||
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
|
|
||||||
.addContainerGap()
|
|
||||||
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
|
|
||||||
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addContainerGap())
|
|
||||||
);
|
|
||||||
|
|
||||||
jPanel6.setBackground(new java.awt.Color(102, 0, 0));
|
|
||||||
|
|
||||||
jTextArea3.setEditable(false);
|
|
||||||
jTextArea3.setColumns(20);
|
|
||||||
jTextArea3.setRows(5);
|
|
||||||
jScrollPane3.setViewportView(jTextArea3);
|
|
||||||
|
|
||||||
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
|
|
||||||
jPanel6.setLayout(jPanel6Layout);
|
|
||||||
jPanel6Layout.setHorizontalGroup(
|
|
||||||
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(jPanel6Layout.createSequentialGroup()
|
|
||||||
.addContainerGap()
|
|
||||||
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
|
|
||||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
||||||
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 234, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addContainerGap())
|
|
||||||
);
|
|
||||||
jPanel6Layout.setVerticalGroup(
|
|
||||||
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
|
|
||||||
.addContainerGap()
|
|
||||||
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
||||||
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addContainerGap())
|
|
||||||
);
|
|
||||||
|
|
||||||
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
|
|
||||||
jPanel3.setLayout(jPanel3Layout);
|
|
||||||
jPanel3Layout.setHorizontalGroup(
|
|
||||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
|
||||||
.addContainerGap(10, Short.MAX_VALUE)
|
|
||||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
|
||||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
|
||||||
.addComponent(jCPerso1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
||||||
.addComponent(jCPerso2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
||||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
|
||||||
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addGap(18, 18, 18)
|
|
||||||
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
|
||||||
);
|
|
||||||
jPanel3Layout.setVerticalGroup(
|
|
||||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
|
||||||
.addContainerGap()
|
|
||||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
||||||
.addComponent(jCPerso1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addComponent(jCPerso2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
||||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
|
||||||
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
||||||
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
||||||
.addContainerGap(16, Short.MAX_VALUE))
|
|
||||||
);
|
|
||||||
|
|
||||||
jButton1.setText("GO");
|
|
||||||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
jButton1ActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
|
||||||
getContentPane().setLayout(layout);
|
|
||||||
layout.setHorizontalGroup(
|
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addGap(0, 0, Short.MAX_VALUE)
|
|
||||||
.addComponent(jLabel2)
|
|
||||||
.addGap(222, 222, 222))
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
||||||
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addGap(78, 78, 78))
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addGap(232, 232, 232)
|
|
||||||
.addComponent(jButton1)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
|
||||||
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addGap(22, 22, 22))
|
|
||||||
);
|
|
||||||
layout.setVerticalGroup(
|
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
|
||||||
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
|
||||||
.addGap(31, 31, 31)
|
|
||||||
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addGap(18, 18, 18)
|
|
||||||
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addGap(18, 18, 18)
|
|
||||||
.addComponent(jButton1)))
|
|
||||||
.addContainerGap(33, Short.MAX_VALUE))
|
|
||||||
);
|
|
||||||
|
|
||||||
pack();
|
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
|
||||||
|
|
||||||
private void jCPerso2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCPerso2ActionPerformed
|
|
||||||
String perso = (String) jCPerso2.getSelectedItem();
|
|
||||||
String nomPerso = perso.split(": ")[1];
|
|
||||||
|
|
||||||
p2 = jeu.rechercherPerso(nomPerso);
|
|
||||||
jTextArea3.setText(p2.toString());
|
|
||||||
}//GEN-LAST:event_jCPerso2ActionPerformed
|
|
||||||
|
|
||||||
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
|
||||||
p1.rencontrer(p2);
|
|
||||||
majTF();
|
|
||||||
}//GEN-LAST:event_jButton1ActionPerformed
|
|
||||||
private void jCPerso1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCPerso1ActionPerformed
|
|
||||||
String perso = (String) jCPerso1.getSelectedItem();
|
|
||||||
String nomPerso = perso.split(": ")[1];
|
|
||||||
|
|
||||||
p1 = jeu.rechercherPerso(nomPerso);
|
|
||||||
jTextArea2.setText(p1.toString());
|
|
||||||
}//GEN-LAST:event_jCPerso1ActionPerformed
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param args the command line arguments
|
|
||||||
*/
|
|
||||||
public static void main(String args[]) {
|
|
||||||
/* Set the Nimbus look and feel */
|
|
||||||
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
|
|
||||||
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
|
|
||||||
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
|
||||||
*/
|
|
||||||
try {
|
|
||||||
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
|
|
||||||
if ("Nimbus".equals(info.getName())) {
|
|
||||||
javax.swing.UIManager.setLookAndFeel(info.getClassName());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
|
|
||||||
java.util.logging.Logger.getLogger(JFPlateau.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
||||||
}
|
|
||||||
//</editor-fold>
|
|
||||||
|
|
||||||
//</editor-fold>
|
|
||||||
|
|
||||||
/* Create and display the form */
|
|
||||||
java.awt.EventQueue.invokeLater(() -> {
|
|
||||||
new JFPlateau().setVisible(true);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
|
||||||
private javax.swing.JButton jButton1;
|
|
||||||
private javax.swing.JComboBox<String> jCPerso1;
|
|
||||||
private javax.swing.JComboBox<String> jCPerso2;
|
|
||||||
private javax.swing.JLabel jLabel1;
|
|
||||||
private javax.swing.JLabel jLabel2;
|
|
||||||
private javax.swing.JLabel jLabel3;
|
|
||||||
private javax.swing.JLabel jLabel4;
|
|
||||||
private javax.swing.JPanel jPanel1;
|
|
||||||
private javax.swing.JPanel jPanel2;
|
|
||||||
private javax.swing.JPanel jPanel3;
|
|
||||||
private javax.swing.JPanel jPanel4;
|
|
||||||
private javax.swing.JPanel jPanel6;
|
|
||||||
private javax.swing.JScrollPane jScrollPane2;
|
|
||||||
private javax.swing.JScrollPane jScrollPane3;
|
|
||||||
private javax.swing.JScrollPane jScrollPane4;
|
|
||||||
private javax.swing.JTextArea jTextArea2;
|
|
||||||
private javax.swing.JTextArea jTextArea3;
|
|
||||||
private javax.swing.JTextArea jTextArea4;
|
|
||||||
// End of variables declaration//GEN-END:variables
|
|
||||||
}
|
|
Reference in New Issue
Block a user