En train de faire la fonction du boutton

This commit is contained in:
emile.malcuit 2025-02-10 11:49:54 +01:00
parent efbc5f81dd
commit 3024a370c3
2 changed files with 758 additions and 6 deletions

View File

@ -1,6 +1,33 @@
<?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.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.JList" name="jList1">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="5">
<StringItem index="0" value="Item 1"/>
<StringItem index="1" value="Item 2"/>
<StringItem index="2" value="Item 3"/>
<StringItem index="3" value="Item 4"/>
<StringItem index="4" value="Item 5"/>
</StringArray>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
</SubComponents>
</Container>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
</Properties>
@ -23,13 +50,402 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="-524" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="14" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPJeu" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="JPFondListePerso" min="-2" pref="196" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="JPFondListePerso" min="-2" pref="484" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="jPJeu" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="JPFondListePerso">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="66" type="rgb"/>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="false"/>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLImageListePerso">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="40" y="10" width="130" height="80"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<Properties>
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="30" y="100" width="148" height="360"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="jTextArea1">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="66" type="rgb"/>
</Property>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPJeu">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="15" max="32767" attributes="0"/>
<Component id="jPChoixPerso" min="-2" pref="528" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="54" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="215" max="-2" attributes="0"/>
<Component id="jLChoixPerso" min="-2" pref="151" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="236" max="-2" attributes="0"/>
<Component id="jBGo" min="-2" max="-2" attributes="0"/>
</Group>
</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="32767" attributes="0"/>
<Component id="jLChoixPerso" min="-2" pref="78" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
<Component id="jPChoixPerso" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jBGo" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLChoixPerso">
</Component>
<Container class="javax.swing.JPanel" name="jPChoixPerso">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
<Component id="jLChoixPersoText" min="-2" pref="134" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jPCHoixPersoFond" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="70" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
<Component id="jLChoixPersoText" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jPCHoixPersoFond" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLChoixPersoText">
<Properties>
<Property name="text" type="java.lang.String" value="Choix Des personnages"/>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="jPCHoixPersoFond">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
<LineBorder/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="81" max="-2" attributes="0"/>
<Component id="jCBoxAttaquant" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jCBoxDefenseur" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="75" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Component id="jPAttaquant" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="80" max="32767" attributes="0"/>
<Component id="jPDefenseur" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="38" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jCBoxAttaquant" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jCBoxDefenseur" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPAttaquant" max="32767" attributes="0"/>
<Component id="jPDefenseur" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JComboBox" name="jCBoxAttaquant">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="4">
<StringItem index="0" value="Item 1"/>
<StringItem index="1" value="Item 2"/>
<StringItem index="2" value="Item 3"/>
<StringItem index="3" value="Item 4"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="inputMethodTextChanged" listener="java.awt.event.InputMethodListener" parameters="java.awt.event.InputMethodEvent" handler="jCBoxAttaquantInputMethodTextChanged"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCBoxAttaquantActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JComboBox" name="jCBoxDefenseur">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="4">
<StringItem index="0" value="Item 1"/>
<StringItem index="1" value="Item 2"/>
<StringItem index="2" value="Item 3"/>
<StringItem index="3" value="Item 4"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCBoxDefenseurActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Container class="javax.swing.JPanel" name="jPAttaquant">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="66" type="rgb"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
<Component id="jLImageAttaquant" min="-2" pref="99" max="-2" attributes="0"/>
<EmptySpace pref="51" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane3" pref="0" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLImageAttaquant" min="-2" pref="63" max="-2" attributes="0"/>
<EmptySpace pref="15" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLImageAttaquant">
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane3">
<Properties>
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
<Property name="verticalScrollBarPolicy" type="int" value="21"/>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="jTAAttaquantCaracteristiques">
<Properties>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Text Cursor"/>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPDefenseur">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="66" type="rgb"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
<Component id="jLImageDefenseur" min="-2" pref="98" max="-2" attributes="0"/>
<EmptySpace pref="38" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane4" pref="0" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane4" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLImageDefenseur" min="-2" pref="53" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLImageDefenseur">
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane4">
<Properties>
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
<Property name="verticalScrollBarPolicy" type="int" value="21"/>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="jTADefenseurCaracteristiques">
<Properties>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="jBGo">
<Properties>
<Property name="text" type="java.lang.String" value="Go"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBGoActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>

View File

