Compare commits
	
		
			1 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					7a3546c81c | 
@@ -37,7 +37,7 @@ includes=**
 | 
			
		||||
jar.compress=false
 | 
			
		||||
javac.classpath=
 | 
			
		||||
# Space-separated list of extra javac options
 | 
			
		||||
javac.compilerargs=
 | 
			
		||||
javac.compilerargs=\ --enable-preview
 | 
			
		||||
javac.deprecation=false
 | 
			
		||||
javac.external.vm=true
 | 
			
		||||
javac.modulepath=
 | 
			
		||||
@@ -71,7 +71,7 @@ jlink.additionalmodules=
 | 
			
		||||
jlink.additionalparam=
 | 
			
		||||
jlink.launcher=true
 | 
			
		||||
jlink.launcher.name=JDR
 | 
			
		||||
main.class=jdr.JDR
 | 
			
		||||
main.class=presentation.JFPlateau
 | 
			
		||||
manifest.file=manifest.mf
 | 
			
		||||
meta.inf.dir=${src.dir}/META-INF
 | 
			
		||||
mkdist.disabled=false
 | 
			
		||||
@@ -82,7 +82,7 @@ run.classpath=\
 | 
			
		||||
# 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.
 | 
			
		||||
# To set system properties for unit tests define test-sys-prop.name=value:
 | 
			
		||||
run.jvmargs=
 | 
			
		||||
run.jvmargs=\ --enable-preview
 | 
			
		||||
run.modulepath=\
 | 
			
		||||
    ${javac.modulepath}
 | 
			
		||||
run.test.classpath=\
 | 
			
		||||
 
 | 
			
		||||
