Procházet zdrojové kódy

Merge branch 'master' of https://github.com/babolivier/burger-quizz

Brendan Abolivier před 9 roky
rodič
revize
bb9bf7f7e8

+ 183
- 122
java/.idea/workspace.xml Zobrazit soubor

@@ -7,12 +7,14 @@
7 7
   </component>
8 8
   <component name="ChangeListManager">
9 9
     <list default="true" id="a647cb6a-4230-4101-a652-d7cfd0c21e24" name="Default" comment="">
10
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/java/InterfacePrincipale$PanCategoriesListener.class" afterPath="$PROJECT_DIR$/out/production/java/InterfacePrincipale$PanCategoriesListener.class" />
11
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/java/InterfacePrincipale.class" afterPath="$PROJECT_DIR$/out/production/java/InterfacePrincipale.class" />
10
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/java/ConnexionBDD.class" afterPath="$PROJECT_DIR$/out/production/java/ConnexionBDD.class" />
11
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/java/GestionQuestions.class" afterPath="$PROJECT_DIR$/out/production/java/GestionQuestions.class" />
12
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/java/InterfacePrincipale$PanQuestionsListener.class" afterPath="$PROJECT_DIR$/out/production/java/InterfacePrincipale$PanQuestionsListener.class" />
13
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/out/production/java/InterfacePrincipale$PanReponsesListener.class" afterPath="$PROJECT_DIR$/out/production/java/InterfacePrincipale$PanReponsesListener.class" />
12 14
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ConnexionBDD.java" afterPath="$PROJECT_DIR$/src/ConnexionBDD.java" />
13
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/GestionCategories.java" afterPath="$PROJECT_DIR$/src/GestionCategories.java" />
14
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/GestionReponses.java" afterPath="$PROJECT_DIR$/src/GestionReponses.java" />
15
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/GestionQuestions.java" afterPath="$PROJECT_DIR$/src/GestionQuestions.java" />
15 16
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/InterfacePrincipale.java" afterPath="$PROJECT_DIR$/src/InterfacePrincipale.java" />
17
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/NouvelleQuestionDialog.java" afterPath="$PROJECT_DIR$/src/NouvelleQuestionDialog.java" />
16 18
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/NouvelleReponseDialog.java" afterPath="$PROJECT_DIR$/src/NouvelleReponseDialog.java" />
17 19
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
18 20
     </list>
@@ -36,31 +38,18 @@
36 38
   </component>
37 39
   <component name="FileEditorManager">
38 40
     <leaf>
39
-      <file leaf-file-name="InterfacePrincipale.java" pinned="false" current-in-tab="true">
41
+      <file leaf-file-name="InterfacePrincipale.java" pinned="false" current-in-tab="false">
40 42
         <entry file="file://$PROJECT_DIR$/src/InterfacePrincipale.java">
41 43
           <provider selected="true" editor-type-id="text-editor">
42
-            <state vertical-scroll-proportion="0.45895523">
43
-              <caret line="470" column="79" selection-start-line="470" selection-start-column="79" selection-end-line="470" selection-end-column="79" />
44
-              <folding>
45
-                <element signature="imports" expanded="true" />
46
-              </folding>
47
-            </state>
48
-          </provider>
49
-        </entry>
50
-      </file>
51
-      <file leaf-file-name="NouvelleReponseDialog.java" pinned="false" current-in-tab="false">
52
-        <entry file="file://$PROJECT_DIR$/src/NouvelleReponseDialog.java">
53
-          <provider selected="true" editor-type-id="text-editor">
54 44
             <state vertical-scroll-proportion="0.0">
55
-              <caret line="59" column="31" selection-start-line="59" selection-start-column="31" selection-end-line="59" selection-end-column="31" />
45
+              <caret line="231" column="68" selection-start-line="231" selection-start-column="68" selection-end-line="231" selection-end-column="68" />
56 46
               <folding>
57 47
                 <element signature="imports" expanded="true" />
58
-                <element signature="e#2268#2269#0" expanded="true" />
59
-                <element signature="e#2296#2297#0" expanded="true" />
60
-                <element signature="e#2324#2325#0" expanded="true" />
61
-                <element signature="e#2352#2353#0" expanded="true" />
62
-                <element signature="e#2379#2380#0" expanded="true" />
63
-                <element signature="e#2430#2431#0" expanded="true" />
48
+                <element signature="method#InterfacePrincipale#0;class#InterfacePrincipale#0" expanded="false" />
49
+                <element signature="method#loadImgBouton#0;class#InterfacePrincipale#0" expanded="false" />
50
+                <element signature="method#createStatusBar#0;class#InterfacePrincipale#0" expanded="false" />
51
+                <element signature="method#modem56k#0;class#InterfacePrincipale#0" expanded="false" />
52
+                <element signature="method#nyan#0;class#InterfacePrincipale#0" expanded="false" />
64 53
               </folding>
65 54
             </state>
66 55
           </provider>
@@ -70,7 +59,7 @@
70 59
         <entry file="file://$PROJECT_DIR$/src/ConnexionBDD.java">
71 60
           <provider selected="true" editor-type-id="text-editor">
72 61
             <state vertical-scroll-proportion="0.0">
73
-              <caret line="78" column="54" selection-start-line="78" selection-start-column="54" selection-end-line="78" selection-end-column="54" />
62
+              <caret line="83" column="30" selection-start-line="83" selection-start-column="30" selection-end-line="83" selection-end-column="30" />
74 63
               <folding>
75 64
                 <element signature="imports" expanded="true" />
76 65
                 <element signature="e#1239#1240#0" expanded="true" />
@@ -84,59 +73,59 @@
84 73
           </provider>
85 74
         </entry>
86 75
       </file>
87
-      <file leaf-file-name="GestionCategories.java" pinned="false" current-in-tab="false">
88
-        <entry file="file://$PROJECT_DIR$/src/GestionCategories.java">
76
+      <file leaf-file-name="GestionReponses.java" pinned="false" current-in-tab="false">
77
+        <entry file="file://$PROJECT_DIR$/src/GestionReponses.java">
89 78
           <provider selected="true" editor-type-id="text-editor">
90 79
             <state vertical-scroll-proportion="0.0">
91
-              <caret line="93" column="38" selection-start-line="93" selection-start-column="38" selection-end-line="93" selection-end-column="38" />
80
+              <caret line="84" column="28" selection-start-line="84" selection-start-column="28" selection-end-line="84" selection-end-column="28" />
92 81
               <folding>
93 82
                 <element signature="imports" expanded="true" />
94
-                <element signature="e#2160#2161#0" expanded="true" />
95
-                <element signature="e#2188#2189#0" expanded="true" />
83
+                <element signature="e#2627#2628#0" expanded="true" />
84
+                <element signature="e#2653#2654#0" expanded="true" />
96 85
               </folding>
97 86
             </state>
98 87
           </provider>
99 88
         </entry>
100 89
       </file>
101
-      <file leaf-file-name="GestionReponses.java" pinned="false" current-in-tab="false">
102
-        <entry file="file://$PROJECT_DIR$/src/GestionReponses.java">
90
+      <file leaf-file-name="GestionQuestions.java" pinned="false" current-in-tab="false">
91
+        <entry file="file://$PROJECT_DIR$/src/GestionQuestions.java">
103 92
           <provider selected="true" editor-type-id="text-editor">