@ -4,17 +4,25 @@
*/
package Presentation;
import javax.swing.DefaultComboBoxModel;
import metier.Jeu;
import metier.Personnage;
/**
*
* @author emile.lalorcey
*/
public class Plateau_de_jeu extends javax.swing.JFrame {
/**
* Creates new form Plateau_de_jeu
*/
Jeu leJeu = new Jeu();
public Plateau_de_jeu() {
initComponents();
jCBoxAttaquant.setModel( new DefaultComboBoxModel(leJeu.getLesPersonnagesVivants()));
jCBoxDefenseur.setModel( new DefaultComboBoxModel(leJeu.getLesPersonnagesVivants()));
majStatistiquesPersos();
}
/**
@ -26,22 +34,326 @@ public class Plateau_de_jeu extends javax.swing.JFrame {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jList1 = new javax.swing.JList<>();
jPanel1 = new javax.swing.JPanel();
JPFondListePerso = new javax.swing.JPanel();
jLImageListePerso = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jPJeu = new javax.swing.JPanel();
jLChoixPerso = new javax.swing.JLabel();
jPChoixPerso = new javax.swing.JPanel();
jLChoixPersoText = new javax.swing.JLabel();
jPCHoixPersoFond = new javax.swing.JPanel();
jCBoxAttaquant = new javax.swing.JComboBox<>();
jCBoxDefenseur = new javax.swing.JComboBox<>();
jPAttaquant = new javax.swing.JPanel();
jLImageAttaquant = new javax.swing.JLabel();
jScrollPane3 = new javax.swing.JScrollPane();
jTAAttaquantCaracteristiques = new javax.swing.JTextArea();
jPDefenseur = new javax.swing.JPanel();
jLImageDefenseur = new javax.swing.JLabel();
jScrollPane4 = new javax.swing.JScrollPane();
jTADefenseurCaracteristiques = new javax.swing.JTextArea();
jBGo = new javax.swing.JButton();
jList1.setModel(new javax.swing.AbstractListModel<String>() {
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
public int getSize() { return strings.length; }
public String getElementAt(int i) { return strings[i]; }
});
jScrollPane1.setViewportView(jList1);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
JPFondListePerso.setBackground(new java.awt.Color(102, 0, 0));
JPFondListePerso.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
JPFondListePerso.add(jLImageListePerso, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 10, 130, 80));
jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jTextArea1.setBackground(new java.awt.Color(102, 0, 0));
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane2.setViewportView(jTextArea1);
JPFondListePerso.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 100, 148, 360));
jPJeu.setBackground(new java.awt.Color(255, 255, 255));
jLChoixPersoText.setText("Choix Des personnages");
jPCHoixPersoFond.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jCBoxAttaquant.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
jCBoxAttaquant.addInputMethodListener(new java.awt.event.InputMethodListener() {
public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {
}
public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
jCBoxAttaquantInputMethodTextChanged(evt);
}
});
jCBoxAttaquant.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCBoxAttaquantActionPerformed(evt);
}
});
jCBoxDefenseur.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
jCBoxDefenseur.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCBoxDefenseurActionPerformed(evt);
}
});
jPAttaquant.setBackground(new java.awt.Color(102, 0, 0));
jScrollPane3.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane3.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
jTAAttaquantCaracteristiques.setColumns(20);
jTAAttaquantCaracteristiques.setRows(5);
jTAAttaquantCaracteristiques.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
jTAAttaquantCaracteristiques.setOpaque(false);
jScrollPane3.setViewportView(jTAAttaquantCaracteristiques);
javax.swing.GroupLayout jPAttaquantLayout = new javax.swing.GroupLayout(jPAttaquant);
jPAttaquant.setLayout(jPAttaquantLayout);
jPAttaquantLayout.setHorizontalGroup(
jPAttaquantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPAttaquantLayout.createSequentialGroup()
.addGap(25, 25, 25)
.addComponent(jLImageAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(51, Short.MAX_VALUE))
.addGroup(jPAttaquantLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addContainerGap())
);
jPAttaquantLayout.setVerticalGroup(
jPAttaquantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPAttaquantLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLImageAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(15, Short.MAX_VALUE))
);
jPDefenseur.setBackground(new java.awt.Color(102, 0, 0));
jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
jTADefenseurCaracteristiques.setColumns(20);
jTADefenseurCaracteristiques.setRows(5);
jScrollPane4.setViewportView(jTADefenseurCaracteristiques);
javax.swing.GroupLayout jPDefenseurLayout = new javax.swing.GroupLayout(jPDefenseur);
jPDefenseur.setLayout(jPDefenseurLayout);
jPDefenseurLayout.setHorizontalGroup(
jPDefenseurLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPDefenseurLayout.createSequentialGroup()
.addGap(31, 31, 31)
.addComponent(jLImageDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(38, Short.MAX_VALUE))
.addGroup(jPDefenseurLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addContainerGap())
);
jPDefenseurLayout.setVerticalGroup(
jPDefenseurLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPDefenseurLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLImageDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout jPCHoixPersoFondLayout = new javax.swing.GroupLayout(jPCHoixPersoFond);
jPCHoixPersoFond.setLayout(jPCHoixPersoFondLayout);
jPCHoixPersoFondLayout.setHorizontalGroup(
jPCHoixPersoFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPCHoixPersoFondLayout.createSequentialGroup()
.addGap(81, 81, 81)
.addComponent(jCBoxAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jCBoxDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(75, 75, 75))
.addGroup(jPCHoixPersoFondLayout.createSequentialGroup()
.addGap(27, 27, 27)
.addComponent(jPAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 80, Short.MAX_VALUE)
.addComponent(jPDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(38, 38, 38))
);
jPCHoixPersoFondLayout.setVerticalGroup(
jPCHoixPersoFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPCHoixPersoFondLayout.createSequentialGroup()
.addGap(15, 15, 15)
.addGroup(jPCHoixPersoFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jCBoxAttaquant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jCBoxDefenseur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPCHoixPersoFondLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPAttaquant, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPDefenseur, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
javax.swing.GroupLayout jPChoixPersoLayout = new javax.swing.GroupLayout(jPChoixPerso);
jPChoixPerso.setLayout(jPChoixPersoLayout);
jPChoixPersoLayout.setHorizontalGroup(
jPChoixPersoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPChoixPersoLayout.createSequentialGroup()
.addGap(26, 26, 26)
.addComponent(jLChoixPersoText, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPChoixPersoLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPCHoixPersoFond, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(70, 70, 70))
);
jPChoixPersoLayout.setVerticalGroup(
jPChoixPersoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPChoixPersoLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLChoixPersoText)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPCHoixPersoFond, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jBGo.setText("Go");
jBGo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBGoActionPerformed(evt);
}
});
javax.swing.GroupLayout jPJeuLayout = new javax.swing.GroupLayout(jPJeu);
jPJeu.setLayout(jPJeuLayout);
jPJeuLayout.setHorizontalGroup(
jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPJeuLayout.createSequentialGroup()
.addContainerGap(15, Short.MAX_VALUE)
.addComponent(jPChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, 528, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(54, 54, 54))
.addGroup(jPJeuLayout.createSequentialGroup()
.addGroup(jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPJeuLayout.createSequentialGroup()
.addGap(215, 215, 215)
.addComponent(jLChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPJeuLayout.createSequentialGroup()
.addGap(236, 236, 236)
.addComponent(jBGo)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPJeuLayout.setVerticalGroup(
jPJeuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPJeuLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(32, 32, 32)
.addComponent(jPChoixPerso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBGo)
.addGap(5, 5, 5))
);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPJeu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(JPFondListePerso, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(JPFondListePerso, javax.swing.GroupLayout.PREFERRED_SIZE, 484, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jPJeu, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(14, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jCBoxAttaquantActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBoxAttaquantActionPerformed
// TODO add your handling code here:
String perso = (String) jCBoxAttaquant.getSelectedItem();
String nomPerso = perso.split(":")[1];
Personnage Perso = leJeu.rechercherPerso(nomPerso);
jTAAttaquantCaracteristiques.setText(Perso.toString());
}//GEN-LAST:event_jCBoxAttaquantActionPerformed
private void jCBoxAttaquantInputMethodTextChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_jCBoxAttaquantInputMethodTextChanged
}//GEN-LAST:event_jCBoxAttaquantInputMethodTextChanged
private void jCBoxDefenseurActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBoxDefenseurActionPerformed
// TODO add your handling code here:
String perso = (String) jCBoxDefenseur.getSelectedItem();
String nomPerso = perso.split(":")[1];
Personnage Perso = leJeu.rechercherPerso(nomPerso);
jTADefenseurCaracteristiques.setText(Perso.toString());
}//GEN-LAST:event_jCBoxDefenseurActionPerformed
private void jBGoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBGoActionPerformed
//Attaquant
String attaque = (String) jCBoxAttaquant.getSelectedItem();
String nomAttaque = attaque.split(":")[1];
Personnage attaquant = leJeu.rechercherPerso(nomAttaque);
//Defenseur
String defense = (String) jCBoxAttaquant.getSelectedItem();
String nomDefense = defense.split(":")[1];
Personnage defenseur = leJeu.rechercherPerso(nomDefense);
//Combat
attaquant.rencontrer(defenseur);
//mise à jour ath
majStatistiquesPersos();
}//GEN-LAST:event_jBGoActionPerformed
private void majStatistiquesPersos(){
String persos = "Jeu : "+leJeu.getnomJeu();
for(Personnage Perso:leJeu.getmesPersonnages()){
persos += "\n";
persos += Perso;
persos += "\n";
persos += "----------------";
}
jTextArea1.setText(persos);
}
/**
* @param args the command line arguments
*/
@ -76,7 +388,31 @@ public class Plateau_de_jeu extends javax.swing.JFrame {
}
});
}
//Déclaration variables
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel JPFondListePerso;
private javax.swing.JButton jBGo;
private javax.swing.JComboBox<String> jCBoxAttaquant;
private javax.swing.JComboBox<String> jCBoxDefenseur;
private javax.swing.JLabel jLChoixPerso;
private javax.swing.JLabel jLChoixPersoText;
private javax.swing.JLabel jLImageAttaquant;
private javax.swing.JLabel jLImageDefenseur;
private javax.swing.JLabel jLImageListePerso;
private javax.swing.JList<String> jList1;
private javax.swing.JPanel jPAttaquant;
private javax.swing.JPanel jPCHoixPersoFond;
private javax.swing.JPanel jPChoixPerso;
private javax.swing.JPanel jPDefenseur;
private javax.swing.JPanel jPJeu;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JTextArea jTAAttaquantCaracteristiques;
private javax.swing.JTextArea jTADefenseurCaracteristiques;
private javax.swing.JTextArea jTextArea1;
// End of variables declaration//GEN-END:variables
}