@@ -1,292 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8" ?>
 | 
			
		||||
 | 
			
		||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
 | 
			
		||||
  <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" alignment="1" attributes="0">
 | 
			
		||||
              <EmptySpace min="-2" pref="79" max="-2" attributes="0"/>
 | 
			
		||||
              <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
              <EmptySpace min="-2" pref="60" max="-2" attributes="0"/>
 | 
			
		||||
              <Component id="jPanel2" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
              <EmptySpace pref="257" max="32767" attributes="0"/>
 | 
			
		||||
              <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
              <EmptySpace min="-2" pref="481" 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="0" attributes="0">
 | 
			
		||||
                  <Group type="102" attributes="0">
 | 
			
		||||
                      <EmptySpace min="-2" pref="64" max="-2" attributes="0"/>
 | 
			
		||||
                      <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                  </Group>
 | 
			
		||||
                  <Group type="102" alignment="0" attributes="0">
 | 
			
		||||
                      <EmptySpace max="-2" attributes="0"/>
 | 
			
		||||
                      <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                  </Group>
 | 
			
		||||
              </Group>
 | 
			
		||||
              <EmptySpace pref="176" max="32767" attributes="0"/>
 | 
			
		||||
          </Group>
 | 
			
		||||
          <Group type="102" alignment="1" attributes="0">
 | 
			
		||||
              <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
 | 
			
		||||
              <Component id="jPanel2" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
              <EmptySpace max="32767" attributes="0"/>
 | 
			
		||||
          </Group>
 | 
			
		||||
      </Group>
 | 
			
		||||
    </DimensionLayout>
 | 
			
		||||
  </Layout>
 | 
			
		||||
  <SubComponents>
 | 
			
		||||
    <Component class="javax.swing.JLabel" name="jLabel1">
 | 
			
		||||
    </Component>
 | 
			
		||||
    <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>
 | 
			
		||||
        <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
 | 
			
		||||
          <Color blue="f2" green="f2" red="f2" type="rgb"/>
 | 
			
		||||
        </Property>
 | 
			
		||||
      </Properties>
 | 
			
		||||
 | 
			
		||||
      <Layout>
 | 
			
		||||
        <DimensionLayout dim="0">
 | 
			
		||||
          <Group type="103" groupAlignment="0" attributes="0">
 | 
			
		||||
              <Group type="102" alignment="0" attributes="0">
 | 
			
		||||
                  <EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
 | 
			
		||||
                  <Group type="103" groupAlignment="0" attributes="0">
 | 
			
		||||
                      <Component id="jScrollPane1" pref="0" max="32767" attributes="0"/>
 | 
			
		||||
                      <Component id="jLabel2" max="32767" attributes="0"/>
 | 
			
		||||
                  </Group>
 | 
			
		||||
                  <EmptySpace min="-2" pref="25" 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="36" max="-2" attributes="0"/>
 | 
			
		||||
                  <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                  <EmptySpace pref="29" max="32767" attributes="0"/>
 | 
			
		||||
                  <Component id="jScrollPane1" min="-2" pref="251" max="-2" attributes="0"/>
 | 
			
		||||
                  <EmptySpace max="-2" attributes="0"/>
 | 
			
		||||
              </Group>
 | 
			
		||||
          </Group>
 | 
			
		||||
        </DimensionLayout>
 | 
			
		||||
      </Layout>
 | 
			
		||||
      <SubComponents>
 | 
			
		||||
        <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/adj_1.jpg"/>
 | 
			
		||||
            </Property>
 | 
			
		||||
          </Properties>
 | 
			
		||||
        </Component>
 | 
			
		||||
        <Container class="javax.swing.JScrollPane" name="jScrollPane1">
 | 
			
		||||
          <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="jTextAreaPerso">
 | 
			
		||||
              <Properties>
 | 
			
		||||
                <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="jPanel2">
 | 
			
		||||
      <Properties>
 | 
			
		||||
        <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
 | 
			
		||||
          <Color blue="0" green="99" 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" alignment="0" attributes="0">
 | 
			
		||||
                          <EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
 | 
			
		||||
                          <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                      </Group>
 | 
			
		||||
                      <Group type="102" alignment="0" attributes="0">
 | 
			
		||||
                          <EmptySpace min="-2" pref="122" 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="70" max="-2" attributes="0"/>
 | 
			
		||||
                          <Component id="jPanel3" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                      </Group>
 | 
			
		||||
                  </Group>
 | 
			
		||||
                  <EmptySpace pref="27" 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="41" max="-2" attributes="0"/>
 | 
			
		||||
                  <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                  <EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
 | 
			
		||||
                  <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                  <EmptySpace pref="182" max="32767" attributes="0"/>
 | 
			
		||||
                  <Component id="jPanel3" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
              </Group>
 | 
			
		||||
          </Group>
 | 
			
		||||
        </DimensionLayout>
 | 
			
		||||
      </Layout>
 | 
			
		||||
      <SubComponents>
 | 
			
		||||
        <Component class="javax.swing.JLabel" name="jLabel3">
 | 
			
		||||
          <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>
 | 
			
		||||
        <Component class="javax.swing.JLabel" name="jLabel4">
 | 
			
		||||
          <Properties>
 | 
			
		||||
            <Property name="text" type="java.lang.String" value="Choix des personnages"/>
 | 
			
		||||
          </Properties>
 | 
			
		||||
        </Component>
 | 
			
		||||
        <Container class="javax.swing.JPanel" name="jPanel3">
 | 
			
		||||
          <Properties>
 | 
			
		||||
            <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
 | 
			
		||||
              <Color blue="ff" green="ff" red="cc" type="rgb"/>
 | 
			
		||||
            </Property>
 | 
			
		||||
          </Properties>
 | 
			
		||||
 | 
			
		||||
          <Layout>
 | 
			
		||||
            <DimensionLayout dim="0">
 | 
			
		||||
              <Group type="103" groupAlignment="0" attributes="0">
 | 
			
		||||
                  <Group type="102" alignment="0" attributes="0">
 | 
			
		||||
                      <EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
 | 
			
		||||
                      <Group type="103" groupAlignment="0" attributes="0">
 | 
			
		||||
                          <Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                          <Component id="jPanel4" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                      </Group>
 | 
			
		||||
                      <EmptySpace pref="179" max="32767" attributes="0"/>
 | 
			
		||||
                      <Group type="103" groupAlignment="0" attributes="0">
 | 
			
		||||
                          <Group type="102" alignment="1" attributes="0">
 | 
			
		||||
                              <Component id="jComboBox2" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                              <EmptySpace min="-2" pref="59" max="-2" attributes="0"/>
 | 
			
		||||
                          </Group>
 | 
			
		||||
                          <Group type="102" alignment="1" attributes="0">
 | 
			
		||||
                              <Component id="jPanel5" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                              <EmptySpace min="-2" pref="21" 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 min="-2" pref="23" max="-2" attributes="0"/>
 | 
			
		||||
                      <Group type="103" groupAlignment="3" attributes="0">
 | 
			
		||||
                          <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                          <Component id="jComboBox2" alignment="3" min="-2" max="-2" attributes="0"/>
 | 
			
		||||
                      </Group>
 | 
			
		||||
                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
 | 
			
		||||
                      <Group type="103" groupAlignment="0" attributes="0">
 | 
			
		||||
                          <Component id="jPanel4" max="32767" attributes="0"/>
 | 
			
		||||
                          <Component id="jPanel5" max="32767" attributes="0"/>
 | 
			
		||||
                      </Group>
 | 
			
		||||
                      <EmptySpace max="-2" attributes="0"/>
 | 
			
		||||
                  </Group>
 | 
			
		||||
              </Group>
 | 
			
		||||
            </DimensionLayout>
 | 
			
		||||
          </Layout>
 | 
			
		||||
          <SubComponents>
 | 
			
		||||
            <Component class="javax.swing.JComboBox" name="jComboBox1">
 | 
			
		||||
              <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.JComboBox" name="jComboBox2">
 | 
			
		||||
              <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>
 | 
			
		||||
            <Container class="javax.swing.JPanel" name="jPanel4">
 | 
			
		||||
 | 
			
		||||
              <Layout>
 | 
			
		||||
                <DimensionLayout dim="0">
 | 
			
		||||
                  <Group type="103" groupAlignment="0" attributes="0">
 | 
			
		||||
                      <EmptySpace min="0" pref="165" max="32767" attributes="0"/>
 | 
			
		||||
                  </Group>
 | 
			
		||||
                </DimensionLayout>
 | 
			
		||||
                <DimensionLayout dim="1">
 | 
			
		||||
                  <Group type="103" groupAlignment="0" attributes="0">
 | 
			
		||||
                      <EmptySpace min="0" pref="154" max="32767" attributes="0"/>
 | 
			
		||||
                  </Group>
 | 
			
		||||
                </DimensionLayout>
 | 
			
		||||
              </Layout>
 | 
			
		||||
            </Container>
 | 
			
		||||
            <Container class="javax.swing.JPanel" name="jPanel5">
 | 
			
		||||
 | 
			
		||||
              <Layout>
 | 
			
		||||
                <DimensionLayout dim="0">
 | 
			
		||||
                  <Group type="103" groupAlignment="0" attributes="0">
 | 
			
		||||
                      <EmptySpace min="0" pref="150" max="32767" attributes="0"/>
 | 
			
		||||
                  </Group>
 | 
			
		||||
                </DimensionLayout>
 | 
			
		||||
                <DimensionLayout dim="1">
 | 
			
		||||
                  <Group type="103" groupAlignment="0" attributes="0">
 | 
			
		||||
                      <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
 | 
			
		||||
                  </Group>
 | 
			
		||||
                </DimensionLayout>
 | 
			
		||||
              </Layout>
 | 
			
		||||
            </Container>
 | 
			
		||||
          </SubComponents>
 | 
			
		||||
        </Container>
 | 
			
		||||
      </SubComponents>
 | 
			
		||||
    </Container>
 | 
			
		||||
  </SubComponents>
 | 
			
		||||