104 93
             <state vertical-scroll-proportion="0.0">
105
-              <caret line="99" column="38" selection-start-line="99" selection-start-column="38" selection-end-line="99" selection-end-column="38" />
94
+              <caret line="89" column="36" selection-start-line="89" selection-start-column="36" selection-end-line="89" selection-end-column="36" />
106 95
               <folding>
107 96
                 <element signature="imports" expanded="true" />
108
-                <element signature="e#2635#2636#0" expanded="true" />
109
-                <element signature="e#2661#2662#0" expanded="true" />
97
+                <element signature="e#2985#2986#0" expanded="true" />
98
+                <element signature="e#3013#3014#0" expanded="true" />
110 99
               </folding>
111 100
             </state>
112 101
           </provider>
113 102
         </entry>
114 103
       </file>
115
-      <file leaf-file-name="Reponses.java" pinned="false" current-in-tab="false">
116
-        <entry file="file://$PROJECT_DIR$/src/Reponses.java">
104
+      <file leaf-file-name="NouvelleQuestionDialog.java" pinned="false" current-in-tab="false">
105
+        <entry file="file://$PROJECT_DIR$/src/NouvelleQuestionDialog.java">
117 106
           <provider selected="true" editor-type-id="text-editor">
118 107
             <state vertical-scroll-proportion="0.0">
119
-              <caret line="13" column="0" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
108
+              <caret line="19" column="8" selection-start-line="19" selection-start-column="8" selection-end-line="19" selection-end-column="28" />
120 109
               <folding>
121
-                <element signature="e#223#224#0" expanded="true" />
122
-                <element signature="e#245#246#0" expanded="true" />
123
-                <element signature="e#290#291#0" expanded="true" />
124
-                <element signature="e#321#322#0" expanded="true" />
125
-                <element signature="e#353#354#0" expanded="true" />
126
-                <element signature="e#375#376#0" expanded="true" />
127
-                <element signature="e#420#421#0" expanded="true" />
128
-                <element signature="e#451#452#0" expanded="true" />
129
-                <element signature="e#480#481#0" expanded="true" />
130
-                <element signature="e#539#540#0" expanded="true" />
110
+                <element signature="imports" expanded="true" />
111
+                <element signature="e#1976#1977#0" expanded="true" />
112
+                <element signature="e#2008#2009#0" expanded="true" />
113
+                <element signature="e#2036#2037#0" expanded="true" />
114
+                <element signature="e#2076#2077#0" expanded="true" />
131 115
               </folding>
132 116
             </state>
133 117
           </provider>
134 118
         </entry>
135 119
       </file>
136
-      <file leaf-file-name="mcd.png" pinned="false" current-in-tab="false">
137
-        <entry file="file://$PROJECT_DIR$/mcd.png">
138
-          <provider selected="true" editor-type-id="images">
139
-            <state />
120
+      <file leaf-file-name="NouvelleReponseDialog.java" pinned="false" current-in-tab="true">
121
+        <entry file="file://$PROJECT_DIR$/src/NouvelleReponseDialog.java">
122
+          <provider selected="true" editor-type-id="text-editor">
123
+            <state vertical-scroll-proportion="0.5635359">
124
+              <caret line="20" column="28" selection-start-line="20" selection-start-column="28" selection-end-line="20" selection-end-column="28" />
125
+              <folding>
126
+                <element signature="imports" expanded="true" />
127
+              </folding>
128
+            </state>
140 129
           </provider>
141 130
         </entry>
142 131
       </file>
@@ -168,14 +157,15 @@
168 157
         <option value="$PROJECT_DIR$/src/Bouton.java" />
169 158
         <option value="$PROJECT_DIR$/src/Categorie.java" />
170 159
         <option value="$PROJECT_DIR$/src/Reponses.java" />
171
-        <option value="$PROJECT_DIR$/src/Question.java" />
172
-        <option value="$PROJECT_DIR$/src/MainAdminBddBurgerQuizz.java" />
173
-        <option value="$PROJECT_DIR$/src/GestionQuestions.java" />
174
-        <option value="$PROJECT_DIR$/src/ConnexionBDD.java" />
175 160
         <option value="$PROJECT_DIR$/src/GestionCategories.java" />
161
+        <option value="$PROJECT_DIR$/src/MainAdminBddBurgerQuizz.java" />
162
+        <option value="$PROJECT_DIR$/src/Question.java" />
176 163
         <option value="$PROJECT_DIR$/src/GestionReponses.java" />
177
-        <option value="$PROJECT_DIR$/src/NouvelleReponseDialog.java" />
164
+        <option value="$PROJECT_DIR$/src/ConnexionBDD.java" />
165
+        <option value="$PROJECT_DIR$/src/GestionQuestions.java" />
178 166
         <option value="$PROJECT_DIR$/src/InterfacePrincipale.java" />
167
+        <option value="$PROJECT_DIR$/src/NouvelleQuestionDialog.java" />
168
+        <option value="$PROJECT_DIR$/src/NouvelleReponseDialog.java" />
179 169
       </list>
180 170
     </option>
181 171
   </component>
@@ -294,6 +284,9 @@
294 284
       <sortByType />
295 285
     </navigator>
296 286
     <panes>
287
+      <pane id="PackagesPane" />
288
+      <pane id="Scope" />
289
+      <pane id="Scratches" />
297 290
       <pane id="ProjectPane">
298 291
         <subPane>
299 292
           <PATH>
@@ -328,9 +321,6 @@
328 321
           </PATH>
329 322
         </subPane>
330 323
       </pane>
331
-      <pane id="PackagesPane" />
332
-      <pane id="Scratches" />
333
-      <pane id="Scope" />
334 324
     </panes>
335 325
   </component>
336 326
   <component name="PropertiesComponent">
@@ -372,7 +362,7 @@
372 362
           <option name="mySupportsDeletion" value="false" />
373 363
           <option name="myCanBeAbsent" value="false" />
374 364
           <option name="myId" value="UPDATED" />
375
-          <PATH vcs="Git" revision="">$PROJECT_DIR$/../web/api/model/class.questset.php</PATH>
365
+          <PATH vcs="Git" revision="">$PROJECT_DIR$/../web/api/controller/palmares.php</PATH>
376 366
           <PATH vcs="Git" revision="">$PROJECT_DIR$/../web/index.htm</PATH>
377 367
           <PATH vcs="Git" revision="">$PROJECT_DIR$/../web/js/game.js</PATH>
378 368
         </FILE-GROUP>
@@ -731,7 +721,31 @@
731 721
       <option name="project" value="LOCAL" />
732 722
       <updated>1433172079872</updated>
733 723
     </task>
