Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
7a3546c81c |
@ -1,10 +1,9 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processor.options=
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
application.title=JDR
|
||||
application.vendor=steve.maingana
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
@ -33,14 +32,12 @@ dist.jar=${dist.dir}/JDR.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
dist.jlink.dir=${dist.dir}/jlink
|
||||
dist.jlink.output=${dist.jlink.dir}/JDR
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
${libs.absolutelayout.classpath}
|
||||
javac.classpath=
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.compilerargs=\ --enable-preview
|
||||
javac.deprecation=false
|
||||
javac.external.vm=true
|
||||
javac.modulepath=
|
||||
@ -74,7 +71,7 @@ jlink.additionalmodules=
|
||||
jlink.additionalparam=
|
||||
jlink.launcher=true
|
||||
jlink.launcher.name=JDR
|
||||
main.class=interfaces.jFFJDR
|
||||
main.class=presentation.JFPlateau
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
@ -85,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=\
|
||||
|
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 6.3 KiB |
@ -1,495 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||
<NonVisualComponents>
|
||||
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
|
||||
<SubComponents>
|
||||
<Menu class="javax.swing.JMenu" name="jMItemRecommencer">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Jeu"/>
|
||||
</Properties>
|
||||
<SubComponents>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem1">
|
||||
<Properties>
|
||||
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||
<KeyStroke key="Ctrl+N"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Nouvelle partie"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem1ActionPerformed"/>
|
||||
</Events>
|
||||
</MenuItem>
|
||||
<Menu class="javax.swing.JMenu" name="jMenu1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Ajouter un personnage"/>
|
||||
</Properties>
|
||||
<SubComponents>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Guerrier"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem5">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Sorcier"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem9">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Voleur"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
</SubComponents>
|
||||
</Menu>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMItemNouveauPerso">
|
||||
<Properties>
|
||||
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||
<KeyStroke key="PLUS"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Ajouter des personnages"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMItemNouveauPersoActionPerformed"/>
|
||||
</Events>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem3">
|
||||
<Properties>
|
||||
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||
<KeyStroke key="Ctrl+O"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Ouvrir une partie"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem4">
|
||||
<Properties>
|
||||
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||
<KeyStroke key="Ctrl+S"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Sauvegarder la partie"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem4ActionPerformed"/>
|
||||
</Events>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMItemQuitter">
|
||||
<Properties>
|
||||
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
|
||||
<KeyStroke key="Ctrl+Q"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Quitter"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMItemQuitterActionPerformed"/>
|
||||
</Events>
|
||||
</MenuItem>
|
||||
</SubComponents>
|
||||
</Menu>
|
||||
<Menu class="javax.swing.JMenu" name="jMenu2">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="?"/>
|
||||
</Properties>
|
||||
<SubComponents>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem6">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Aide"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem7">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Objectifs"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem8">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="À propos"/>
|
||||
</Properties>
|
||||
</MenuItem>
|
||||
</SubComponents>
|
||||
</Menu>
|
||||
</SubComponents>
|
||||
</Menu>
|
||||
</NonVisualComponents>
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||
</SyntheticProperties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,-119,0,0,3,45"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="false"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="jPChoix">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="20" y="50" width="530" height="510"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<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="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="161" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="24" max="32767" 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/famille_1.jpg"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="cc" green="cc" red="cc" type="rgb"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="false"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Snap ITC" size="18" style="0"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="66" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Choix du personnages"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="0" y="0" width="220" height="30"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="cc" green="cc" red="cc" type="rgb"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="0" y="30" width="520" height="320"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<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="73" max="-2" attributes="0"/>
|
||||
<Component id="jCBPerso1" min="-2" pref="163" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel4" min="-2" pref="252" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace type="unrelated" max="32767" attributes="0"/>
|
||||
<Component id="jCBPerso2" min="-2" pref="163" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="63" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jPanel3" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jCBPerso1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jCBPerso2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jPanel4" max="32767" attributes="0"/>
|
||||
<Component id="jPanel3" pref="282" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JComboBox" name="jCBPerso1">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="0"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCBPerso1ActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel3">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="99" type="rgb"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="false"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane3">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="0" y="0" width="250" height="141"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextArea" name="jTAPerso2">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="99" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Lucida Calligraphy" size="12" style="0"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JLabel" name="jLIconPerso2">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="60" y="140" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<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="99" type="rgb"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="false"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="0" y="0" width="250" height="140"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextArea" name="jTAPerso1">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="99" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Lucida Calligraphy" size="12" style="0"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JLabel" name="jLIconPerso1">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="70" y="140" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JComboBox" name="jCBPerso2">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="0"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCBPerso2ActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPInfos">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="33" type="rgb"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="560" y="0" width="260" height="650"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="30" pref="30" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" pref="190" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane1" min="-2" pref="240" 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" attributes="0">
|
||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane1" pref="508" max="32767" 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>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
</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="jTAInfos">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<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="columns" type="int" value="20"/>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Lucida Calligraphy" size="12" style="0"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="jBtGo">
|
||||
<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="jBtGoActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="230" y="580" width="110" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
@ -1,471 +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 interfaces;
|
||||
|
||||
import java.util.*;
|
||||
import javax.swing.*;
|
||||
import static javax.swing.JOptionPane.*;
|
||||
import metier.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author steve.maingana
|
||||
*/
|
||||
public class jFFJDR extends javax.swing.JFrame {
|
||||
public String nomJeu = "JDR: LOL";
|
||||
public Jeu jdr = new Jeu(nomJeu);
|
||||
public Personnage p1;
|
||||
public Personnage p2;
|
||||
|
||||
/**
|
||||
* Creates new form jFFJDR
|
||||
*/
|
||||
public jFFJDR() {
|
||||
initComponents();
|
||||
actualiserInformations();
|
||||
}
|
||||
|
||||
|
||||
public void actualiserInformations() {
|
||||
String str = "";
|
||||
ArrayList<Personnage> lesPersonnages = this.jdr.getPersos();
|
||||
str += "Jeu: "+jdr.getNomJeu()+"\n";
|
||||
str += "*************\n";
|
||||
for (Personnage unPerso : lesPersonnages) {
|
||||
str += unPerso.resumerPersonnage();
|
||||
str += "-----------------------\n";
|
||||
}
|
||||
jTAInfos.setText(str);
|
||||
|
||||
jCBPerso1.setModel(new DefaultComboBoxModel(jdr.getLesPersonnagesVivants()));
|
||||
jCBPerso1.setSelectedIndex(0);
|
||||
jCBPerso2.setModel(new DefaultComboBoxModel(jdr.getLesPersonnagesVivants()));
|
||||
jCBPerso2.setSelectedIndex(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
|
||||
jPChoix = new javax.swing.JPanel();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jCBPerso1 = new javax.swing.JComboBox<>();
|
||||
jPanel3 = new javax.swing.JPanel();
|
||||
jScrollPane3 = new javax.swing.JScrollPane();
|
||||
jTAPerso2 = new javax.swing.JTextArea();
|
||||
jLIconPerso2 = new javax.swing.JLabel();
|
||||
jPanel4 = new javax.swing.JPanel();
|
||||
jScrollPane2 = new javax.swing.JScrollPane();
|
||||
jTAPerso1 = new javax.swing.JTextArea();
|
||||
jLIconPerso1 = new javax.swing.JLabel();
|
||||
jCBPerso2 = new javax.swing.JComboBox<>();
|
||||
jPInfos = new javax.swing.JPanel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
jTAInfos = new javax.swing.JTextArea();
|
||||
jBtGo = new javax.swing.JButton();
|
||||
jMenuBar1 = new javax.swing.JMenuBar();
|
||||
jMItemRecommencer = new javax.swing.JMenu();
|
||||
jMenuItem1 = new javax.swing.JMenuItem();
|
||||
jMenu1 = new javax.swing.JMenu();
|
||||
jMenuItem2 = new javax.swing.JMenuItem();
|
||||
jMenuItem5 = new javax.swing.JMenuItem();
|
||||
jMenuItem9 = new javax.swing.JMenuItem();
|
||||
jMItemNouveauPerso = new javax.swing.JMenuItem();
|
||||
jMenuItem3 = new javax.swing.JMenuItem();
|
||||
jMenuItem4 = new javax.swing.JMenuItem();
|
||||
jMItemQuitter = new javax.swing.JMenuItem();
|
||||
jMenu2 = new javax.swing.JMenu();
|
||||
jMenuItem6 = new javax.swing.JMenuItem();
|
||||
jMenuItem7 = new javax.swing.JMenuItem();
|
||||
jMenuItem8 = new javax.swing.JMenuItem();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
|
||||
|
||||
jPChoix.setBackground(new java.awt.Color(255, 255, 255));
|
||||
|
||||
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/famille_1.jpg"))); // NOI18N
|
||||
|
||||
jPanel1.setBackground(new java.awt.Color(204, 204, 204));
|
||||
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
|
||||
|
||||
jLabel3.setFont(new java.awt.Font("Snap ITC", 0, 18)); // NOI18N
|
||||
jLabel3.setForeground(new java.awt.Color(102, 0, 0));
|
||||
jLabel3.setText("Choix du personnages");
|
||||
jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 220, 30));
|
||||
|
||||
jPanel2.setBackground(new java.awt.Color(204, 204, 204));
|
||||
|
||||
jCBPerso1.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jCBPerso1ActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jPanel3.setBackground(new java.awt.Color(153, 0, 0));
|
||||
jPanel3.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
|
||||
|
||||
jTAPerso2.setBackground(new java.awt.Color(153, 0, 0));
|
||||
jTAPerso2.setColumns(20);
|
||||
jTAPerso2.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N
|
||||
jTAPerso2.setForeground(new java.awt.Color(255, 255, 255));
|
||||
jTAPerso2.setRows(5);
|
||||
jTAPerso2.setFocusable(false);
|
||||
jScrollPane3.setViewportView(jTAPerso2);
|
||||
|
||||
jPanel3.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 250, 141));
|
||||
jPanel3.add(jLIconPerso2, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 140, -1, -1));
|
||||
|
||||
jPanel4.setBackground(new java.awt.Color(153, 0, 0));
|
||||
jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
|
||||
|
||||
jTAPerso1.setBackground(new java.awt.Color(153, 0, 0));
|
||||
jTAPerso1.setColumns(20);
|
||||
jTAPerso1.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N
|
||||
jTAPerso1.setForeground(new java.awt.Color(255, 255, 255));
|
||||
jTAPerso1.setRows(5);
|
||||
jTAPerso1.setFocusable(false);
|
||||
jScrollPane2.setViewportView(jTAPerso1);
|
||||
|
||||
jPanel4.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 250, 140));
|
||||
jPanel4.add(jLIconPerso1, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 140, -1, -1));
|
||||
|
||||
jCBPerso2.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jCBPerso2ActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
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(73, 73, 73)
|
||||
.addComponent(jCBPerso1, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jCBPerso2, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(63, 63, 63))
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap())))
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jCBPerso1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jCBPerso2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(6, 6, 6)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel1.add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 30, 520, 320));
|
||||
|
||||
javax.swing.GroupLayout jPChoixLayout = new javax.swing.GroupLayout(jPChoix);
|
||||
jPChoix.setLayout(jPChoixLayout);
|
||||
jPChoixLayout.setHorizontalGroup(
|
||||
jPChoixLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPChoixLayout.createSequentialGroup()
|
||||
.addGroup(jPChoixLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPChoixLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPChoixLayout.createSequentialGroup()
|
||||
.addGap(161, 161, 161)
|
||||
.addComponent(jLabel1)))
|
||||
.addContainerGap())
|
||||
);
|
||||
jPChoixLayout.setVerticalGroup(
|
||||
jPChoixLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPChoixLayout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(24, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
getContentPane().add(jPChoix, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 530, 510));
|
||||
|
||||
jPInfos.setBackground(new java.awt.Color(51, 0, 0));
|
||||
|
||||
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/adj_1.jpg"))); // NOI18N
|
||||
jLabel2.setToolTipText("");
|
||||
|
||||
jTAInfos.setEditable(false);
|
||||
jTAInfos.setBackground(new java.awt.Color(51, 0, 0));
|
||||
jTAInfos.setColumns(20);
|
||||
jTAInfos.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N
|
||||
jTAInfos.setForeground(new java.awt.Color(255, 255, 255));
|
||||
jTAInfos.setRows(5);
|
||||
jTAInfos.setFocusable(false);
|
||||
jScrollPane1.setViewportView(jTAInfos);
|
||||
|
||||
javax.swing.GroupLayout jPInfosLayout = new javax.swing.GroupLayout(jPInfos);
|
||||
jPInfos.setLayout(jPInfosLayout);
|
||||
jPInfosLayout.setHorizontalGroup(
|
||||
jPInfosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPInfosLayout.createSequentialGroup()
|
||||
.addGap(30, 30, 30)
|
||||
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(30, 30, 30))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPInfosLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
);
|
||||
jPInfosLayout.setVerticalGroup(
|
||||
jPInfosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPInfosLayout.createSequentialGroup()
|
||||
.addGap(10, 10, 10)
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 508, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
getContentPane().add(jPInfos, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 0, 260, 650));
|
||||
|
||||
jBtGo.setText("GO");
|
||||
jBtGo.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jBtGoActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
getContentPane().add(jBtGo, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 580, 110, -1));
|
||||
|
||||
jMItemRecommencer.setText("Jeu");
|
||||
|
||||
jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||
jMenuItem1.setText("Nouvelle partie");
|
||||
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jMenuItem1ActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jMItemRecommencer.add(jMenuItem1);
|
||||
|
||||
jMenu1.setText("Ajouter un personnage");
|
||||
|
||||
jMenuItem2.setText("Guerrier");
|
||||
jMenu1.add(jMenuItem2);
|
||||
|
||||
jMenuItem5.setText("Sorcier");
|
||||
jMenu1.add(jMenuItem5);
|
||||
|
||||
jMenuItem9.setText("Voleur");
|
||||
jMenu1.add(jMenuItem9);
|
||||
|
||||
jMItemRecommencer.add(jMenu1);
|
||||
|
||||
jMItemNouveauPerso.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_PLUS, 0));
|
||||
jMItemNouveauPerso.setText("Ajouter des personnages");
|
||||
jMItemNouveauPerso.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jMItemNouveauPersoActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jMItemRecommencer.add(jMItemNouveauPerso);
|
||||
|
||||
jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||
jMenuItem3.setText("Ouvrir une partie");
|
||||
jMItemRecommencer.add(jMenuItem3);
|
||||
|
||||
jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||
jMenuItem4.setText("Sauvegarder la partie");
|
||||
jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jMenuItem4ActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jMItemRecommencer.add(jMenuItem4);
|
||||
|
||||
jMItemQuitter.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_DOWN_MASK));
|
||||
jMItemQuitter.setText("Quitter");
|
||||
jMItemQuitter.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jMItemQuitterActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jMItemRecommencer.add(jMItemQuitter);
|
||||
|
||||
jMenuBar1.add(jMItemRecommencer);
|
||||
|
||||
jMenu2.setText("?");
|
||||
|
||||
jMenuItem6.setText("Aide");
|
||||
jMenu2.add(jMenuItem6);
|
||||
|
||||
jMenuItem7.setText("Objectifs");
|
||||
jMenu2.add(jMenuItem7);
|
||||
|
||||
jMenuItem8.setText("<EFBFBD> propos");
|
||||
jMenu2.add(jMenuItem8);
|
||||
|
||||
jMenuBar1.add(jMenu2);
|
||||
|
||||
setJMenuBar(jMenuBar1);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void jBtGoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtGoActionPerformed
|
||||
// TODO add your handling code here:
|
||||
String selectionPerso1 = (String) jCBPerso1.getSelectedItem();
|
||||
String selectionPerso2 = (String) jCBPerso2.getSelectedItem();
|
||||
String nomPerso1 = selectionPerso1.split(": ")[1];
|
||||
String nomPerso2 = selectionPerso2.split(": ")[1];
|
||||
p1 = jdr.rechercherPerso(nomPerso1);
|
||||
p2 = jdr.rechercherPerso(nomPerso2);
|
||||
|
||||
if (p1.equals(p2)) {
|
||||
String message = "Tu as de s<>rieux probl<62>mes psychologiques pour avoir besoin de te rencontrer toi-m<>me...\n";
|
||||
message += "Tu deviens plus faible et perds un point d'<27>nergie !";
|
||||
JOptionPane.showMessageDialog(null, message, "Faiblesses psychologiques", WARNING_MESSAGE);
|
||||
if (p1.getEnergie() > 0) {
|
||||
p1.setEnergie(p1.getEnergie()-1);
|
||||
}
|
||||
} else {
|
||||
p1.rencontrer(p2);
|
||||
}
|
||||
|
||||
actualiserInformations();
|
||||
}//GEN-LAST:event_jBtGoActionPerformed
|
||||
|
||||
private void jCBPerso2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBPerso2ActionPerformed
|
||||
// TODO add your handling code here:
|
||||
String selectionPerso = (String) jCBPerso2.getSelectedItem();
|
||||
String nomPerso = selectionPerso.split(": ")[1];
|
||||
Personnage perso = jdr.rechercherPerso(nomPerso);
|
||||
Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + perso.getImg()));
|
||||
jTAPerso2.setText(perso.resumerPersonnage());
|
||||
jLIconPerso2.setIcon(imgPerso);
|
||||
}//GEN-LAST:event_jCBPerso2ActionPerformed
|
||||
|
||||
private void jCBPerso1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBPerso1ActionPerformed
|
||||
// TODO add your handling code here:
|
||||
String selectionPerso = (String) jCBPerso1.getSelectedItem();
|
||||
String nomPerso = selectionPerso.split(": ")[1];
|
||||
Personnage perso = jdr.rechercherPerso(nomPerso);
|
||||
Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + perso.getImg()));
|
||||
jTAPerso1.setText(perso.resumerPersonnage());
|
||||
jLIconPerso1.setIcon(imgPerso);
|
||||
}//GEN-LAST:event_jCBPerso1ActionPerformed
|
||||
|
||||
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
|
||||
// TODO add your handling code here:
|
||||
this.jdr = new Jeu(nomJeu);
|
||||
initComponents();
|
||||
actualiserInformations();
|
||||
}//GEN-LAST:event_jMenuItem1ActionPerformed
|
||||
|
||||
private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_jMenuItem4ActionPerformed
|
||||
|
||||
private void jMItemQuitterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMItemQuitterActionPerformed
|
||||
// TODO add your handling code here:
|
||||
System.exit(0);
|
||||
}//GEN-LAST:event_jMItemQuitterActionPerformed
|
||||
|
||||
private void jMItemNouveauPersoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMItemNouveauPersoActionPerformed
|
||||
// TODO add your handling code here:
|
||||
jFFNouveauPerso saisiPerso = new jFFNouveauPerso(jdr, jMItemNouveauPerso, true);
|
||||
saisiPerso.setVisible(true);
|
||||
}//GEN-LAST:event_jMItemNouveauPersoActionPerformed
|
||||
|
||||
/**
|
||||
* @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(jFFJDR.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
} catch (InstantiationException ex) {
|
||||
java.util.logging.Logger.getLogger(jFFJDR.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
} catch (IllegalAccessException ex) {
|
||||
java.util.logging.Logger.getLogger(jFFJDR.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||
java.util.logging.Logger.getLogger(jFFJDR.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 jFFJDR().setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton jBtGo;
|
||||
private javax.swing.JComboBox<String> jCBPerso1;
|
||||
private javax.swing.JComboBox<String> jCBPerso2;
|
||||
private javax.swing.JLabel jLIconPerso1;
|
||||
private javax.swing.JLabel jLIconPerso2;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
private javax.swing.JMenuItem jMItemNouveauPerso;
|
||||
private javax.swing.JMenuItem jMItemQuitter;
|
||||
private javax.swing.JMenu jMItemRecommencer;
|
||||
private javax.swing.JMenu jMenu1;
|
||||
private javax.swing.JMenu jMenu2;
|
||||
private javax.swing.JMenuBar jMenuBar1;
|
||||
private javax.swing.JMenuItem jMenuItem1;
|
||||
private javax.swing.JMenuItem jMenuItem2;
|
||||
private javax.swing.JMenuItem jMenuItem3;
|
||||
private javax.swing.JMenuItem jMenuItem4;
|
||||
private javax.swing.JMenuItem jMenuItem5;
|
||||
private javax.swing.JMenuItem jMenuItem6;
|
||||
private javax.swing.JMenuItem jMenuItem7;
|
||||
private javax.swing.JMenuItem jMenuItem8;
|
||||
private javax.swing.JMenuItem jMenuItem9;
|
||||
private javax.swing.JPanel jPChoix;
|
||||
private javax.swing.JPanel jPInfos;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JPanel jPanel3;
|
||||
private javax.swing.JPanel jPanel4;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JScrollPane jScrollPane2;
|
||||
private javax.swing.JScrollPane jScrollPane3;
|
||||
private javax.swing.JTextArea jTAInfos;
|
||||
private javax.swing.JTextArea jTAPerso1;
|
||||
private javax.swing.JTextArea jTAPerso2;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
@ -1,280 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||
<NonVisualComponents>
|
||||
<Component class="javax.swing.ButtonGroup" name="bGClasse">
|
||||
</Component>
|
||||
</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"/>
|
||||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,108,0,0,2,-41"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="false"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="jPCreation">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="0" y="0" width="290" height="310"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="false"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLTitre">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Lucida Calligraphy" size="12" style="0"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="99" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="CRÉATION DE PERSONNAGE"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="40" y="20" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLNom">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Lucida Calligraphy" size="12" style="0"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="0" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Entrer le nom du personnage"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="20" y="60" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLClasse">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Lucida Calligraphy" size="12" style="0"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="0" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Choisissez la classe du personnage"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="20" y="130" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLArme">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Lucida Calligraphy" size="12" style="0"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="0" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Entrez le nom de l'arme"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="20" y="230" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="jRBGuerrier">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="bGClasse"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="66" green="66" red="66" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Guerrier"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jRBGuerrierActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="20" y="150" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="jRBSorcier">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="bGClasse"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="66" green="66" red="66" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Sorcier"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jRBSorcierActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="20" y="170" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="jRBVoleur">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="bGClasse"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="66" green="66" red="66" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Voleur"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jRBVoleurActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="20" y="190" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="jTFNom">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="20" y="80" width="90" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="jTFArme">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="20" y="250" width="90" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="jBValider">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Valider"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBValiderActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="650" y="180" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="jBAnnuler">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Annuler"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBAnnulerActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="650" y="140" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
<Properties>
|
||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="360" y="190" width="270" height="120"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="false"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Lucida Calligraphy" size="12" style="0"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="99" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="CRÉATION D'ÉNIGMES"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="60" y="20" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</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="ff" green="ff" red="ff" type="rgb"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="360" y="0" width="270" height="120"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="false"/>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Lucida Calligraphy" size="12" style="0"/>
|
||||
</Property>
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="0" green="0" red="99" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="IMAGE DU PERSONNAGE"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||
<AbsoluteConstraints x="50" y="20" width="-1" height="-1"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Form>
|
@ -1,277 +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 interfaces;
|
||||
|
||||
import java.util.*;
|
||||
import javax.swing.*;
|
||||
import metier.Jeu;
|
||||
import metier.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author steve.maingana
|
||||
*/
|
||||
public class jFFNouveauPerso extends javax.swing.JFrame {
|
||||
private Jeu leJeu;
|
||||
private JMenuItem parent;
|
||||
private String classePerso = "";
|
||||
private boolean sorcier = false;
|
||||
|
||||
/**
|
||||
* Creates new form jFFNouveauPerso
|
||||
*/
|
||||
public jFFNouveauPerso() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
public jFFNouveauPerso(Jeu jeu, JMenuItem fenetre, boolean sorcier) {
|
||||
initComponents();
|
||||
if (sorcier) {
|
||||
this.jPanel1.setVisible(false);
|
||||
}
|
||||
this.leJeu = jeu;
|
||||
this.parent = fenetre;
|
||||
this.parent.setEnabled(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
|
||||
bGClasse = new javax.swing.ButtonGroup();
|
||||
jPCreation = new javax.swing.JPanel();
|
||||
jLTitre = new javax.swing.JLabel();
|
||||
jLNom = new javax.swing.JLabel();
|
||||
jLClasse = new javax.swing.JLabel();
|
||||
jLArme = new javax.swing.JLabel();
|
||||
jRBGuerrier = new javax.swing.JRadioButton();
|
||||
jRBSorcier = new javax.swing.JRadioButton();
|
||||
jRBVoleur = new javax.swing.JRadioButton();
|
||||
jTFNom = new javax.swing.JTextField();
|
||||
jTFArme = new javax.swing.JTextField();
|
||||
jBValider = new javax.swing.JButton();
|
||||
jBAnnuler = new javax.swing.JButton();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
|
||||
|
||||
jPCreation.setBackground(new java.awt.Color(255, 255, 255));
|
||||
jPCreation.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
|
||||
|
||||
jLTitre.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N
|
||||
jLTitre.setForeground(new java.awt.Color(153, 0, 0));
|
||||
jLTitre.setText("CR<EFBFBD>ATION DE PERSONNAGE");
|
||||
jPCreation.add(jLTitre, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, -1, -1));
|
||||
|
||||
jLNom.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N
|
||||
jLNom.setForeground(new java.awt.Color(0, 0, 0));
|
||||
jLNom.setText("Entrer le nom du personnage");
|
||||
jPCreation.add(jLNom, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 60, -1, -1));
|
||||
|
||||
jLClasse.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N
|
||||
jLClasse.setForeground(new java.awt.Color(0, 0, 0));
|
||||
jLClasse.setText("Choisissez la classe du personnage");
|
||||
jPCreation.add(jLClasse, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 130, -1, -1));
|
||||
|
||||
jLArme.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N
|
||||
jLArme.setForeground(new java.awt.Color(0, 0, 0));
|
||||
jLArme.setText("Entrez le nom de l'arme");
|
||||
jPCreation.add(jLArme, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 230, -1, -1));
|
||||
|
||||
bGClasse.add(jRBGuerrier);
|
||||
jRBGuerrier.setForeground(new java.awt.Color(102, 102, 102));
|
||||
jRBGuerrier.setText("Guerrier");
|
||||
jRBGuerrier.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jRBGuerrierActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jPCreation.add(jRBGuerrier, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 150, -1, -1));
|
||||
|
||||
bGClasse.add(jRBSorcier);
|
||||
jRBSorcier.setForeground(new java.awt.Color(102, 102, 102));
|
||||
jRBSorcier.setText("Sorcier");
|
||||
jRBSorcier.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jRBSorcierActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jPCreation.add(jRBSorcier, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 170, -1, -1));
|
||||
|
||||
bGClasse.add(jRBVoleur);
|
||||
jRBVoleur.setForeground(new java.awt.Color(102, 102, 102));
|
||||
jRBVoleur.setText("Voleur");
|
||||
jRBVoleur.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jRBVoleurActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
jPCreation.add(jRBVoleur, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 190, -1, -1));
|
||||
jPCreation.add(jTFNom, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 90, -1));
|
||||
jPCreation.add(jTFArme, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 250, 90, -1));
|
||||
|
||||
getContentPane().add(jPCreation, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 290, 310));
|
||||
|
||||
jBValider.setText("Valider");
|
||||
jBValider.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jBValiderActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
getContentPane().add(jBValider, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 180, -1, -1));
|
||||
|
||||
jBAnnuler.setText("Annuler");
|
||||
jBAnnuler.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jBAnnulerActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
getContentPane().add(jBAnnuler, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 140, -1, -1));
|
||||
|
||||
jPanel1.setBackground(new java.awt.Color(255, 255, 255));
|
||||
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
|
||||
|
||||
jLabel2.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N
|
||||
jLabel2.setForeground(new java.awt.Color(153, 0, 0));
|
||||
jLabel2.setText("CR<EFBFBD>ATION D'<27>NIGMES");
|
||||
jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 20, -1, -1));
|
||||
|
||||
getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 190, 270, 120));
|
||||
|
||||
jPanel2.setBackground(new java.awt.Color(255, 255, 255));
|
||||
jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
|
||||
|
||||
jLabel1.setFont(new java.awt.Font("Lucida Calligraphy", 0, 12)); // NOI18N
|
||||
jLabel1.setForeground(new java.awt.Color(153, 0, 0));
|
||||
jLabel1.setText("IMAGE DU PERSONNAGE");
|
||||
jPanel2.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 20, -1, -1));
|
||||
|
||||
getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 0, 270, 120));
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void jBAnnulerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAnnulerActionPerformed
|
||||
// TODO add your handling code here:
|
||||
this.parent.setEnabled(true);
|
||||
dispose();
|
||||
}//GEN-LAST:event_jBAnnulerActionPerformed
|
||||
|
||||
private void jBValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBValiderActionPerformed
|
||||
// TODO add your handling code here:
|
||||
String nomPerso = jTFNom.getText();
|
||||
String nomArme = jTFArme.getText();
|
||||
Personnage perso = null;
|
||||
|
||||
switch (classePerso) {
|
||||
case "Guerrier":
|
||||
perso = new Guerrier(nomPerso, "Guerrier05", 5, 10, nomArme);
|
||||
break;
|
||||
case "Sorcier":
|
||||
Enigme[] enigmes = {
|
||||
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")
|
||||
};
|
||||
|
||||
perso = new Sorcier(nomPerso, "Guerrier05", 5, 10, nomArme, enigmes);
|
||||
break;
|
||||
case "Voleur":
|
||||
perso = new Voleur(nomPerso, "Guerrier05", 5, 10, nomArme);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (perso != null) {
|
||||
this.leJeu.getPersos().add(perso);
|
||||
String message = "Le personnage a <20>t<EFBFBD> ajout<75> au jeu avec succ<63>s";
|
||||
JOptionPane.showMessageDialog(null, message, "Ajout de personnage", JOptionPane.INFORMATION_MESSAGE);
|
||||
} else {
|
||||
String message = "Vous n'avez pas entr<74> aucune information";
|
||||
JOptionPane.showMessageDialog(null, message, "Ajout de personnage", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}//GEN-LAST:event_jBValiderActionPerformed
|
||||
|
||||
private void jRBGuerrierActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRBGuerrierActionPerformed
|
||||
// TODO add your handling code here:
|
||||
this.classePerso = "Guerrier";
|
||||
jTFArme.setVisible(rootPaneCheckingEnabled);
|
||||
}//GEN-LAST:event_jRBGuerrierActionPerformed
|
||||
|
||||
private void jRBSorcierActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRBSorcierActionPerformed
|
||||
// TODO add your handling code here:
|
||||
this.classePerso = "Sorcier";
|
||||
}//GEN-LAST:event_jRBSorcierActionPerformed
|
||||
|
||||
private void jRBVoleurActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRBVoleurActionPerformed
|
||||
// TODO add your handling code here:
|
||||
this.classePerso = "Action";
|
||||
}//GEN-LAST:event_jRBVoleurActionPerformed
|
||||
|
||||
/**
|
||||
* @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(jFFNouveauPerso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
} catch (InstantiationException ex) {
|
||||
java.util.logging.Logger.getLogger(jFFNouveauPerso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
} catch (IllegalAccessException ex) {
|
||||
java.util.logging.Logger.getLogger(jFFNouveauPerso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
|
||||
java.util.logging.Logger.getLogger(jFFNouveauPerso.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 jFFNouveauPerso().setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.ButtonGroup bGClasse;
|
||||
private javax.swing.JButton jBAnnuler;
|
||||
private javax.swing.JButton jBValider;
|
||||
private javax.swing.JLabel jLArme;
|
||||
private javax.swing.JLabel jLClasse;
|
||||
private javax.swing.JLabel jLNom;
|
||||
private javax.swing.JLabel jLTitre;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JPanel jPCreation;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JRadioButton jRBGuerrier;
|
||||
private javax.swing.JRadioButton jRBSorcier;
|
||||
private javax.swing.JRadioButton jRBVoleur;
|
||||
private javax.swing.JTextField jTFArme;
|
||||
private javax.swing.JTextField jTFNom;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
|
||||
*/
|
||||
package jdr;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author sio
|
||||
*/
|
||||
public class JDR {
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// TODO code application logic here
|
||||
System.out.println("Hello world !");
|
||||
}
|
||||
|
||||
}
|
@ -4,7 +4,10 @@
|
||||
*/
|
||||
package jeuderole;
|
||||
|
||||
import metier.*;
|
||||
import metier.Guerrier;
|
||||
import metier.Personnage;
|
||||
import metier.Sorcier;
|
||||
import metier.Voleur;
|
||||
|
||||
/**
|
||||
* Test Classe Jeu
|
||||
@ -16,32 +19,14 @@ public class JeuDeRolePolymorphisme {
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
Personnage Jinx = new Voleur("Jinx", "Jinx.jpg", 2, 4, "Poignard");
|
||||
Personnage Ekko = new Guerrier("Ekko", "Ekko.jpg", 6, 4, "Hache");
|
||||
|
||||
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);
|
||||
|
||||
|
||||
Enigme[] enigmes1 = {
|
||||
new Enigme("Qu’est ce qui est plus grand que la Tour Eiffel, mais infiniment moins lourd ?","ombre"),
|
||||
new Enigme("Girafe = 3, Élé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")
|
||||
};
|
||||
|
||||
Personnage Mel = new Sorcier("Mel", "Mel.jpg", 10, 5, "De laurier", enigmes1);
|
||||
Personnage[] persos = {
|
||||
Jinx, Ekko, Mel
|
||||
};
|
||||
|
||||
System.out.println(Jinx.getNom()+"\nHP: "+Jinx.getDureeVie()+"\nEP: "+Jinx.getEnergie());
|
||||
Jinx.varierDureeVie(5);
|
||||
Jinx.varierEnergie(-10);
|
||||
System.out.println(Jinx.getNom()+"\nHP: "+Jinx.getDureeVie()+"\nEP: "+Jinx.getEnergie());
|
||||
Jinx.varierDureeVie(-5);
|
||||
Jinx.varierEnergie(10);
|
||||
System.out.println(Jinx.getNom()+"\nHP: "+Jinx.getDureeVie()+"\nEP: "+Jinx.getEnergie());
|
||||
|
||||
Mel.rencontrer(Jinx);
|
||||
Jinx.rencontrer(Mel);
|
||||
}
|
||||
|
||||
}
|
||||
mesPersonnages[0].saluer(mesPersonnages[1]);
|
||||
mesPersonnages[2].saluer(mesPersonnages[0]);
|
||||
mesPersonnages[1].saluer(mesPersonnages[2]);
|
||||
}
|
||||
}
|
@ -4,24 +4,57 @@
|
||||
*/
|
||||
package metier;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author steve.maingana
|
||||
* @author mohamed.boussemaha
|
||||
*/
|
||||
public class Enigme {
|
||||
|
||||
private String question;
|
||||
private String reponse;
|
||||
|
||||
|
||||
public Enigme(String question, String reponse) {
|
||||
this.question = question;
|
||||
this.reponse = reponse;
|
||||
};
|
||||
}
|
||||
|
||||
public String getQuestion() {
|
||||
return question;
|
||||
}
|
||||
|
||||
public void setQuestion(String question) {
|
||||
this.question = question;
|
||||
}
|
||||
|
||||
public String getReponse() {
|
||||
return reponse;
|
||||
}
|
||||
|
||||
public void setReponse(String reponse) {
|
||||
this.reponse = reponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(question, reponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final Enigme other = (Enigme) obj;
|
||||
return Objects.equals(this.question, other.question) && Objects.equals(this.reponse, other.reponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Enigme{" + "question='" + question + '\'' + ", reponse='" + reponse + '\'' + '}';
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
*
|
||||
@ -84,69 +89,54 @@ public class Guerrier extends Personnage{
|
||||
}
|
||||
|
||||
/**
|
||||
* R<>sume les informations sur le personnage
|
||||
* @return Informations du personnage
|
||||
*
|
||||
* @param unPerso
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String resumerPersonnage() {
|
||||
String str = "";
|
||||
str += "Nom "+this.getNom()+"\n";
|
||||
str += "<EFBFBD>nergie "+this.getEnergie()+"\n";
|
||||
str += "Dur<EFBFBD>e de vie "+this.getDureeVie()+"\n";
|
||||
str += "Guerrier arme : "+this.getArme()+"\n";
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initie la rencontre avec un autre personnage
|
||||
* @param unPerso un Personnage
|
||||
* @return Message de rencontre
|
||||
*/
|
||||
public String rencontrer(Personnage unPerso) {
|
||||
String titre = this.getNom() + " rencontre " + unPerso.getNom() + " : Jeu de dés";
|
||||
String message = "Es-tu prêt à me combattre "+ unPerso.getNom() +" ?";
|
||||
Icon ImgDe = new javax.swing.ImageIcon(getClass().getResource("/img/des.jpg"));
|
||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, ImgDe);
|
||||
|
||||
int Attaquant = Jeu.genererNbAleatoire(1, 100);
|
||||
int Defenseur = Jeu.genererNbAleatoire(1, 100);
|
||||
message = this.getNom()+": "+Attaquant+" - "+ unPerso.getNom() +": "+ Defenseur +"\n\n";
|
||||
Icon ImgVainqueur;
|
||||
if (Attaquant > Defenseur) {
|
||||
message += this.getNom() +" l'emporte !\n\n";
|
||||
ImgVainqueur = new javax.swing.ImageIcon(getClass().getResource("/img/"+ this.getNom() +".jpg"));
|
||||
unPerso.setEnergie(unPerso.getEnergie()-2);
|
||||
unPerso.setDureeVie(unPerso.getDureeVie()-1);
|
||||
} else if (Defenseur > Attaquant) {
|
||||
message += unPerso.getNom() +" l'emporte !\n\n";
|
||||
ImgVainqueur = new javax.swing.ImageIcon(getClass().getResource("/img/"+ unPerso.getNom() +".jpg"));
|
||||
this.setEnergie(this.getEnergie()-1);
|
||||
unPerso.setEnergie(unPerso.getEnergie()+2);
|
||||
} else {
|
||||
ImgVainqueur = null;
|
||||
message += "Il y a égalité entre les parties !\n\n";
|
||||
}
|
||||
message += this.getNom() +": "+ this.getDureeVie()+" - "+ unPerso.getNom() +": "+ unPerso.getDureeVie();
|
||||
|
||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, ImgVainqueur);
|
||||
//Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + this.getImg()));
|
||||
//JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, imgPerso);
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saluer un personnage
|
||||
* @param unPerso Un personnage
|
||||
* @return Message de salutation
|
||||
*/
|
||||
@Override
|
||||
public String saluer(Personnage unPerso) {
|
||||
String titre = this.getNom() + " salue " + unPerso.getNom();
|
||||
String message = "Bonjour " + unPerso.getNom() + " , sauve-toi vite avant que je ne te frappe avec mon arme redoutable !";
|
||||
//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) {
|
||||
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);
|
||||
|
||||
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,191 +4,131 @@
|
||||
*/
|
||||
package metier;
|
||||
|
||||
import java.util.*;
|
||||
import javax.swing.*;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author steve.maingana
|
||||
* @author mohamed.boussemaha
|
||||
*/
|
||||
public class Jeu {
|
||||
// Nom du jeu
|
||||
private String nomJeu;
|
||||
// Tableau de personnages
|
||||
private ArrayList<Personnage> persos;
|
||||
// Equipes de jeu
|
||||
private ArrayList<Personnage> Equipe1;
|
||||
private ArrayList<Personnage> Equipe2;
|
||||
|
||||
/**
|
||||
* Création du jeu
|
||||
* @param nomJeu Nom du jeu
|
||||
*/
|
||||
/*****Attributs*****/
|
||||
private final String nomJeu;
|
||||
private Personnage[] lesPersonnages;
|
||||
|
||||
/*****Constructeur*****/
|
||||
public Jeu(String nomJeu) {
|
||||
this.setNomJeu(nomJeu);
|
||||
this.chargerPersonnages();
|
||||
// this.definirEquipes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Représentation de la classe Jeu sous la forme d'une chaîne de caractères
|
||||
* @return Chaîne de caractères
|
||||
*/
|
||||
public String toString() {
|
||||
String envoi = "";
|
||||
envoi += "Jeu{" + "nomJeu=" + this.nomJeu + ",\n persos=";
|
||||
for (int i = 0; i < this.persos.size(); i++) {
|
||||
envoi += this.persos.get(i).toString();
|
||||
envoi += ",\n";
|
||||
}
|
||||
envoi += "}";
|
||||
|
||||
return envoi;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Défini le nom du jeu
|
||||
* @param nomJeu Nom du jeu
|
||||
*/
|
||||
public void setNomJeu(String nomJeu) {
|
||||
this.nomJeu = nomJeu;
|
||||
this.chargerLesPersonnages();
|
||||
}
|
||||
|
||||
/*****Accesseur*****/
|
||||
public String getNomJeu() {
|
||||
return nomJeu;
|
||||
return this.nomJeu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini le tableau de personnages
|
||||
* @param persos Tableau de personnages
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void setPersos(ArrayList<Personnage> persos) {
|
||||
this.persos = persos;
|
||||
}
|
||||
|
||||
public ArrayList getPersos() {
|
||||
return this.persos;
|
||||
public Personnage[] getLesPersonnages() {
|
||||
return this.lesPersonnages;
|
||||
}
|
||||
|
||||
/*****Mutateurs*****/
|
||||
|
||||
/**
|
||||
* Initialise le tableau de personnages
|
||||
*
|
||||
* @param lesPersonnages
|
||||
*/
|
||||
private void chargerPersonnages() {
|
||||
//création des énigmes;
|
||||
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, Élé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")
|
||||
new Enigme("Qu?est ce qui est plus grand que la Tour Eiffel, mais infiniment moins lourd ?", "ombre"),
|
||||
new Enigme("Girafe = 3, <EFBFBD>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é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çoit 7 euros. L'abeille reçoit 21 euros. L'araignée reçoit 28 euros. Combien reç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")
|
||||
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<EFBFBD>oit 7 euros. L'abeille re<EFBFBD>oit 21 euros. L'araign<EFBFBD>e re<EFBFBD>oit 28 euros. Combien re<EFBFBD>oit le chien ?", "14"),
|
||||
new Enigme("Un escargot est au fond d'un puits de 10 m<EFBFBD>tres. Chaque matin il monte de 3 m<EFBFBD>tres et chaque nuit il descend de 2 m<EFBFBD>tres. Combien de jours lui faudra-t-il pour sortir de ce puits ?", "7")
|
||||
};
|
||||
|
||||
ArrayList<Personnage> persos = new ArrayList<Personnage>();
|
||||
persos.add(new Guerrier("Jayce", "Jayce.jpg", 5, 5, "Hache"));
|
||||
persos.add(new Guerrier("Ambresa", "Ambresa.jpg", 8, 9, "Lance"));
|
||||
persos.add(new Guerrier("Ekko", "Ekko.jpg", 5, 6, "Poignard"));
|
||||
persos.add(new Sorcier("Mel", "Mel.jpg", 6, 7, "De laurier", enigmes1));
|
||||
persos.add(new Sorcier("Viktor", "Viktor.jpg", 10, 5, "Hexcore", enigmes2));
|
||||
persos.add(new Voleur("Jinx", "Jinx.jpg", 7, 6, "Marteau"));
|
||||
|
||||
this.setPersos(persos);
|
||||
System.out.println("Personnages chargés !");
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtenir la liste des personnages encore en vie
|
||||
* @return Liste des personnages encore en vie
|
||||
*/
|
||||
public Vector getLesPersonnagesVivants() {
|
||||
Vector<String> lesPersonnages = new Vector<>();
|
||||
for (Personnage perso : this.persos) {
|
||||
if (perso.getDureeVie() > 0) {
|
||||
lesPersonnages.add(perso.getClass().getSimpleName()+": "+perso.getNom());
|
||||
}
|
||||
|
||||
Sorcier sorcier1 = new Sorcier("Merlin", "merlin.png", 5, 10, "Baguette de ch<63>ne", 10);
|
||||
for (Enigme e : enigmes1) {
|
||||
sorcier1.ajouterEnigme(e);
|
||||
}
|
||||
|
||||
return lesPersonnages;
|
||||
}
|
||||
|
||||
/**
|
||||
* R<>partit les personnages en <20>quipes de 3
|
||||
*/
|
||||
private void definirEquipes() {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
int rollEquipe = (int) (Math.random()*2)+1;
|
||||
if (rollEquipe == 1) {
|
||||
if (this.Equipe1.size() == 3) {
|
||||
this.Equipe2.add(this.persos.get(i));
|
||||
} else {
|
||||
this.Equipe1.add(this.persos.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recherche un personnage dans le tableau
|
||||
* @param nom Nom du personnage
|
||||
* @return S'il existe, il retourne le personnage sinon rien
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Personnage rechercherPerso(String nom) {
|
||||
Personnage perso = null;
|
||||
boolean trouve = false;
|
||||
int i = 0;
|
||||
while (!trouve && i < this.persos.size()) {
|
||||
if (this.persos.get(i).getNom().equals(nom)) {
|
||||
perso = this.persos.get(i);
|
||||
while (!trouve && i < lesPersonnages.length) {
|
||||
if (lesPersonnages[i].getNom().equals(nom)) {
|
||||
trouve = true;
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
return perso;
|
||||
return lesPersonnages[i];
|
||||
}
|
||||
|
||||
public void deroulement() {
|
||||
boolean actif = true;
|
||||
int tour = 1;
|
||||
ArrayList<Personnage> DuelE1 = null;
|
||||
ArrayList<Personnage> DuelE2 = null;
|
||||
|
||||
|
||||
|
||||
do {
|
||||
JOptionPane.showMessageDialog(null, "Tour "+tour, "3v3", JOptionPane.INFORMATION_MESSAGE);
|
||||
|
||||
do {
|
||||
Personnage hasard = this.Equipe1.get(genererNbAleatoire(0, 2));
|
||||
if (!DuelE1.contains(hasard)) {
|
||||
DuelE1.add(hasard);
|
||||
}
|
||||
} while (DuelE1.size() < 3);
|
||||
|
||||
do {
|
||||
Personnage hasard = this.Equipe2.get(genererNbAleatoire(0, 2));
|
||||
if (!DuelE2.contains(hasard)) {
|
||||
DuelE2.add(hasard);
|
||||
}
|
||||
} while (DuelE1.size() < 3);
|
||||
|
||||
} while(actif);
|
||||
}
|
||||
|
||||
/**
|
||||
* Génère un nombre aléatoire dans une intervalle
|
||||
* @param min Intervalle de début
|
||||
* @param max Intervalle de fin
|
||||
* @return Nombre aléatoire
|
||||
*
|
||||
* @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 affichage = "";
|
||||
for (Personnage personnage : this.lesPersonnages) {
|
||||
affichage += personnage + "\n";
|
||||
}
|
||||
return affichage;
|
||||
}
|
||||
|
||||
public static int genererNbAleatoire(int min, int max) {
|
||||
return min + (int)(Math.random() * ((max - min) + 1));
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -157,24 +154,9 @@ public class Personnage {
|
||||
}
|
||||
|
||||
/**
|
||||
* R<>sume les informations sur le personnage
|
||||
* @return Informations du personnage
|
||||
*/
|
||||
public String resumerPersonnage() {
|
||||
String str = "";
|
||||
str += "Nom "+this.getNom()+"\n";
|
||||
str += "<EFBFBD>nergie "+this.getEnergie()+"\n";
|
||||
str += "Dur<EFBFBD>e de vie "+this.getDureeVie()+"\n";
|
||||
str += "Civil arme : Aucune\n";
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initie la rencontre avec un autre personnage
|
||||
* @param unPerso un Personnage
|
||||
* @return Message de rencontre
|
||||
*
|
||||
* @param unPerso
|
||||
* @return
|
||||
*/
|
||||
public String rencontrer(Personnage unPerso) {
|
||||
String titre = this.getNom() + " rencontre " + unPerso.getNom();
|
||||
@ -185,43 +167,33 @@ public class Personnage {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saluer un personnage
|
||||
* @param unPerso Un personnage
|
||||
* @return Message de salutation
|
||||
*/
|
||||
public String saluer(Personnage unPerso) {
|
||||
String titre = this.getNom() + " salue " + unPerso.getNom();
|
||||
String message = "Salut " + unPerso.getNom() + " !";
|
||||
// JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
||||
Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + this.getImg()));
|
||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, imgPerso);
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Varier l'énergie du personnage
|
||||
* @param nb Nombre d'énergie à ajouter au personnage
|
||||
*/
|
||||
public void varierEnergie(int nb) {
|
||||
int energie = this.getEnergie()+nb;
|
||||
if (energie < 0) {
|
||||
this.setEnergie(0);
|
||||
if(this.energie + nb < 0) {
|
||||
this.energie = 0;
|
||||
JOptionPane.showMessageDialog(null, "Fin",this.getNom() + "est mort", JOptionPane.ABORT);
|
||||
} else {
|
||||
this.setEnergie(energie);
|
||||
|
||||
this.energie += nb;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Varier la duree vie du personnage
|
||||
* @param nb Nombre de vie à ajouter au personnage
|
||||
*/
|
||||
public void varierDureeVie(int nb) {
|
||||
int dureeVie = this.getDureeVie()+nb;
|
||||
if (dureeVie < 0) {
|
||||
this.setDureeVie(0);
|
||||
if(this.dureeVie + nb <= 0) {
|
||||
this.dureeVie = 0;
|
||||
JOptionPane.showMessageDialog(null, "Fin", this.getNom() + "est mort", JOptionPane.ABORT);
|
||||
} else {
|
||||
this.setDureeVie(dureeVie);
|
||||
|
||||
this.dureeVie += nb;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,177 +1,87 @@
|
||||
package metier;
|
||||
|
||||
import java.util.Objects;
|
||||
import javax.swing.Icon;
|
||||
import java.util.Random;
|
||||
import javax.swing.JOptionPane;
|
||||
import static javax.swing.JOptionPane.DEFAULT_OPTION;
|
||||
import static javax.swing.JOptionPane.QUESTION_MESSAGE;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Dominique_2
|
||||
*/
|
||||
public class Sorcier extends Personnage {
|
||||
public class Sorcier extends Personnage {
|
||||
|
||||
private String baguette;
|
||||
private Enigme[] enigmes;
|
||||
|
||||
public Sorcier(String nom, String img, int energie, int dureeVie, String baguette, 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;
|
||||
this.enigmes = enigmes;
|
||||
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;
|
||||
Sorcier other = (Sorcier) obj;
|
||||
return super.equals(obj) && Objects.equals(baguette, other.baguette) && nbEnigmes == other.nbEnigmes;
|
||||
}
|
||||
|
||||
|
||||
@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;
|
||||
return super.toString() + "\tBaguette=" + baguette + "\nNb Enigmes=" + nbEnigmes;
|
||||
}
|
||||
|
||||
public Enigme[] getEnigmes() {
|
||||
return this.enigmes;
|
||||
}
|
||||
|
||||
/**
|
||||
* R<>sume les informations sur le personnage
|
||||
* @return Informations du personnage
|
||||
*/
|
||||
@Override
|
||||
public String resumerPersonnage() {
|
||||
String str = "";
|
||||
str += "Nom "+this.getNom()+"\n";
|
||||
str += "<EFBFBD>nergie "+this.getEnergie()+"\n";
|
||||
str += "Dur<EFBFBD>e de vie "+this.getDureeVie()+"\n";
|
||||
str += "Sorcier arme : "+this.getBaguette()+"\n";
|
||||
|
||||
return str;
|
||||
return enigmes;
|
||||
}
|
||||
|
||||
public void ajouterEnigme(Enigme e) {
|
||||
int tailleEnigmes = this.enigmes.length+1;
|
||||
Enigme[] enigmes = new Enigme[tailleEnigmes];
|
||||
for (int i = 0; i < this.enigmes.length; i++) {
|
||||
enigmes[i] = this.enigmes[i];
|
||||
if (nbEnigmes < enigmes.length) {
|
||||
enigmes[nbEnigmes] = e;
|
||||
nbEnigmes++;
|
||||
} else {
|
||||
System.out.println("Impossible d'ajouter une <20>nigme. Le tableau est plein.");
|
||||
}
|
||||
enigmes[this.enigmes.length] = e;
|
||||
|
||||
this.enigmes = enigmes;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the value of baguette
|
||||
*
|
||||
* @param baguette new value of baguette
|
||||
*/
|
||||
public void setBaguette(String baguette) {
|
||||
this.baguette = baguette;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initie la rencontre avec un autre personnage
|
||||
* @param unPerso un Personnage
|
||||
* @return Message de rencontre
|
||||
*/
|
||||
public String rencontrer(Personnage unPerso) {
|
||||
// Message de défi à l'adversaire
|
||||
String titre = this.getNom() + " rencontre " + unPerso.getNom() + " : Enigme";
|
||||
String message = "Es-tu prêt à me combattre "+ unPerso.getNom() +" ?\n\nJeu d'énigme";
|
||||
|
||||
// Icone du jeu d'énigme à afficher
|
||||
Icon iEnigme = new javax.swing.ImageIcon(getClass().getResource("/img/adj_1.jpg"));
|
||||
|
||||
// Envoi du message et de l'icone dans une boite de dialogue
|
||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, iEnigme);
|
||||
|
||||
|
||||
// Numéro d'énigme aléatoire
|
||||
int idQuestion = Jeu.genererNbAleatoire(0, this.enigmes.length-1);
|
||||
|
||||
// Message de choix du PFC
|
||||
String question = this.enigmes[idQuestion].getQuestion();
|
||||
String reponseVrai = this.enigmes[idQuestion].getReponse();
|
||||
|
||||
message = question;
|
||||
// Choix du joueur avec des boutons
|
||||
String reponse = (String) JOptionPane.showInputDialog(null, message, titre, QUESTION_MESSAGE, null, null, null);
|
||||
|
||||
// Comparaison des choix pour définir un vainqueur
|
||||
message = "Ma question: "+ question +"\nTa réponse: "+ reponse +"\nLa réponse: "+ reponseVrai +"\n\n";
|
||||
|
||||
// Prendra en valeur l'image du vainqueur si vainqueur, il y a
|
||||
Icon ImgVainqueur;
|
||||
|
||||
if (!reponse.equals(reponseVrai)) { // Si this Voleur gagne
|
||||
// Message de victoire
|
||||
message += this.getNom() +" l'emporte !\n\n";
|
||||
ImgVainqueur = new javax.swing.ImageIcon(getClass().getResource("/img/"+ this.getNom() +".jpg"));
|
||||
|
||||
// Ajout d'un point d'énergie au Voleur
|
||||
unPerso.setDureeVie(unPerso.getDureeVie()-2);
|
||||
} else { // Si l'autre combattant gagne
|
||||
// Message de victoire
|
||||
message += unPerso.getNom() +" l'emporte !\n\n";
|
||||
ImgVainqueur = new javax.swing.ImageIcon(getClass().getResource("/img/"+ unPerso.getNom() +".jpg"));
|
||||
|
||||
// Retrait d'un point d'énergie au Voleur
|
||||
unPerso.setEnergie(this.getEnergie()+2);
|
||||
}
|
||||
|
||||
// Message d'information sur les vies de chaque partie
|
||||
message += this.getNom() +": "+ this.getDureeVie()+" - "+ unPerso.getNom() +": "+ unPerso.getDureeVie();
|
||||
|
||||
// Envoi du message et de l'icone dans une boîte du dialogue
|
||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, ImgVainqueur);
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saluer un personnage
|
||||
* @param unPerso Un personnage
|
||||
* @return Message de salutation
|
||||
*/
|
||||
@Override
|
||||
public String saluer(Personnage unPerso) {
|
||||
String titre = this.getNom() + " salue " + unPerso.getNom();
|
||||
String message = "Bonjour " + unPerso.getNom() + ", je t'ai jeté un sort, tu es désormais 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);
|
||||
String titre = this.getNom() + " saluer " + unPerso.getNom();
|
||||
String message = "Bonjour " + unPerso.getNom() + ", je t'ai jet<EFBFBD> un sort, tu es d<EFBFBD>sormais sous ma d<EFBFBD>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,15 +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.DEFAULT_OPTION;
|
||||
import static javax.swing.JOptionPane.QUESTION_MESSAGE;
|
||||
import static javax.swing.JOptionPane.WARNING_MESSAGE;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -19,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) {
|
||||
@ -50,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
|
||||
*
|
||||
@ -67,7 +71,7 @@ public class Voleur extends Personnage{
|
||||
public String getOutil() {
|
||||
return outil;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of outil
|
||||
*
|
||||
@ -76,129 +80,54 @@ public class Voleur extends Personnage{
|
||||
public void setOutil(String outil) {
|
||||
this.outil = outil;
|
||||
}
|
||||
|
||||
|
||||
public String[] getOutils() {
|
||||
return outils;
|
||||
}
|
||||
|
||||
|
||||
public void setOutils(String[] outils) {
|
||||
this.outils = outils;
|
||||
}
|
||||
|
||||
private int jeuPFC(String J1, String J2) {
|
||||
if (J1 == "Pierre" && J2 == "Feuille") {
|
||||
return -1;
|
||||
} else if (J1 == "Feuille" && J2 == "Pierre") {
|
||||
return 1;
|
||||
} else if (J1 == "Feuille" && J2 == "Ciseaux") {
|
||||
return -1;
|
||||
} else if (J1 == "Ciseaux" && J2 == "Feuille") {
|
||||
return 1;
|
||||
} else if (J1 == "Ciseaux" && J2 == "Pierre") {
|
||||
return -1;
|
||||
} else if (J1 == "Pierre" && J2 == "Ciseaux") {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* R<>sume les informations sur le personnage
|
||||
* @return Informations du personnage
|
||||
*/
|
||||
@Override
|
||||
public String resumerPersonnage() {
|
||||
String str = "";
|
||||
str += "Nom "+this.getNom()+"\n";
|
||||
str += "<EFBFBD>nergie "+this.getEnergie()+"\n";
|
||||
str += "Dur<EFBFBD>e de vie "+this.getDureeVie()+"\n";
|
||||
str += "Voleur arme : "+this.getOutil()+"\n";
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initie la rencontre avec un autre personnage
|
||||
* @param unPerso un Personnage
|
||||
* @return Message de rencontre
|
||||
*/
|
||||
public String rencontrer(Personnage unPerso) {
|
||||
// Message de défi à l'adversaire
|
||||
String titre = this.getNom() + " rencontre " + unPerso.getNom() + " : Pierre Feuille Ciseaux";
|
||||
String message = "Es-tu prêt à me combattre "+ unPerso.getNom() +" ?";
|
||||
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"));
|
||||
|
||||
// Icone de PFC à afficher
|
||||
Icon iPFC = new javax.swing.ImageIcon(getClass().getResource("/img/pierreFeuilleCiseaux.jpg"));
|
||||
|
||||
// Envoi du message et de l'icone dans une boite de dialogue
|
||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, iPFC);
|
||||
String resultat = "";
|
||||
String choixJoueur;
|
||||
String choixAdversaire;
|
||||
|
||||
// Message de choix du PFC
|
||||
message = "Que choisis-tu, "+ unPerso.getNom() +" ?";
|
||||
do {
|
||||
int choixUtilisateur = JOptionPane.showOptionDialog(
|
||||
null, message, titre, JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE,
|
||||
null, outils, 0);
|
||||
|
||||
// Choix du joueur avec des boutons
|
||||
int reponse = JOptionPane.showOptionDialog(null, message, titre, DEFAULT_OPTION, QUESTION_MESSAGE, iPFC, outils, 0);
|
||||
|
||||
// Choix aléatoire du Voleur
|
||||
int choixVoleur = Jeu.genererNbAleatoire(0, 2);
|
||||
|
||||
// Comparaison des choix pour définir un vainqueur
|
||||
int PFC = this.jeuPFC(this.outils[choixVoleur], this.outils[reponse]);
|
||||
message = "Mon choix: "+ this.outils[choixVoleur] +" - Ton choix: "+ this.outils[reponse] +"\n\n";
|
||||
|
||||
// Prendra en valeur l'image du vainqueur si vainqueur, il y a
|
||||
Icon ImgVainqueur;
|
||||
|
||||
if (PFC > 0) { // Si this Voleur gagne
|
||||
// Message de victoire
|
||||
message += this.getNom() +" l'emporte !\n\n";
|
||||
ImgVainqueur = new javax.swing.ImageIcon(getClass().getResource("/img/"+ this.getNom() +".jpg"));
|
||||
|
||||
// Ajout d'un point d'énergie au Voleur
|
||||
this.setEnergie(this.getEnergie()+1);
|
||||
|
||||
// Retrait d'un point d'énergie à l'autre combattant
|
||||
unPerso.setEnergie(unPerso.getEnergie()-1);
|
||||
|
||||
// Retrait d'un point de vie à l'autre combattant
|
||||
unPerso.setDureeVie(unPerso.getDureeVie()-1);
|
||||
} else if (PFC < 0) { // Si l'autre combattant gagne
|
||||
// Message de victoire
|
||||
message += unPerso.getNom() +" l'emporte !\n\n";
|
||||
ImgVainqueur = new javax.swing.ImageIcon(getClass().getResource("/img/"+ unPerso.getNom() +".jpg"));
|
||||
|
||||
// Retrait d'un point d'énergie au Voleur
|
||||
this.setEnergie(this.getEnergie()-1);
|
||||
|
||||
// Ajout d'un point d'énergie à l'autre combattant
|
||||
unPerso.setEnergie(unPerso.getEnergie()+1);
|
||||
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 {
|
||||
ImgVainqueur = null;
|
||||
// Message d'égalité
|
||||
message += "Il y a égalité entre les parties !\n\n";
|
||||
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);
|
||||
|
||||
// Message d'information sur les vies de chaque partie
|
||||
message += this.getNom() +": "+ this.getDureeVie()+" - "+ unPerso.getNom() +": "+ unPerso.getDureeVie();
|
||||
|
||||
// Envoi du message et de l'icone dans une boîte du dialogue
|
||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, ImgVainqueur);
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saluer un personnage
|
||||
* @param unPerso Un personnage
|
||||
* @return Message de salutation
|
||||
*/
|
||||
@Override
|
||||
public String saluer(Personnage unPerso) {
|
||||
String titre = this.getNom() + " salue " + unPerso.getNom();
|
||||
String message = "Bonjour " + unPerso.getNom() + ", si tu baisses ton attention, je vais te dépouiller !";
|
||||
//JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE);
|
||||
Icon imgPerso = new javax.swing.ImageIcon(getClass().getResource("/img/" + this.getImg()));
|
||||
JOptionPane.showMessageDialog(null, message, titre, JOptionPane.INFORMATION_MESSAGE, imgPerso);
|
||||
return message;
|
||||
return resultat;
|
||||
}
|
||||
|
||||
}
|
||||
|
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
@ -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
|
||||
}
|