</Form>
 | 
			
		||||
@@ -1,252 +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;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * @author medhi.rodrigues
 | 
			
		||||
 */
 | 
			
		||||
public class JFPlateau extends javax.swing.JFrame {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Creates new form JFPlateau
 | 
			
		||||
     */
 | 
			
		||||
    public JFPlateau() {
 | 
			
		||||
        initComponents();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 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() {
 | 
			
		||||
 | 
			
		||||
        jLabel1 = new javax.swing.JLabel();
 | 
			
		||||
        jPanel1 = new javax.swing.JPanel();
 | 
			
		||||
        jLabel2 = new javax.swing.JLabel();
 | 
			
		||||
        jScrollPane1 = new javax.swing.JScrollPane();
 | 
			
		||||
        jTextAreaPerso = new javax.swing.JTextArea();
 | 
			
		||||
        jPanel2 = new javax.swing.JPanel();
 | 
			
		||||
        jLabel3 = new javax.swing.JLabel();
 | 
			
		||||
        jLabel4 = new javax.swing.JLabel();
 | 
			
		||||
        jPanel3 = new javax.swing.JPanel();
 | 
			
		||||
        jComboBox1 = new javax.swing.JComboBox<>();
 | 
			
		||||
        jComboBox2 = new javax.swing.JComboBox<>();
 | 
			
		||||
        jPanel4 = new javax.swing.JPanel();
 | 
			
		||||
        jPanel5 = new javax.swing.JPanel();
 | 
			
		||||
 | 
			
		||||
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 | 
			
		||||
 | 
			
		||||
        jPanel1.setBackground(new java.awt.Color(102, 0, 0));
 | 
			
		||||
        jPanel1.setForeground(new java.awt.Color(242, 242, 242));
 | 
			
		||||
 | 
			
		||||
        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/adj_1.jpg"))); // NOI18N
 | 
			
		||||
 | 
			
		||||
        jTextAreaPerso.setColumns(20);
 | 
			
		||||
        jTextAreaPerso.setRows(5);
 | 
			
		||||
        jScrollPane1.setViewportView(jTextAreaPerso);
 | 
			
		||||
 | 
			
		||||
        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
 | 
			
		||||
        jPanel1.setLayout(jPanel1Layout);
 | 
			
		||||
        jPanel1Layout.setHorizontalGroup(
 | 
			
		||||
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGroup(jPanel1Layout.createSequentialGroup()
 | 
			
		||||
                .addGap(27, 27, 27)
 | 
			
		||||
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
 | 
			
		||||
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 | 
			
		||||
                .addGap(25, 25, 25))
 | 
			
		||||
        );
 | 
			
		||||
        jPanel1Layout.setVerticalGroup(
 | 
			
		||||
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGroup(jPanel1Layout.createSequentialGroup()
 | 
			
		||||
                .addGap(36, 36, 36)
 | 
			
		||||
                .addComponent(jLabel2)
 | 
			
		||||
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)
 | 
			
		||||
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
 | 
			
		||||
                .addContainerGap())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        jPanel2.setBackground(new java.awt.Color(255, 153, 0));
 | 
			
		||||
 | 
			
		||||
        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/famille_1.jpg"))); // NOI18N
 | 
			
		||||
 | 
			
		||||
        jLabel4.setText("Choix des personnages");
 | 
			
		||||
 | 
			
		||||
        jPanel3.setBackground(new java.awt.Color(204, 255, 255));
 | 
			
		||||
 | 
			
		||||
        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
 | 
			
		||||
 | 
			
		||||
        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
 | 
			
		||||
 | 
			
		||||
        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
 | 
			
		||||
        jPanel4.setLayout(jPanel4Layout);
 | 
			
		||||
        jPanel4Layout.setHorizontalGroup(
 | 
			
		||||
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGap(0, 165, Short.MAX_VALUE)
 | 
			
		||||
        );
 | 
			
		||||
        jPanel4Layout.setVerticalGroup(
 | 
			
		||||
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGap(0, 154, Short.MAX_VALUE)
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
 | 
			
		||||
        jPanel5.setLayout(jPanel5Layout);
 | 
			
		||||
        jPanel5Layout.setHorizontalGroup(
 | 
			
		||||
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGap(0, 150, Short.MAX_VALUE)
 | 
			
		||||
        );
 | 
			
		||||
        jPanel5Layout.setVerticalGroup(
 | 
			
		||||
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGap(0, 0, Short.MAX_VALUE)
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
 | 
			
		||||
        jPanel3.setLayout(jPanel3Layout);
 | 
			
		||||
        jPanel3Layout.setHorizontalGroup(
 | 
			
		||||
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGroup(jPanel3Layout.createSequentialGroup()
 | 
			
		||||
                .addGap(30, 30, 30)
 | 
			
		||||
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 | 
			
		||||
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 | 
			
		||||
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 179, Short.MAX_VALUE)
 | 
			
		||||
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
 | 
			
		||||
                        .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 | 
			
		||||
                        .addGap(59, 59, 59))
 | 
			
		||||
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
 | 
			
		||||
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 | 
			
		||||
                        .addGap(21, 21, 21))))
 | 
			
		||||
        );
 | 
			