734
-    <option name="localTasksCounter" value="17" />
724
+    <task id="LOCAL-00017" summary="++ gestion reponsesV2">
725
+      <created>1433236557607</created>
726
+      <option name="number" value="00017" />
727
+      <option name="project" value="LOCAL" />
728
+      <updated>1433236557607</updated>
729
+    </task>
730
+    <task id="LOCAL-00018" summary="++ gestion reponsesV3">
731
+      <created>1433247288224</created>
732
+      <option name="number" value="00018" />
733
+      <option name="project" value="LOCAL" />
734
+      <updated>1433247288224</updated>
735
+    </task>
736
+    <task id="LOCAL-00019" summary="++ gestion reponsesV4">
737
+      <created>1433253655646</created>
738
+      <option name="number" value="00019" />
739
+      <option name="project" value="LOCAL" />
740
+      <updated>1433253655646</updated>
741
+    </task>
742
+    <task id="LOCAL-00020" summary="++ gestion reponsesV5">
743
+      <created>1433256920732</created>
744
+      <option name="number" value="00020" />
745
+      <option name="project" value="LOCAL" />
746
+      <updated>1433256920732</updated>
747
+    </task>
748
+    <option name="localTasksCounter" value="21" />
735 749
     <servers />
736 750
   </component>
737 751
   <component name="TodoView">
@@ -751,25 +765,25 @@
751 765
       <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
752 766
       <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
753 767
       <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
754
-      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
768
+      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
769
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
755 770
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
756
-      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32922536" sideWeight="0.5030441" order="7" side_tool="true" content_ui="tabs" />
771
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3996479" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
772
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32922536" sideWeight="0.5030441" order="9" side_tool="true" content_ui="tabs" />
757 773
       <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
758
-      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.49695587" order="7" side_tool="false" content_ui="tabs" />
759
-      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
760
-      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32922536" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
774
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.49695587" order="10" side_tool="false" content_ui="tabs" />
775
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32864675" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
776
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32922536" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
761 777
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
762 778
       <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
763
-      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
779
+      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
764 780
       <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16717325" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
765
-      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
781
+      <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.30579966" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
782
+      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
766 783
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
767
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
768
-      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3996479" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
769 784
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
785
+      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
770 786
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
771
-      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
772
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.30579966" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
773 787
     </layout>
774 788
   </component>
775 789
   <component name="Vcs.Log.UiProperties">
@@ -799,11 +813,15 @@
799 813
     <MESSAGE value="++" />
800 814
     <MESSAGE value="correction de bug" />
801 815
     <MESSAGE value="++ gestion reponses" />
802
-    <option name="LAST_COMMIT_MESSAGE" value="++ gestion reponses" />
816
+    <MESSAGE value="++ gestion reponsesV2" />
817
+    <MESSAGE value="++ gestion reponsesV3" />
818
+    <MESSAGE value="++ gestion reponsesV4" />
819
+    <MESSAGE value="++ gestion reponsesV5" />
820
+    <option name="LAST_COMMIT_MESSAGE" value="++ gestion reponsesV5" />
803 821
   </component>
804 822
   <component name="XDebuggerManager">
805 823
     <breakpoint-manager>
806
-      <option name="time" value="5" />
824
+      <option name="time" value="6" />
807 825
     </breakpoint-manager>
808 826
     <watches-manager />
809 827
   </component>
@@ -812,13 +830,6 @@
812 830
     <option name="FILTER_TARGETS" value="false" />
813 831
   </component>
814 832
   <component name="editorHistoryManager">
815
-    <entry file="file://$PROJECT_DIR$/src/GestionReponses.java">
816
-      <provider selected="true" editor-type-id="text-editor">
817
-        <state vertical-scroll-proportion="0.0">
818
-          <caret line="5" column="12" selection-start-line="5" selection-start-column="12" selection-end-line="5" selection-end-column="12" />
819
-        </state>
820
-      </provider>
821
-    </entry>
822 833
     <entry file="file://$PROJECT_DIR$/src/GestionQuestions.java">
823 834
       <provider selected="true" editor-type-id="text-editor">
824 835
         <state vertical-scroll-proportion="0.0">
@@ -856,6 +867,11 @@
856 867
           <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
857 868
           <folding>
858 869
             <element signature="imports" expanded="true" />
870
+            <element signature="method#InterfacePrincipale#0;class#InterfacePrincipale#0" expanded="false" />
871
+            <element signature="method#loadImgBouton#0;class#InterfacePrincipale#0" expanded="false" />
872
+            <element signature="method#createStatusBar#0;class#InterfacePrincipale#0" expanded="false" />
873
+            <element signature="method#modem56k#0;class#InterfacePrincipale#0" expanded="false" />
874
+            <element signature="method#nyan#0;class#InterfacePrincipale#0" expanded="false" />
859 875
           </folding>
860 876
         </state>
861 877
       </provider>
@@ -890,6 +906,11 @@
890 906
           <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
891 907
           <folding>
892 908
             <element signature="imports" expanded="true" />
909
+            <element signature="method#InterfacePrincipale#0;class#InterfacePrincipale#0" expanded="false" />
910
+            <element signature="method#loadImgBouton#0;class#InterfacePrincipale#0" expanded="false" />
911
+            <element signature="method#createStatusBar#0;class#InterfacePrincipale#0" expanded="false" />
912
+            <element signature="method#modem56k#0;class#InterfacePrincipale#0" expanded="false" />
913
+            <element signature="method#nyan#0;class#InterfacePrincipale#0" expanded="false" />
893 914
           </folding>
894 915
         </state>
895 916
       </provider>
@@ -924,6 +945,11 @@
924 945
           <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
925 946
           <folding>
926 947
             <element signature="imports" expanded="true" />
948
+            <element signature="method#InterfacePrincipale#0;class#InterfacePrincipale#0" expanded="false" />
949
+            <element signature="method#loadImgBouton#0;class#InterfacePrincipale#0" expanded="false" />
950
+            <element signature="method#createStatusBar#0;class#InterfacePrincipale#0" expanded="false" />
951
+            <element signature="method#modem56k#0;class#InterfacePrincipale#0" expanded="false" />
952
+            <element signature="method#nyan#0;class#InterfacePrincipale#0" expanded="false" />
927 953
           </folding>
928 954
         </state>
929 955
       </provider>
@@ -958,6 +984,11 @@
958 984
           <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
959 985
           <folding>
960 986
             <element signature="imports" expanded="true" />
987
+            <element signature="method#InterfacePrincipale#0;class#InterfacePrincipale#0" expanded="false" />
988
+            <element signature="method#loadImgBouton#0;class#InterfacePrincipale#0" expanded="false" />
989
+            <element signature="method#createStatusBar#0;class#InterfacePrincipale#0" expanded="false" />
990
+            <element signature="method#modem56k#0;class#InterfacePrincipale#0" expanded="false" />
991
+            <element signature="method#nyan#0;class#InterfacePrincipale#0" expanded="false" />
961 992
           </folding>
962 993
         </state>
963 994
       </provider>
@@ -992,6 +1023,11 @@
992 1023
           <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
993 1024
           <folding>
994 1025
             <element signature="imports" expanded="true" />
1026
+            <element signature="method#InterfacePrincipale#0;class#InterfacePrincipale#0" expanded="false" />
1027
+            <element signature="method#loadImgBouton#0;class#InterfacePrincipale#0" expanded="false" />
1028
+            <element signature="method#createStatusBar#0;class#InterfacePrincipale#0" expanded="false" />
1029
+            <element signature="method#modem56k#0;class#InterfacePrincipale#0" expanded="false" />
1030
+            <element signature="method#nyan#0;class#InterfacePrincipale#0" expanded="false" />
995 1031
           </folding>
996 1032
         </state>
997 1033
       </provider>
@@ -1047,6 +1083,11 @@
1047 1083
           <caret line="0" column="21" selection-start-line="0" selection-start-column="21" selection-end-line="0" selection-end-column="21" />
1048 1084
           <folding>
1049 1085
             <element signature="imports" expanded="true" />
1086
+            <element signature="method#InterfacePrincipale#0;class#InterfacePrincipale#0" expanded="false" />
1087
+            <element signature="method#loadImgBouton#0;class#InterfacePrincipale#0" expanded="false" />
1088
+            <element signature="method#createStatusBar#0;class#InterfacePrincipale#0" expanded="false" />
1089
+            <element signature="method#modem56k#0;class#InterfacePrincipale#0" expanded="false" />
1090
+            <element signature="method#nyan#0;class#InterfacePrincipale#0" expanded="false" />
1050 1091
           </folding>
1051 1092
         </state>
1052 1093
       </provider>
@@ -1084,37 +1125,36 @@
1084 1125
         </state>
1085 1126
       </provider>
1086 1127
     </entry>
1087
-    <entry file="file://$PROJECT_DIR$/src/MainAdminBddBurgerQuizz.java">
1088
-      <provider selected="true" editor-type-id="text-editor">
1089
-        <state vertical-scroll-proportion="0.6130031">
1090
-          <caret line="11" column="44" selection-start-line="11" selection-start-column="44" selection-end-line="11" selection-end-column="44" />
1091
-        </state>
1092
-      </provider>
1093
-    </entry>
1094
-    <entry file="file://$PROJECT_DIR$/src/Question.java">
1128
+    <entry file="file://$PROJECT_DIR$/src/Categorie.java">
1095 1129
       <provider selected="true" editor-type-id="text-editor">
1096
-        <state vertical-scroll-proportion="0.26915887">
1097
-          <caret line="8" column="4" selection-start-line="8" selection-start-column="4" selection-end-line="8" selection-end-column="4" />
1130
+        <state vertical-scroll-proportion="0.0">
1131
+          <caret line="5" column="4" selection-start-line="5" selection-start-column="4" selection-end-line="5" selection-end-column="4" />
1098 1132
         </state>
1099 1133
       </provider>
1100 1134
     </entry>
1101
-    <entry file="file://$PROJECT_DIR$/src/GestionQuestions.java">
1135
+    <entry file="file://$PROJECT_DIR$/src/MainAdminBddBurgerQuizz.java">
1102 1136
       <provider selected="true" editor-type-id="text-editor">
1103
-        <state vertical-scroll-proportion="0.24930748">
1104
-          <caret line="5" column="12" selection-start-line="5" selection-start-column="12" selection-end-line="5" selection-end-column="12" />
1137
+        <state vertical-scroll-proportion="0.51657456">
1138
+          <caret line="11" column="44" selection-start-line="11" selection-start-column="44" selection-end-line="11" selection-end-column="44" />
1139
+          <folding />
1105 1140
         </state>
1106 1141
       </provider>
1107 1142
     </entry>
1108
-    <entry file="file://$PROJECT_DIR$/src/Categorie.java">
1143
+    <entry file="file://$PROJECT_DIR$/src/GestionCategories.java">
1109 1144
       <provider selected="true" editor-type-id="text-editor">
1110
-        <state vertical-scroll-proportion="0.0">
1111
-          <caret line="5" column="4" selection-start-line="5" selection-start-column="4" selection-end-line="5" selection-end-column="4" />
1145
+        <state vertical-scroll-proportion="2.4738805">
1146
+          <caret line="93" column="38" selection-start-line="93" selection-start-column="38" selection-end-line="93" selection-end-column="38" />
1147
+          <folding>
1148
+            <element signature="imports" expanded="true" />
1149
+            <element signature="e#2160#2161#0" expanded="true" />
1150
+            <element signature="e#2188#2189#0" expanded="true" />
1151
+          </folding>
1112 1152
         </state>
1113 1153
       </provider>
1114 1154
     </entry>
1115 1155
     <entry file="file://$PROJECT_DIR$/src/Reponses.java">
1116 1156
       <provider selected="true" editor-type-id="text-editor">
1117
-        <state vertical-scroll-proportion="0.0">
1157
+        <state vertical-scroll-proportion="0.3488806">
1118 1158
           <caret line="13" column="0" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
1119 1159
           <folding>
1120 1160
             <element signature="e#223#224#0" expanded="true" />
@@ -1136,30 +1176,22 @@
1136 1176
         <state />
1137 1177
       </provider>
1138 1178
     </entry>
1139
-    <entry file="file://$PROJECT_DIR$/src/GestionCategories.java">
1179
+    <entry file="file://$PROJECT_DIR$/src/Question.java">
1140 1180
       <provider selected="true" editor-type-id="text-editor">
1141
-        <state vertical-scroll-proportion="0.0">
1142
-          <caret line="93" column="38" selection-start-line="93" selection-start-column="38" selection-end-line="93" selection-end-column="38" />
1143
-          <folding>
1144
-            <element signature="imports" expanded="true" />
1145
-            <element signature="e#2160#2161#0" expanded="true" />
1146
-            <element signature="e#2188#2189#0" expanded="true" />
1147
-          </folding>
1181
+        <state vertical-scroll-proportion="0.46082088">
1182
+          <caret line="52" column="26" selection-start-line="52" selection-start-column="26" selection-end-line="52" selection-end-column="26" />
1183
+          <folding />
1148 1184
         </state>
1149 1185
       </provider>
1150 1186
     </entry>
1151
-    <entry file="file://$PROJECT_DIR$/src/NouvelleReponseDialog.java">
1187
+    <entry file="file://$PROJECT_DIR$/src/GestionReponses.java">
1152 1188
       <provider selected="true" editor-type-id="text-editor">
1153 1189
         <state vertical-scroll-proportion="0.0">
1154
-          <caret line="59" column="31" selection-start-line="59" selection-start-column="31" selection-end-line="59" selection-end-column="31" />
1190
+          <caret line="84" column="28" selection-start-line="84" selection-start-column="28" selection-end-line="84" selection-end-column="28" />
1155 1191
           <folding>
1156 1192
             <element signature="imports" expanded="true" />
1157
-            <element signature="e#2268#2269#0" expanded="true" />
1158
-            <element signature="e#2296#2297#0" expanded="true" />
1159
-            <element signature="e#2324#2325#0" expanded="true" />
1160
-            <element signature="e#2352#2353#0" expanded="true" />
1161
-            <element signature="e#2379#2380#0" expanded="true" />
1162
-            <element signature="e#2430#2431#0" expanded="true" />
1193
+            <element signature="e#2627#2628#0" expanded="true" />
1194
+            <element signature="e#2653#2654#0" expanded="true" />
1163 1195
           </folding>
1164 1196
         </state>
1165 1197
       </provider>
@@ -1167,7 +1199,7 @@
1167 1199
     <entry file="file://$PROJECT_DIR$/src/ConnexionBDD.java">
1168 1200
       <provider selected="true" editor-type-id="text-editor">
1169 1201
         <state vertical-scroll-proportion="0.0">
1170
-          <caret line="78" column="54" selection-start-line="78" selection-start-column="54" selection-end-line="78" selection-end-column="54" />
1202
+          <caret line="83" column="30" selection-start-line="83" selection-start-column="30" selection-end-line="83" selection-end-column="30" />
1171 1203
           <folding>