		||||
        jPanel3Layout.setVerticalGroup(
 | 
			
		||||
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGroup(jPanel3Layout.createSequentialGroup()
 | 
			
		||||
                .addGap(23, 23, 23)
 | 
			
		||||
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 | 
			
		||||
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 | 
			
		||||
                    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 | 
			
		||||
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 | 
			
		||||
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 | 
			
		||||
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 | 
			
		||||
                .addContainerGap())
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
 | 
			
		||||
        jPanel2.setLayout(jPanel2Layout);
 | 
			
		||||
        jPanel2Layout.setHorizontalGroup(
 | 
			
		||||
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGroup(jPanel2Layout.createSequentialGroup()
 | 
			
		||||
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
                    .addGroup(jPanel2Layout.createSequentialGroup()
 | 
			
		||||
                        .addGap(32, 32, 32)
 | 
			
		||||
                        .addComponent(jLabel4))
 | 
			
		||||
                    .addGroup(jPanel2Layout.createSequentialGroup()
 | 
			
		||||
                        .addGap(122, 122, 122)
 | 
			
		||||
                        .addComponent(jLabel3))
 | 
			
		||||
                    .addGroup(jPanel2Layout.createSequentialGroup()
 | 
			
		||||
                        .addGap(70, 70, 70)
 | 
			
		||||
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
 | 
			
		||||
                .addContainerGap(27, Short.MAX_VALUE))
 | 
			
		||||
        );
 | 
			
		||||
        jPanel2Layout.setVerticalGroup(
 | 
			
		||||
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGroup(jPanel2Layout.createSequentialGroup()
 | 
			
		||||
                .addGap(41, 41, 41)
 | 
			
		||||
                .addComponent(jLabel3)
 | 
			
		||||
                .addGap(26, 26, 26)
 | 
			
		||||
                .addComponent(jLabel4)
 | 
			
		||||
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 182, Short.MAX_VALUE)
 | 
			
		||||
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
 | 
			
		||||
        getContentPane().setLayout(layout);
 | 
			
		||||
        layout.setHorizontalGroup(
 | 
			
		||||
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
 | 
			
		||||
                .addGap(79, 79, 79)
 | 
			
		||||
                .addComponent(jLabel1)
 | 
			
		||||
                .addGap(60, 60, 60)
 | 
			
		||||
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 | 
			
		||||
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 257, Short.MAX_VALUE)
 | 
			
		||||
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 | 
			
		||||
                .addGap(481, 481, 481))
 | 
			
		||||
        );
 | 
			
		||||
        layout.setVerticalGroup(
 | 
			
		||||
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
            .addGroup(layout.createSequentialGroup()
 | 
			
		||||
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 | 
			
		||||
                    .addGroup(layout.createSequentialGroup()
 | 
			
		||||
                        .addGap(64, 64, 64)
 | 
			
		||||
                        .addComponent(jLabel1))
 | 
			
		||||
                    .addGroup(layout.createSequentialGroup()
 | 
			
		||||
                        .addContainerGap()
 | 
			
		||||
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
 | 
			
		||||
                .addContainerGap(176, Short.MAX_VALUE))
 | 
			
		||||
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
 | 
			
		||||
                .addGap(0, 0, Short.MAX_VALUE)
 | 
			
		||||
                .addComponent(jPanel2, 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
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @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(JFPlateau.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
 | 
			
		||||
        } catch (InstantiationException ex) {
 | 
			
		||||
            java.util.logging.Logger.getLogger(JFPlateau.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
 | 
			
		||||
        } catch (IllegalAccessException ex) {
 | 
			
		||||
            java.util.logging.Logger.getLogger(JFPlateau.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
 | 
			
		||||
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
 | 
			
		||||
            java.util.logging.Logger.getLogger(JFPlateau.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 JFPlateau().setVisible(true);
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Variables declaration - do not modify//GEN-BEGIN:variables
 | 
			
		||||
    private javax.swing.JComboBox<String> jComboBox1;
 | 
			
		||||
    private javax.swing.JComboBox<String> jComboBox2;
 | 
			
		||||
    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 jPanel5;
 | 
			
		||||
    private javax.swing.JScrollPane jScrollPane1;
 | 
			
		||||
    private javax.swing.JTextArea jTextAreaPerso;
 | 
			
		||||
    // End of variables declaration//GEN-END:variables
 | 
			
		||||
}
 | 
			
		||||
@@ -4,7 +4,10 @@
 | 
			
		||||
 */
 | 
			
		||||
package jeuderole;
 | 
			
		||||
 | 
			
		||||
import metier.Jeu;
 | 
			
		||||
import metier.Guerrier;
 | 
			
		||||
import metier.Personnage;
 | 
			
		||||
import metier.Sorcier;
 | 
			
		||||
import metier.Voleur;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Test Classe Jeu
 | 
			
		||||
@@ -16,22 +19,14 @@ public class JeuDeRolePolymorphisme {
 | 
			
		||||
     * @param args the command line arguments
 | 
			
		||||
     */
 | 
			
		||||
    public static void main(String[] args) {
 | 
			
		||||
         /**
 | 
			
		||||
        mesPersonnages[0].saluer(mesPersonnages[1]);
 | 
			
		||||
        mesPersonnages[2].saluer(mesPersonnages[0]);
 | 
			
		||||
        mesPersonnages[1].saluer(mesPersonnages[2]);**/
 | 
			
		||||
                
 | 
			
		||||
    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);            
 | 
			
		||||
        
 | 
			
		||||
        Jeu role = new Jeu();
 | 
			
		||||
        System.out.println(role.getmesPersonnages());
 | 
			
		||||
        System.out.println(".................");
 | 
			
		||||
        System.out.println(role);
 | 
			
		||||
        System.out.println(role.rechercherPerso("Barbare"));
 | 
			
		||||
        System.out.println(role.rechercherPerso("Panoramix"));
 | 
			
		||||
        System.out.println(".................");
 | 
			
		||||
        System.out.println(role.rechercherPerso("Barbare").rencontrer(role.rechercherPerso("Panoramix")));
 | 
			
		||||
        System.out.println(role.rechercherPerso("Raptout").rencontrer(role.rechercherPerso("Barbare")));
 | 
			
		||||
         
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
    mesPersonnages[0].saluer(mesPersonnages[1]);
 | 
			
		||||
    mesPersonnages[2].saluer(mesPersonnages[0]);
 | 
			
		||||
    mesPersonnages[1].saluer(mesPersonnages[2]);
 | 
			
		||||
     }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,50 +1,60 @@
 | 
			
		||||
package metier;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 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.Objects;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * @author emile.lalorcey
 | 
			
		||||
 * @author mohamed.boussemaha
 | 
			
		||||
 */
 | 
			
		||||
public class Enigme {
 | 
			
		||||
    String question;
 | 
			
		||||
    String reponse;
 | 
			
		||||
    
 | 
			
		||||
    //Constructeurs
 | 
			
		||||
    /**
 | 
			
		||||
     * Cette fonction est un constructeur de Enigme
 | 
			
		||||
     * @param Question
 | 
			
		||||
     * @param Reponse 
 | 
			
		||||
     */
 | 
			
		||||
    public Enigme (String Question , String Reponse){
 | 
			
		||||
        this.question = Question;
 | 
			
		||||
        this.reponse = Reponse;
 | 
			
		||||
 | 
			
		||||
    private String question;
 | 
			
		||||
    private String 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;
 | 
			
		||||
 | 
			
		||||
    public void setQuestion(String question) {
 | 
			
		||||
        this.question = question;
 | 
			
		||||
    }
 | 
			
		||||
    //Setteur
 | 
			
		||||
    public void SetQuestion(String Question){
 | 
			
		||||
        this.question = Question;
 | 
			
		||||
 | 
			
		||||
    public String getReponse() {
 | 
			
		||||
        return reponse;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public void SetReponse(String Reponse){
 | 
			
		||||
        this.reponse = 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 + '\'' + '}';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -2,6 +2,7 @@ package metier;
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
import javax.swing.Icon;
 | 
			
		||||
import javax.swing.JOptionPane;
 | 
			
		||||
import static javax.swing.JOptionPane.WARNING_MESSAGE;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Classe Guerrier, hérite de la classe Personnage
 | 
			
		||||
@@ -11,7 +12,7 @@ import javax.swing.JOptionPane;
 | 
			
		||||
public class Guerrier extends Personnage{
 | 
			
		||||
    // Variable membre
 | 
			
		||||
    private String arme;
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Valorisation des variables membres
 | 
			
		||||
     * @param nom       nom du guerrier
 | 
			
		||||
@@ -32,7 +33,11 @@ public class Guerrier extends Personnage{
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return super.toString() + "\tArme=" + arme;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public int hashCode() {
 | 
			
		||||
        int hash = 7;
 | 
			
		||||
@@ -64,7 +69,7 @@ public class Guerrier extends Personnage{
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Get the value of arme
 | 
			
		||||
     *
 | 
			
		||||
@@ -73,7 +78,7 @@ public class Guerrier extends Personnage{
 | 
			
		||||
    public String getArme() {
 | 
			
		||||
        return arme;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Set the value of arme
 | 
			
		||||
     *
 | 
			
		||||
@@ -83,45 +88,55 @@ public class Guerrier extends Personnage{
 | 
			
		||||
        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 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);
 | 
			
		||||
        String message = "Bonjour " + unPerso.getNom() + ", sauve-toi vite avant que je ne te frappe avec mon arme redoutable !";
 | 
			
		||||
        JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
 | 
			
		||||
        return message;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @param unPerso
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public String rencontrer(Personnage unPerso) {
 | 
			
		||||
        this.saluer(unPerso); //appelle de la contion saluer
 | 
			
		||||
        int pts_attaque = 0;
 | 
			
		||||
        int pts_defense = 0;
 | 
			
		||||
        do{
 | 
			
		||||
            pts_attaque = Jeu.genererNbAleatoire(0, 10);
 | 
			
		||||
            pts_defense = Jeu.genererNbAleatoire(0, 10);
 | 
			
		||||
        }while(pts_attaque ==  pts_defense);
 | 
			
		||||
        String titre = this.getNom() + " rencontre " + unPerso.getNom() + ": d<>fi d<>s";
 | 
			
		||||
        String message = "Es-tu pr<70>t <20><> me combattre " + unPerso.getNom() + "?";
 | 
			
		||||
        JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
 | 
			
		||||
        Icon img = new javax.swing.ImageIcon(getClass().getResource("/img/des.jpg"));
 | 
			
		||||
        JOptionPane.showMessageDialog( null, message, titre, WARNING_MESSAGE, img);
 | 
			
		||||
        
 | 
			
		||||
        if(pts_attaque > pts_defense){
 | 
			
		||||
            unPerso.varierDureeVie(-1);
 | 
			
		||||
            unPerso.varierEnergie(-2);
 | 
			
		||||
            return "Tu as perdu, Tu es maintenant à "+unPerso.getEnergie()+ "energie et "+unPerso.getDureeVie()+ " PV !!";
 | 
			
		||||
        }else{ // pts_defense > pts_attaque
 | 
			
		||||
            this.varierEnergie(-1);
 | 
			
		||||
            unPerso.varierEnergie(2);
 | 
			
		||||
            return "Mon energie est à "+ this.getEnergie() + "et toi qui m'a vaincu tu es à "+ unPerso.getEnergie();
 | 
			
		||||
        }  
 | 
			
		||||
        int scoreAttaquant = Jeu.genererNbAleatoire(1, 6);
 | 
			
		||||
        int scoreAttaque = Jeu.genererNbAleatoire(1, 6);
 | 
			
		||||
        
 | 
			
		||||
        if (scoreAttaquant == scoreAttaque) {
 | 
			
		||||
            message = "Egalit<EFBFBD> ! Vous avez tous les deux lanc<6E> " + scoreAttaquant + ". Rejoue vite !";
 | 
			
		||||
            JOptionPane.showMessageDialog(null, message, titre, JOptionPane.WARNING_MESSAGE);
 | 
			
		||||
        } else {
 | 
			
		||||
            String gagnant = scoreAttaquant > scoreAttaque ? this.getNom() : unPerso.getNom();
 | 
			
		||||
            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,94 +4,131 @@
 | 
			
		||||
 */
 | 
			
		||||
package metier;
 | 
			
		||||
 | 
			
		||||
import java.util.Vector;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * @author emile.lalorcey
 | 
			
		||||
 * @author mohamed.boussemaha
 | 
			
		||||
 */
 | 
			
		||||
public class Jeu {
 | 
			
		||||
    String nomJeu = "Jeu de Role" ;
 | 
			
		||||
    Personnage[] mesPersonnages = new Personnage[7];
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    /********* Constructeurs ********/
 | 
			
		||||
    /*****Attributs*****/
 | 
			
		||||
    private final String nomJeu;
 | 
			
		||||
    private Personnage[] lesPersonnages;
 | 
			
		||||
 | 
			
		||||
    /*****Constructeur*****/
 | 
			
		||||
    public Jeu(String nomJeu) {
 | 
			
		||||
        this.nomJeu = nomJeu;
 | 
			
		||||
        this.chargerLesPersonnages();         
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*****Accesseur*****/
 | 
			
		||||
    public String getNomJeu() {
 | 
			
		||||
        return this.nomJeu;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public Personnage[] getLesPersonnages() {
 | 
			
		||||
        return this.lesPersonnages;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*****Mutateurs*****/
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
    * Constructeur de Jeu
 | 
			
		||||
    */ 
 | 
			
		||||
    public Jeu(){
 | 
			
		||||
        this.chargerLesPersonnages();
 | 
			
		||||
     * 
 | 
			
		||||
     * @param lesPersonnages 
 | 
			
		||||
     */
 | 
			
		||||
    public void setLesPersonnages(Personnage[] lesPersonnages) {
 | 
			
		||||
        this.lesPersonnages = lesPersonnages;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*****M<>thodes*****/
 | 
			
		||||
    private void chargerLesPersonnages() {
 | 
			
		||||
        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")
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        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
 | 
			
		||||
        }
 | 
			
		||||
    
 | 
			
		||||
    /********* Guetteur ********/
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Getteur de mes personnages
 | 
			
		||||
     * @return  mes personnages
 | 
			
		||||
     */
 | 
			
		||||
    public Personnage[] getmesPersonnages(){
 | 
			
		||||
        return this.mesPersonnages;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    /********* Setteurs ********/
 | 
			
		||||
    
 | 
			
		||||
        
 | 
			
		||||
    /********* Fonctions ********/
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Crée les personnages
 | 
			
		||||
     * 
 | 
			
		||||
     * @return 
 | 
			
		||||
     */
 | 
			
		||||
    private void chargerLesPersonnages(){
 | 
			
		||||
        mesPersonnages = new Personnage[7];
 | 
			
		||||
        mesPersonnages[0] = new Guerrier("Barbare", "", 6, 4, "Hache");
 | 
			
		||||
        mesPersonnages[5] = new Guerrier("Garren","Guerrier08.jpg" , 0, 0, "Gourdin");
 | 
			
		||||
        mesPersonnages[6] = new Guerrier("Hellen","Guerrier08.jpg" , 0, 0, "Gourdin");
 | 
			
		||||
        mesPersonnages[3] = new Personnage("Gaelle", "Barbare04.jpg", 0, 0); 
 | 
			
		||||
        mesPersonnages[1] = new Voleur("Raptout", "", 2, 4, "Marteau");
 | 
			
		||||
        mesPersonnages[2] = new Sorcier("Panoramix", "", 10, 5, "Baguette de laurier");
 | 
			
		||||
        mesPersonnages[4] = new Sorcier("Jinx","Barbare04.jpg",0,0, "Bâton");
 | 
			
		||||
    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];
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Cette méthode sert à affiché les différents personnages avec leurs affectations
 | 
			
		||||
     * @return String tout les personnages avec leurs capacités
 | 
			
		||||
     * 
 | 
			
		||||
     * @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
 | 
			
		||||
    public String toString(){
 | 
			
		||||
        String mesPersos = "";
 | 
			
		||||
        for (int i = 0; i < mesPersonnages.length; i++){
 | 
			
		||||
            mesPersos += mesPersonnages[i] + "\n" + "\n";
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        String affichage = "";
 | 
			
		||||
        for (Personnage personnage : this.lesPersonnages) {
 | 
			
		||||
            affichage += personnage + "\n";
 | 
			
		||||
        }
 | 
			
		||||
        return mesPersos;
 | 
			
		||||
        return affichage;
 | 
			
		||||
    }
 | 
			
		||||
     
 | 
			
		||||
    /**
 | 
			
		||||
     * 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.length && !trouver){
 | 
			
		||||
            trouver = (this.mesPersonnages[indice].getNom().equals(n));
 | 
			
		||||
            indice++;
 | 
			
		||||
        }
 | 
			
		||||
        if(trouver){
 | 
			
		||||
            indice--;
 | 
			
		||||
            return this.mesPersonnages[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) {
 | 
			
		||||
        return min + (int)(Math.random() * ((max - min) + 1));
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
@@ -77,10 +77,7 @@ public class Personnage {
 | 
			
		||||
        if (!Objects.equals(this.nom, other.nom)) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        if (!Objects.equals(this.img, other.img)) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
        return Objects.equals(this.img, other.img);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -156,6 +153,11 @@ public class Personnage {
 | 
			
		||||
        this.nom = nom;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @param unPerso
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public String rencontrer(Personnage unPerso) {
 | 
			
		||||
        String titre = this.getNom() + " rencontre " + unPerso.getNom();
 | 
			
		||||
        String message = "Bonjour " + unPerso.getNom() + " !";
 | 
			
		||||
@@ -165,38 +167,33 @@ public class Personnage {
 | 
			
		||||
        return message;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public String saluer(Personnage unPerso){
 | 
			
		||||
    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);
 | 
			
		||||
        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;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Cette fonction permet de faire varier l'energie de l'objet émetteur
 | 
			
		||||
     * @param nb l'énergie à faire varier de this.energie 
 | 
			
		||||
     */
 | 
			
		||||
    public void varierEnergie(int nb){
 | 
			
		||||
        if ( (this.energie+ nb) >= 0){
 | 
			
		||||
    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;
 | 
			
		||||
        }
 | 
			
		||||
        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);
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Cette fonction permet de faire varier la vie de l'objet émetteur
 | 
			
		||||
     * @param nb l'énergie à faire varier de this.dureeVie 
 | 
			
		||||
     */    
 | 
			
		||||
    public void varierDureeVie(int nb){
 | 
			
		||||
        if ( (this.dureeVie+ nb) >= 0){
 | 
			
		||||
    public void varierDureeVie(int nb) {
 | 
			
		||||
        if(this.dureeVie + nb <= 0) {
 | 
			
		||||
            this.dureeVie = 0;
 | 
			
		||||
            JOptionPane.showMessageDialog(null, "Fin", this.getNom() + "est mort", JOptionPane.ABORT);
 | 
			
		||||
        } else {
 | 
			
		||||
            
 | 
			
		||||
            this.dureeVie += nb;
 | 
			
		||||
        }
 | 
			
		||||
        else{
 | 
			
		||||
            JOptionPane.showMessageDialog(null,"Je me meurt\n Adieu monde cruel","Mortalité !", JOptionPane.INFORMATION_MESSAGE);    
 | 
			
		||||
            
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
@@ -1,81 +1,87 @@
 | 
			
		||||
package metier;
 | 
			
		||||
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
import javax.swing.Icon;
 | 
			
		||||
import java.util.Random;
 | 
			
		||||
import javax.swing.JOptionPane;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * @author Dominique_2
 | 
			
		||||
 */
 | 
			
		||||
public class Sorcier  extends Personnage {
 | 
			
		||||
public class Sorcier extends Personnage {
 | 
			
		||||
    
 | 
			
		||||
    private String baguette; 
 | 
			
		||||
 | 
			
		||||
    public Sorcier(String nom, String img, int energie, int dureeVie, String baguette) {
 | 
			
		||||
    private String baguette;
 | 
			
		||||
    private Enigme[] enigmes;
 | 
			
		||||
    private int nbEnigmes;
 | 
			
		||||
    
 | 
			
		||||
    public Sorcier(String nom, String img, int energie, int dureeVie, String baguette, int par2) {
 | 
			
		||||
        super(nom, img, energie, dureeVie);
 | 
			
		||||
        this.baguette = baguette;
 | 
			
		||||
        int tailleMaxEnigmes = 0;
 | 
			
		||||
        this.enigmes = new Enigme[tailleMaxEnigmes];
 | 
			
		||||
        this.nbEnigmes = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public int hashCode() {
 | 
			
		||||
        int hash = 7;
 | 
			
		||||
        hash = super.hashCode() + (73 * hash + Objects.hashCode(this.baguette));
 | 
			
		||||
        return hash;
 | 
			
		||||
        return Objects.hash(super.hashCode(), baguette, enigmes, nbEnigmes);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean equals(Object obj) {
 | 
			
		||||
        if (this == obj) {
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
        if (obj == null) {
 | 
			
		||||
        if (obj == null || getClass() != obj.getClass()) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        if (getClass() != obj.getClass()) {
 | 
			
		||||
            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
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return super.toString() + "\tBaguette=" + baguette + "\nNb Enigmes";
 | 
			
		||||
    }
 | 
			
		||||
        
 | 
			
		||||
    /**
 | 
			
		||||
     * Get the value of baguette
 | 
			
		||||
     *
 | 
			
		||||
     * @return the value of baguette
 | 
			
		||||
     */
 | 
			
		||||
    public String getBaguette() {
 | 
			
		||||
        return baguette;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Set the value of baguette
 | 
			
		||||
     *
 | 
			
		||||
     * @param baguette new value of baguette
 | 
			
		||||
     */
 | 
			
		||||
    public void setBaguette(String baguette) {
 | 
			
		||||
        this.baguette = baguette;
 | 
			
		||||
        Sorcier other = (Sorcier) obj;
 | 
			
		||||
        return super.equals(obj) && Objects.equals(baguette, other.baguette) && nbEnigmes == other.nbEnigmes;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public String saluer(Personnage unPerso){
 | 
			
		||||
        String titre = this.getNom() + " salue " + unPerso.getNom();
 | 
			
		||||
        String 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);
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return super.toString() + "\tBaguette=" + baguette + "\nNb Enigmes=" + nbEnigmes;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public Enigme[] getEnigmes() {
 | 
			
		||||
        return enigmes;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public void ajouterEnigme(Enigme e) {
 | 
			
		||||
        if (nbEnigmes < enigmes.length) {
 | 
			
		||||
            enigmes[nbEnigmes] = e;
 | 
			
		||||
            nbEnigmes++;
 | 
			
		||||
        } else {
 | 
			
		||||
            System.out.println("Impossible d'ajouter une <20>nigme. Le tableau est plein.");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public String saluer(Personnage unPerso) {
 | 
			
		||||
        String titre = this.getNom() + " saluer " + unPerso.getNom();
 | 
			
		||||
        String message = "Bonjour " + unPerso.getNom() + ", je t'ai jet<65> un sort, tu es d<>sormais sous ma d<>pendance !";
 | 
			
		||||
        JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
 | 
			
		||||
        return message;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public String rencontrer(Personnage unPerso) {
 | 
			
		||||
        if (nbEnigmes == 0) {
 | 
			
		||||
            JOptionPane.showMessageDialog(null, "Je n'ai pas d'<27>nigmes <20> te poser...", "Sorcier " + this.getNom(), JOptionPane.INFORMATION_MESSAGE);
 | 
			
		||||
            return "";
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        Random rand = new Random();
 | 
			
		||||
        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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,13 +1,14 @@
 | 
			
		||||
/*
 | 
			
		||||
 * To change this license header, choose License Headers in Project Properties.
 | 
			
		||||
 * To change this template file, choose Tools | Templates
 | 
			
		||||
 * and open the template in the editor.
 | 
			
		||||
 */
 | 
			
		||||
* To change this license header, choose License Headers in Project Properties.
 | 
			
		||||
* To change this template file, choose Tools | Templates
 | 
			
		||||
* and open the template in the editor.
 | 
			
		||||
*/
 | 
			
		||||
package metier;
 | 
			
		||||
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
import javax.swing.Icon;
 | 
			
		||||
import javax.swing.JOptionPane;
 | 
			
		||||
import static javax.swing.JOptionPane.WARNING_MESSAGE;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
@@ -17,20 +18,25 @@ public class Voleur extends Personnage{
 | 
			
		||||
    
 | 
			
		||||
    private String outil;
 | 
			
		||||
    private String [] outils={"Pierre","Feuille","Ciseaux"};
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    public Voleur(String nom, String img, int energie, int dureeVie, String outil) {
 | 
			
		||||
        super(nom, img, energie, dureeVie);
 | 
			
		||||
        this.outil = outil;
 | 
			
		||||
        //this.butin = butin;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public int hashCode() {
 | 
			
		||||
        int hash = 7;
 | 
			
		||||
        hash = super.hashCode() + (29 * hash + Objects.hashCode(this.outil));
 | 
			
		||||
        return hash;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     *
 | 
			
		||||
     * @param obj
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean equals(Object obj) {
 | 
			
		||||
        if (this == obj) {
 | 
			
		||||
@@ -48,15 +54,15 @@ public class Voleur extends Personnage{
 | 
			
		||||
        }
 | 
			
		||||
        if (!super.equals(obj)) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }        
 | 
			
		||||
        }
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return super.toString() + "\t Outil=" + outil + "\nButin=";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Get the value of outil
 | 
			
		||||
     *
 | 
			
		||||
@@ -65,7 +71,7 @@ public class Voleur extends Personnage{
 | 
			
		||||
    public String getOutil() {
 | 
			
		||||
        return outil;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Set the value of outil
 | 
			
		||||
     *
 | 
			
		||||
@@ -74,39 +80,54 @@ public class Voleur extends Personnage{
 | 
			
		||||
    public void setOutil(String outil) {
 | 
			
		||||
        this.outil = outil;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String rencontrer(Personnage unPerso){
 | 
			
		||||
        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 String[] getOutils() {
 | 
			
		||||
        return outils;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public void setOutils(String[] outils) {
 | 
			
		||||
        this.outils = outils;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public String rencontrer(Personnage unPerso) {
 | 
			
		||||
        String titre = this.getNom() + " rencontre " + unPerso.getNom();
 | 
			
		||||
        String message = "Que choisis-tu, " + unPerso.getNom() + "?";
 | 
			
		||||
        JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
 | 
			
		||||
        Icon img = new javax.swing.ImageIcon(getClass().getResource("/img/pierreFeuilleCiseaux.jpg"));
 | 
			
		||||
        
 | 
			
		||||
        
 | 
			
		||||
        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;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										353
									
								
								JDR/src/presentation/JFPlateau.form
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										353
									
								
								JDR/src/presentation/JFPlateau.form
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,353 @@
 | 
			
		||||
<?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>
 | 
			
		||||
							
								
								
									
										342
									
								
								JDR/src/presentation/JFPlateau.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										342
									
								
								JDR/src/presentation/JFPlateau.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,342 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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