1172 1204
             <element signature="imports" expanded="true" />
1173 1205
             <element signature="e#1239#1240#0" expanded="true" />
@@ -1180,22 +1212,51 @@
1180 1212
         </state>
1181 1213
       </provider>
1182 1214
     </entry>
1183
-    <entry file="file://$PROJECT_DIR$/src/GestionReponses.java">
1215
+    <entry file="file://$PROJECT_DIR$/src/GestionQuestions.java">
1184 1216
       <provider selected="true" editor-type-id="text-editor">
1185 1217
         <state vertical-scroll-proportion="0.0">
1186
-          <caret line="99" column="38" selection-start-line="99" selection-start-column="38" selection-end-line="99" selection-end-column="38" />
1218
+          <caret line="89" column="36" selection-start-line="89" selection-start-column="36" selection-end-line="89" selection-end-column="36" />
1187 1219
           <folding>
1188 1220
             <element signature="imports" expanded="true" />
1189
-            <element signature="e#2635#2636#0" expanded="true" />
1190
-            <element signature="e#2661#2662#0" expanded="true" />
1221
+            <element signature="e#2985#2986#0" expanded="true" />
1222
+            <element signature="e#3013#3014#0" expanded="true" />
1191 1223
           </folding>
1192 1224
         </state>
1193 1225
       </provider>
1194 1226
     </entry>
1195 1227
     <entry file="file://$PROJECT_DIR$/src/InterfacePrincipale.java">
1196 1228
       <provider selected="true" editor-type-id="text-editor">
1197
-        <state vertical-scroll-proportion="0.45895523">
1198
-          <caret line="470" column="79" selection-start-line="470" selection-start-column="79" selection-end-line="470" selection-end-column="79" />
1229
+        <state vertical-scroll-proportion="0.0">
1230
+          <caret line="231" column="68" selection-start-line="231" selection-start-column="68" selection-end-line="231" selection-end-column="68" />
1231
+          <folding>
1232
+            <element signature="imports" expanded="true" />
1233
+            <element signature="method#InterfacePrincipale#0;class#InterfacePrincipale#0" expanded="false" />
1234
+            <element signature="method#loadImgBouton#0;class#InterfacePrincipale#0" expanded="false" />
1235
+            <element signature="method#createStatusBar#0;class#InterfacePrincipale#0" expanded="false" />
1236
+            <element signature="method#modem56k#0;class#InterfacePrincipale#0" expanded="false" />
1237
+            <element signature="method#nyan#0;class#InterfacePrincipale#0" expanded="false" />
1238
+          </folding>
1239
+        </state>
1240
+      </provider>
1241
+    </entry>
1242
+    <entry file="file://$PROJECT_DIR$/src/NouvelleQuestionDialog.java">
1243
+      <provider selected="true" editor-type-id="text-editor">
1244
+        <state vertical-scroll-proportion="0.0">
1245
+          <caret line="19" column="8" selection-start-line="19" selection-start-column="8" selection-end-line="19" selection-end-column="28" />
1246
+          <folding>
1247
+            <element signature="imports" expanded="true" />
1248
+            <element signature="e#1976#1977#0" expanded="true" />
1249
+            <element signature="e#2008#2009#0" expanded="true" />
1250
+            <element signature="e#2036#2037#0" expanded="true" />
1251
+            <element signature="e#2076#2077#0" expanded="true" />
1252
+          </folding>
1253
+        </state>
1254
+      </provider>
1255
+    </entry>
1256
+    <entry file="file://$PROJECT_DIR$/src/NouvelleReponseDialog.java">
1257
+      <provider selected="true" editor-type-id="text-editor">
1258
+        <state vertical-scroll-proportion="0.5635359">
1259
+          <caret line="20" column="28" selection-start-line="20" selection-start-column="28" selection-end-line="20" selection-end-column="28" />
1199 1260
           <folding>
1200 1261
             <element signature="imports" expanded="true" />
1201 1262
           </folding>

binární
java/out/production/java/ConnexionBDD.class Zobrazit soubor


binární
java/out/production/java/GestionCategories.class Zobrazit soubor


binární
java/out/production/java/GestionQuestions.class Zobrazit soubor


binární
java/out/production/java/GestionReponses.class Zobrazit soubor


binární
java/out/production/java/InterfacePrincipale$PanQuestionsListener.class Zobrazit soubor


binární
java/out/production/java/InterfacePrincipale$PanReponsesListener.class Zobrazit soubor


binární
java/out/production/java/Question.class Zobrazit soubor


+ 24
- 2
java/src/ConnexionBDD.java Zobrazit soubor

@@ -81,8 +81,30 @@ public class ConnexionBDD
81 81
 		gestionReponses.deleteReponses(reponse1, reponse2);
82 82
 	}
83 83
 
84
-	public void modifyReponsesReponses(String categorie, String oldRep1, String oldRep2, String newRep1, String newRep2)
84
+	public void modifyReponses(String categorie, String oldRep1, String oldRep2, String newRep1, String newRep2)
85 85
 	{
86
-		gestionReponses.updateReponsesReponses(categorie, oldRep1, oldRep2, newRep1, newRep2);
86
+		gestionReponses.updateReponses(categorie, oldRep1, oldRep2, newRep1, newRep2);
87
+	}
88
+
89
+	//Gestion questions
90
+	public ArrayList<Question> getListeQuestions(String reponse1, String reponse2)
91
+	{
92
+		gestionQuestions.readQuestions(reponse1, reponse2);
93
+		return gestionQuestions.getListeQuestions();
94
+	}
95
+
96
+	public void createQuestion(String intitule, String reponse1, String reponse2, int num_reponse)
97
+	{
98
+		gestionQuestions.createQuestion(intitule, reponse1, reponse2, num_reponse);
99
+	}
100
+
101
+	public void deleteQuestion(String intitule, String reponse1, String reponse2)
102
+	{
103
+		gestionQuestions.deleteQuestion(intitule, reponse1, reponse2);
104
+	}
105
+
106
+	public void modifyQuestion(String oldIntitule, String newIntitule, String reponse1, String reponse2, int newNum_reponse)
107
+	{
108
+		gestionQuestions.updateQuestion(oldIntitule, newIntitule, reponse1, reponse2, newNum_reponse);
87 109
 	}
88 110
 }

+ 101
- 0
java/src/GestionQuestions.java Zobrazit soubor

@@ -1,4 +1,7 @@
1 1
 import java.sql.Connection;
2
+import java.sql.PreparedStatement;
3
+import java.sql.ResultSet;
4
+import java.sql.SQLException;
2 5
 import java.util.ArrayList;
3 6
 
4 7
 public class GestionQuestions
@@ -9,5 +12,103 @@ public class GestionQuestions
9 12
 	public GestionQuestions(Connection bdd)
10 13
 	{
11 14
 		this.bdd = bdd;
15
+		this.listeQuestions = new ArrayList<Question>();
16
+	}
17
+
18
+	public void readQuestions(String reponse1, String reponse2)
19
+	{
20
+		String rq = "SELECT *" +
21
+				" FROM questions" +
22
+				" WHERE reponse1 = ? AND reponse2 = ?";
23
+
24
+		try
25
+		{
26
+			PreparedStatement preparedStatement = bdd.prepareStatement(rq);
27
+			preparedStatement.setString(1, reponse1);
28
+			preparedStatement.setString(2, reponse2);
29
+			ResultSet resultat = preparedStatement.executeQuery();
30
+
31
+			listeQuestions.clear();
32
+
33
+			while(resultat.next())
34
+			{
35
+				listeQuestions.add(new Question(resultat.getString("intitule"), resultat.getString("reponse1"), resultat.getString("reponse2"), resultat.getInt("num_reponse")));
36
+			}
37
+
38
+			resultat.close();
39
+			preparedStatement.close();
40
+
41
+		}
42
+		catch (SQLException e)
43
+		{
44
+			e.printStackTrace();
45
+		}
46
+	}
47
+
48
+	public void createQuestion(String intitule, String reponse1, String reponse2, int num_reponse)
49
+	{
50
+		String rq = "INSERT INTO questions(intitule, reponse1, reponse2, num_reponse)" +
51
+				" VALUES(?, ?, ?, ?)";
52
+		try
53
+		{
54
+			PreparedStatement preparedStatement = bdd.prepareStatement(rq);
55
+			preparedStatement.setString(1, intitule);
56
+			preparedStatement.setString(2, reponse1);
57
+			preparedStatement.setString(3, reponse2);
58
+			preparedStatement.setInt(4, num_reponse);
59
+			preparedStatement.executeUpdate();
60
+
61
+			preparedStatement.close();
62
+		}
63
+		catch (SQLException e) {
64
+			e.printStackTrace();
65
+		}
66
+	}
67
+
68
+	public void deleteQuestion(String intitule, String reponse1, String reponse2)
69
+	{
70
+		String rq ="DELETE FROM questions" +
71
+				" WHERE reponse1 = ? AND reponse2 = ? AND intitule = ?";
72
+		try
73
+		{
74
+			PreparedStatement preparedStatement = bdd.prepareStatement(rq);
75
+			preparedStatement.setString(1, reponse1);
76
+			preparedStatement.setString(2, reponse2);
77
+			preparedStatement.setString(3, intitule);
78
+			preparedStatement.executeUpdate();
79
+
80
+			preparedStatement.close();
81
+		}
82
+		catch (SQLException e)
83
+		{
84
+			e.printStackTrace();
85
+		}
86
+	}
87
+
88
+	public void updateQuestion(String oldIntitule, String newIntitule, String reponse1, String reponse2, int newNum_reponse)
89
+	{
90
+		String rq ="UPDATE questions" +
91
+				" SET intitule = ?, num_reponse = ?" +
92
+				" WHERE intitule = ? AND reponse1 = ? AND reponse2 = ?";
93
+		try
94
+		{
95
+			PreparedStatement preparedStatement = bdd.prepareStatement(rq);
96
+			preparedStatement.setString(1, newIntitule);
97
+			preparedStatement.setInt(2, newNum_reponse);
98
+			preparedStatement.setString(3, oldIntitule);
99
+			preparedStatement.setString(4, reponse1);
100
+			preparedStatement.setString(5, reponse2);
101
+			preparedStatement.executeUpdate();
102
+
103
+			preparedStatement.close();
104
+		}
105
+		catch (SQLException e)
106
+		{
107
+			e.printStackTrace();
108
+		}
109
+	}
110
+
111
+	public ArrayList<Question> getListeQuestions() {
112
+		return listeQuestions;
12 113
 	}
13 114
 }

+ 1
- 1
java/src/GestionReponses.java Zobrazit soubor

@@ -82,7 +82,7 @@ public class GestionReponses
82 82
 		}
83 83
 	}
84 84
 
85
-	public void updateReponsesReponses(String categorie, String oldRep1, String oldRep2, String newRep1, String newRep2)
85
+	public void updateReponses(String categorie, String oldRep1, String oldRep2, String newRep1, String newRep2)
86 86
 	{
87 87
 		String rq ="UPDATE reponses" +
88 88
 				" SET nom_cat = ?, reponse1 = ?, reponse2 = ?" +

+ 73
- 18
java/src/InterfacePrincipale.java Zobrazit soubor

@@ -32,7 +32,6 @@ public class InterfacePrincipale extends JFrame
32 32
 	private Bouton addQ;
33 33
 	private Bouton delQ;
34 34
 	private Bouton editQ;
35
-	private JComboBox comboQueRep;
36 35
 	private JList listQ;
37 36
 
38 37
 	//image pour les boutons
@@ -186,7 +185,7 @@ public class InterfacePrincipale extends JFrame
186 185
 		panReponses.add(delR);
187 186
 		panReponses.add(Box.createRigidArea(new Dimension(1, 10)));
188 187
 		panReponses.add(sp);
189
-		panReponses.add(Box.createRigidArea(new Dimension(1, 5)));
188
+		panReponses.add(Box.createRigidArea(new Dimension(1, 10)));
190 189
 		panReponses.add(editR);
191 190
 
192 191
 
@@ -203,10 +202,8 @@ public class InterfacePrincipale extends JFrame
203 202
 		addQ = new Bouton("Ajouter une question", plusImg);
204 203
 		delQ = new Bouton("Supprimer la question", delImg);
205 204
 		editQ = new Bouton("Modifier la question", editImg);
206
-		comboQueRep = new JComboBox();
207 205
 
208
-		String tab[] = {"a","b","c","d","e","f"};
209
-		listQ = new JList(tab);
206
+		listQ = new JList();
210 207
 		JScrollPane sp = new JScrollPane(listQ,
211 208
 				JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
212 209
 				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
@@ -217,12 +214,10 @@ public class InterfacePrincipale extends JFrame
217 214
 		addQ.setAlignmentX(CENTER_ALIGNMENT);
218 215
 		delQ.setAlignmentX(CENTER_ALIGNMENT);
219 216
 		editQ.setAlignmentX(CENTER_ALIGNMENT);
220
-		comboQueRep.setOpaque(false);
221 217
 
222 218
 		addQ.setMaximumSize(new Dimension(208,34));
223 219
 		delQ.setMaximumSize(new Dimension(208,34));
224 220
 		editQ.setMaximumSize(new Dimension(208,34));
225
-		comboQueRep.setMaximumSize(new Dimension(1000,34));
226 221
 
227 222
 		JLabel labQ = new JLabel("Questions");
228 223
 		labQ.setAlignmentX(Component.CENTER_ALIGNMENT);
@@ -235,8 +230,6 @@ public class InterfacePrincipale extends JFrame
235 230
 		panQuestions.add(Box.createRigidArea(new Dimension(1, 10)));
236 231
 		panQuestions.add(sp);
237 232
 		panQuestions.add(Box.createRigidArea(new Dimension(1, 10)));
238
-		panQuestions.add(comboQueRep);
239
-		panQuestions.add(Box.createRigidArea(new Dimension(1, 5)));
240 233
 		panQuestions.add(editQ);
241 234
 
242 235
 
@@ -303,6 +296,23 @@ public class InterfacePrincipale extends JFrame
303 296
 		}
304 297
 	}
305 298
 
299
+	private void reSelectQuestion(String intitule)
300
+	{
301
+		Reponses r = (Reponses) listR.getSelectedValue();
302
+		Object[] tabObject = bdd.getListeQuestions(r.getReponse1(), r.getReponse2()).toArray();
303
+		Question[] tabQuestions = Arrays.copyOf(tabObject, tabObject.length, Question[].class);
304
+		listQ.setListData(tabQuestions);
305
+
306
+		for(int i=0; i<tabQuestions.length; i++)
307
+		{
308
+			if(tabQuestions[i].getIntitule().equals(intitule))
309
+			{
310
+				listQ.setSelectedValue(tabQuestions[i], true);
311
+				break;
312
+			}
313
+		}
314
+	}
315
+
306 316
 	private String[] getCategorieList()
307 317
 	{
308 318
 		ListModel model = listC.getModel();
@@ -340,8 +350,9 @@ public class InterfacePrincipale extends JFrame
340 350
 				}
341 351
 
342 352
 				bdd.createCategorie(catName);
343
-				listC.setListData(bdd.getListeCategorie().toArray());
353
+				//listC.setListData(bdd.getListeCategorie().toArray());
344 354
 				reSelectCategorie(catName);
355
+				listQ.setListData(new Vector(0));
345 356
 			}
346 357
 			else if(e.getSource() == delC)
347 358
 			{
@@ -362,6 +373,7 @@ public class InterfacePrincipale extends JFrame
362 373
 					bdd.deleteCategorie(categorieName);
363 374
 					listC.setListData(bdd.getListeCategorie().toArray());
364 375
 					listR.setListData(new Vector(0));
376
+					listQ.setListData(new Vector(0));
365 377
 				}
366 378
 			}
367 379
 			else if(e.getSource() == editC)
@@ -403,6 +415,7 @@ public class InterfacePrincipale extends JFrame
403 415
 			if(!listC.isSelectionEmpty())
404 416
 			{
405 417
 				listR.setListData(bdd.getListeReponses(listC.getSelectedValue().toString()).toArray());
418
+				listQ.setListData(new Vector(0));
406 419
 			}
407 420
 		}
408 421
 	}
@@ -424,7 +437,7 @@ public class InterfacePrincipale extends JFrame
424 437
 				{
425 438
 					String catName = listC.getSelectedValue().toString();
426 439
 					bdd.createReponses(catName, nrd.getRep1(), nrd.getRep2());
427
-					listR.setListData(bdd.getListeReponses(catName).toArray());
440
+					//listR.setListData(bdd.getListeReponses(catName).toArray());
428 441
 					reSelectReponses(nrd.getRep1(), nrd.getRep2());
429 442
 				}
430 443
 			}
@@ -467,8 +480,8 @@ public class InterfacePrincipale extends JFrame
467 480
 				NouvelleReponseDialog nrd = new NouvelleReponseDialog("Modification jeu de réponses", reponse1, reponse2, catName, getCategorieList(), null);
468 481
 				if(nrd.afficher() == true)
469 482
 				{
470
-					bdd.modifyReponsesReponses(nrd.getCat(), reponse1, reponse2, nrd.getRep1(), nrd.getRep2());
471
-					listR.setListData(bdd.getListeReponses(catName).toArray());
483
+					bdd.modifyReponses(nrd.getCat(), reponse1, reponse2, nrd.getRep1(), nrd.getRep2());
484
+					//listR.setListData(bdd.getListeReponses(catName).toArray());
472 485
 					reSelectCategorie(nrd.getCat());
473 486
 					reSelectReponses(nrd.getRep1(), nrd.getRep2());
474 487
 				}
@@ -477,7 +490,11 @@ public class InterfacePrincipale extends JFrame
477 490
 
478 491
 		public void valueChanged(ListSelectionEvent listSelectionEvent)
479 492
 		{
480
-
493
+			if(!listR.isSelectionEmpty())
494
+			{
495
+				Reponses r = (Reponses) listR.getSelectedValue();
496
+				listQ.setListData(bdd.getListeQuestions(r.getReponse1(), r.getReponse2()).toArray());
497
+			}
481 498
 		}
482 499
 	}
483 500
 
@@ -487,21 +504,59 @@ public class InterfacePrincipale extends JFrame
487 504
 		{
488 505
 			if(listR.isSelectionEmpty())
489 506
 			{
490
-				statusText.setText("Veuillez selectioner une catégorie.");
507
+				statusText.setText("Veuillez selectioner une sous-catégorie.");
491 508
 				return;
492 509
 			}
493 510
 
494 511
 			if(e.getSource() == addQ)
495 512
 			{
496
-				statusText.setText("Création de question");
513
+				Reponses r = (Reponses) listR.getSelectedValue();
514
+				NouvelleQuestionDialog nqd = new NouvelleQuestionDialog("Nouvelle question", "",
515
+						0, r.getReponse1(),r.getReponse2(), null);
516
+
517
+				if(nqd.afficher() == true)
518
+				{
519
+					bdd.createQuestion(nqd.getIntitule(), r.getReponse1(), r.getReponse2(), nqd.getReponse());
520
+					//listQ.setListData(bdd.getListeQuestions(r.getReponse1(), r.getReponse2()));
521
+					reSelectQuestion(nqd.getIntitule());
522
+				}
497 523
 			}
498 524
 			else if(e.getSource() == delQ)
499 525
 			{
500
-				statusText.setText("Supression de question");
526
+				JOptionPane jop = new JOptionPane();
527
+
528
+				Question q = (Question) listQ.getSelectedValue();
529
+
530
+				if(q == null)
531
+				{
532
+					statusText.setText("Veuiller d'abord selectionner une question.");
533
+					return;
534
+				}
535
+
536
+				if(jop.showConfirmDialog(null,"Voulez vous vraiment supprimer la question " + q.getIntitule() + " ?", "Supression de question", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION)
537
+				{
538
+					bdd.deleteQuestion(q.getIntitule(), q.getReponse1(), q.getReponse2());
539
+					listQ.setListData(bdd.getListeQuestions(q.getReponse1(), q.getReponse2()).toArray());
540
+				}
501 541
 			}
502 542
 			else if(e.getSource() == editQ)
503 543
 			{
504
-				statusText.setText("Modification de question");
544
+				Question q = (Question) listQ.getSelectedValue();
545
+				if(q == null)
546
+				{
547
+					statusText.setText("Veuiller d'abord selectionner une question.");
548
+					return;
549
+				}
550
+
551
+				NouvelleQuestionDialog nqd = new NouvelleQuestionDialog("Modification question", q.getIntitule(),
552
+						q.getReponse(), q.getReponse1(), q.getReponse2(), null);
553
+
554
+				if(nqd.afficher() == true)
555
+				{
556
+					bdd.modifyQuestion(q.getIntitule(), nqd.getIntitule(),
557
+							q.getReponse1(), q.getReponse2(), nqd.getReponse());
558
+					reSelectQuestion(nqd.getIntitule());
559
+				}
505 560
 			}
506 561
 		}
507 562
 	}

+ 87
- 0
java/src/NouvelleQuestionDialog.java Zobrazit soubor

@@ -0,0 +1,87 @@
1
+import javax.swing.*;
2
+import java.awt.*;
3
+import java.awt.event.ActionEvent;
4
+import java.awt.event.ActionListener;
5
+
6
+public class NouvelleQuestionDialog extends JDialog implements ActionListener
7
+{
8
+	private JTextField intitule;
9
+	private JButton ok;
10
+	private JButton annuler;
11
+	private boolean mofidEffectues;
12
+	private JComboBox reponse;
13
+
14
+	public NouvelleQuestionDialog(String title, String defIntitule, int defReponse, String reponse1, String reponse2, JFrame parent)
15
+	{
16
+		super(parent, title, true);
17
+		createInterface(defIntitule, defReponse, reponse1, reponse2);
18
+		pack();
19
+		setLocationRelativeTo(null);
20
+		setResizable(false);
21
+	}
22
+
23
+	private void createInterface(String defIntitule, int defReponse, String reponse1, String reponse2)
24
+	{
25
+		JPanel champs = new JPanel();
26
+		JPanel boutons = new JPanel();
27
+
28
+		intitule = new JTextField(defIntitule, 20);
29
+		intitule.setBackground(Color.WHITE);
30
+
31
+		ok = new JButton("OK");
32
+		annuler = new JButton("Annuler");
33
+		ok.addActionListener(this);
34
+		annuler.addActionListener(this);
35
+
36
+		reponse = new JComboBox();
37
+		reponse.addItem("Les deux");
38
+		reponse.addItem(reponse1);
39
+		reponse.addItem(reponse2);
40
+		reponse.setSelectedIndex(defReponse);
41
+
42
+		GridLayout gridLayout = new GridLayout(2, 2);
43
+		champs.setLayout(gridLayout);
44
+		champs.add(new JLabel("Intitulé:"));
45
+		champs.add(intitule);
46
+		champs.add(new JLabel("Bonne réponse:"));
47
+		champs.add(reponse);
48
+
49
+		boutons.add(annuler);
50
+		boutons.add(ok);
51
+
52
+		getContentPane().setLayout(new BorderLayout());
53
+		getContentPane().add(champs, BorderLayout.CENTER);
54
+		getContentPane().add(boutons, BorderLayout.SOUTH);
55
+	}
56
+
57
+	public boolean afficher()
58
+	{
59
+		setVisible(true);
60
+		return mofidEffectues;
61
+	}
62
+
63
+	public void actionPerformed(ActionEvent e)
64
+	{
65
+		if(e.getSource() == annuler)
66
+		{
67
+			mofidEffectues = false;
68
+			setVisible(false);
69
+		}
70
+		else if(e.getSource() == ok) {
71
+			if(intitule.getText().isEmpty())
72
+			{
73
+				return;
74
+			}
75
+			mofidEffectues = true;
76
+			setVisible(false);
77
+		}
78
+	}
79
+
80
+	public String getIntitule() {
81
+		return intitule.getText();
82
+	}
83
+
84
+	public int getReponse() {
85
+		return reponse.getSelectedIndex();
86
+	}
87
+}

+ 7
- 6
java/src/NouvelleReponseDialog.java Zobrazit soubor

@@ -14,13 +14,14 @@ public class NouvelleReponseDialog extends JDialog implements ActionListener
14 14
 
15 15
 	public NouvelleReponseDialog(String title, String defRep1, String defRep2, String defCategorie, String[] tabCategorie,JFrame parent)
16 16
 	{
17
-		super(parent,title,true);
17
+		super(parent, title, true);
18 18
 		createInterface(defRep1, defRep2, defCategorie, tabCategorie);
19 19
 		pack();
20 20
 		setLocationRelativeTo(null);
21
+		setResizable(false);
21 22
 	}
22 23
 
23
-	private void createInterface(String defRep1, String defRep2, String defCategorie, String[] tabCatrgorie)
24
+	private void createInterface(String defRep1, String defRep2, String defCategorie, String[] tabCategorie)
24 25
 	{
25 26
 		JPanel champs = new JPanel();
26 27
 		JPanel boutons = new JPanel();
@@ -43,14 +44,14 @@ public class NouvelleReponseDialog extends JDialog implements ActionListener
43 44
 		champs.add(new JLabel("Réponse 2:"));
44 45
 		champs.add(rep2);
45 46
 
46
-		if(defCategorie == null)
47
+		if(defCategorie != null)
47 48
 		{
48 49
 			comboCat = new JComboBox();
49 50
 			comboCat.setOpaque(true);
50
-			for(int i=0; i<tabCatrgorie.length; i++)
51
+			for(int i=0; i< tabCategorie.length; i++)
51 52
 			{
52
-				comboCat.addItem(tabCatrgorie[i]);
53
-				if(tabCatrgorie[i].equals(defCategorie))
53
+				comboCat.addItem(tabCategorie[i]);
54
+				if(tabCategorie[i].equals(defCategorie))
54 55
 				{
55 56
 					comboCat.setSelectedIndex(i);
56 57
 				}

+ 55
- 21
java/src/Question.java Zobrazit soubor

@@ -1,30 +1,64 @@
1 1
 public class Question
2 2
 {
3
-    protected String intitule;
4
-    protected int reponse;
3
+	protected String intitule;
4
+	protected String reponse1;
5
+	protected String reponse2;
6
+	protected int reponse;
5 7
 
6
-    public Question(String intitule, int reponse) {
7
-        this.intitule = intitule;
8
-        this.reponse = reponse;
9
-    }
8
+	public Question(String intitule, String reponse1, String reponse2, int reponse) {
9
+		this.intitule = intitule;
10
+		this.reponse1 = reponse1;
11
+		this.reponse2 = reponse2;
12
+		this.reponse = reponse;
13
+	}
10 14
 
11
-    public String getIntitule() {
12
-        return intitule;
13
-    }
15
+	public String getIntitule() {
16
+		return intitule;
17
+	}
14 18
 
15
-    public void setIntitule(String intitule) {
16
-        this.intitule = intitule;
17
-    }
19
+	public void setIntitule(String intitule) {
20
+		this.intitule = intitule;
21
+	}
18 22
 
19
-    public int getReponse() {
20
-        return reponse;
21
-    }
23
+	public String getReponse1() {
24
+		return reponse1;
25
+	}
22 26
 
23
-    public void setReponse(int reponse) {
24
-        this.reponse = reponse;
25
-    }
27
+	public void setReponse1(String reponse1) {
28
+		this.reponse1 = reponse1;
29
+	}
26 30
 
27
-    public String toString() {
28
-        return intitule + " - " + reponse;
29
-    }
31
+	public String getReponse2() {
32
+		return reponse2;
33
+	}
34
+
35
+	public void setReponse2(String reponse2) {
36
+		this.reponse2 = reponse2;
37
+	}
38
+
39
+	public int getReponse() {
40
+		return reponse;
41
+	}
42
+
43
+	public void setReponse(int reponse) {
44
+		this.reponse = reponse;
45
+	}
46
+
47
+	public String toString() {
48
+		String bonneReponse = new String();
49
+		if(reponse == 0)
50
+		{
51
+			bonneReponse = "Les deux";
52
+		}
53
+		else if(reponse == 1)
54
+		{
55
+			bonneReponse = reponse1;
56
+		}
57
+		else
58
+		{
59
+			bonneReponse = reponse2;
60
+		}
61
+
62
+		return intitule + " " + bonneReponse;
63
+	}
30 64
 }