commit d0c864b23fbc6ddd6f7b3fbc01a0a119ad09b814 Author: Adrien MALINGREY Date: Tue Oct 20 00:33:14 2020 +0200 first commit diff --git a/Procedures.sql b/Procedures.sql new file mode 100755 index 0000000..07596a8 --- /dev/null +++ b/Procedures.sql @@ -0,0 +1,1835 @@ +-- Groupe 1 manque hibernation et une procedure a revoir +CREATE OR REPLACE PROCEDURE MAJ_Nourriture_Volaille AS -- Checked (juste pas d'hibernation) + boire volaille.ABREUVAGE_V%type; + manger volaille.NOURRI_V%type; + mort boolean; + nbJourJeune volaille.NB_JEUNE_V%type; + poids volaille.POIDS_V%type; +BEGIN + for r in (SELECT ID_VOLAILLE, ABREUVAGE_V, NOURRI_V, NB_JEUNE_V, POIDS_V FROM volaille WHERE hibernatin = 'F') loop + boire := r.ABREUVAGE_V; + manger := r.NOURRI_V; + poids := r.POIDS_V; + mort := FALSE; + + if (r.NB_JEUNE_V >= 0) then + nbJourJeune := r.NB_JEUNE_V; + else + nbJourJeune := 0; + end if; + + if ((manger = 'T') and (boire = 'T')) then + nbJourJeune := 0; + poids := poids + 0.65; + elsif (manger = 'T') then + nbJourJeune := 0; + poids := poids + 0.5; + else + if (nbJourJeune = 0) then + poids := poids - 0.2; + elsif (nbJourJeune = 1) then + poids := poids - 0.5; + elsif (nbJourJeune = 2) then + poids := poids - 1; + elsif (nbJourJeune = 3) then + mort := TRUE; + end if; + nbJourJeune := nbJourJeune + 1; + end if; + + -- dans tous les cas, manger et boire deviennent faux... + manger := 'F'; + boire := 'F'; + + -- verification final du poids + if (poids <= 0) then + mort := TRUE; + elsif (poids > 3.5) then + poids := 3.5; + end if; + + -- MaJ Database + if (mort) then + DELETE FROM volaille WHERE ID_VOLAILLE = r.ID_VOLAILLE; + else + UPDATE volaille SET ABREUVAGE_V = boire, NOURRI_V = manger, NB_JEUNE_V = nbJourJeune, POIDS_V = poids WHERE ID_VOLAILLE = r.ID_VOLAILLE; + end if; + end loop; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE MAJ_Nourriture_Vache AS -- Checked + boire ferme.ABREUVAGE_VACHE%type; + manger ferme.NOURRI_VACHE%type; + poids ferme.POIDS_VACHE%type; +BEGIN + -- La vache ne peut pas mourrir dans cette procedure, car toujours nourrie (par l'herbe) + for r in (SELECT ID_FERMIER, ABREUVAGE_VACHE, NOURRI_VACHE, POIDS_VACHE FROM ferme WHERE HIBERNATION = 'F') loop + boire := r.ABREUVAGE_VACHE; + manger := r.NOURRI_VACHE; + poids := r.POIDS_VACHE; + + poids := poids + 5; -- poids du a l herbe (dans tous les cas) + if (manger = 'T') then -- a mange de la paille + poids := poids + 3; + end if; + if (boire = 'T') then -- a bu => prise de poids dans tous les cas car a manger de l herbe (donc a manger) + poids := poids + 1; + end if; + + -- dans tous les cas, manger et boire deviennent faux... + manger := 'F'; + boire := 'F'; + + -- verification final du poids + if (poids > 750) then + poids := 750; + end if; + + -- MaJ Database + UPDATE ferme SET ABREUVAGE_VACHE = boire, NOURRI_VACHE = manger, NB_JEUNE_VACHE = 0, POIDS_VACHE = poids WHERE ID_FERMIER = r.ID_FERMIER; + end loop; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE MAJ_Nourriture_Lapin AS -- Checked + boireLapereau ferme.ABREUVAGE_J%type; + mangerLapereau ferme.NOURRI_J%type; + boireLapin ferme.ABREUVAGE_L%type; + mangerLapin ferme.NOURRI_L%type; + nbPetit ferme.NB_PETIT%type; + nbMoyen ferme.NB_MOYEN%type; + nbGros ferme.NB_GROS%type; + nbMale ferme.NB_MALE%type; + nbFemelle ferme.NB_FEMELLE%type; + nbLapereauTotal integer; + nbLapereauDevenantMal integer; + nbLapereauMourrant integer; +BEGIN + for r in (SELECT ID_FERMIER, NB_MALE, NB_FEMELLE, NB_PETIT, NB_MOYEN, NB_GROS, ABREUVAGE_L, NOURRI_L, ABREUVAGE_J, NOURRI_J FROM ferme WHERE HIBERNATION = 'F') loop + boireLapereau := r.ABREUVAGE_J; + mangerLapereau := r.NOURRI_J; + boireLapin := r.ABREUVAGE_L; + mangerLapin := r.NOURRI_L; + nbPetit := r.NB_PETIT; + nbMoyen := r.NB_MOYEN; + nbGros := r.NB_GROS; + nbMale := r.NB_MALE; + nbFemelle := r.NB_FEMELLE; + nbLapereauTotal := nbGros + nbMoyen + nbPetit; + + -- les lapins + if (mangerLapin = 'F') then + -- pas nourris => on tue une parties des lapins males (1 au minimun) + nbMale := nbMale - nbMale * dbms_random.value - 1; + nbFemelle := nbFemelle - nbFemelle * dbms_random.value - 1; + end if; + + -- les lapereaux + if ((mangerLapereau = 'T') and (boireLapin = 'T')) then + -- les gros deviennent adultes + nbLapereauDevenantMal := nbGros * dbms_random.value; + nbMale := nbMale + nbLapereauDevenantMal; + nbFemelle := nbFemelle + nbGros - nbLapereauDevenantMal; + -- les moyens deviennent gros + nbGros := nbMoyen; + -- les petits deviennent moyens + nbMoyen := nbPetit; + nbPetit := 0; + elsif (mangerLapereau = 'F') then + -- des lapereaux meurent (les petits en premiers ) + nbLapereauMourrant := nbLapereauTotal * dbms_random.value; + nbPetit := nbPetit - nbLapereauMourrant; + nbLapereauMourrant := nbLapereauMourrant - nbPetit; + if (nbLapereauMourrant > 0) then + nbMoyen := nbMoyen - nbLapereauMourrant; + nbLapereauMourrant := nbLapereauMourrant - nbMoyen; + if (nbLapereauMourrant > 0) then + nbGros := nbGros - nbLapereauMourrant; + nbLapereauMourrant := nbLapereauMourrant - nbGros; + end if; + end if; + end if; + + -- dans tous les cas, manger et boire deviennent faux... + boireLapereau := 'F'; + mangerLapereau := 'F'; + boireLapin := 'F'; + mangerLapin := 'F'; + + -- verification final des quantites + if (nbPetit < 0) then + nbPetit := 0; + end if; + if (nbMoyen < 0) then + nbMoyen := 0; + end if; + if (nbGros < 0) then + nbGros := 0; + end if; + if (nbMale < 0) then + nbMale := 0; + end if; + if (nbFemelle < 0) then + nbFemelle := 0; + end if; + + -- mise a jour de la base + UPDATE ferme SET NB_MALE = nbMale, NB_FEMELLE = nbFemelle, NB_PETIT = nbPetit, NB_MOYEN = nbMoyen, NB_GROS = nbGros, ABREUVAGE_L = boireLapin, NOURRI_L = mangerLapin, ABREUVAGE_J = boireLapereau, NOURRI_J = mangerLapereau WHERE ID_FERMIER = r.ID_FERMIER; + end loop; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE MAJ_Nourriture AS -- Checked +BEGIN + MAJ_Nourriture_Volaille; + MAJ_Nourriture_Vache; + MAJ_Nourriture_Lapin; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE Changement_d_age AS -- !!! Deja fait ds nourrire + nb_sexe_masculin ferme.nb_male%type; + nb_nouveaux_adulte ferme.nb_gros%type; + CURSOR clapier IS + SELECT id_fermier,nb_male,nb_femelle,nb_gros,abreuvage_j,nourri_j + FROM ferme + WHERE HIBERNATION = 'F'; + lapins clapier%rowtype; +BEGIN + -- MAJ de l'age des volailles + -- les volailles prenent un jour quel que soit leur etat de sante et leur nutrition + UPDATE volaille SET age_v = age_v + 1 ; + + -- MAJ de l'age des laperaux + -- les laperaux prenent un jour seulement si ils ont ete nourris et abreuves, peu importe leur etat de sante + -- le clapier ne peut contenir plus de 50 individus + -- la determination du sexe d'un laperau se fait a son passage a l'age adulte par un random + OPEN clapier ; + LOOP + EXIT WHEN clapier%NOTFOUND ; + FETCH clapier INTO lapins ; + IF lapins.abreuvage_j='T' and lapins.nourri_j='T' + THEN + IF lapins.nb_male + lapins.nb_femelle + lapins.nb_gros <= 50 + THEN + nb_nouveaux_adulte := lapins.nb_gros ; + ELSE + nb_nouveaux_adulte := 50 - (lapins.nb_male + lapins.nb_femelle) ; + END IF ; + nb_sexe_masculin := dbms_random.value * nb_nouveaux_adulte ; + UPDATE ferme SET nb_male = lapins.nb_male + nb_sexe_masculin WHERE id_fermier=lapins.id_fermier ; + UPDATE ferme SET nb_femelle = lapins.nb_femelle + (nb_nouveaux_adulte - nb_sexe_masculin) WHERE id_fermier=lapins.id_fermier ; + END IF ; + END LOOP ; + CLOSE clapier ; + UPDATE ferme SET nb_gros = nb_moyen WHERE abreuvage_j='T' and nourri_j='T' ; + UPDATE ferme SET nb_moyen = nb_petit WHERE abreuvage_j='T' and nourri_j='T' ; + -- la naissance des plus petits laperaux n'est pas geree ici + UPDATE ferme SET nb_petit = 0 WHERE abreuvage_j='T' and nourri_j='T' ; + + -- MAJ de l'age de la vache + -- la vache prend un jour quel que soit son etat de sante et sa nutrition + -- lorsqu'une vache meurt, tous les champs la concernant sont passes a NULL + UPDATE ferme SET age_vache = age_vache + 1 WHERE age_vache IS NOT NULL ; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE score AS -- Checked + nbre_oeufs_total_vendu integer ; + nbre_oeufs_vendu integer ; + nbre_laits_total_vendu integer ; + nbre_laits_vendu integer ; + nbre_lapins_total_vendu integer ; + nbre_lapins_vendu integer ; + nbre_achat_eleveur integer ; + nbre_achat_eleveur_total integer ; + nbre_vente_eleveur integer ; + nbre_vente_eleveur_total integer ; + solde integer ; + solde_total integer ; + nbre_gens_total integer ; + score_ integer ; + classements integer ; +BEGIN + -- Initialisation des varibles globales : + SELECT COUNT(NB_VENDU) into nbre_oeufs_total_vendu FROM a_vendu WHERE ID_ARTICLE = jmeumeu.id_oeuf ; + if (nbre_oeufs_total_vendu != 0) then + SELECT SUM(NB_VENDU) into nbre_oeufs_total_vendu FROM a_vendu WHERE ID_ARTICLE = jmeumeu.id_oeuf ; + else + nbre_oeufs_total_vendu := 1; + end if ; + + SELECT COUNT(NB_VENDU) into nbre_laits_total_vendu FROM a_vendu WHERE ID_ARTICLE = jmeumeu.id_lait ; + if (nbre_laits_total_vendu != 0) then + SELECT SUM(NB_VENDU) into nbre_laits_total_vendu FROM a_vendu WHERE ID_ARTICLE = jmeumeu.id_lait ; + else + nbre_laits_total_vendu := 1; + end if ; + + SELECT COUNT(NB_VENDU) into nbre_lapins_total_vendu FROM a_vendu WHERE ID_ARTICLE = jmeumeu.id_lapin_male or ID_ARTICLE = jmeumeu.id_lapin_femelle; + if (nbre_lapins_total_vendu != 0) then + SELECT SUM(NB_VENDU) into nbre_lapins_total_vendu FROM a_vendu WHERE ID_ARTICLE = jmeumeu.id_lapin_male or ID_ARTICLE = jmeumeu.id_lapin_femelle; + else + nbre_lapins_total_vendu := 1; + end if ; + + SELECT COUNT(NB_VENDU) into nbre_vente_eleveur_total FROM a_vendu WHERE not(ID_ARTICLE = jmeumeu.id_lapin_male or ID_ARTICLE = jmeumeu.id_lapin_femelle or ID_ARTICLE = jmeumeu.id_lait or ID_ARTICLE = jmeumeu.id_oeuf) ; + if (nbre_vente_eleveur_total != 0) then + SELECT SUM(NB_VENDU) into nbre_vente_eleveur_total FROM a_vendu WHERE not(ID_ARTICLE = jmeumeu.id_lapin_male or ID_ARTICLE = jmeumeu.id_lapin_femelle or ID_ARTICLE = jmeumeu.id_lait or ID_ARTICLE = jmeumeu.id_oeuf) ; + else + nbre_vente_eleveur_total := 1 ; + end if ; + + SELECT SUM(ECUS) into solde_total FROM ferme ; + SELECT SUM(NB_ACHATS_JOUR) into nbre_achat_eleveur_total FROM ferme WHERE HIBERNATION = 'F'; + SELECT COUNT(*) into nbre_gens_total FROM ferme ; + + for un_gens in (SELECT ID_FERMIER, ECUS, NB_ACHATS_JOUR FROM ferme WHERE hibernation = 'F') loop + -- Initialisation des varibles : + solde := un_gens.ECUS ; + nbre_achat_eleveur := un_gens.NB_ACHATS_JOUR ; + + SELECT COUNT(NB_VENDU) into nbre_oeufs_vendu FROM a_vendu WHERE ID_ARTICLE = jmeumeu.id_oeuf and ID_FERMIER = un_gens.ID_FERMIER ; + if (nbre_oeufs_vendu != 0) then + SELECT SUM(NB_VENDU) into nbre_oeufs_vendu FROM a_vendu WHERE ID_ARTICLE = jmeumeu.id_oeuf and ID_FERMIER = un_gens.ID_FERMIER ; + end if ; + + SELECT COUNT(NB_VENDU) into nbre_laits_vendu FROM a_vendu WHERE ID_ARTICLE = jmeumeu.id_lait and ID_FERMIER = un_gens.ID_FERMIER ; + if (nbre_laits_vendu != 0) then + SELECT SUM(NB_VENDU) into nbre_laits_vendu FROM a_vendu WHERE ID_ARTICLE = jmeumeu.id_lait and ID_FERMIER = un_gens.ID_FERMIER ; + end if ; + + SELECT COUNT(NB_VENDU) into nbre_lapins_vendu FROM a_vendu WHERE (ID_ARTICLE = jmeumeu.id_lapin_male or ID_ARTICLE = jmeumeu.id_lapin_femelle) and ID_FERMIER = un_gens.ID_FERMIER ; + if (nbre_lapins_vendu != 0) then + SELECT SUM(NB_VENDU) into nbre_lapins_vendu FROM a_vendu WHERE (ID_ARTICLE = jmeumeu.id_lapin_male or ID_ARTICLE = jmeumeu.id_lapin_femelle) and ID_FERMIER = un_gens.ID_FERMIER ; + end if ; + + SELECT COUNT(NB_VENDU) into nbre_vente_eleveur FROM a_vendu WHERE ID_FERMIER = un_gens.ID_FERMIER and not(ID_ARTICLE = jmeumeu.id_lapin_male or ID_ARTICLE = jmeumeu.id_lapin_femelle or ID_ARTICLE = jmeumeu.id_lait or ID_ARTICLE = jmeumeu.id_oeuf) ; + if (nbre_vente_eleveur != 0) then + SELECT SUM(NB_VENDU) into nbre_vente_eleveur FROM a_vendu WHERE ID_FERMIER = un_gens.ID_FERMIER and not(ID_ARTICLE = jmeumeu.id_lapin_male or ID_ARTICLE = jmeumeu.id_lapin_femelle or ID_ARTICLE = jmeumeu.id_lait or ID_ARTICLE = jmeumeu.id_oeuf) ; + end if ; + + score_ := (jmeumeu.coeff_achat*(nbre_achat_eleveur/nbre_achat_eleveur_total) + jmeumeu.coeff_vente*(nbre_vente_eleveur/nbre_vente_eleveur_total) + jmeumeu.coeff_oeuf*(nbre_oeufs_vendu/nbre_oeufs_total_vendu) + jmeumeu.coeff_lapin*(nbre_lapins_vendu/nbre_lapins_total_vendu) + jmeumeu.coeff_lait*(nbre_laits_vendu/nbre_laits_total_vendu) + jmeumeu.coeff_solde*(solde/solde_total) )*nbre_gens_total ; + + UPDATE ferme set score=score_ WHERE id_fermier = un_gens.id_fermier; + end loop ; + classements := 1 ; + for un_gens in (SELECT ID_FERMIER, SCORE FROM ferme ORDER BY SCORE DESC) loop + UPDATE ferme set CLASSEMENT = classements WHERE ID_FERMIER = un_gens.ID_FERMIER; + classements := classements + 1 ; + end loop ; + COMMIT; +END; +/ + + + + +CREATE OR REPLACE PROCEDURE MAJ_MALADIE AS -- Checked + --curseur sur les fermiers + CURSOR FARM IS + SELECT * + FROM FERME + WHERE HIBERNATION = 'F' + FOR UPDATE; + --curseur parametre sur les volailles + CURSOR MALADIE_V(FERMIER FERME.ID_FERMIER%TYPE) IS + SELECT V.NB_MALADE_V, V.ID_VOLAILLE + FROM VOLAILLE V,FERME F + WHERE F.ID_FERMIER = V.ID_FERMIER + AND V.ID_FERMIER = FERMIER + FOR UPDATE; + SEUIL FLOAT; +BEGIN + --initialisation + SEUIL := 0.6; + + --Parcours des fermes pour les morts... + FOR UNE_FERME IN FARM + LOOP + --mort des volailles + FOR UNE_VOLAILLE IN MALADIE_V(UNE_FERME.ID_FERMIER) + LOOP + IF (UNE_VOLAILLE.NB_MALADE_V = 4) + THEN + DELETE FROM VOLAILLE WHERE CURRENT OF MALADIE_V; + END IF; + END LOOP; + + --mort des vaches + IF (UNE_FERME.NB_MALADE_VACHE = 4) + THEN + UPDATE FERME SET POIDS_VACHE = 0 WHERE CURRENT OF FARM ; + UPDATE FERME SET NB_MALADE_VACHE = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET SALE_VACHE = 'F' WHERE CURRENT OF FARM; + END IF; + + --mort des lapins + IF (UNE_FERME.NB_MALADE_L = 1) + THEN + UPDATE FERME SET NB_MALE = NB_MALE - CAST((NB_MALE * dbms_random.value) AS INTEGER) WHERE CURRENT OF FARM; + UPDATE FERME SET NB_FEMELLE = NB_FEMELLE - CAST((NB_FEMELLE * dbms_random.value) AS INTEGER) WHERE CURRENT OF FARM; + + IF (UNE_FERME.NB_MALE = 0 AND UNE_FERME.NB_FEMELLE = 0 ) + THEN + UPDATE FERME SET NB_MALE = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET NB_FEMELLE = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET NB_MALADE_L = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET SALE_L = 'F' WHERE CURRENT OF FARM; + END IF; + END IF; + + --mort des lapereaux + IF (UNE_FERME.NB_MALADE_J = 1) + THEN + UPDATE FERME SET NB_GROS = NB_GROS - CAST((NB_GROS * dbms_random.value) AS INTEGER) WHERE CURRENT OF FARM; + UPDATE FERME SET NB_MOYEN = NB_MOYEN - CAST((NB_MOYEN * dbms_random.value) AS INTEGER) WHERE CURRENT OF FARM; + UPDATE FERME SET NB_PETIT = NB_PETIT - CAST((NB_PETIT * dbms_random.value) AS INTEGER) WHERE CURRENT OF FARM; + + IF (UNE_FERME.NB_GROS = 0 AND UNE_FERME.NB_MOYEN = 0 AND UNE_FERME.NB_PETIT = 0) + THEN + UPDATE FERME SET NB_GROS = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET NB_MOYEN = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET NB_PETIT = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET NB_MALADE_J = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET SALE_J = 'F' WHERE CURRENT OF FARM; + END IF; + END IF; + END LOOP; + + --Parcours des fermes pour la mise a jour des maladies + FOR UNE_FERME IN FARM + LOOP + --mise a jour des volailles + FOR UNE_VOLAILLE IN MALADIE_V(UNE_FERME.ID_FERMIER) + LOOP + IF (UNE_VOLAILLE.NB_MALADE_V = 0) + THEN + IF (dbms_random.value>SEUIL) + THEN + UPDATE VOLAILLE SET NB_MALADE_V = 1 WHERE CURRENT OF MALADIE_V; + END IF; + ELSE + UPDATE VOLAILLE SET NB_MALADE_V = NB_MALADE_V + 1 WHERE CURRENT OF MALADIE_V; + END IF; + END LOOP; + + --mise a jour des vaches + IF (UNE_FERME.POIDS_VACHE > 0) + THEN + IF (UNE_FERME.NB_MALADE_VACHE = 0) + THEN + IF (dbms_random.value>SEUIL) + THEN + UPDATE FERME SET NB_MALADE_VACHE = 1 WHERE CURRENT OF FARM; + END IF; + ELSE + UPDATE FERME SET NB_MALADE_VACHE = NB_MALADE_VACHE + 1 WHERE CURRENT OF FARM; + END IF; + END IF; + + --mise a jour des lapins + IF (UNE_FERME.NB_MALE > 0 OR UNE_FERME.NB_FEMELLE > 0) + THEN + IF (UNE_FERME.NB_MALADE_L = 0) + THEN + IF (dbms_random.value>SEUIL) + THEN + UPDATE FERME SET NB_MALADE_L = 1 WHERE CURRENT OF FARM; + END IF; + END IF; + END IF; + + --mise a jour des lapereaux + IF (UNE_FERME.NB_GROS > 0 OR UNE_FERME.NB_MOYEN > 0 OR UNE_FERME.NB_PETIT > 0) + THEN + IF (UNE_FERME.NB_MALADE_J = 0) + THEN + IF (dbms_random.value>SEUIL) + THEN + UPDATE FERME SET NB_MALADE_J = 1 WHERE CURRENT OF FARM; + END IF; + END IF; + END IF; + END LOOP; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE MAJ_SALE AS -- Checked + --curseur sur les fermiers + CURSOR FARM IS + SELECT * + FROM FERME + WHERE HIBERNATION = 'F' + FOR UPDATE; + --curseur parametre sur les volailles + CURSOR SALE_VOL(FERMIER FERME.ID_FERMIER%TYPE) IS + SELECT V.NB_MALADE_V + FROM VOLAILLE V,FERME F + WHERE F.ID_FERMIER = V.ID_FERMIER + AND V.ID_FERMIER = FERMIER + AND V.SALE_V = 'F' + FOR UPDATE; + SEUIL FLOAT; +BEGIN + --initialisation + SEUIL := 0.4; + FOR UNE_FERME IN FARM + LOOP + --Mort des lapins et laperaux + --mort des lapins + IF (UNE_FERME.SALE_L = 'T') + THEN + UPDATE FERME SET NB_MALE = NB_MALE - CAST((NB_MALE * dbms_random.value) AS INTEGER) WHERE CURRENT OF FARM; + UPDATE FERME SET NB_FEMELLE = NB_FEMELLE - CAST((NB_FEMELLE * dbms_random.value) AS INTEGER) WHERE CURRENT OF FARM; + + IF (UNE_FERME.NB_MALE = 0 AND UNE_FERME.NB_FEMELLE = 0) + THEN + UPDATE FERME SET NB_MALE = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET NB_FEMELLE = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET NB_MALADE_L = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET SALE_L = 'F' WHERE CURRENT OF FARM; + END IF; + END IF; + + --mort des lapereaux + IF (UNE_FERME.SALE_J = 'T') + THEN + UPDATE FERME SET NB_GROS = NB_GROS - CAST((NB_GROS * dbms_random.value) AS INTEGER) WHERE CURRENT OF FARM; + UPDATE FERME SET NB_MOYEN = NB_MOYEN - CAST((NB_MOYEN * dbms_random.value) AS INTEGER) WHERE CURRENT OF FARM; + UPDATE FERME SET NB_PETIT = NB_PETIT - CAST((NB_PETIT * dbms_random.value) AS INTEGER) WHERE CURRENT OF FARM; + + IF (UNE_FERME.NB_GROS = 0 AND UNE_FERME.NB_MOYEN = 0 AND UNE_FERME.NB_PETIT = 0) + THEN + UPDATE FERME SET NB_GROS = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET NB_MOYEN = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET NB_PETIT = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET NB_MALADE_J = 0 WHERE CURRENT OF FARM; + UPDATE FERME SET SALE_J = 'F' WHERE CURRENT OF FARM; + END IF; + END IF; + + --mise a jour des volailles + FOR UNE_VOLAILLE IN SALE_VOL(UNE_FERME.ID_FERMIER) + LOOP + IF (dbms_random.value>SEUIL) + THEN + UPDATE VOLAILLE SET SALE_V = 'T' WHERE CURRENT OF SALE_VOL; + END IF; + END LOOP; + + --mise a jour des vaches + IF (UNE_FERME.POIDS_VACHE > 0) + THEN + IF (UNE_FERME.SALE_VACHE = 'F') + THEN + IF (dbms_random.value>SEUIL) + THEN + UPDATE FERME SET SALE_VACHE = 'T' WHERE CURRENT OF FARM; + END IF; + END IF; + END IF; + + --mise a jour des lapins + IF (UNE_FERME.NB_MALE > 0 OR UNE_FERME.NB_FEMELLE > 0) + THEN + IF (UNE_FERME.SALE_L = 'F') + THEN + IF (dbms_random.value>SEUIL) + THEN + UPDATE FERME SET SALE_L = 'T' WHERE ID_FERMIER LIKE UNE_FERME.ID_FERMIER; + END IF; + END IF; + END IF; + + --mise a jour des lapereaux + IF (UNE_FERME.NB_GROS > 0 OR UNE_FERME.NB_MOYEN > 0 OR UNE_FERME.NB_PETIT > 0) + THEN + IF (UNE_FERME.SALE_J = 'F') + THEN + IF (dbms_random.value>SEUIL) + THEN + UPDATE FERME SET SALE_J = 'T' WHERE CURRENT OF FARM; + END IF; + END IF; + END IF; + END LOOP; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE MAJ_GLOBALE AS -- Checked + CURSOR FERMIERS IS + SELECT ID_FERMIER + FROM FERME + WHERE HIBERNATION = 'F' + FOR UPDATE; + CURSOR VOLAILLES_DE(FERMIER FERME.ID_FERMIER%TYPE) IS + SELECT ID_VOLAILLE + FROM VOLAILLE + WHERE ID_FERMIER = FERMIER + FOR UPDATE; +BEGIN + FOR FERMIER IN FERMIERS LOOP + FOR VOLAILLE IN VOLAILLES_DE(FERMIER.ID_FERMIER) LOOP + Creation_oeuf(VOLAILLE.ID_VOLAILLE,FERMIER.ID_FERMIER); -- Ponte des poules + END LOOP; + Creation_lait(FERMIER.ID_FERMIER); -- Remplissage du pis des vaches + END LOOP; + + MAJ_Nourriture(); -- Mise à jour des animaux nourris + MAJ_MALADIE(); -- Mise à jour des animaux malades + MAJ_SALE(); -- Mise à jour des animaux sales + Changement_d_age(); -- Changement d'âge des animaux si besoin est + score(); -- Mise à jour des scores + Naissance_Lapins(); -- Naissance des jolis petits lapinous + Mise_A_JourCoop(); -- Remplissage de la coopérative + Hiberner(); -- Hibernation automatique au bout de 3 jours +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE Mise_A_JourCoop AS -- Checked + nb_fermier INTEGER ; + facteur_mul INTEGER ; +BEGIN + -- la cooperative possede un stock adapte au nombre de fermier + SELECT count(*) INTO nb_fermier FROM ferme ; + -- on augmente d'une quantite tous les 20 fermiers + facteur_mul := nb_fermier / 20 + 1 ; + -- reinitialisation du nombre de sac de nourriture + UPDATE article SET quantite = jmeumeu.qte_sac_de_graine * facteur_mul WHERE id_article = jmeumeu.id_sac_de_graine ; + -- reinitialisation du nombre de seau d'eau + UPDATE article SET quantite = jmeumeu.qte_seau_d_eau * facteur_mul WHERE id_article = jmeumeu.id_seau_d_eau ; + -- reinitialisation du nombre de + UPDATE article SET quantite = jmeumeu.qte_seringue * facteur_mul WHERE id_article = jmeumeu.id_seringue ; + -- reinitialisation du nombre de + UPDATE article SET quantite = jmeumeu.qte_botte_de_paille * facteur_mul WHERE id_article = jmeumeu.id_botte_de_paille ; + -- reinitialisation du nombre de + UPDATE article SET quantite = jmeumeu.qte_poussin_male * facteur_mul WHERE id_article = jmeumeu.id_poussin_male ; + -- reinitialisation du nombre de + UPDATE article SET quantite = jmeumeu.qte_poussin_femelle * facteur_mul WHERE id_article = jmeumeu.id_poussin_femelle ; + -- reinitialisation du nombre de + UPDATE article SET quantite = jmeumeu.qte_coq * facteur_mul WHERE id_article = jmeumeu.id_coq ; + -- reinitialisation du nombre de + UPDATE article SET quantite = jmeumeu.qte_poule * facteur_mul WHERE id_article = jmeumeu.id_poule ; + -- reinitialisation du nombre de + UPDATE article SET quantite = jmeumeu.qte_lapin_male * facteur_mul WHERE id_article = jmeumeu.id_lapin_male ; + -- reinitialisation du nombre de + UPDATE article SET quantite = jmeumeu.qte_lapin_femelle * facteur_mul WHERE id_article = jmeumeu.id_lapin_femelle ; + COMMIT; +END; +/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-- Groupe 2 CHECKED +CREATE OR REPLACE PROCEDURE Ajouter_a_collection -- Checked +( + fermier ENTREPOSE.ID_FERMIER%type, + id ENTREPOSE.ID_ARTICLE%type, + nb ENTREPOSE.QUANTITE%type +) AS + boolCollect ARTICLE.collectionnable%TYPE; +BEGIN + SELECT collectionnable into boolCollect FROM ARTICLE WHERE id_article = id; + IF (boolCollect = 'T') + THEN + INSERT INTO ENTREPOSE(ENTREPOSE.id_fermier,ENTREPOSE.id_article,ENTREPOSE.quantite,ENTREPOSE.collection) VALUES(fermier,id,nb,'T'); + ELSE + RAISE_APPLICATION_ERROR(-20112,'Article non collectionnable'); + END IF; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE Vente_article_remise -- Checked +( + fermier MARCHE_VEND.ID_FERMIER%type, + id ARTICLE.ID_ARTICLE%type, + nb MARCHE_VEND.NB_VENTE%type, + prix MARCHE_VEND.prix%type +) AS + dispo ENTREPOSE.quantite%type; + nb_rest ENTREPOSE.quantite%type; +BEGIN + SELECT quantite INTO dispo FROM ENTREPOSE WHERE ENTREPOSE.id_article = id; + IF dispo >= nb + THEN + nb_rest := dispo - nb ; + UPDATE MARCHE_VEND set MARCHE_VEND.nb_vente = nb_rest WHERE id = MARCHE_VEND.id_article ; + INSERT INTO MARCHE_VEND(MARCHE_VEND.id_fermier,MARCHE_VEND.id_article,MARCHE_VEND.nb_vente,MARCHE_VEND.prix) VALUES(fermier,id,nb,prix); + ELSE + RAISE_APPLICATION_ERROR(-20113,'Trop d`articles vendus'); + END IF; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE Acheter_articleM -- Checked +( + id_fer FERME.ID_FERMIER%type, + id_art ARTICLE.ID_ARTICLE%type, + quant INTEGER +) AS + fermier FERME%rowtype; + prod A_VENDU%rowtype; + prod_E ENTREPOSE%rowtype; + produit MARCHE_VEND%rowtype; + produit_M MARCHE_VEND%rowtype; + nb_achat FERME.NB_ACHATS_JOUR%type; + age VOLAILLE.AGE_V%type; + prix ARTICLE.PRIX_ACHAT%type; + vente integer := 0; + tmp integer; + droit boolean; + fait integer; + cursor prods IS + SELECT * FROM A_VENDU WHERE id_fer = A_VENDU.ID_FERMIER; + cursor produits IS + SELECT * FROM MARCHE_VEND WHERE id_art = MARCHE_VEND.ID_ARTICLE; +BEGIN + SELECT * INTO fermier FROM FERME WHERE id_fer = FERME.ID_FERMIER; + droit := FALSE; + IF(fermier.NB_ACHATS_JOUR < 1) + THEN + IF(fermier.NB_ACHATS_JOUR + quant <= 12) + THEN + droit := TRUE; + END IF; + END IF; + -- si l'article est mis en vente au marché avec la quantité demandée + SELECT SUM(NB_VENTE) INTO vente FROM MARCHE_VEND WHERE id_art = MARCHE_VEND.ID_ARTICLE; + IF (vente >= quant) + THEN + -- Ajouter + IF(droit) + THEN + -- Si le fermier a assez d'argent pour acheter + SELECT PRIX_ACHAT INTO prix FROM ARTICLE WHERE id_art = ARTICLE.ID_ARTICLE; + IF(fermier.ECUS >= quant*prix) + THEN + -- Recherche du fermier qui vent ses produits avec le prix le moins cher + WHILE (fait= quant) + THEN + IF(produit_M.NB_VENTE = quant) + THEN --offre==demande => supp du vendeur de cette categorie + DELETE FROM MARCHE_VEND WHERE id_art = MARCHE_VEND.ID_ARTICLE and produit_M.ID_FERMIER = MARCHE_VEND.ID_FERMIER; + ELSE --offre > demande => mis a jour + UPDATE MARCHE_VEND set MARCHE_VEND.NB_VENTE = MARCHE_VEND.NB_VENTE-quant WHERE id_art=MARCHE_VEND.ID_ARTICLE and produit_M.ID_FERMIER = MARCHE_VEND.ID_FERMIER; + END IF; + -- MaJ Compte Bancaire + UPDATE FERME set FERME.ECUS=FERME.ECUS+(quant*prix) WHERE FERME.ID_FERMIER=produit_M.ID_FERMIER; + UPDATE FERME set FERME.ECUS=FERME.ECUS-(quant*prix) WHERE FERME.ID_FERMIER=id_fer; + -- VerIFier si on a deja d'autres articles du mm type + SELECT count(ID_ARTICLE) INTO tmp FROM ENTREPOSE WHERE id_fer=ENTREPOSE.ID_FERMIER and id_art=ENTREPOSE.ID_ARTICLE; + IF(tmp = 0) + THEN + INSERT INTO ENTREPOSE values(id_fer, id_art, quant, 'F'); + ELSE + UPDATE ENTREPOSE set ENTREPOSE.QUANTITE=ENTREPOSE.QUANTITE+quant WHERE id_art=ENTREPOSE.ID_ARTICLE and produit_M.ID_FERMIER = ENTREPOSE.ID_FERMIER; + END IF; + -- Idem pr Vendeur + SELECT count(ID_ARTICLE) INTO tmp FROM A_VENDU WHERE id_fer=A_VENDU.ID_FERMIER and id_art=A_VENDU.ID_ARTICLE; + IF(tmp = 0) + THEN + INSERT INTO A_VENDU values(id_fer, id_art, quant, CURRENT_DATE); + ELSE + UPDATE A_VENDU set A_VENDU.NB_VENDU=A_VENDU.NB_VENDU+quant, DATE_VENTE=CURRENT_DATE WHERE id_art=A_VENDU.ID_ARTICLE and produit_M.ID_FERMIER = A_VENDU.ID_FERMIER; + END IF; + fait := quant; + ELSE --ce fermier seul ne satisfait pas la demande + DELETE FROM MARCHE_VEND WHERE id_art=MARCHE_VEND.ID_ARTICLE and produit_M.ID_FERMIER = MARCHE_VEND.ID_FERMIER; + UPDATE FERME set FERME.ECUS=FERME.ECUS+(produit_M.NB_VENTE*prix) WHERE FERME.ID_FERMIER=produit_M.ID_FERMIER; + UPDATE FERME set FERME.ECUS=FERME.ECUS-(produit_M.NB_VENTE*prix) WHERE FERME.ID_FERMIER=id_fer; + SELECT count(ID_ARTICLE) INTO tmp FROM ENTREPOSE WHERE id_fer=ENTREPOSE.ID_FERMIER and id_art=ENTREPOSE.ID_ARTICLE; + IF(tmp = 0) + THEN + INSERT INTO ENTREPOSE values(id_fer, id_art, produit_M.NB_VENTE, 'F'); + ELSE + UPDATE ENTREPOSE set ENTREPOSE.QUANTITE=ENTREPOSE.QUANTITE+produit_M.NB_VENTE WHERE id_art=ENTREPOSE.ID_ARTICLE and produit_M.ID_FERMIER = ENTREPOSE.ID_FERMIER; + END IF; + SELECT count(ID_ARTICLE) INTO tmp FROM A_VENDU WHERE id_fer=A_VENDU.ID_FERMIER and id_art=A_VENDU.ID_ARTICLE; + IF(tmp = 0) + THEN + INSERT INTO A_VENDU values(id_fer, id_art, produit_M.NB_VENTE, CURRENT_DATE); + ELSE + UPDATE A_VENDU set A_VENDU.NB_VENDU=A_VENDU.NB_VENDU+produit_M.NB_VENTE, DATE_VENTE=CURRENT_DATE WHERE id_art=A_VENDU.ID_ARTICLE and produit_M.ID_FERMIER = A_VENDU.ID_FERMIER; + END IF; + fait := produit_M.NB_VENTE; + END IF; + END loop; + ELSE + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + END IF; + ELSE + RAISE_APPLICATION_ERROR(-20114,'Vous n`avez pas les droits necessaires'); + END IF; + ELSE + RAISE_APPLICATION_ERROR(-20113,'Trop d`articles vendus'); + END IF; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE Acheter_articleC -- Checked +( + idfermier FERME.ID_FERMIER%type, + idarticle article.id_article%type, + quantite INTEGER +) AS + ferm FERME%rowtype ; + stock ENTREPOSE%rowtype ; + coop ARTICLE%rowtype ; + vente A_VENDU%rowtype ; + achat MARCHE_VEND%rowtype; + Cursor curVente IS + SELECT * FROM a_vendu WHERE a_vendu.id_fermier = idfermier; + Cursor curAchat IS + SELECT * FROM marche_vend WHERE marche_vend.id_fermier = idfermier; + nbMaxAchat FERME.NB_ACHATS_JOUR%type; + solde FERME.ECUS%type; + quant ARTICLE.QUANTITE%type; + fermQuant ARTICLE.QUANTITE%type; + prix ARTICLE.PRIX_VENTE%type; + prixTotal integer; + noHeure number; + dateActu date; + jour varchar(20) ; + heure varchar(20); + ouverte number; + nbPoules number ; + nbLapins number; + nbVendus number; + nbLitres number ; + nbAchats number ; + animaux number ; + ageV number; + nbLF number; + nbLM number; +BEGIN + SELECT * INTO ferm FROM FERME WHERE idfermier = FERME.ID_FERMIER; + SELECT * INTO coop FROM article WHERE ARTICLE.id_article = idarticle; + SELECT * INTO stock FROM entrepose WHERE ENTREPOSE.id_fermier = idfermier and id_article= idarticle; + + nbMaxAchat := ferm.NB_ACHATS_JOUR; + solde := ferm.ECUS; + quant := coop.QUANTITE; + prix := coop.PRIX_VENTE; + prixTotal := prix*quantite; + -- Nb Lapins + nbLapins := ferm.NB_MALE + ferm.NB_FEMELLE ; + -- Compter le nb d'achats + nbAchats := 0; + FOR achat IN curAchat + LOOP + nbAchats := nbAchats + achat.nb_vente ; + END LOOP; + -- Variables pour gerer les ouvertures et fermetures de la coop + SELECT current_date INTO dateActu FROM dual; + heure := TO_CHAR(dateActu,'HH24'); + jour := TO_CHAR(dateActu,'DY'); + noHeure := TO_NUMBER(heure); + + -- Coop ouverte ? + IF((jour = 'SAM.') or (jour = 'DIM.')) + THEN + IF(((noHeure >= 9) and (noHeure < 14)) or (noHeure > 19) or (noHeure < 3)) + THEN + ouverte := 1; + ELSE + ouverte := 0; + END IF ; + ELSE + IF (((noHeure >= 5) and (noHeure < 14)) or ((noHeure >= 17) and (noHeure<20)) or(noHeure >= 22)or(noHeure < 3)) + THEN + ouverte := 1; + ELSE + ouverte := 0; + END IF; + END IF; + + -- Si coop ouverte + IF(ouverte = 1) + THEN + -- Achats encore possibles + IF (nbMaxAchat > quantite) + THEN + -- Article en stock + IF (quantite < quant) + THEN + -- Assez d'argent + IF(solde > prixTotal) + THEN + -- mise a jour des donnees + solde := solde - prixTotal ; + UPDATE FERME set FERME.ECUS = solde WHERE id_fermier = idfermier; + quant := quant - quantite ; + UPDATE ARTICLE set ARTICLE.QUANTITE = quant WHERE id_article = idarticle; + nbMaxAchat := nbMaxAchat - quantite; + UPDATE FERME set FERME.NB_ACHATS_JOUR = nbMaxAchat WHERE FERME.ID_FERMIER = idfermier; + SELECT count(ID_ARTICLE) INTO fermQuant FROM ENTREPOSE WHERE ENTREPOSE.ID_FERMIER = idfermier and ENTREPOSE.ID_ARTICLE= idarticle; + -- Nb ds entrepot + IF(fermQuant = 0) + THEN + INSERT INTO ENTREPOSE values(idfermier, idarticle, quantite, 'F'); + -- gestion des poules et des coqs + IF((idarticle = jmeumeu.id_coq) or (idarticle = jmeumeu.id_poule)) + THEN + SELECT count(AGE_V) INTO ageV FROM VOLAILLE WHERE VOLAILLE.ID_FERMIER =idfermier and VOLAILLE.ID_VOLAILLE =idarticle; + IF(ageV = 0) + THEN + INSERT INTO VOLAILLE values(idarticle,idfermier,'F',0,'F',0,'F',0,2.5,4,0); + END IF; + ELSE + -- gestion des lapins et lapines + IF((idarticle = jmeumeu.id_lapin_male) or (idarticle = jmeumeu.id_lapin_femelle)) + THEN + IF(idarticle = jmeumeu.id_lapin_male) + THEN + UPDATE FERME set FERME.NB_MALE = quantite WHERE FERME.ID_FERMIER = idfermier; + ELSE + UPDATE FERME set FERME.NB_FEMELLE = quantite WHERE FERME.ID_FERMIER = idfermier; + END IF; + END IF; + END IF; + ELSE + -- gestion generale des poules et coqs + IF((idarticle = jmeumeu.id_coq) or (idarticle = jmeumeu.id_poule) or (idarticle = jmeumeu.id_poussin_male) or (idarticle = jmeumeu.id_poussin_femelle)) + THEN + IF((fermQuant + quantite) > 60) + THEN + RAISE_APPLICATION_ERROR(-20227,'Capacite maximale atteinte'); + END IF; + ELSE + -- gestion generale des lapins et lapines + IF(((idarticle =jmeumeu.id_lapin_male) or (idarticle = jmeumeu.id_lapin_femelle)) and ((nbLapins+quantite)<40)) + THEN + IF(idarticle = jmeumeu.id_lapin_male) + THEN + SELECT NB_MALE INTO nbLM FROM FERME WHERE FERME.ID_FERMIER =idfermier ; + nbLM := nbLM +quantite ; + UPDATE FERME set FERME.NB_MALE = nbLM WHERE FERME.ID_FERMIER = idfermier; + ELSE + SELECT NB_FEMELLE INTO nbLF FROM FERME WHERE FERME.ID_FERMIER =idfermier ; + nbLF := nbLF +quantite ; + UPDATE FERME set FERME.NB_FEMELLE = nbLF WHERE FERME.ID_FERMIER = idfermier; + END IF; + ELSE + RAISE_APPLICATION_ERROR(-20227,'Capacite maximale atteinte'); + END IF; + END IF; + -- Gestion stock + fermQuant := stock.QUANTITE; + fermQuant := fermQuant + quantite ; + UPDATE ENTREPOSE set ENTREPOSE.QUANTITE = fermQuant WHERE id_fermier = idfermier and id_article= idarticle; + END IF; + ELSE + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + END IF; + ELSE + RAISE_APPLICATION_ERROR(-20113,'Trop d`articles vendus'); + END IF; + ELSE + RAISE_APPLICATION_ERROR(-20115,'Depassement de la limite de ventes/achats par jour'); + END IF; + ELSE + RAISE_APPLICATION_ERROR(-20116,'Coop ferme'); + END IF; + COMMIT; +END; +/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-- Groupe 3 CHECKED +CREATE OR REPLACE PROCEDURE nourrir_clapier -- Checked +( + idfermier ferme.id_fermier%type, + young boolean +) AS + nb_ecus ferme.ecus%type; + nourrij ferme.nourri_j%type; + nourril ferme.nourri_l%type; +BEGIN + SELECT ecus into nb_ecus FROM ferme WHERE ferme.id_fermier = idfermier; + nb_ecus := nb_ecus - 5; + if nb_ecus < 0 then + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + else + if young then + SELECT nourri_j into nourrij FROM ferme WHERE idfermier = id_fermier; + if nourrij = 'T' then + RAISE_APPLICATION_ERROR(-20222,'Animaux deja nourris'); + else + UPDATE ferme set nourri_j = 'T' WHERE idfermier = id_fermier; + end if; + else + SELECT nourri_l into nourril from ferme WHERE idfermier = id_fermier; + if nourril = 'T' then + RAISE_APPLICATION_ERROR(-20222,'Animaux deja nourris'); + else + UPDATE ferme set nourri_l = 'T' WHERE idfermier = id_fermier; + end if; + end if; + UPDATE ferme set ecus = nb_ecus WHERE ferme.id_fermier = idfermier; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE abreuver_clapier -- Checked +( + idfermier ferme.id_fermier%type, + young boolean +) AS + nb_ecus ferme.ecus%type; + abreuvagej ferme.abreuvage_j%type; + abreuvagel ferme.abreuvage_l%type; +BEGIN + SELECT ecus into nb_ecus FROM ferme WHERE ferme.id_fermier = idfermier; + nb_ecus := nb_ecus - 2; + if nb_ecus < 0 then + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + else + if young then + SELECT abreuvage_j into abreuvagej FROM ferme WHERE idfermier = id_fermier; + if abreuvagej = 'T' then + RAISE_APPLICATION_ERROR(-20223,'Animaux deja abreuves'); + else + UPDATE ferme set abreuvage_j = 'T' WHERE idfermier = id_fermier; + end if; + else + SELECT abreuvage_l into abreuvagel FROM ferme WHERE idfermier = id_fermier; + if abreuvagel = 'T' then + RAISE_APPLICATION_ERROR(-20223,'Animaux deja abreuves'); + else + UPDATE ferme set abreuvage_l = 'T' WHERE idfermier = id_fermier; + end if; + end if; + UPDATE ferme set ecus = nb_ecus WHERE ferme.id_fermier = idfermier; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE nettoyer_clapier -- Checked +( + idfermier ferme.id_fermier%type, + young boolean +) AS + nb_ecus ferme.ecus%type; +BEGIN + SELECT ecus into nb_ecus FROM ferme WHERE ferme.id_fermier = idfermier; + nb_ecus := nb_ecus - 3; + if nb_ecus < 0 then + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + else + if young then + UPDATE ferme set sale_j = 'F' WHERE idfermier = id_fermier; + else + UPDATE ferme set sale_l = 'F' WHERE idfermier = id_fermier; + end if; + UPDATE ferme set ecus = nb_ecus WHERE ferme.id_fermier = idfermier; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE soigner_clapier -- Checked +( + idfermier ferme.id_fermier%type, + young boolean +) AS + nb_ecus ferme.ecus%type; +BEGIN + SELECT ecus into nb_ecus FROM ferme WHERE ferme.id_fermier = idfermier; + nb_ecus := nb_ecus - 6; + if nb_ecus < 0 then + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + else + if young then + UPDATE ferme set nb_malade_j = 0 WHERE idfermier = id_fermier; + else + UPDATE ferme set nb_malade_l = 0 WHERE idfermier = id_fermier; + end if; + UPDATE ferme set ecus = nb_ecus WHERE ferme.id_fermier = idfermier; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE vendre_lapins -- Checked +( + idfermier ferme.id_fermier%type, + male boolean, + nb integer +) AS + nb_lapins integer; +BEGIN + if male then + SELECT nb_male into nb_lapins FROM ferme WHERE idfermier=id_fermier; + nb_lapins := nb_lapins - nb; + if nb_lapins < 0 then + RAISE_APPLICATION_ERROR(-20224,'Pas assez d`animaux'); + end if; + UPDATE ferme set nb_male = nb_lapins WHERE idfermier=id_fermier; + INSERT INTO a_vendu VALUES (idfermier,jmeumeu.id_lapin_male,nb,CURRENT_DATE); + else + SELECT nb_femelle into nb_lapins FROM ferme WHERE idfermier=id_fermier; + nb_lapins := nb_lapins - nb; + if nb_lapins < 0 then + RAISE_APPLICATION_ERROR(-20224,'Pas assez d`animaux'); + end if; + UPDATE ferme set nb_femelle = nb_lapins WHERE idfermier=id_fermier; + INSERT INTO a_vendu VALUES (idfermier,jmeumeu.id_lapin_femelle,nb,CURRENT_DATE); + end if; + UPDATE ferme set ecus=ecus+25*nb WHERE idfermier=id_fermier; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE naissance_lapins AS -- Checked + nb_naissances integer; + surplus integer; +BEGIN + for r in (SELECT id_fermier, nb_male, nb_femelle, nb_moyen, nb_gros FROM ferme WHERE hibernation = 'F' and nb_male > 0 and nb_femelle > 0 and nb_moyen + nb_gros < 50) loop + if r.nb_male < r.nb_femelle then + nb_naissances := r.nb_male * (7/9); + else + nb_naissances := r.nb_femelle * (7/9); + end if; + surplus := nb_naissances + r.nb_moyen + r.nb_gros - 50; + if surplus > 0 then + nb_naissances := nb_naissances - surplus; + end if; + UPDATE ferme set nb_petit=nb_naissances WHERE id_fermier = r.id_fermier; + end loop; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE FUNCTION aff_clapier -- Checked +( + idfermier ferme.id_fermier%type +) + RETURN sys_refcursor +AS + curseur sys_refcursor; +BEGIN + OPEN curseur FOR + SELECT nb_male,nb_femelle,nb_petit,nb_moyen,nb_gros,abreuvage_l,nb_abreuvage_l,nourri_l,nb_jeune_l,sale_l,nb_malade_l,abreuvage_j,nb_abreuvage_j,nourri_j,nb_jeune_j,sale_j,nb_malade_j + FROM ferme WHERE id_fermier=idfermier; + return curseur; +END; +/ + + + + + +CREATE OR REPLACE FUNCTION aff_remise -- Checked +( + idfermier entrepose.id_fermier%type +) + RETURN sys_refcursor +AS + curseur sys_refcursor; +BEGIN + OPEN curseur FOR + SELECT article.id_article,nom,description,collectionnable,article.quantite,prix_vente,prix_achat,entrepose.quantite + FROM entrepose,article WHERE id_fermier=idfermier and collection = 'F' and entrepose.id_article=article.id_article; + return curseur; +END; +/ + + + + + + + + + + + + + + + + + + + + + + + + + +-- Groupe 4 CHECKED +CREATE OR REPLACE PROCEDURE Creation_Compte -- Checked +( + login FERME.ID_FERMIER%type, + nom FERME.NOM%type, + pwd FERME.MDP%type, + email FERME.MAIL%type +) AS +BEGIN + INSERT INTO FERME VALUES (login,nom,pwd,email,CURRENT_DATE,CURRENT_DATE,1500,0,NULL,'F',0,0,0,0,0,8,'F',0,'F',0,'F',0,'F', 0,'F',0,'F',0,'F',0,'F',0,'F',0,0,0,0); + COMMIT; +EXCEPTION + WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20001,'Login deja utilisee'); +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE Suppression_Compte -- Checked +( + login FERME.ID_FERMIER%type +) AS +BEGIN + DELETE FROM FERME WHERE login = Ferme.id_fermier ; + COMMIT; +EXCEPTION + WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20002,'Compte Inexistant'); +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE Hiberner AS -- Checked + x number := 0 ; +BEGIN + for uneFerme in(SELECT date_connection,id_fermier FROM ferme) loop + x := trunc(CURRENT_DATE) - trunc(UneFerme.date_connection) ; + if (x > 3) then + UPDATE Ferme set Hibernation = 'T' WHERE id_fermier = uneFerme.id_fermier; + elsif x > 50 then + Suppression_Compte(uneFerme.id_fermier); + end if ; + end loop; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE FUNCTION Aff_poulailler -- Checked +( + idfermier ferme.id_fermier%type +) + RETURN SYS_REFCURSOR +AS + curseur SYS_REFCURSOR; +BEGIN + OPEN curseur FOR + SELECT id_volaille,abreuvage_v,nourri_v,sale_v,nb_malade_v,production_v + FROM Volaille WHERE id_fermier=idfermier; + RETURN curseur; +END; +/ + + + + + +CREATE OR REPLACE FUNCTION Aff_Collection -- Checked +( + idfermier Ferme.id_fermier%type +) + RETURN SYS_REFCURSOR +AS + curseur SYS_REFCURSOR; +BEGIN + OPEN curseur FOR + SELECT e.ID_ARTICLE, NOM, DESCRIPTION, e.QUANTITE + FROM ENTREPOSE e, ARTICLE a WHERE idfermier = e.id_fermier and e.id_article = a.id_article and a.collectionnable = 'T' ; + RETURN curseur; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE Connection -- Checked +( + login Ferme.id_fermier%type, + motdepasse Ferme.mdp%type +) AS +BEGIN + UPDATE Ferme set date_connection = CURRENT_DATE, Hibernation = 'F' WHERE login = id_fermier and motdepasse = mdp; + COMMIT; +EXCEPTION + WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20003,'Connexion Impossible'); +END; +/ + + + + + + + + + + + + + + + + + + + + + + + + + + + +-- Groupe 5 CHECKED +CREATE OR REPLACE PROCEDURE vendre_oeufs -- Checked +( + volaile volaille.id_volaille%type, + fermier ferme.id_fermier%type +) AS + nb_oeufs volaille.production_v%type; + nb_ecus ferme.ecus%type; +BEGIN + SELECT PRODUCTION_V INTO nb_oeufs FROM Volaille WHERE id_fermier=fermier and id_volaille=volaile; + IF nb_oeufs > 0 THEN + SELECT ecus INTO nb_ecus FROM Ferme WHERE id_fermier=fermier; + UPDATE Ferme SET ECUS=nb_ecus+nb_oeufs*8 WHERE id_fermier=fermier; + UPDATE Volaille SET PRODUCTION_V=0 WHERE id_fermier=fermier and id_volaille=volaile; + ELSE + RAISE_APPLICATION_ERROR(-20333,'Aucun oeuf'); + END IF; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE abreuver_volaille -- Checked +( + idvolaille volaille.id_volaille%type, + idfermier ferme.id_fermier%type +) AS + nb_ecus ferme.ecus%type; + abreuvage volaille.abreuvage_v%type; +BEGIN + SELECT ecus into nb_ecus FROM ferme WHERE ferme.id_fermier = idfermier; + nb_ecus := nb_ecus - 1; + if nb_ecus < 0 then + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + else + SELECT abreuvage_v into abreuvage FROM volaille WHERE idfermier = id_fermier and idvolaille = id_volaille; + if abreuvage = 'T' then + RAISE_APPLICATION_ERROR(-20223,'Animaux deja abreuves'); + else + UPDATE volaille set abreuvage_v = 'T' WHERE idfermier = id_fermier and idvolaille = id_volaille; + UPDATE ferme set ecus = nb_ecus WHERE ferme.id_fermier = idfermier; + end if; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE nourrir_volaille -- Checked +( + idvolaille volaille.id_volaille%type, + idfermier ferme.id_fermier%type +) AS + nb_ecus ferme.ecus%type; + nourri volaille.nourri_v%type; +BEGIN + SELECT ecus into nb_ecus FROM ferme WHERE ferme.id_fermier = idfermier; + nb_ecus := nb_ecus - 3; + if nb_ecus < 0 then + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + else + SELECT nourri_v into nourri FROM volaille WHERE idfermier = id_fermier and idvolaille = id_volaille; + if nourri = 'T' then + RAISE_APPLICATION_ERROR(-20222,'Animaux deja nourris'); + else + UPDATE volaille set nourri_v = 'T' WHERE idfermier = id_fermier and idvolaille = id_volaille; + UPDATE ferme set ecus = nb_ecus WHERE ferme.id_fermier = idfermier; + end if; + end if; + COMMIT; +END; +/ + + + + + +CREATE or REPLACE PROCEDURE nettoyage_volaille -- Checked +( + idfermier ferme.id_fermier%type, + idvolaille volaille.id_volaille%type +) AS + nb_ecus ferme.ecus%type; + sale volaille.SALE_V%type; +BEGIN + SELECT ecus into nb_ecus FROM ferme WHERE id_fermier = idfermier; + SELECT sale_v into sale FROM volaille WHERE id_fermier = idfermier and id_volaille = idvolaille; + IF sale = 'T' THEN + IF nb_ecus < 3 THEN + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + ELSE + nb_ecus := nb_ecus - 3; + UPDATE ferme set ecus = nb_ecus WHERE ferme.id_fermier = idfermier; + UPDATE volaille set sale_v = 'F' WHERE id_fermier = idfermier and id_volaille = idvolaille; + END IF; + END IF; + COMMIT; +END; +/ + + + + + +CREATE or REPLACE PROCEDURE soin_volaille -- Checked +( + idfermier ferme.id_fermier%type, + idvolaille volaille.id_volaille%type +) AS + nb_ecus ferme.ecus%type; + nb_malade volaille.NB_MALADE_V%type; +BEGIN + SELECT ecus into nb_ecus FROM ferme WHERE id_fermier = idfermier; + SELECT nb_malade_v into nb_malade FROM volaille WHERE id_fermier = idfermier and id_volaille = idvolaille; + IF (nb_malade > 0 and nb_malade < 4) THEN + IF nb_ecus < 6 THEN + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + ELSE + nb_ecus := nb_ecus - 6; + UPDATE ferme set ecus = nb_ecus WHERE ferme.id_fermier = idfermier; + UPDATE volaille set nb_malade_v = 0 WHERE id_fermier = idfermier and id_volaille = idvolaille; + END IF; + END IF; + COMMIT; +END; +/ + + + + + +CREATE or REPLACE PROCEDURE creation_oeuf -- Checked +( + volaile volaille.id_volaille%type, + fermier ferme.id_fermier%type +) AS + poids volaille.poids_v%type; + age volaille.age_v%type; + sale volaille.sale_v%type; + malade volaille.nb_malade_v%type; + rnd NUMBER; +BEGIN + SELECT POIDS_V INTO poids FROM Volaille WHERE id_fermier=fermier and id_volaille=volaile; + SELECT AGE_V INTO age FROM Volaille WHERE id_fermier=fermier and id_volaille=volaile; + SELECT SALE_V INTO sale FROM Volaille WHERE id_fermier=fermier and id_volaille=volaile; + SELECT NB_MALADE_V INTO malade FROM Volaille WHERE id_fermier=fermier and id_volaille=volaile; + + IF poids < 2.5 THEN + RAISE_APPLICATION_ERROR(-20334,'Trop maigre'); + END IF; + IF age < 5 THEN + RAISE_APPLICATION_ERROR(-20335,'Trop Jeune'); + END IF; + IF sale = 'T' THEN + RAISE_APPLICATION_ERROR(-20225,'Animal Sale'); + END IF; + IF malade > 0 THEN + RAISE_APPLICATION_ERROR(-20226,'Animal Malade'); + END IF; + + SELECT dbms_random.value into rnd FROM dual; + -- Mise à jour des tables + IF rnd < 0.1 THEN + -- ne ponds pas + UPDATE Volaille SET PRODUCTION_V=PRODUCTION_V WHERE id_fermier=fermier and id_volaille=volaile; + ELSE + IF rnd < 0.5 THEN + -- pond 2 oeufs + UPDATE Volaille SET PRODUCTION_V=PRODUCTION_V+2 WHERE id_fermier=fermier and id_volaille=volaile; + ELSE + -- pond 1 oeuf + UPDATE Volaille SET PRODUCTION_V=PRODUCTION_V+1 WHERE id_fermier=fermier and id_volaille=volaile; + END IF; + END IF; + COMMIT; +END; +/ + + + + + + + + + + + + + + + + + + + + + + + +-- Groupe 6 CHECKED +CREATE OR REPLACE PROCEDURE NettoyerVache -- Checked +( + IdFermier ferme.id_fermier%type +) AS + Money ferme.ecus%type; +BEGIN + SELECT ecus into Money FROM ferme WHERE ferme.id_fermier = IdFermier; + Money := Money - 3; + if (Money < 0) then + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + else + UPDATE ferme set sale_vache = 'F' WHERE IdFermier = id_fermier; + UPDATE ferme set ecus = Money WHERE ferme.id_fermier = IdFermier; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE SoignerVache -- Checked +( + IdFermier ferme.id_fermier%type +) AS + Money ferme.ecus%type; +BEGIN + SELECT ecus into Money FROM ferme WHERE ferme.id_fermier = IdFermier; + Money := Money - 6; + if (Money < 0) then + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + else + UPDATE ferme set nb_malade_vache = '0' WHERE IdFermier = id_fermier; + UPDATE ferme set ecus = Money WHERE ferme.id_fermier = IdFermier; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE nourrir_vache -- Checked +( + idfermier ferme.id_fermier%type +) AS + Cout ferme.ecus%type; + nourriv ferme.nourri_vache%type; +BEGIN + SELECT ecus into Cout FROM ferme WHERE ferme.id_fermier = idfermier; + Cout := Cout - 5; + if Cout < 0 then + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + else + SELECT nourri_vache into nourriv FROM ferme WHERE idfermier = id_fermier; + if nourriv = 'T' then + RAISE_APPLICATION_ERROR(-20222,'Animaux deja nourris'); + else + UPDATE ferme set nourri_vache = 'T' WHERE idfermier = id_fermier; + UPDATE ferme set ecus = Cout WHERE ferme.id_fermier = idfermier; + end if; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE abreuver_vache -- Checked +( + idfermier ferme.id_fermier%type +) AS + Cout ferme.ecus%type; + abreuvagev ferme.abreuvage_vache%type; +BEGIN + SELECT ecus into Cout FROM ferme WHERE ferme.id_fermier = idfermier; + Cout := Cout - 2; + if Cout < 0 then + RAISE_APPLICATION_ERROR(-20111,'Pas assez d`argent'); + else + SELECT abreuvage_vache into abreuvagev FROM ferme WHERE idfermier = id_fermier; + if abreuvagev = 'T' then + RAISE_APPLICATION_ERROR(-20223,'Animaux deja abreuves'); + else + UPDATE ferme set abreuvage_vache = 'T' WHERE idfermier = id_fermier; + UPDATE ferme set ecus = Cout WHERE ferme.id_fermier = idfermier; + end if; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE creation_lait -- Checked +( + idfermier ferme.id_fermier%type +) AS + lait ferme.NB_LAIT%type; + sale_vache ferme.SALE_VACHE%type; + malade_vache ferme.NB_MALADE_VACHE%type; + poids ferme.POIDS_VACHE%type; + age ferme.AGE_VACHE%type; +BEGIN + SELECT SALE_VACHE into sale_vache FROM ferme WHERE ferme.id_fermier = IdFermier; + SELECT NB_MALADE_VACHE into malade_vache FROM ferme WHERE ferme.id_fermier = IdFermier; + SELECT NB_LAIT into lait FROM ferme WHERE ferme.id_fermier = IdFermier; + SELECT POIDS_VACHE into poids FROM ferme WHERE ferme.id_fermier = IdFermier; + SELECT AGE_VACHE into age FROM ferme WHERE ferme.id_fermier = IdFermier; + + -- Vache tjs nourrie + if (malade_vache = 0 and sale_vache = 'F') then + if ((poids >= 80) and (age >= 10)) then + if (lait = 0) then + lait := lait + 8 ; + else + lait := lait + 4 ; + end if; + if (lait > 16) then + lait := 16; + end if; + UPDATE ferme set NB_LAIT = lait WHERE ferme.id_fermier = IdFermier; + end if; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE PROCEDURE traire_lait -- Checked +( + idfermier ferme.id_fermier%type +) AS + nb_ecus ferme.ecus%type; + nblait ferme.NB_LAIT%type; +BEGIN + SELECT ecus into nb_ecus FROM ferme WHERE ferme.id_fermier = IdFermier; + SELECT NB_LAIT into nblait FROM ferme WHERE ferme.id_fermier = IdFermier; + + -- Traire et vendre le lait + if (nblait <= 0) then + RAISE_APPLICATION_ERROR(-20444,'Pas de Lait'); + else + nb_ecus := nb_ecus + (2 * nblait); + UPDATE ferme set ecus = nb_ecus WHERE ferme.id_fermier = IdFermier; + UPDATE ferme set NB_LAIT = 0 WHERE ferme.id_fermier = IdFermier; + end if; + COMMIT; +END; +/ + + + + + +CREATE OR REPLACE FUNCTION aff_paturage -- Checked +( + IdFermier ferme.id_fermier%type +) + RETURN sys_refcursor +AS + curseur sys_refcursor; +BEGIN + OPEN curseur FOR + SELECT ABREUVAGE_VACHE, NB_ABREUVAGE_VACHE, NOURRI_VACHE, NB_JEUNE_VACHE,SALE_VACHE, NB_MALADE_VACHE, POIDS_VACHE, AGE_VACHE, NB_LAIT + FROM ferme WHERE id_fermier = IdFermier; + RETURN curseur; +END; +/ + + + + + + + diff --git a/build.xml b/build.xml new file mode 100755 index 0000000..8e974d5 --- /dev/null +++ b/build.xml @@ -0,0 +1,69 @@ + + + + + + Builds, tests, and runs the project JMeuMeu. + + + diff --git a/build/classes/GameField/resources/Clapier.properties b/build/classes/GameField/resources/Clapier.properties new file mode 100755 index 0000000..ac6004d --- /dev/null +++ b/build/classes/GameField/resources/Clapier.properties @@ -0,0 +1,6 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. + +#NOI18N +jLabel1.font=Tahoma 14 Bold +jLabel1.text=SECTION CLAPIER diff --git a/build/classes/GameField/resources/Cooperative.properties b/build/classes/GameField/resources/Cooperative.properties new file mode 100755 index 0000000..b5f6ef1 --- /dev/null +++ b/build/classes/GameField/resources/Cooperative.properties @@ -0,0 +1,3 @@ +jLabel1.text=SECTION COOPERATIVE +#NOI18N +jLabel1.font=Tahoma 14 12 12 12 Bold diff --git a/build/classes/GameField/resources/Marche.properties b/build/classes/GameField/resources/Marche.properties new file mode 100755 index 0000000..dfa1c0e --- /dev/null +++ b/build/classes/GameField/resources/Marche.properties @@ -0,0 +1,6 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. + +#NOI18N +jLabel1.font=Tahoma 14 12 12 Bold +jLabel1.text=SECTION MARCHE diff --git a/build/classes/GameField/resources/Paturage.properties b/build/classes/GameField/resources/Paturage.properties new file mode 100755 index 0000000..06e2762 --- /dev/null +++ b/build/classes/GameField/resources/Paturage.properties @@ -0,0 +1,22 @@ +jLabel1.text=SECTION PATURAGE +#NOI18N +jLabel1.font=Tahoma 14 12 Bold +lblHealthString.text=Etat de Sant\u00E9 de la Vache : +jLabel3.text=Hygi\u00E8ne de la Vache : +jLabel4.text=Masse de la vache (Kg) : +jLabel5.text=Litres de Lait dans les pies de la vache : +jLabel6.text=Vache d\u00E9salt\u00E9rer : +jLabel7.text=Vache nourri : +lblHealthStatus.text=Sain +DirtyStatus.text=Propre +CowMass.text=0 +MilkLiter.text=0 +IsCowAlreadyDrink.text=Non +CowAlreadyEat.text=Non +jButton1.text=Abreuver +jButton2.text=Nourrir +jButton3.text=Soigner +jButton4.text=Nettoyer +jButton5.text=Traire +jLabel14.text=Age de la vache : +CowAge.text=0 diff --git a/build/classes/GameField/resources/Poulailler.properties b/build/classes/GameField/resources/Poulailler.properties new file mode 100755 index 0000000..632b066 --- /dev/null +++ b/build/classes/GameField/resources/Poulailler.properties @@ -0,0 +1,3 @@ +jLabel1.text=SECTION POULAILLER +#NOI18N +jLabel1.font=Tahoma-Bold-14 diff --git a/build/classes/GameField/resources/Remise.properties b/build/classes/GameField/resources/Remise.properties new file mode 100755 index 0000000..5a3bf6b --- /dev/null +++ b/build/classes/GameField/resources/Remise.properties @@ -0,0 +1,6 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. + +#NOI18N +jLabel1.font=Tahoma 14 12 12 12 12 Bold +jLabel1.text=SECTION REMISE diff --git a/build/classes/GameField/resources/Welcome.properties b/build/classes/GameField/resources/Welcome.properties new file mode 100755 index 0000000..40b6977 --- /dev/null +++ b/build/classes/GameField/resources/Welcome.properties @@ -0,0 +1,6 @@ +jLabel1.text=BIENVENUE DANS VOTRE FERME +#NOI18N +jLabel1.font=Tahoma-Bold-14 +jLabel2.text= +#NOI18N +jLabel2.font=Tahoma-Bold-14 diff --git a/build/classes/META-INF/services/org.jdesktop.application.Application b/build/classes/META-INF/services/org.jdesktop.application.Application new file mode 100755 index 0000000..6c6402e --- /dev/null +++ b/build/classes/META-INF/services/org.jdesktop.application.Application @@ -0,0 +1 @@ +jmeumeu.JMeuMeuApp \ No newline at end of file diff --git a/build/classes/jmeumeu/resources/JMeuMeuAboutBox.properties b/build/classes/jmeumeu/resources/JMeuMeuAboutBox.properties new file mode 100755 index 0000000..f5741c0 --- /dev/null +++ b/build/classes/jmeumeu/resources/JMeuMeuAboutBox.properties @@ -0,0 +1,19 @@ +title = About: ${Application.title} ${Application.version} + +closeAboutBox.Action.text = &Close + +appDescLabel.text=A derivated game from myefarm.com + +versionLabel.text=Product Version\: + +#NOI18N +imageLabel.icon=about.png +jLabel1.text=Programmer : +#NOI18N +jLabel1.font=Tahoma-Bold-11 +jLabel2.text=Jeremy JANISZEWSKI +jLabel3.text=This project was a team project. +jLabel4.text=But without any reason, I was the only person to work on this project. +jLabel5.text=The others have provided 'I don't know JAVA' like reason. +jLabel6.text=Sadly, I cannot finished this project. It was interesting. +jLabel7.text=Adrien MALINGREY diff --git a/build/classes/jmeumeu/resources/JMeuMeuApp.properties b/build/classes/jmeumeu/resources/JMeuMeuApp.properties new file mode 100755 index 0000000..8c8c917 --- /dev/null +++ b/build/classes/jmeumeu/resources/JMeuMeuApp.properties @@ -0,0 +1,11 @@ +# Application global resources + +Application.name = JMeuMeu +Application.title = JMEUMEU Staff +Application.version = 1.0 +Application.vendor = Sun Microsystems Inc. +Application.homepage = http\://appframework.dev.java.net/ +Application.description = A simple Java desktop application based on Swing Application Framework. +Application.vendorId = Sun +Application.id = ${Application.name} +Application.lookAndFeel = system diff --git a/build/classes/jmeumeu/resources/JMeuMeuDeleteUser.properties b/build/classes/jmeumeu/resources/JMeuMeuDeleteUser.properties new file mode 100755 index 0000000..95f394f --- /dev/null +++ b/build/classes/jmeumeu/resources/JMeuMeuDeleteUser.properties @@ -0,0 +1,15 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. + +jButton2.text=Annuler +jButton1.text=Supprimer Compte +jTextField2.text=Identifiant +jLabel3.text=Identifiant +jLabel1.text=Suppression d'un Compte +#NOI18N +jLabel1.font=Tahoma 24-Bold-24 +#NOI18N +jLabel3.font=Tahoma-Bold-11 +#NOI18N +jLabel4.font=Tahoma-Bold-11 +jButton1.actionCommand=SupprimerCompte diff --git a/build/classes/jmeumeu/resources/JMeuMeuGameField.properties b/build/classes/jmeumeu/resources/JMeuMeuGameField.properties new file mode 100755 index 0000000..1aae574 --- /dev/null +++ b/build/classes/jmeumeu/resources/JMeuMeuGameField.properties @@ -0,0 +1,41 @@ +jButton1.text=D\u00E9connexion +jButton1.actionCommand=Deconnexion +jButton2.text=Poulailler +jButton3.text=Clapier +jButton2.actionCommand=Poulailler +jButton4.text=Paturage +jButton5.text=Remise +jButton2.toolTipText=Affiche le formulaire concernant le poulailler +jButton3.toolTipText=Affiche le formulaire concernant le Clapier +jButton4.toolTipText=Affiche le formulaire concernant le Paturage +jButton5.toolTipText=Affiche le formulaire concernant la Remise +jButton1.toolTipText=Retourne au Menu de Connexion +jLabel1.text=Actions Autoris\u00E9es +#NOI18N +jLabel1.font=Tahoma-Bold-14 +jLabel2.text=Statistiques +#NOI18N +jLabel2.font=Tahoma-Bold-14 +jLabel3.AccessibleContext.accessibleName=Ecus +lblEcus.text=Ecus : +jLabel4.text=0 +#NOI18N +lblEcus.font=Tahoma-Bold-11 +jLabel4.AccessibleContext.accessibleName=lblNumEcus +lblPoints.text=Points : +#NOI18N +lblPoints.font=Tahoma-Bold-11 +lblNumPoints.text=0 +lblNumRank.text=0 +lblRank.text=Classement : +#NOI18N +lblRank.font=Tahoma-Bold-11 +jLabel9.text=eme +jButton6.text=Coop\u00E9rative +jButton6.actionCommand=Cooperative +jButton6.label=Cooperative +jButton7.text=March\u00E9 +jButton7.actionCommand=Marche +jButton8.actionCommand=Hibernation +jButton8.toolTipText=Passe en mode Hibernation +jButton8.text=Hiberner diff --git a/build/classes/jmeumeu/resources/JMeuMeuMenuCreerCompteView.properties b/build/classes/jmeumeu/resources/JMeuMeuMenuCreerCompteView.properties new file mode 100755 index 0000000..6bf54cd --- /dev/null +++ b/build/classes/jmeumeu/resources/JMeuMeuMenuCreerCompteView.properties @@ -0,0 +1,17 @@ + +lblCreateCompte.text=Cr\u00E9ation d'un Compte +#NOI18N +lblCreateCompte.font=Tahoma-Bold-24 +lblID.text=Identifiant +lblUserName.text=Nom Utilisateur +lblPwd.text=Mot de Passe : +lblVerifPwd.text=Verification Mot de Passe +lblEmail.text=Adresse Email +btnCreerCompte.actionCommand=CC +btnCreerCompte.text=Creer Compte +btnCancel.text=Annuler +txtIdentifiant.text=Identifiant +txtUserName.text=NomUtilisateur +txtPassword.text=password +txtChkPwd.text=Password +txtMail.text=@mail diff --git a/build/classes/jmeumeu/resources/JMeuMeuView.properties b/build/classes/jmeumeu/resources/JMeuMeuView.properties new file mode 100755 index 0000000..bf87982 --- /dev/null +++ b/build/classes/jmeumeu/resources/JMeuMeuView.properties @@ -0,0 +1,52 @@ + +# @Action resources + +showAboutBox.Action.text = &About... +showAboutBox.Action.shortDescription = Show the application's information dialog + +# status bar resources + +StatusBar.messageTimeout = 5000 +StatusBar.busyAnimationRate = 30 +StatusBar.idleIcon = busyicons/idle-icon.png +StatusBar.busyIcons[0] = busyicons/busy-icon0.png +StatusBar.busyIcons[1] = busyicons/busy-icon1.png +StatusBar.busyIcons[2] = busyicons/busy-icon2.png +StatusBar.busyIcons[3] = busyicons/busy-icon3.png +StatusBar.busyIcons[4] = busyicons/busy-icon4.png +StatusBar.busyIcons[5] = busyicons/busy-icon5.png +StatusBar.busyIcons[6] = busyicons/busy-icon6.png +StatusBar.busyIcons[7] = busyicons/busy-icon7.png +StatusBar.busyIcons[8] = busyicons/busy-icon8.png +StatusBar.busyIcons[9] = busyicons/busy-icon9.png +StatusBar.busyIcons[10] = busyicons/busy-icon10.png +StatusBar.busyIcons[11] = busyicons/busy-icon11.png +StatusBar.busyIcons[12] = busyicons/busy-icon12.png +StatusBar.busyIcons[13] = busyicons/busy-icon13.png +StatusBar.busyIcons[14] = busyicons/busy-icon14.png +lblJMeuMeu.text=Bienvenue sur JMeuMeu +#NOI18N +lblJMeuMeu.font=Tahoma-Bold-24 +lblUserName.text=Nom Utilisateur +lblPwd.text=Mot De Passe +txtUserName.text= +txtPwd.text= +btnOK.text=Connexion +btnAnnuler.text=Quitter +btnCreate.text=Creer Compte +btnCreate.label=CreerCompte +btnCreate.actionCommand=CreerCompte +#NOI18N +lblUserName.font=Tahoma-Bold-11 +#NOI18N +lblPwd.foreground=51, 0, 255 +#NOI18N +lblUserName.foreground=51, 0, 255 +#NOI18N +lblPwd.font=Tahoma-Bold-11 +jButton4.text=? +jButton4.actionCommand=About +jButton4.AccessibleContext.accessibleName=About +jButton5.label=CreerCompte +jButton5.actionCommand=SuppCompte +jButton5.text=Supprimer Compte diff --git a/build/classes/jmeumeu/resources/about.png b/build/classes/jmeumeu/resources/about.png new file mode 100755 index 0000000..e179f30 Binary files /dev/null and b/build/classes/jmeumeu/resources/about.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon0.png b/build/classes/jmeumeu/resources/busyicons/busy-icon0.png new file mode 100755 index 0000000..242c0c8 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon0.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon1.png b/build/classes/jmeumeu/resources/busyicons/busy-icon1.png new file mode 100755 index 0000000..9f6f634 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon1.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon10.png b/build/classes/jmeumeu/resources/busyicons/busy-icon10.png new file mode 100755 index 0000000..c4ef4a1 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon10.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon11.png b/build/classes/jmeumeu/resources/busyicons/busy-icon11.png new file mode 100755 index 0000000..6eca1f5 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon11.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon12.png b/build/classes/jmeumeu/resources/busyicons/busy-icon12.png new file mode 100755 index 0000000..e447ee8 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon12.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon13.png b/build/classes/jmeumeu/resources/busyicons/busy-icon13.png new file mode 100755 index 0000000..848a6f1 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon13.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon14.png b/build/classes/jmeumeu/resources/busyicons/busy-icon14.png new file mode 100755 index 0000000..7b3561d Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon14.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon2.png b/build/classes/jmeumeu/resources/busyicons/busy-icon2.png new file mode 100755 index 0000000..c866e62 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon2.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon3.png b/build/classes/jmeumeu/resources/busyicons/busy-icon3.png new file mode 100755 index 0000000..9be22fa Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon3.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon4.png b/build/classes/jmeumeu/resources/busyicons/busy-icon4.png new file mode 100755 index 0000000..f07c20d Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon4.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon5.png b/build/classes/jmeumeu/resources/busyicons/busy-icon5.png new file mode 100755 index 0000000..653fc9c Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon5.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon6.png b/build/classes/jmeumeu/resources/busyicons/busy-icon6.png new file mode 100755 index 0000000..7035572 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon6.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon7.png b/build/classes/jmeumeu/resources/busyicons/busy-icon7.png new file mode 100755 index 0000000..49fbc6e Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon7.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon8.png b/build/classes/jmeumeu/resources/busyicons/busy-icon8.png new file mode 100755 index 0000000..e1a5a40 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon8.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/busy-icon9.png b/build/classes/jmeumeu/resources/busyicons/busy-icon9.png new file mode 100755 index 0000000..8278012 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/busy-icon9.png differ diff --git a/build/classes/jmeumeu/resources/busyicons/idle-icon.png b/build/classes/jmeumeu/resources/busyicons/idle-icon.png new file mode 100755 index 0000000..50312f8 Binary files /dev/null and b/build/classes/jmeumeu/resources/busyicons/idle-icon.png differ diff --git a/build/classes/jmeumeu/resources/splash.png b/build/classes/jmeumeu/resources/splash.png new file mode 100755 index 0000000..a1fbdc1 Binary files /dev/null and b/build/classes/jmeumeu/resources/splash.png differ diff --git a/dist/README.TXT b/dist/README.TXT new file mode 100755 index 0000000..8cd60fa --- /dev/null +++ b/dist/README.TXT @@ -0,0 +1,33 @@ +======================== +BUILD OUTPUT DESCRIPTION +======================== + +When you build an Java application project that has a main class, the IDE +automatically copies all of the JAR +files on the projects classpath to your projects dist/lib folder. The IDE +also adds each of the JAR files to the Class-Path element in the application +JAR files manifest file (MANIFEST.MF). + +To run the project from the command line, go to the dist folder and +type the following: + +java -jar "JMeuMeu.jar" + +To distribute this project, zip up the dist folder (including the lib folder) +and distribute the ZIP file. + +Notes: + +* If two JAR files on the project classpath have the same name, only the first +JAR file is copied to the lib folder. +* Only JAR files are copied to the lib folder. +If the classpath contains other types of files or folders, none of the +classpath elements are copied to the lib folder. In such a case, +you need to copy the classpath elements to the lib folder manually after the build. +* If a library on the projects classpath also has a Class-Path element +specified in the manifest,the content of the Class-Path element has to be on +the projects runtime path. +* To set a main class in a standard Java project, right-click the project node +in the Projects window and choose Properties. Then click Run and enter the +class name in the Main Class field. Alternatively, you can manually type the +class name in the manifest Main-Class element. diff --git a/images/Chickens.jpg b/images/Chickens.jpg new file mode 100755 index 0000000..dd7ea91 Binary files /dev/null and b/images/Chickens.jpg differ diff --git a/images/Farm.jpg b/images/Farm.jpg new file mode 100755 index 0000000..1e8aa5d Binary files /dev/null and b/images/Farm.jpg differ diff --git a/images/Marche.jpg b/images/Marche.jpg new file mode 100755 index 0000000..b2025b5 Binary files /dev/null and b/images/Marche.jpg differ diff --git a/images/N-1156350181.jpg b/images/N-1156350181.jpg new file mode 100755 index 0000000..f883ccc Binary files /dev/null and b/images/N-1156350181.jpg differ diff --git a/images/Rabbit.jpg b/images/Rabbit.jpg new file mode 100755 index 0000000..274a654 Binary files /dev/null and b/images/Rabbit.jpg differ diff --git a/images/Traire.jpg b/images/Traire.jpg new file mode 100755 index 0000000..7e516cf Binary files /dev/null and b/images/Traire.jpg differ diff --git a/images/accueil.jpg b/images/accueil.jpg new file mode 100755 index 0000000..45bce4f Binary files /dev/null and b/images/accueil.jpg differ diff --git a/images/clapier.jpg b/images/clapier.jpg new file mode 100755 index 0000000..4835673 Binary files /dev/null and b/images/clapier.jpg differ diff --git a/images/lapereau.jpg b/images/lapereau.jpg new file mode 100755 index 0000000..99af0be Binary files /dev/null and b/images/lapereau.jpg differ diff --git a/images/lapin.jpg b/images/lapin.jpg new file mode 100755 index 0000000..5c4d684 Binary files /dev/null and b/images/lapin.jpg differ diff --git a/images/matrixcow.jpg b/images/matrixcow.jpg new file mode 100755 index 0000000..eb61956 Binary files /dev/null and b/images/matrixcow.jpg differ diff --git a/images/poulailler.jpg b/images/poulailler.jpg new file mode 100755 index 0000000..f100934 Binary files /dev/null and b/images/poulailler.jpg differ diff --git a/images/src/JMeuMeu.jpg b/images/src/JMeuMeu.jpg new file mode 100755 index 0000000..83423c2 Binary files /dev/null and b/images/src/JMeuMeu.jpg differ diff --git a/images/src/JMeuMeu.psp b/images/src/JMeuMeu.psp new file mode 100755 index 0000000..ec1f21b Binary files /dev/null and b/images/src/JMeuMeu.psp differ diff --git a/images/src/JMeuMeu.tif b/images/src/JMeuMeu.tif new file mode 100755 index 0000000..93d6d81 Binary files /dev/null and b/images/src/JMeuMeu.tif differ diff --git a/images/src/coq+fd.tif b/images/src/coq+fd.tif new file mode 100755 index 0000000..b7693eb Binary files /dev/null and b/images/src/coq+fd.tif differ diff --git a/images/src/coq.TIF b/images/src/coq.TIF new file mode 100755 index 0000000..23e0068 Binary files /dev/null and b/images/src/coq.TIF differ diff --git a/images/src/décor ferme.RIF b/images/src/décor ferme.RIF new file mode 100755 index 0000000..c8241d0 Binary files /dev/null and b/images/src/décor ferme.RIF differ diff --git a/images/src/décor ferme.TIF b/images/src/décor ferme.TIF new file mode 100755 index 0000000..817febd Binary files /dev/null and b/images/src/décor ferme.TIF differ diff --git a/images/src/fd clapier.TIF b/images/src/fd clapier.TIF new file mode 100755 index 0000000..c5f33f0 Binary files /dev/null and b/images/src/fd clapier.TIF differ diff --git a/images/src/fd paturage.TIF b/images/src/fd paturage.TIF new file mode 100755 index 0000000..c8adc67 Binary files /dev/null and b/images/src/fd paturage.TIF differ diff --git a/images/src/fd poulailler.TIF b/images/src/fd poulailler.TIF new file mode 100755 index 0000000..25abc80 Binary files /dev/null and b/images/src/fd poulailler.TIF differ diff --git a/images/src/lapereau+fd.TIF b/images/src/lapereau+fd.TIF new file mode 100755 index 0000000..c4d4130 Binary files /dev/null and b/images/src/lapereau+fd.TIF differ diff --git a/images/src/lapereau.RIF b/images/src/lapereau.RIF new file mode 100755 index 0000000..daebe9e Binary files /dev/null and b/images/src/lapereau.RIF differ diff --git a/images/src/lapereau.TIF b/images/src/lapereau.TIF new file mode 100755 index 0000000..c18b9ab Binary files /dev/null and b/images/src/lapereau.TIF differ diff --git a/images/src/lapin+fd.TIF b/images/src/lapin+fd.TIF new file mode 100755 index 0000000..66d2b04 Binary files /dev/null and b/images/src/lapin+fd.TIF differ diff --git a/images/src/lapin.RIF b/images/src/lapin.RIF new file mode 100755 index 0000000..9362665 Binary files /dev/null and b/images/src/lapin.RIF differ diff --git a/images/src/lapin.TIF b/images/src/lapin.TIF new file mode 100755 index 0000000..cf43464 Binary files /dev/null and b/images/src/lapin.TIF differ diff --git a/images/src/paysan.TIF b/images/src/paysan.TIF new file mode 100755 index 0000000..fb3aa82 Binary files /dev/null and b/images/src/paysan.TIF differ diff --git a/images/src/poule+fd.tif b/images/src/poule+fd.tif new file mode 100755 index 0000000..e8110d8 Binary files /dev/null and b/images/src/poule+fd.tif differ diff --git a/images/src/poule.TIF b/images/src/poule.TIF new file mode 100755 index 0000000..f1505fb Binary files /dev/null and b/images/src/poule.TIF differ diff --git a/images/src/poussin+fd.tif b/images/src/poussin+fd.tif new file mode 100755 index 0000000..c15dd09 Binary files /dev/null and b/images/src/poussin+fd.tif differ diff --git a/images/src/poussin.TIF b/images/src/poussin.TIF new file mode 100755 index 0000000..f8abe94 Binary files /dev/null and b/images/src/poussin.TIF differ diff --git a/images/src/vache+fd.TIF b/images/src/vache+fd.TIF new file mode 100755 index 0000000..07d6209 Binary files /dev/null and b/images/src/vache+fd.TIF differ diff --git a/images/src/vache.TIF b/images/src/vache.TIF new file mode 100755 index 0000000..7f14b85 Binary files /dev/null and b/images/src/vache.TIF differ diff --git a/images/vache.jpg b/images/vache.jpg new file mode 100755 index 0000000..3de9f44 Binary files /dev/null and b/images/vache.jpg differ diff --git a/manifest.mf b/manifest.mf new file mode 100755 index 0000000..328e8e5 --- /dev/null +++ b/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml new file mode 100755 index 0000000..20450fb --- /dev/null +++ b/nbproject/build-impl.xml @@ -0,0 +1,633 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + + + + + + java -cp "${run.classpath.with.dist.jar}" ${main.class} + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100755 index 0000000..5ed10d4 --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=ce12e244 +build.xml.script.CRC32=c0697925 +build.xml.stylesheet.CRC32=be360661 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=ce12e244 +nbproject/build-impl.xml.script.CRC32=7709f7ae +nbproject/build-impl.xml.stylesheet.CRC32=487672f9 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100755 index 0000000..4c01d36 --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,2 @@ +jaxws.endorsed.dir=C:\\Program Files\\NetBeans 6.1\\java2\\modules\\ext\\jaxws21\\api +user.properties.file=C:\\Users\\Adz\\.netbeans\\6.1\\build.properties diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100755 index 0000000..cc2c0e5 --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100755 index 0000000..8305762 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,70 @@ +application.desc=A simple java desktop application based on Swing Application Framework +application.homepage=http://appframework.dev.java.net +application.title=Basic Application Example +application.vendor=Sun Microsystems Inc. +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/JMeuMeu.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +file.reference.ojdbc14_g.jar=C:\\Users\\Adz\\LMI\\Projet JMeuMeu\\JMeuMeu\\dist\\ojdbc14_g.jar +includes=** +jar.compress=false +javac.classpath=\ + ${libs.swing-app-framework.classpath}:\ + ${reference.JMeuMeuCustomComponents.jar}:\ + ${file.reference.ojdbc14_g.jar}:\ + ${libs.absolutelayout.classpath} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.junit_4.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=jmeumeu.JMeuMeuApp +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +project.JMeuMeuCustomComponents=../JMeuMeuCustomComponents +reference.JMeuMeuCustomComponents.jar=${project.JMeuMeuCustomComponents}/dist/JMeuMeuCustomComponents.jar +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100755 index 0000000..6abdab5 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,29 @@ + + + org.netbeans.modules.java.j2seproject + + + JMeuMeu + 1.6.5 + + + + + + + + + + JMeuMeuCustomComponents + jar + + jar + clean + jar + + + + + + + diff --git a/script génération base.txt b/script génération base.txt new file mode 100755 index 0000000..ce0a85d --- /dev/null +++ b/script génération base.txt @@ -0,0 +1,152 @@ +--Suppression +DROP TABLE FERME CASCADE CONSTRAINTS; +DROP TABLE VOLAILLE CASCADE CONSTRAINTS; +DROP TABLE ARTICLE CASCADE CONSTRAINTS; +DROP TABLE MARCHE_VEND CASCADE CONSTRAINTS; +DROP TABLE ENTREPOSE CASCADE CONSTRAINTS; +DROP TABLE A_VENDU CASCADE CONSTRAINTS; + +--Table ferme +CREATE TABLE FERME +( + ID_FERMIER VARCHAR2(15) NOT NULL, + NOM VARCHAR2(50) NOT NULL, + MDP VARCHAR2(15) NOT NULL, + MAIL VARCHAR2(50) NOT NULL, + DATE_ENREGISTREMENT DATE NOT NULL, + DATE_CONNECTION DATE NOT NULL, + ECUS INTEGER DEFAULT 500 CHECK( ECUS >= 0), + SCORE INTEGER DEFAULT 0 CHECK( SCORE >= 0), + CLASSEMENT INTEGER NULL, + HIBERNATION CHAR(1) DEFAULT 'F' CHECK (HIBERNATION IN ('T','F')), + NB_ACHATS_JOUR INTEGER DEFAULT 0 CHECK (NB_ACHATS_JOUR BETWEEN 0 AND 12), + NB_MALE INTEGER DEFAULT 0 CHECK ( NB_MALE >= 0), + NB_FEMELLE INTEGER DEFAULT 0 CHECK ( NB_FEMELLE >= 0), + NB_GROS INTEGER DEFAULT 0 CHECK ( NB_GROS >= 0), + NB_MOYEN INTEGER DEFAULT 0 CHECK ( NB_MOYEN >= 0), + NB_PETIT INTEGER DEFAULT 8 CHECK ( NB_PETIT >= 0), + ABREUVAGE_L CHAR(1) DEFAULT 'F' CHECK (ABREUVAGE_L IN ('T','F')), + NB_ABREUVAGE_L INTEGER CHECK (NB_ABREUVAGE_L BETWEEN 0 AND 4), + NOURRI_L CHAR(1) DEFAULT 'F' CHECK (NOURRI_L IN ('T','F')), + NB_JEUNE_L INTEGER CHECK (NB_JEUNE_L BETWEEN 0 AND 4), + SALE_L CHAR(1) DEFAULT 'F' CHECK (SALE_L IN ('T','F')), + NB_MALADE_L INTEGER CHECK(NB_MALADE_L BETWEEN 0 AND 4), + ABREUVAGE_J CHAR(1) DEFAULT 'F' CHECK (ABREUVAGE_J IN ('T','F')), + NB_ABREUVAGE_J INTEGER CHECK (NB_ABREUVAGE_J BETWEEN 0 AND 4), + NOURRI_J CHAR(1) DEFAULT 'F' CHECK (NOURRI_J IN ('T','F')), + NB_JEUNE_J INTEGER CHECK(NB_JEUNE_J BETWEEN 0 AND 4), + SALE_J CHAR(1) DEFAULT 'F' CHECK ( SALE_J IN ('T','F')), + NB_MALADE_J INTEGER CHECK(NB_MALADE_J BETWEEN 0 AND 4), + ABREUVAGE_VACHE CHAR(1) DEFAULT 'F' CHECK (ABREUVAGE_VACHE IN ('T','F')), + NB_ABREUVAGE_VACHE INTEGER CHECK(NB_ABREUVAGE_VACHE BETWEEN 0 AND 4), + NOURRI_VACHE CHAR(1) DEFAULT 'F' CHECK (NOURRI_VACHE IN ('T','F')), + NB_JEUNE_VACHE INTEGER CHECK(NB_JEUNE_VACHE BETWEEN 0 AND 4), + SALE_VACHE CHAR(1) DEFAULT 'F' CHECK (SALE_VACHE IN ('T','F')), + NB_MALADE_VACHE INTEGER CHECK (NB_MALADE_VACHE BETWEEN 0 AND 4), + POIDS_VACHE INTEGER DEFAULT 0 CHECK ( POIDS_VACHE BETWEEN 0 AND 750), + AGE_VACHE INTEGER DEFAULT 0, + NB_LAIT INTEGER DEFAULT 0 CHECK ( NB_LAIT BETWEEN 0 AND 16), + CONSTRAINT PK_FERMIER PRIMARY KEY (ID_FERMIER) +); + +--Table volaille +CREATE TABLE VOLAILLE +( + ID_VOLAILLE INTEGER NOT NULL, + ID_FERMIER VARCHAR2(15) NOT NULL, + ABREUVAGE_V CHAR(1) DEFAULT 'F' CHECK (ABREUVAGE_V IN ('T','F')), + NB_ABREUVAGE_V INTEGER CHECK (NB_ABREUVAGE_V BETWEEN 0 AND 4), + NOURRI_V CHAR(1) DEFAULT 'F' CHECK (NOURRI_V IN ('T','F')), + NB_JEUNE_V INTEGER CHECK (NB_JEUNE_V BETWEEN 0 AND 4), + SALE_V CHAR(1) DEFAULT 'F' CHECK (SALE_V IN ('T','F')), + NB_MALADE_V INTEGER CHECK (NB_MALADE_V BETWEEN 0 AND 4), + POIDS_V FLOAT DEFAULT 0.05 CHECK (POIDS_V BETWEEN 0 AND 3.5), + AGE_V INTEGER DEFAULT 0 CHECK (AGE_V >= 0), + PRODUCTION_V INTEGER DEFAULT 0, + CONSTRAINT PK_VOLAILLES PRIMARY KEY (ID_VOLAILLE) +); + +--Table article +CREATE TABLE ARTICLE +( + ID_ARTICLE INTEGER NOT NULL, + NOM VARCHAR2(25) NOT NULL, + DESCRIPTION VARCHAR2(500) NOT NULL, + COLLECTIONNABLE CHAR(1) DEFAULT 'F' CHECK (COLLECTIONNABLE IN ('T','F')), + QUANTITE INTEGER DEFAULT 0 CHECK(QUANTITE >= 0), + PRIX_VENTE INTEGER DEFAULT 0 CHECK(PRIX_VENTE >= 0), + PRIX_ACHAT INTEGER DEFAULT 0 CHECK(PRIX_ACHAT >= 0), + CONSTRAINT PK_ARTICLE PRIMARY KEY (ID_ARTICLE) +); + +--Table marche_vend +CREATE TABLE MARCHE_VEND +( + ID_FERMIER VARCHAR2(15) NOT NULL, + ID_ARTICLE INTEGER NOT NULL, + NB_VENTE INTEGER DEFAULT 0 CHECK (NB_VENTE >= 0), + PRIX INTEGER DEFAULT 0 CHECK (PRIX >= 0), + CONSTRAINT PK_MARCHE_VEND PRIMARY KEY (ID_FERMIER, ID_ARTICLE) +); + +--Table entrepose +CREATE TABLE ENTREPOSE +( + ID_FERMIER VARCHAR2(15) NOT NULL, + ID_ARTICLE INTEGER NOT NULL, + QUANTITE INTEGER DEFAULT 0 CHECK (QUANTITE >= 0), + COLLECTION CHAR(1) DEFAULT 'F' CHECK (COLLECTION IN ('T','F')), + CONSTRAINT PK_ENTREPOSE PRIMARY KEY (ID_FERMIER, ID_ARTICLE) +); + +--Table a_vendu +CREATE TABLE A_VENDU +( + ID_FERMIER VARCHAR2(15) NOT NULL, + ID_ARTICLE INTEGER NOT NULL, + NB_VENDU INTEGER DEFAULT 0 CHECK (NB_VENDU >= 0), + DATE_VENTE DATE NULL, + CONSTRAINT PK_A_VENDU PRIMARY KEY (ID_FERMIER, ID_ARTICLE) +); + +--Alter table pour les cles etrangeres +ALTER TABLE VOLAILLE ADD ( + CONSTRAINT FK_VOLAILLE_FERMIER + FOREIGN KEY (ID_FERMIER) + REFERENCES FERME (ID_FERMIER)) ; + +ALTER TABLE MARCHE_VEND ADD ( + CONSTRAINT FK_MARCHE_VEND_FERMIER + FOREIGN KEY (ID_FERMIER) + REFERENCES FERME (ID_FERMIER)) ; + +ALTER TABLE MARCHE_VEND ADD ( + CONSTRAINT FK_MARCHE_VEND_ARTICLE + FOREIGN KEY (ID_ARTICLE) + REFERENCES ARTICLE (ID_ARTICLE)) ; + +ALTER TABLE ENTREPOSE ADD ( + CONSTRAINT FK_ENTREPOSE_FERMIER + FOREIGN KEY (ID_FERMIER) + REFERENCES FERME (ID_FERMIER)) ; + +ALTER TABLE ENTREPOSE ADD ( + CONSTRAINT FK_ENTREPOSE_ARTICLE + FOREIGN KEY (ID_ARTICLE) + REFERENCES ARTICLE (ID_ARTICLE)) ; + +ALTER TABLE A_VENDU ADD ( + CONSTRAINT FK_A_VENDU_FERMIER + FOREIGN KEY (ID_FERMIER) + REFERENCES FERME (ID_FERMIER)) ; + +ALTER TABLE A_VENDU ADD ( + CONSTRAINT FK_A_VENDU_ARTICLE + FOREIGN KEY (ID_ARTICLE) + REFERENCES ARTICLE (ID_ARTICLE)) ; + + +-- View : coop_stock +-- View : Clapier +-- View : Paturage + diff --git a/src/GameField/Clapier.form b/src/GameField/Clapier.form new file mode 100755 index 0000000..59aa36d --- /dev/null +++ b/src/GameField/Clapier.form @@ -0,0 +1,495 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/GameField/Clapier.java b/src/GameField/Clapier.java new file mode 100755 index 0000000..a94334b --- /dev/null +++ b/src/GameField/Clapier.java @@ -0,0 +1,706 @@ +/* + * Clapier.java + * + * Created on 7 mai 2008, 17:15 + */ + +package GameField; + +import jmeumeu.JMeuMeuView; + +/** + * + * @author Jeremy + */ +public class Clapier extends javax.swing.JPanel { + + /** Creates new form Clapier */ + public Clapier(JMeuMeuView View, jmeumeu.JMeuMeuGameField Field) { + initComponents(); + _View = View; + _Field = Field; + imagePanelLapereau.SetBackground(View.getFrame(), "./images/lapereau.jpg"); + imagePanelLapin.SetBackground(View.getFrame(), "./images/lapin.jpg"); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + imagePanelLapereau = new Components.ImagePanel(); + jLabel1 = new javax.swing.JLabel(); + imagePanelLapin = new Components.ImagePanel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jButtonAbreuverJ = new javax.swing.JButton(); + jButtonNourrirJ = new javax.swing.JButton(); + jButtonSoignerJ = new javax.swing.JButton(); + jButtonNettoyerJ = new javax.swing.JButton(); + jButtonNourrirV = new javax.swing.JButton(); + jButtonAbreuverV = new javax.swing.JButton(); + jButtonNettoyerV = new javax.swing.JButton(); + jButtonSoignerV = new javax.swing.JButton(); + panel1 = new java.awt.Panel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabelNbMaladesJ = new javax.swing.JLabel(); + jLabelNourrisJ = new javax.swing.JLabel(); + jLabelDesalteresJ = new javax.swing.JLabel(); + panel3 = new java.awt.Panel(); + jLabel12 = new javax.swing.JLabel(); + jLabel13 = new javax.swing.JLabel(); + jLabel14 = new javax.swing.JLabel(); + jLabelNbMaladesL = new javax.swing.JLabel(); + jLabelNourrisL = new javax.swing.JLabel(); + jLabelDesalteresL = new javax.swing.JLabel(); + + setName("Form"); // NOI18N + + imagePanelLapereau.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + imagePanelLapereau.setMaximumSize(new java.awt.Dimension(330, 330)); + imagePanelLapereau.setMinimumSize(new java.awt.Dimension(330, 330)); + imagePanelLapereau.setName("imagePanelLapereau"); // NOI18N + + javax.swing.GroupLayout imagePanelLapereauLayout = new javax.swing.GroupLayout(imagePanelLapereau); + imagePanelLapereau.setLayout(imagePanelLapereauLayout); + imagePanelLapereauLayout.setHorizontalGroup( + imagePanelLapereauLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 228, Short.MAX_VALUE) + ); + imagePanelLapereauLayout.setVerticalGroup( + imagePanelLapereauLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 203, Short.MAX_VALUE) + ); + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(Clapier.class); + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + imagePanelLapin.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + imagePanelLapin.setMaximumSize(new java.awt.Dimension(330, 330)); + imagePanelLapin.setMinimumSize(new java.awt.Dimension(330, 330)); + imagePanelLapin.setName("imagePanelLapin"); // NOI18N + + javax.swing.GroupLayout imagePanelLapinLayout = new javax.swing.GroupLayout(imagePanelLapin); + imagePanelLapin.setLayout(imagePanelLapinLayout); + imagePanelLapinLayout.setHorizontalGroup( + imagePanelLapinLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 228, Short.MAX_VALUE) + ); + imagePanelLapinLayout.setVerticalGroup( + imagePanelLapinLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 203, Short.MAX_VALUE) + ); + + jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N + jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N + jLabel2.setName("jLabel2"); // NOI18N + + jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N + jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N + jLabel3.setName("jLabel3"); // NOI18N + + jButtonAbreuverJ.setText(resourceMap.getString("jButtonAbreuverJ.text")); // NOI18N + jButtonAbreuverJ.setName("jButtonAbreuverJ"); // NOI18N + jButtonAbreuverJ.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButtonAbreuverJMouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButtonAbreuverJMouseExited(evt); + } + }); + jButtonAbreuverJ.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonAbreuverJButtonActionPerformed(evt); + } + }); + + jButtonNourrirJ.setText(resourceMap.getString("jButtonNourrirJ.text")); // NOI18N + jButtonNourrirJ.setName("jButtonNourrirJ"); // NOI18N + jButtonNourrirJ.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButtonNourrirJMouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButtonNourrirJMouseExited(evt); + } + }); + jButtonNourrirJ.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonNourrirJButtonActionPerformed(evt); + } + }); + + jButtonSoignerJ.setText(resourceMap.getString("jButtonSoignerJ.text")); // NOI18N + jButtonSoignerJ.setName("jButtonSoignerJ"); // NOI18N + jButtonSoignerJ.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButtonSoignerJMouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButtonSoignerJMouseExited(evt); + } + }); + jButtonSoignerJ.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonSoignerJButtonActionPerformed(evt); + } + }); + + jButtonNettoyerJ.setText(resourceMap.getString("jButtonNettoyerJ.text")); // NOI18N + jButtonNettoyerJ.setName("jButtonNettoyerJ"); // NOI18N + jButtonNettoyerJ.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButtonNettoyerJMouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButtonNettoyerJMouseExited(evt); + } + }); + jButtonNettoyerJ.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonNettoyerJButtonActionPerformed(evt); + } + }); + + jButtonNourrirV.setText(resourceMap.getString("jButtonNourrirV.text")); // NOI18N + jButtonNourrirV.setName("jButtonNourrirV"); // NOI18N + jButtonNourrirV.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButtonNourrirVMouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButtonNourrirVMouseExited(evt); + } + }); + jButtonNourrirV.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonNourrirVButtonActionPerformed(evt); + } + }); + + jButtonAbreuverV.setText(resourceMap.getString("jButtonAbreuverV.text")); // NOI18N + jButtonAbreuverV.setName("jButtonAbreuverV"); // NOI18N + jButtonAbreuverV.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButtonAbreuverVMouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButtonAbreuverVMouseExited(evt); + } + }); + jButtonAbreuverV.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonAbreuverVButtonActionPerformed(evt); + } + }); + + jButtonNettoyerV.setText(resourceMap.getString("jButtonNettoyerV.text")); // NOI18N + jButtonNettoyerV.setName("jButtonNettoyerV"); // NOI18N + jButtonNettoyerV.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButtonNettoyerVMouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButtonNettoyerVMouseExited(evt); + } + }); + jButtonNettoyerV.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonNettoyerVButtonActionPerformed(evt); + } + }); + + jButtonSoignerV.setText(resourceMap.getString("jButtonSoignerV.text")); // NOI18N + jButtonSoignerV.setName("jButtonSoignerV"); // NOI18N + jButtonSoignerV.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButtonSoignerVMouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButtonSoignerVMouseExited(evt); + } + }); + jButtonSoignerV.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonSoignerVButtonActionPerformed(evt); + } + }); + + panel1.setName("panel1"); // NOI18N + + jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N + jLabel4.setName("jLabel4"); // NOI18N + + jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N + jLabel5.setName("jLabel5"); // NOI18N + + jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N + jLabel6.setName("jLabel6"); // NOI18N + + jLabelNbMaladesJ.setText(resourceMap.getString("jLabelNbMaladesJ.text")); // NOI18N + jLabelNbMaladesJ.setName("jLabelNbMaladesJ"); // NOI18N + + jLabelNourrisJ.setText(resourceMap.getString("jLabelNourrisJ.text")); // NOI18N + jLabelNourrisJ.setName("jLabelNourrisJ"); // NOI18N + + jLabelDesalteresJ.setText(resourceMap.getString("jLabelDesalteresJ.text")); // NOI18N + jLabelDesalteresJ.setName("jLabelDesalteresJ"); // NOI18N + + javax.swing.GroupLayout panel1Layout = new javax.swing.GroupLayout(panel1); + panel1.setLayout(panel1Layout); + panel1Layout.setHorizontalGroup( + panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panel1Layout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE) + .addComponent(jLabelDesalteresJ)) + .addGroup(panel1Layout.createSequentialGroup() + .addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel6) + .addComponent(jLabel5)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabelNourrisJ) + .addComponent(jLabelNbMaladesJ)))) + .addContainerGap(23, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + panel1Layout.setVerticalGroup( + panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(jLabelDesalteresJ)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(jLabelNourrisJ)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(jLabelNbMaladesJ)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + panel3.setName("panel3"); // NOI18N + + jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N + jLabel12.setName("jLabel12"); // NOI18N + + jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N + jLabel13.setName("jLabel13"); // NOI18N + + jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N + jLabel14.setName("jLabel14"); // NOI18N + + jLabelNbMaladesL.setText(resourceMap.getString("jLabelNbMaladesL.text")); // NOI18N + jLabelNbMaladesL.setName("jLabelNbMaladesL"); // NOI18N + + jLabelNourrisL.setText(resourceMap.getString("jLabelNourrisL.text")); // NOI18N + jLabelNourrisL.setName("jLabelNourrisL"); // NOI18N + + jLabelDesalteresL.setText(resourceMap.getString("jLabelDesalteresL.text")); // NOI18N + jLabelDesalteresL.setName("jLabelDesalteresL"); // NOI18N + + javax.swing.GroupLayout panel3Layout = new javax.swing.GroupLayout(panel3); + panel3.setLayout(panel3Layout); + panel3Layout.setHorizontalGroup( + panel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(panel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panel3Layout.createSequentialGroup() + .addComponent(jLabel14) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabelNbMaladesL)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel3Layout.createSequentialGroup() + .addGroup(panel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel12) + .addComponent(jLabel13)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE) + .addGroup(panel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabelNourrisL) + .addComponent(jLabelDesalteresL)))) + .addContainerGap(29, Short.MAX_VALUE)) + ); + panel3Layout.setVerticalGroup( + panel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(panel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel12) + .addComponent(jLabelDesalteresL)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(panel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel13) + .addComponent(jLabelNourrisL)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(panel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel14) + .addComponent(jLabelNbMaladesL)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 731, Short.MAX_VALUE) + .addContainerGap()) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE) + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(92, 92, 92) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(imagePanelLapereau, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jButtonNourrirJ, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonAbreuverJ, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 43, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jButtonNettoyerJ, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonSoignerJ, javax.swing.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE)))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 131, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jButtonNourrirV, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonAbreuverV, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 43, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jButtonNettoyerV, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonSoignerV, javax.swing.GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE))) + .addComponent(imagePanelLapin, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(68, 68, 68)) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(panel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(jLabel3)) + .addGap(17, 17, 17) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(imagePanelLapin, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(imagePanelLapereau, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButtonAbreuverJ) + .addComponent(jButtonSoignerJ)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButtonNettoyerJ) + .addComponent(jButtonNourrirJ))) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButtonAbreuverV) + .addComponent(jButtonSoignerV)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButtonNourrirV) + .addComponent(jButtonNettoyerV)))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(panel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(143, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + +private void jButtonAbreuverJMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonAbreuverJMouseEntered +}//GEN-LAST:event_jButtonAbreuverJMouseEntered + +private void jButtonAbreuverJMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonAbreuverJMouseExited +}//GEN-LAST:event_jButtonAbreuverJMouseExited + +private void jButtonAbreuverJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAbreuverJButtonActionPerformed +}//GEN-LAST:event_jButtonAbreuverJButtonActionPerformed + +private void jButtonNourrirJMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonNourrirJMouseEntered +}//GEN-LAST:event_jButtonNourrirJMouseEntered + +private void jButtonNourrirJMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonNourrirJMouseExited +}//GEN-LAST:event_jButtonNourrirJMouseExited + +private void jButtonNourrirJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNourrirJButtonActionPerformed +}//GEN-LAST:event_jButtonNourrirJButtonActionPerformed + +private void jButtonSoignerJMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonSoignerJMouseEntered +}//GEN-LAST:event_jButtonSoignerJMouseEntered + +private void jButtonSoignerJMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonSoignerJMouseExited +}//GEN-LAST:event_jButtonSoignerJMouseExited + +private void jButtonSoignerJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSoignerJButtonActionPerformed +}//GEN-LAST:event_jButtonSoignerJButtonActionPerformed + +private void jButtonNettoyerJMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonNettoyerJMouseEntered +}//GEN-LAST:event_jButtonNettoyerJMouseEntered + +private void jButtonNettoyerJMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonNettoyerJMouseExited +}//GEN-LAST:event_jButtonNettoyerJMouseExited + +private void jButtonNettoyerJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNettoyerJButtonActionPerformed +}//GEN-LAST:event_jButtonNettoyerJButtonActionPerformed + +private void ButtonActionPerformed(java.awt.event.ActionEvent evt) { + String ActionEvent = evt.getActionCommand(); + + if(ActionEvent.equals("AbreuverJ")) + { + if(_View._Oracle.callProc("abreuver_clapier", _View._Datas.id_fermier+", TRUE")) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("AbreuverV")) + { + if(_View._Oracle.callProc("abreuver_clapier", _View._Datas.id_fermier+", FALSE")) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("NourrirJ")) + { + if(_View._Oracle.callProc("nourrir_clapier", _View._Datas.id_fermier+", TRUE")) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("NourrirV")) + { + if(_View._Oracle.callProc("nourrir_clapier", _View._Datas.id_fermier+", FALSE")) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("SoignerJ")) + { + if(_View._Oracle.callProc("soigner_clapier", _View._Datas.id_fermier+", TRUE")) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("SoignerV")) + { + if(_View._Oracle.callProc("soigner_clapier", _View._Datas.id_fermier+", FALSE")) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("NettoyerJ")) + { + if(_View._Oracle.callProc("nettoyer_clapier", _View._Datas.id_fermier+", TRUE")) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("NettoyerV")) + { + if(_View._Oracle.callProc("nettoyer_clapier", _View._Datas.id_fermier+", FALSE")) + { + ReloadDatas(); + } + } +} + +private void jButtonNourrirVMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonNourrirVMouseEntered +// TODO add your handling code here: +}//GEN-LAST:event_jButtonNourrirVMouseEntered + +private void jButtonNourrirVMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonNourrirVMouseExited +// TODO add your handling code here: +}//GEN-LAST:event_jButtonNourrirVMouseExited + +private void jButtonNourrirVButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNourrirVButtonActionPerformed +// TODO add your handling code here: +}//GEN-LAST:event_jButtonNourrirVButtonActionPerformed + +private void jButtonAbreuverVMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonAbreuverVMouseEntered +// TODO add your handling code here: +}//GEN-LAST:event_jButtonAbreuverVMouseEntered + +private void jButtonAbreuverVMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonAbreuverVMouseExited +// TODO add your handling code here: +}//GEN-LAST:event_jButtonAbreuverVMouseExited + +private void jButtonAbreuverVButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAbreuverVButtonActionPerformed +// TODO add your handling code here: +}//GEN-LAST:event_jButtonAbreuverVButtonActionPerformed + +private void jButtonNettoyerVMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonNettoyerVMouseEntered +// TODO add your handling code here: +}//GEN-LAST:event_jButtonNettoyerVMouseEntered + +private void jButtonNettoyerVMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonNettoyerVMouseExited +// TODO add your handling code here: +}//GEN-LAST:event_jButtonNettoyerVMouseExited + +private void jButtonNettoyerVButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNettoyerVButtonActionPerformed +// TODO add your handling code here: +}//GEN-LAST:event_jButtonNettoyerVButtonActionPerformed + +private void jButtonSoignerVMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonSoignerVMouseEntered +// TODO add your handling code here: +}//GEN-LAST:event_jButtonSoignerVMouseEntered + +private void jButtonSoignerVMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonSoignerVMouseExited +// TODO add your handling code here: +}//GEN-LAST:event_jButtonSoignerVMouseExited + +private void jButtonSoignerVButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSoignerVButtonActionPerformed +// TODO add your handling code here: +}//GEN-LAST:event_jButtonSoignerVButtonActionPerformed + + public void Show() + { + setVisible(true); + _Field.SetEcus(); + FillDatas(); + } + + private void ReloadDatas() + { + _View._Oracle.SetFarmDatas(_View._Datas.nom); + _Field.SetEcus(); + FillDatas(); + } + + + private void FillDatas() + { + this.jLabelNbMaladesJ.setText(Integer.toString(_View._Datas.nb_malade_j)); + this.jLabelNbMaladesL.setText(Integer.toString(_View._Datas.nb_malade_l)); + this.jLabelDesalteresJ.setText(_View._Datas.abreuvage_j.equals("T") ? "Oui" : "Non"); + this.jLabelDesalteresL.setText(_View._Datas.abreuvage_l.equals("T") ? "Oui" : "Non"); + this.jLabelNourrisJ.setText(_View._Datas.nourri_j.equals("T") ? "Oui" : "Non"); + this.jLabelNourrisL.setText(_View._Datas.nourri_l.equals("T") ? "Oui" : "Non"); + + if(_View._Datas.nb_malade_j>0) + jmeumeu.JMeuMeuHelpers.Enabled(jButtonSoignerJ); + else + jmeumeu.JMeuMeuHelpers.Disabled(jButtonSoignerJ); + + if(_View._Datas.nb_malade_l>0) + jmeumeu.JMeuMeuHelpers.Enabled(jButtonSoignerV); + else + jmeumeu.JMeuMeuHelpers.Disabled(jButtonSoignerV); + + if(this.jLabelNourrisJ.equals("oui")) + jmeumeu.JMeuMeuHelpers.Disabled(jButtonNourrirJ); + else + jmeumeu.JMeuMeuHelpers.Enabled(jButtonNourrirJ); + + if(this.jLabelNourrisL.equals("oui")) + jmeumeu.JMeuMeuHelpers.Disabled(jButtonNourrirV); + else + jmeumeu.JMeuMeuHelpers.Enabled(jButtonNourrirV); + + if(this.jLabelDesalteresJ.equals("oui")) + jmeumeu.JMeuMeuHelpers.Disabled(jButtonNourrirJ); + else + jmeumeu.JMeuMeuHelpers.Enabled(jButtonNourrirJ); + + if(this.jLabelDesalteresL.equals("oui")) + jmeumeu.JMeuMeuHelpers.Disabled(jButtonNourrirV); + else + jmeumeu.JMeuMeuHelpers.Enabled(jButtonNourrirV); + } + + + public void Hide() + { + setVisible(false); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private Components.ImagePanel imagePanelLapereau; + private Components.ImagePanel imagePanelLapin; + private javax.swing.JButton jButtonAbreuverJ; + private javax.swing.JButton jButtonAbreuverV; + private javax.swing.JButton jButtonNettoyerJ; + private javax.swing.JButton jButtonNettoyerV; + private javax.swing.JButton jButtonNourrirJ; + private javax.swing.JButton jButtonNourrirV; + private javax.swing.JButton jButtonSoignerJ; + private javax.swing.JButton jButtonSoignerV; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel16; + private javax.swing.JLabel jLabel17; + private javax.swing.JLabel jLabel18; + private javax.swing.JLabel jLabel19; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel20; + private javax.swing.JLabel jLabel21; + private javax.swing.JLabel jLabel22; + private javax.swing.JLabel jLabel23; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JLabel jLabelDesalteresJ; + private javax.swing.JLabel jLabelDesalteresJ1; + private javax.swing.JLabel jLabelDesalteresJ3; + private javax.swing.JLabel jLabelDesalteresJ4; + private javax.swing.JLabel jLabelDesalteresL; + private javax.swing.JLabel jLabelNbMaladesJ; + private javax.swing.JLabel jLabelNbMaladesL; + private javax.swing.JLabel jLabelNourrisJ; + private javax.swing.JLabel jLabelNourrisJ1; + private javax.swing.JLabel jLabelNourrisJ3; + private javax.swing.JLabel jLabelNourrisJ4; + private javax.swing.JLabel jLabelNourrisL; + private java.awt.Panel panel1; + private java.awt.Panel panel2; + private java.awt.Panel panel3; + private java.awt.Panel panel4; + private java.awt.Panel panel5; + // End of variables declaration//GEN-END:variables + + private JMeuMeuView _View; + private jmeumeu.JMeuMeuGameField _Field; +} diff --git a/src/GameField/Cooperative.form b/src/GameField/Cooperative.form new file mode 100755 index 0000000..210f638 --- /dev/null +++ b/src/GameField/Cooperative.form @@ -0,0 +1,77 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/GameField/Cooperative.java b/src/GameField/Cooperative.java new file mode 100755 index 0000000..25fee42 --- /dev/null +++ b/src/GameField/Cooperative.java @@ -0,0 +1,101 @@ +/* + * Cooperative.java + * + * Created on 7 mai 2008, 17:16 + */ + +package GameField; + +import jmeumeu.JMeuMeuView; + +/** + * + * @author Jeremy + */ +public class Cooperative extends javax.swing.JPanel { + + /** Creates new form Cooperative */ + public Cooperative(JMeuMeuView View) { + initComponents(); + _View = View; + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + imagePanel1 = new Components.ImagePanel(); + jLabel1 = new javax.swing.JLabel(); + + setName("Form"); // NOI18N + + imagePanel1.setName("imagePanel1"); // NOI18N + + javax.swing.GroupLayout imagePanel1Layout = new javax.swing.GroupLayout(imagePanel1); + imagePanel1.setLayout(imagePanel1Layout); + imagePanel1Layout.setHorizontalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 691, Short.MAX_VALUE) + ); + imagePanel1Layout.setVerticalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 306, Short.MAX_VALUE) + ); + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(Cooperative.class); + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 711, Short.MAX_VALUE) + .addGap(0, 711, Short.MAX_VALUE) + .addGap(0, 711, Short.MAX_VALUE) + .addGap(0, 711, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(imagePanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 691, Short.MAX_VALUE)) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 362, Short.MAX_VALUE) + .addGap(0, 362, Short.MAX_VALUE) + .addGap(0, 362, Short.MAX_VALUE) + .addGap(0, 362, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addGap(18, 18, 18) + .addComponent(imagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + public void Show() + { + setVisible(true); + } + + public void Hide() + { + setVisible(false); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private Components.ImagePanel imagePanel1; + private javax.swing.JLabel jLabel1; + // End of variables declaration//GEN-END:variables + + private JMeuMeuView _View; +} diff --git a/src/GameField/Marche.form b/src/GameField/Marche.form new file mode 100755 index 0000000..a8511c1 --- /dev/null +++ b/src/GameField/Marche.form @@ -0,0 +1,75 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/GameField/Marche.java b/src/GameField/Marche.java new file mode 100755 index 0000000..c64556e --- /dev/null +++ b/src/GameField/Marche.java @@ -0,0 +1,100 @@ +/* + * Marche.java + * + * Created on 7 mai 2008, 17:16 + */ + +package GameField; + +import jmeumeu.JMeuMeuView; + +/** + * + * @author Jeremy + */ +public class Marche extends javax.swing.JPanel { + + /** Creates new form Marche */ + public Marche(JMeuMeuView View) { + initComponents(); + _View = View; + imagePanel1.SetBackground(View.getFrame(), "./images/Marche.jpg"); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + imagePanel1 = new Components.ImagePanel(); + jLabel1 = new javax.swing.JLabel(); + + setName("Form"); // NOI18N + + imagePanel1.setName("imagePanel1"); // NOI18N + + javax.swing.GroupLayout imagePanel1Layout = new javax.swing.GroupLayout(imagePanel1); + imagePanel1.setLayout(imagePanel1Layout); + imagePanel1Layout.setHorizontalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 632, Short.MAX_VALUE) + ); + imagePanel1Layout.setVerticalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 306, Short.MAX_VALUE) + ); + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(Marche.class); + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 652, Short.MAX_VALUE) + .addGap(0, 652, Short.MAX_VALUE) + .addGap(0, 652, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(imagePanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 632, Short.MAX_VALUE)) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 362, Short.MAX_VALUE) + .addGap(0, 362, Short.MAX_VALUE) + .addGap(0, 362, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addGap(18, 18, 18) + .addComponent(imagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + public void Show() + { + setVisible(true); + } + + public void Hide() + { + setVisible(false); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private Components.ImagePanel imagePanel1; + private javax.swing.JLabel jLabel1; + // End of variables declaration//GEN-END:variables + + private JMeuMeuView _View; +} diff --git a/src/GameField/Paturage.form b/src/GameField/Paturage.form new file mode 100755 index 0000000..96c71b3 --- /dev/null +++ b/src/GameField/Paturage.form @@ -0,0 +1,331 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/GameField/Paturage.java b/src/GameField/Paturage.java new file mode 100755 index 0000000..ccc60d6 --- /dev/null +++ b/src/GameField/Paturage.java @@ -0,0 +1,471 @@ +/* + * Paturage.java + * + * Created on 7 mai 2008, 17:15 + */ + +package GameField; + +import jmeumeu.*; +import java.sql.ResultSet; +import java.sql.SQLException; + +/** + * + * @author Jeremy + */ +public class Paturage extends javax.swing.JPanel { + + /** Creates new form Paturage */ + public Paturage(JMeuMeuView View, JMeuMeuGameField Field) { + _View = View; + _Field = Field; + initComponents(); + imagePanel1.SetBackground(View.getFrame(), "./images/vache.jpg"); + + FillDatas(); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + imagePanel1 = new Components.ImagePanel(); + jLabel1 = new javax.swing.JLabel(); + jPanel1 = new javax.swing.JPanel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jLabel10 = new javax.swing.JLabel(); + jLabel11 = new javax.swing.JLabel(); + jLabel12 = new javax.swing.JLabel(); + jLabel13 = new javax.swing.JLabel(); + jLabel14 = new javax.swing.JLabel(); + jLabel15 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jButton3 = new javax.swing.JButton(); + jButton4 = new javax.swing.JButton(); + jButton5 = new javax.swing.JButton(); + + setName("Form"); // NOI18N + + imagePanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + imagePanel1.setMaximumSize(new java.awt.Dimension(330, 330)); + imagePanel1.setMinimumSize(new java.awt.Dimension(330, 330)); + imagePanel1.setName("imagePanel1"); // NOI18N + + javax.swing.GroupLayout imagePanel1Layout = new javax.swing.GroupLayout(imagePanel1); + imagePanel1.setLayout(imagePanel1Layout); + imagePanel1Layout.setHorizontalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 311, Short.MAX_VALUE) + ); + imagePanel1Layout.setVerticalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 304, Short.MAX_VALUE) + ); + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(Paturage.class); + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + jPanel1.setName("jPanel1"); // NOI18N + + jLabel2.setText(resourceMap.getString("lblHealthString.text")); // NOI18N + jLabel2.setName("lblHealthString"); // NOI18N + + jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N + jLabel3.setName("jLabel3"); // NOI18N + + jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N + jLabel4.setName("jLabel4"); // NOI18N + + jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N + jLabel5.setName("jLabel5"); // NOI18N + + jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N + jLabel6.setName("jLabel6"); // NOI18N + + jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N + jLabel7.setName("jLabel7"); // NOI18N + + jLabel8.setText(resourceMap.getString("lblHealthStatus.text")); // NOI18N + jLabel8.setName("lblHealthStatus"); // NOI18N + + jLabel9.setText(resourceMap.getString("DirtyStatus.text")); // NOI18N + jLabel9.setName("DirtyStatus"); // NOI18N + + jLabel10.setText(resourceMap.getString("CowMass.text")); // NOI18N + jLabel10.setName("CowMass"); // NOI18N + + jLabel11.setText(resourceMap.getString("MilkLiter.text")); // NOI18N + jLabel11.setName("MilkLiter"); // NOI18N + + jLabel12.setText(resourceMap.getString("IsCowAlreadyDrink.text")); // NOI18N + jLabel12.setName("IsCowAlreadyDrink"); // NOI18N + + jLabel13.setText(resourceMap.getString("CowAlreadyEat.text")); // NOI18N + jLabel13.setName("CowAlreadyEat"); // NOI18N + + jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N + jLabel14.setName("jLabel14"); // NOI18N + + jLabel15.setText(resourceMap.getString("CowAge.text")); // NOI18N + jLabel15.setName("CowAge"); // NOI18N + + 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() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(jLabel3) + .addComponent(jLabel4) + .addComponent(jLabel5) + .addComponent(jLabel6) + .addComponent(jLabel7) + .addComponent(jLabel14)) + .addGap(44, 44, 44) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel15) + .addComponent(jLabel13) + .addComponent(jLabel12) + .addComponent(jLabel11) + .addComponent(jLabel10) + .addComponent(jLabel9) + .addComponent(jLabel8)) + .addContainerGap(23, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(jLabel8)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(jLabel9)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(jLabel10)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(jLabel11)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(jLabel12)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(jLabel13)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel14) + .addComponent(jLabel15)) + .addContainerGap(19, Short.MAX_VALUE)) + ); + + jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N + jButton1.setName("jButton1"); // NOI18N + jButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButton1MouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButton1MouseExited(evt); + } + }); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N + jButton2.setName("jButton2"); // NOI18N + jButton2.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButton2MouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButton2MouseExited(evt); + } + }); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N + jButton3.setName("jButton3"); // NOI18N + jButton3.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButton3MouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButton3MouseExited(evt); + } + }); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N + jButton4.setName("jButton4"); // NOI18N + jButton4.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButton4MouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButton4MouseExited(evt); + } + }); + jButton4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton5.setText(resourceMap.getString("jButton5.text")); // NOI18N + jButton5.setName("jButton5"); // NOI18N + jButton5.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseEntered(java.awt.event.MouseEvent evt) { + jButton5MouseEntered(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jButton5MouseExited(evt); + } + }); + jButton5.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(218, 218, 218) + .addComponent(imagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(188, 188, 188) + .addComponent(jButton1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton5)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addGap(221, 221, 221) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(imagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2) + .addComponent(jButton3) + .addComponent(jButton4) + .addComponent(jButton5)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGap(18, 18, 18)) + ); + }// //GEN-END:initComponents + +private void ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonActionPerformed + String ActionEvent = evt.getActionCommand(); + + if(ActionEvent.equals("Abreuver")) + { + if(_View._Oracle.callProc("abreuver_vache", _View._Datas.id_fermier)) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("Nourrir")) + { + if(_View._Oracle.callProc("nourrir_vache", _View._Datas.id_fermier)) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("Soigner")) + { + if(_View._Oracle.callProc("SoignerVache", _View._Datas.id_fermier)) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("Nettoyer")) + { + if(_View._Oracle.callProc("NettoyerVache", _View._Datas.id_fermier)) + { + ReloadDatas(); + } + } + else if(ActionEvent.equals("Traire")) + { + if(_View._Oracle.callProc("traire_lait", _View._Datas.id_fermier)) + { + ReloadDatas(); + } + } + +}//GEN-LAST:event_ButtonActionPerformed + +private void jButton1MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseEntered +}//GEN-LAST:event_jButton1MouseEntered + +private void jButton1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseExited +}//GEN-LAST:event_jButton1MouseExited + +private void jButton2MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseEntered +}//GEN-LAST:event_jButton2MouseEntered + +private void jButton2MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseExited +}//GEN-LAST:event_jButton2MouseExited + +private void jButton3MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseEntered +}//GEN-LAST:event_jButton3MouseEntered + +private void jButton3MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseExited +}//GEN-LAST:event_jButton3MouseExited + +private void jButton4MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseEntered +}//GEN-LAST:event_jButton4MouseEntered + +private void jButton4MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseExited +}//GEN-LAST:event_jButton4MouseExited + +private void jButton5MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton5MouseEntered +}//GEN-LAST:event_jButton5MouseEntered + +private void jButton5MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton5MouseExited +}//GEN-LAST:event_jButton5MouseExited + + public void Show() + { + setVisible(true); + ReloadDatas(); + } + + private void ReloadDatas() + { + _View._Oracle.SetFarmDatas(_View._Datas.nom); + _Field.SetEcus(); + FillDatas(); + } + + public void Hide() + { + setVisible(false); + } + + private void FillDatas() + { + this.jLabel8.setText(_View._Datas.nb_malade_vache > 0 ? "Malade" : "Sain"); + this.jLabel9.setText(_View._Datas.sale_vache.equals("V") ? "Sale" : "Propre"); + this.jLabel10.setText(Integer.toString(_View._Datas.poids_vache)); + this.jLabel11.setText(Integer.toString(_View._Datas.nb_lait)); + this.jLabel12.setText(_View._Datas.abreuvage_vache.equals("F") ? "Non" : "Oui"); + this.jLabel13.setText(_View._Datas.nourri_vache.equals("F") ? "Non" : "Oui" ); + this.jLabel15.setText(Integer.toString(_View._Datas.age_vache)); + + if(jLabel8.getText().equals("Sain")) + JMeuMeuHelpers.Disabled(jButton3); + else + JMeuMeuHelpers.Enabled(jButton3); + + + if(jLabel9.getText().equals("Propre")) + JMeuMeuHelpers.Disabled(jButton4); + else + JMeuMeuHelpers.Enabled(jButton4); + + int i = Integer.parseInt(jLabel11.getText()); + if(i == 0) + JMeuMeuHelpers.Disabled(jButton5); + else + JMeuMeuHelpers.Enabled(jButton5); + + if(jLabel12.getText().equals("Oui")) + JMeuMeuHelpers.Disabled(jButton1); + else + JMeuMeuHelpers.Enabled(jButton1); + + if(jLabel13.getText().equals("Oui")) + JMeuMeuHelpers.Disabled(jButton2); + else + JMeuMeuHelpers.Enabled(jButton2); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private Components.ImagePanel imagePanel1; + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JButton jButton4; + private javax.swing.JButton jButton5; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel10; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel15; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JPanel jPanel1; + // End of variables declaration//GEN-END:variables + + private JMeuMeuView _View; + private JMeuMeuGameField _Field; +} + diff --git a/src/GameField/Poulailler.form b/src/GameField/Poulailler.form new file mode 100755 index 0000000..53ca53f --- /dev/null +++ b/src/GameField/Poulailler.form @@ -0,0 +1,110 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/GameField/Poulailler.java b/src/GameField/Poulailler.java new file mode 100755 index 0000000..79c9b27 --- /dev/null +++ b/src/GameField/Poulailler.java @@ -0,0 +1,169 @@ +/* + * Poulailler.java + * + * Created on 7 mai 2008, 17:09 + */ + +package GameField; + +import jmeumeu.JMeuMeuView; + +/** + * + * @author Jeremy + */ +public class Poulailler extends javax.swing.JPanel { + + /** Creates new form Poulailler */ + public Poulailler(JMeuMeuView View, jmeumeu.JMeuMeuGameField Field) { + initComponents(); + _View = View; + _Field = Field; + imagePanel1.SetBackground(View.getFrame(), "./images/poulailler.jpg"); + + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + panel1 = new java.awt.Panel(); + imagePanel1 = new Components.ImagePanel(); + + setName("Form"); // NOI18N + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(Poulailler.class); + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + panel1.setBackground(resourceMap.getColor("panel1.background")); // NOI18N + panel1.setName("panel1"); // NOI18N + + imagePanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + imagePanel1.setName("imagePanel1"); // NOI18N + + javax.swing.GroupLayout imagePanel1Layout = new javax.swing.GroupLayout(imagePanel1); + imagePanel1.setLayout(imagePanel1Layout); + imagePanel1Layout.setHorizontalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 179, Short.MAX_VALUE) + ); + imagePanel1Layout.setVerticalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 176, Short.MAX_VALUE) + ); + + javax.swing.GroupLayout panel1Layout = new javax.swing.GroupLayout(panel1); + panel1.setLayout(panel1Layout); + panel1Layout.setHorizontalGroup( + panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel1Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(imagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + panel1Layout.setVerticalGroup( + panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(imagePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 771, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addGap(304, 304, 304) + .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(261, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + public void Show() + { + setVisible(true); + ReloadDatas(); + } + + private void ReloadDatas() + { + _View._Oracle.SetFarmDatas(_View._Datas.nom); + _Field.SetEcus(); + FillDatas(); + } + + private void FillDatas() + { + /*this.jLabel8.setText(_View._Datas.nb_malade_vache > 0 ? "Malade" : "Sain"); + this.jLabel9.setText(_View._Datas.sale_vache.equals("V") ? "Sale" : "Propre"); + this.jLabel10.setText(Integer.toString(_View._Datas.poids_vache)); + this.jLabel11.setText(Integer.toString(_View._Datas.nb_lait)); + this.jLabel12.setText(_View._Datas.abreuvage_vache.equals("F") ? "Non" : "Oui"); + this.jLabel13.setText(_View._Datas.nourri_vache.equals("F") ? "Non" : "Oui" ); + this.jLabel15.setText(Integer.toString(_View._Datas.age_vache)); + + if(jLabel8.getText().equals("Sain")) + JMeuMeuHelpers.Disabled(jButton3); + else + JMeuMeuHelpers.Enabled(jButton3); + + + if(jLabel9.getText().equals("Propre")) + JMeuMeuHelpers.Disabled(jButton4); + else + JMeuMeuHelpers.Enabled(jButton4); + + int i = Integer.parseInt(jLabel11.getText()); + if(i == 0) + JMeuMeuHelpers.Disabled(jButton5); + else + JMeuMeuHelpers.Enabled(jButton5); + + if(jLabel12.getText().equals("Oui")) + JMeuMeuHelpers.Disabled(jButton1); + else + JMeuMeuHelpers.Enabled(jButton1); + + if(jLabel13.getText().equals("Oui")) + JMeuMeuHelpers.Disabled(jButton2); + else + JMeuMeuHelpers.Enabled(jButton2);*/ + } + + public void Hide() + { + setVisible(false); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private Components.ImagePanel imagePanel1; + private javax.swing.JLabel jLabel1; + private java.awt.Panel panel1; + // End of variables declaration//GEN-END:variables + + private JMeuMeuView _View; + private jmeumeu.JMeuMeuGameField _Field; +} diff --git a/src/GameField/Remise.form b/src/GameField/Remise.form new file mode 100755 index 0000000..b0c59ed --- /dev/null +++ b/src/GameField/Remise.form @@ -0,0 +1,77 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/GameField/Remise.java b/src/GameField/Remise.java new file mode 100755 index 0000000..b8df069 --- /dev/null +++ b/src/GameField/Remise.java @@ -0,0 +1,101 @@ +/* + * Remise.java + * + * Created on 7 mai 2008, 17:21 + */ + +package GameField; + +import jmeumeu.JMeuMeuView; + +/** + * + * @author Jeremy + */ +public class Remise extends javax.swing.JPanel { + + /** Creates new form Remise */ + public Remise(JMeuMeuView View) { + _View = View; + initComponents(); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + imagePanel1 = new Components.ImagePanel(); + + setName("Form"); // NOI18N + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(Remise.class); + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + imagePanel1.setName("imagePanel1"); // NOI18N + + javax.swing.GroupLayout imagePanel1Layout = new javax.swing.GroupLayout(imagePanel1); + imagePanel1.setLayout(imagePanel1Layout); + imagePanel1Layout.setHorizontalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 801, Short.MAX_VALUE) + ); + imagePanel1Layout.setVerticalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 306, Short.MAX_VALUE) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 821, Short.MAX_VALUE) + .addGap(0, 821, Short.MAX_VALUE) + .addGap(0, 821, Short.MAX_VALUE) + .addGap(0, 821, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(imagePanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 801, Short.MAX_VALUE)) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 362, Short.MAX_VALUE) + .addGap(0, 362, Short.MAX_VALUE) + .addGap(0, 362, Short.MAX_VALUE) + .addGap(0, 362, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addGap(18, 18, 18) + .addComponent(imagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + public void Show() + { + setVisible(true); + } + + public void Hide() + { + setVisible(false); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private Components.ImagePanel imagePanel1; + private javax.swing.JLabel jLabel1; + // End of variables declaration//GEN-END:variables + + private JMeuMeuView _View; +} diff --git a/src/GameField/Welcome.form b/src/GameField/Welcome.form new file mode 100755 index 0000000..ae1d8d1 --- /dev/null +++ b/src/GameField/Welcome.form @@ -0,0 +1,82 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/GameField/Welcome.java b/src/GameField/Welcome.java new file mode 100755 index 0000000..3bf35c5 --- /dev/null +++ b/src/GameField/Welcome.java @@ -0,0 +1,107 @@ +/* + * Welcome.java + * + * Created on 7 mai 2008, 13:34 + */ + +package GameField; + +import jmeumeu.JMeuMeuView; + +/** + * + * @author Jeremy + */ +public class Welcome extends javax.swing.JPanel { + + /** Creates new form Welcome */ + public Welcome(JMeuMeuView View) { + initComponents(); + + _View = View; + imagePanel1.SetBackground(View.getFrame(), "./images/Farm.jpg"); + jLabel2.setText(_View._Datas.nom); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + imagePanel1 = new Components.ImagePanel(); + jLabel2 = new javax.swing.JLabel(); + + setName("Form"); // NOI18N + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(Welcome.class); + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + imagePanel1.setName("imagePanel1"); // NOI18N + + javax.swing.GroupLayout imagePanel1Layout = new javax.swing.GroupLayout(imagePanel1); + imagePanel1.setLayout(imagePanel1Layout); + imagePanel1Layout.setHorizontalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 710, Short.MAX_VALUE) + ); + imagePanel1Layout.setVerticalGroup( + imagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 390, Short.MAX_VALUE) + ); + + jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N + jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N + jLabel2.setName("jLabel2"); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 710, Short.MAX_VALUE) + .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 710, Short.MAX_VALUE) + .addComponent(imagePanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel2) + .addGap(53, 53, 53) + .addComponent(imagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(73, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + public void Show() + { + setVisible(true); + } + + public void Hide() + { + setVisible(false); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private Components.ImagePanel imagePanel1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + // End of variables declaration//GEN-END:variables + + private JMeuMeuView _View; +} diff --git a/src/GameField/resources/Clapier.properties b/src/GameField/resources/Clapier.properties new file mode 100755 index 0000000..66a7c30 --- /dev/null +++ b/src/GameField/resources/Clapier.properties @@ -0,0 +1,32 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. + +#NOI18N +jLabel1.font=Tahoma 14 Bold +jLabel1.text=SECTION CLAPIER +#NOI18N +jLabel2.font=Tahoma 14 12 Bold +jLabel2.text=LAPEREAUX +#NOI18N +jLabel3.font=Tahoma 14 12 12 Bold +jLabel3.text=LAPINS +jLabel4.text=Lapereaux d\u00E9salt\u00E9r\u00E9s : +jButtonAbreuverJ.text=Abreuver +jButtonSoignerJ.text=Soigner +jButtonNourrirJ.text=Nourrir +jButtonNettoyerJ.text=Nettoyer +jButtonNettoyerV.text=Nettoyer +jLabel5.text=Lapereaux nourris : +jLabel6.text=Nombre de lapereaux malades : +jLabelDesalteresJ.text=Non +jLabelNourrisJ.text=Non +jLabel14.text=Nombre de lapereaux malades : +jLabel13.text=Lapereaux nourris : +jLabel12.text=Lapereaux d\u00E9salt\u00E9r\u00E9s : +jLabelDesalteresL.text=Non +jLabelNourrisL.text=Non +jButtonNourrirV.text=Nourrir +jButtonSoignerV.text=Soigner +jButtonAbreuverV.text=Abreuver +jLabelNbMaladesJ.text=0 +jLabelNbMaladesL.text=0 diff --git a/src/GameField/resources/Cooperative.properties b/src/GameField/resources/Cooperative.properties new file mode 100755 index 0000000..b5f6ef1 --- /dev/null +++ b/src/GameField/resources/Cooperative.properties @@ -0,0 +1,3 @@ +jLabel1.text=SECTION COOPERATIVE +#NOI18N +jLabel1.font=Tahoma 14 12 12 12 Bold diff --git a/src/GameField/resources/Marche.properties b/src/GameField/resources/Marche.properties new file mode 100755 index 0000000..dfa1c0e --- /dev/null +++ b/src/GameField/resources/Marche.properties @@ -0,0 +1,6 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. + +#NOI18N +jLabel1.font=Tahoma 14 12 12 Bold +jLabel1.text=SECTION MARCHE diff --git a/src/GameField/resources/Paturage.properties b/src/GameField/resources/Paturage.properties new file mode 100755 index 0000000..feb2080 --- /dev/null +++ b/src/GameField/resources/Paturage.properties @@ -0,0 +1,22 @@ +jLabel1.text=SECTION PATURAGE +#NOI18N +jLabel1.font=Tahoma 14 12 Bold +lblHealthString.text=Etat de Sant\u00E9 de la Vache : +jLabel3.text=Hygi\u00E8ne de la Vache : +jLabel4.text=Masse de la vache (Kg) : +jLabel5.text=Litres de Lait dans les pis de la vache : +jLabel6.text=Vache d\u00E9salt\u00E9ree : +jLabel7.text=Vache nourrie : +lblHealthStatus.text=Sain +DirtyStatus.text=Propre +CowMass.text=0 +MilkLiter.text=0 +IsCowAlreadyDrink.text=Non +CowAlreadyEat.text=Non +jButton1.text=Abreuver +jButton2.text=Nourrir +jButton3.text=Soigner +jButton4.text=Nettoyer +jButton5.text=Traire +jLabel14.text=Age de la vache : +CowAge.text=0 diff --git a/src/GameField/resources/Poulailler.properties b/src/GameField/resources/Poulailler.properties new file mode 100755 index 0000000..e420fbc --- /dev/null +++ b/src/GameField/resources/Poulailler.properties @@ -0,0 +1,5 @@ +jLabel1.text=SECTION POULAILLER +#NOI18N +jLabel1.font=Tahoma-Bold-14 +#NOI18N +panel1.background=255, 255, 255 diff --git a/src/GameField/resources/Remise.properties b/src/GameField/resources/Remise.properties new file mode 100755 index 0000000..5a3bf6b --- /dev/null +++ b/src/GameField/resources/Remise.properties @@ -0,0 +1,6 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. + +#NOI18N +jLabel1.font=Tahoma 14 12 12 12 12 Bold +jLabel1.text=SECTION REMISE diff --git a/src/GameField/resources/Welcome.properties b/src/GameField/resources/Welcome.properties new file mode 100755 index 0000000..40b6977 --- /dev/null +++ b/src/GameField/resources/Welcome.properties @@ -0,0 +1,6 @@ +jLabel1.text=BIENVENUE DANS VOTRE FERME +#NOI18N +jLabel1.font=Tahoma-Bold-14 +jLabel2.text= +#NOI18N +jLabel2.font=Tahoma-Bold-14 diff --git a/src/META-INF/services/org.jdesktop.application.Application b/src/META-INF/services/org.jdesktop.application.Application new file mode 100755 index 0000000..6c6402e --- /dev/null +++ b/src/META-INF/services/org.jdesktop.application.Application @@ -0,0 +1 @@ +jmeumeu.JMeuMeuApp \ No newline at end of file diff --git a/src/jmeumeu/JMeuMeuAboutBox.form b/src/jmeumeu/JMeuMeuAboutBox.form new file mode 100755 index 0000000..6a675d3 --- /dev/null +++ b/src/jmeumeu/JMeuMeuAboutBox.form @@ -0,0 +1,203 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/jmeumeu/JMeuMeuAboutBox.java b/src/jmeumeu/JMeuMeuAboutBox.java new file mode 100755 index 0000000..b6c611e --- /dev/null +++ b/src/jmeumeu/JMeuMeuAboutBox.java @@ -0,0 +1,163 @@ +/* + * JMeuMeuAboutBox.java + */ + +package jmeumeu; + +import org.jdesktop.application.Action; + +public class JMeuMeuAboutBox extends javax.swing.JDialog { + + public JMeuMeuAboutBox(java.awt.Frame parent) { + super(parent); + initComponents(); + getRootPane().setDefaultButton(closeButton); + } + + @Action public void closeAboutBox() { + setVisible(false); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + closeButton = new javax.swing.JButton(); + javax.swing.JLabel appTitleLabel = new javax.swing.JLabel(); + javax.swing.JLabel versionLabel = new javax.swing.JLabel(); + javax.swing.JLabel appVersionLabel = new javax.swing.JLabel(); + javax.swing.JLabel appDescLabel = new javax.swing.JLabel(); + javax.swing.JLabel imageLabel = new javax.swing.JLabel(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(JMeuMeuAboutBox.class); + setTitle(resourceMap.getString("title")); // NOI18N + setModal(true); + setName("aboutBox"); // NOI18N + setResizable(false); + + javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getActionMap(JMeuMeuAboutBox.class, this); + closeButton.setAction(actionMap.get("closeAboutBox")); // NOI18N + closeButton.setName("closeButton"); // NOI18N + + appTitleLabel.setFont(appTitleLabel.getFont().deriveFont(appTitleLabel.getFont().getStyle() | java.awt.Font.BOLD, appTitleLabel.getFont().getSize()+4)); + appTitleLabel.setText(resourceMap.getString("Application.title")); // NOI18N + appTitleLabel.setName("jmeumeustaffl"); // NOI18N + + versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getStyle() | java.awt.Font.BOLD)); + versionLabel.setText(resourceMap.getString("versionLabel.text")); // NOI18N + versionLabel.setName("versionLabel"); // NOI18N + + appVersionLabel.setText(resourceMap.getString("Application.version")); // NOI18N + appVersionLabel.setName("appVersionLabel"); // NOI18N + + appDescLabel.setText(resourceMap.getString("appDescLabel.text")); // NOI18N + appDescLabel.setName("appDescLabel"); // NOI18N + + imageLabel.setIcon(resourceMap.getIcon("imageLabel.icon")); // NOI18N + imageLabel.setName("imageLabel"); // NOI18N + + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N + jLabel2.setName("jLabel2"); // NOI18N + + jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N + jLabel3.setName("jLabel3"); // NOI18N + + jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N + jLabel4.setName("jLabel4"); // NOI18N + + jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N + jLabel5.setName("jLabel5"); // NOI18N + + jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N + jLabel6.setName("jLabel6"); // NOI18N + + jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N + jLabel7.setName("jLabel7"); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(imageLabel) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(appTitleLabel) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(versionLabel) + .addComponent(jLabel1)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(appVersionLabel) + .addComponent(jLabel2) + .addComponent(jLabel7) + .addComponent(jLabel3) + .addComponent(jLabel4) + .addComponent(jLabel5) + .addComponent(jLabel6) + .addComponent(closeButton))) + .addComponent(appDescLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(imageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 230, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(appTitleLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(appDescLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(versionLabel) + .addComponent(appVersionLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jLabel2)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(closeButton) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + pack(); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton closeButton; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + // End of variables declaration//GEN-END:variables + +} diff --git a/src/jmeumeu/JMeuMeuApp.java b/src/jmeumeu/JMeuMeuApp.java new file mode 100755 index 0000000..f865fd6 --- /dev/null +++ b/src/jmeumeu/JMeuMeuApp.java @@ -0,0 +1,45 @@ +/* + * JMeuMeuApp.java + */ + +package jmeumeu; + +import org.jdesktop.application.Application; +import org.jdesktop.application.SingleFrameApplication; + +/** + * The main class of the application. + */ +public class JMeuMeuApp extends SingleFrameApplication { + + /** + * At startup create and show the main frame of the application. + */ + @Override protected void startup() { + show(new JMeuMeuView(this)); + } + + /** + * This method is to initialize the specified window by injecting resources. + * Windows shown in our application come fully initialized from the GUI + * builder, so this additional configuration is not needed. + */ + @Override protected void configureWindow(java.awt.Window root) { + + } + + /** + * A convenient static getter for the application instance. + * @return the instance of JMeuMeuApp + */ + public static JMeuMeuApp getApplication() { + return Application.getInstance(JMeuMeuApp.class); + } + + /** + * Main method launching the application. + */ + public static void main(String[] args) { + launch(JMeuMeuApp.class, args); + } +} diff --git a/src/jmeumeu/JMeuMeuDatas.java b/src/jmeumeu/JMeuMeuDatas.java new file mode 100755 index 0000000..f9d54c6 --- /dev/null +++ b/src/jmeumeu/JMeuMeuDatas.java @@ -0,0 +1,73 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package jmeumeu; + +import java.sql.Date; + +/** + * + * @author Jeremy + */ +public class JMeuMeuDatas { +//variables du joueur +public String id_fermier;//ID_FERMIER ---login +public String mdp;// MDP --- password +public String mail;//MAIL +public Date date_enregistrement;// DATE_ENREGISTREMENT +public Date date_connection;// DATE_CONNECTION + +//variables de la ferme +public String nom;//NOM +public int ecus;//ECUS +public int score;//SCORE +public int classement;//CLASSEMENT +public String hibernation; //HIBERNATION -- F ou T +public int nb_achats_jour;//NB_ACHATS_JOUR -- 0<..<12 + +//variables du poulailler +public int abreuvage_v; +public int nb_abreuvage_v; +public int nourri_v; +public int nb_jeune_v; +public int sale_v; +public int nb_malade_v; +public int poids_v; +public int age_v; +public int production_v; + +//variables du clapier +public int nb_male; +public int nb_femelle; +public int nb_gros; +public int nb_moyen; +public int nb_petit; +public String abreuvage_l; +public int nb_abreuvage_l; +public String nourri_l; +public int nb_jeune_l; +public String sale_l; +public int nb_malade_l; +public String abreuvage_j; +public int nb_abreuvage_j; +public String nourri_j; +public int nb_jeune_j;// ???? bizarre nbre de jeune j(jeunes?) +public String sale_j; +public int nb_malade_j; + +//variables de la vache +public String abreuvage_vache; +public int nb_abreuvage_vache; +public String nourri_vache; +public int nb_jeune_vache; +public String sale_vache; +public int nb_malade_vache; +public int poids_vache; +public int age_vache; +public int nb_lait; +//variables de l'entrepot +//TODO +} + diff --git a/src/jmeumeu/JMeuMeuDeleteUser.form b/src/jmeumeu/JMeuMeuDeleteUser.form new file mode 100755 index 0000000..2757e03 --- /dev/null +++ b/src/jmeumeu/JMeuMeuDeleteUser.form @@ -0,0 +1,137 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/jmeumeu/JMeuMeuDeleteUser.java b/src/jmeumeu/JMeuMeuDeleteUser.java new file mode 100755 index 0000000..390be97 --- /dev/null +++ b/src/jmeumeu/JMeuMeuDeleteUser.java @@ -0,0 +1,164 @@ +/* + * JMeuMeuDeleteUser.java + * + * Created on 15 mai 2008, 09:42 + */ + +package jmeumeu; + + +/** + * + * @author Jeremy + */ +public class JMeuMeuDeleteUser extends javax.swing.JFrame { + + /** Creates new form JMeuMeuDeleteUser */ + public JMeuMeuDeleteUser(JMeuMeuView View) { + this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); + initComponents(); + _View = View; + this.setTitle("Supprimer un Compte Utilisateur"); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jTextField2 = new javax.swing.JTextField(); + jLabel4 = new javax.swing.JLabel(); + jPasswordField1 = new javax.swing.JPasswordField(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); + setName("Form"); // NOI18N + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(JMeuMeuDeleteUser.class); + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N + jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N + jLabel3.setName("jLabel3"); // NOI18N + + jTextField2.setText(resourceMap.getString("jTextField2.text")); // NOI18N + jTextField2.setName("jTextField2"); // NOI18N + + jLabel4.setFont(resourceMap.getFont("jLabel4.font")); // NOI18N + jLabel4.setName("jLabel4"); // NOI18N + + jPasswordField1.setName("jPasswordField1"); // NOI18N + + jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N + jButton1.setActionCommand(resourceMap.getString("jButton1.actionCommand")); // NOI18N + jButton1.setName("jButton1"); // NOI18N + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N + jButton2.setName("jButton2"); // NOI18N + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(65, 65, 65) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel4) + .addGap(64, 64, 64)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jPasswordField1) + .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE))) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 406, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 216, Short.MAX_VALUE) + .addComponent(jButton2))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addGap(33, 33, 33) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel3)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 51, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2)) + .addContainerGap()) + ); + }// //GEN-END:initComponents + +private void ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonActionPerformed + + String Action = evt.getActionCommand(); + + if(Action.equals("Annuler")) + { + this.setVisible(false); + _View.show(); + + } + else if(Action.equals("SupprimerCompte")) + { + if(_View._Oracle.Connexion()) + { + if(_View._Oracle.callProc("Suppression_Compte", this.jTextField2.getText())) + { + JMeuMeuHelpers.ShowInformationMessage("Utilisateur supprimé."); + + _View._Oracle.Deconnexion(); + } + } + } +}//GEN-LAST:event_ButtonActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JPasswordField jPasswordField1; + private javax.swing.JTextField jTextField2; + // End of variables declaration//GEN-END:variables + + private JMeuMeuView _View; +} diff --git a/src/jmeumeu/JMeuMeuGameField.form b/src/jmeumeu/JMeuMeuGameField.form new file mode 100755 index 0000000..4641307 --- /dev/null +++ b/src/jmeumeu/JMeuMeuGameField.form @@ -0,0 +1,328 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/jmeumeu/JMeuMeuGameField.java b/src/jmeumeu/JMeuMeuGameField.java new file mode 100755 index 0000000..18eb081 --- /dev/null +++ b/src/jmeumeu/JMeuMeuGameField.java @@ -0,0 +1,513 @@ +/* + * JMeuMeuGameField.java + * + * Created on 6 mai 2008, 17:48 + */ + +package jmeumeu; + +import java.sql.ResultSet; +import java.sql.SQLException; + +/** + * + * @author Jeremy + */ +public class JMeuMeuGameField extends javax.swing.JFrame { + + /** Creates new form JMeuMeuGameField */ + public JMeuMeuGameField(JMeuMeuView View) { + initComponents(); + _View = View; + + this.jLabel4.setText(Integer.toString(_View._Datas.ecus)); + + getFrames()[1].setTitle("Projet JMeuMeu"); + + _Welcome = new GameField.Welcome(View); + _Welcome.setSize(this.jPanel2.getSize().width, this.jPanel2.getSize().height); + + _Poulailler = new GameField.Poulailler(View, this); + _Poulailler.setSize(this.jPanel2.getSize().width, this.jPanel2.getSize().height); + + _Clapier = new GameField.Clapier(View, this); + _Clapier.setSize(this.jPanel2.getSize().width, this.jPanel2.getSize().height); + + _Paturage = new GameField.Paturage(View, this); + _Paturage.setSize(this.jPanel2.getSize().width, this.jPanel2.getSize().height); + + _Remise = new GameField.Remise(View); + _Remise.setSize(this.jPanel2.getSize().width, this.jPanel2.getSize().height); + + _Cooperative = new GameField.Cooperative(View); + _Cooperative.setSize(this.jPanel2.getSize().width, this.jPanel2.getSize().height); + + _Marche = new GameField.Marche(View); + _Marche.setSize(this.jPanel2.getSize().width, this.jPanel2.getSize().height); + + jPanel2.add(_Welcome); + jPanel2.add(_Poulailler); + jPanel2.add(_Clapier); + jPanel2.add(_Paturage); + jPanel2.add(_Remise); + jPanel2.add(_Cooperative); + jPanel2.add(_Marche); + + ((GameField.Welcome)jPanel2.getComponent(0)).Show(); + ((GameField.Poulailler)jPanel2.getComponent(1)).Hide(); + ((GameField.Clapier)jPanel2.getComponent(2)).Hide(); + ((GameField.Paturage)jPanel2.getComponent(3)).Hide(); + ((GameField.Remise)jPanel2.getComponent(4)).Hide(); + ((GameField.Cooperative)jPanel2.getComponent(5)).Hide(); + ((GameField.Marche)jPanel2.getComponent(6)).Hide(); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jPanel1 = new javax.swing.JPanel(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jButton3 = new javax.swing.JButton(); + jButton4 = new javax.swing.JButton(); + jButton5 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jButton6 = new javax.swing.JButton(); + jButton7 = new javax.swing.JButton(); + jButton8 = new javax.swing.JButton(); + jPanel2 = new javax.swing.JPanel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); + setName("Form"); // NOI18N + + jPanel1.setName("jPanel1"); // NOI18N + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(JMeuMeuGameField.class); + jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N + jButton1.setToolTipText(resourceMap.getString("jButton1.toolTipText")); // NOI18N + jButton1.setActionCommand(resourceMap.getString("jButton1.actionCommand")); // NOI18N + jButton1.setName("jButton1"); // NOI18N + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N + jButton2.setToolTipText(resourceMap.getString("jButton2.toolTipText")); // NOI18N + jButton2.setActionCommand(resourceMap.getString("jButton2.actionCommand")); // NOI18N + jButton2.setName("jButton2"); // NOI18N + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N + jButton3.setToolTipText(resourceMap.getString("jButton3.toolTipText")); // NOI18N + jButton3.setName("jButton3"); // NOI18N + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N + jButton4.setToolTipText(resourceMap.getString("jButton4.toolTipText")); // NOI18N + jButton4.setName("jButton4"); // NOI18N + jButton4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton5.setText(resourceMap.getString("jButton5.text")); // NOI18N + jButton5.setToolTipText(resourceMap.getString("jButton5.toolTipText")); // NOI18N + jButton5.setName("jButton5"); // NOI18N + jButton5.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N + jLabel1.setName("jLabel1"); // NOI18N + + jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N + jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N + jLabel2.setName("jLabel2"); // NOI18N + + jLabel3.setFont(resourceMap.getFont("lblEcus.font")); // NOI18N + jLabel3.setText(resourceMap.getString("lblEcus.text")); // NOI18N + jLabel3.setName("lblEcus"); // NOI18N + + jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N + jLabel4.setName("jLabel4"); // NOI18N + + jLabel5.setFont(resourceMap.getFont("lblPoints.font")); // NOI18N + jLabel5.setText(resourceMap.getString("lblPoints.text")); // NOI18N + jLabel5.setName("lblPoints"); // NOI18N + + jLabel6.setText(resourceMap.getString("lblNumPoints.text")); // NOI18N + jLabel6.setName("lblNumPoints"); // NOI18N + + jLabel7.setFont(resourceMap.getFont("lblRank.font")); // NOI18N + jLabel7.setText(resourceMap.getString("lblRank.text")); // NOI18N + jLabel7.setName("lblRank"); // NOI18N + + jLabel8.setText(resourceMap.getString("lblNumRank.text")); // NOI18N + jLabel8.setName("lblNumRank"); // NOI18N + + jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N + jLabel9.setName("jLabel9"); // NOI18N + + jButton6.setText(resourceMap.getString("jButton6.text")); // NOI18N + jButton6.setActionCommand(resourceMap.getString("jButton6.actionCommand")); // NOI18N + jButton6.setName("jButton6"); // NOI18N + jButton6.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton7.setText(resourceMap.getString("jButton7.text")); // NOI18N + jButton7.setActionCommand(resourceMap.getString("jButton7.actionCommand")); // NOI18N + jButton7.setName("jButton7"); // NOI18N + jButton7.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton8.setText(resourceMap.getString("jButton8.text")); // NOI18N + jButton8.setToolTipText(resourceMap.getString("jButton8.toolTipText")); // NOI18N + jButton8.setActionCommand(resourceMap.getString("jButton8.actionCommand")); // NOI18N + jButton8.setName("jButton8"); // NOI18N + jButton8.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 200, 300) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE) + .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE) + .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE) + .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)) + .addContainerGap()) + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE) + .addContainerGap()) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE) + .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE) + .addContainerGap()) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton8, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE) + .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel7) + .addComponent(jLabel3) + .addComponent(jLabel5)) + .addGap(10, 10, 10) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE)))) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(16, 16, 16) + .addComponent(jLabel1) + .addGap(18, 18, 18) + .addComponent(jButton2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton8) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton1) + .addGap(18, 18, 18) + .addComponent(jLabel2) + .addGap(22, 22, 22) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(jLabel9) + .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(238, Short.MAX_VALUE)) + ); + + jLabel3.getAccessibleContext().setAccessibleName(resourceMap.getString("jLabel3.AccessibleContext.accessibleName")); // NOI18N + jLabel4.getAccessibleContext().setAccessibleName(resourceMap.getString("jLabel4.AccessibleContext.accessibleName")); // NOI18N + + jPanel2.setName("jPanel2"); // NOI18N + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 700, Short.MAX_VALUE) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 626, Short.MAX_VALUE) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGap(28, 28, 28) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + +private void ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonActionPerformed + + String s = evt.getActionCommand(); + + if(s.equals("Deconnexion")) + { + if(JMeuMeuHelpers.ShowQuestionMessage("Voulez-vous vraiment vous déconnecter ?") == 0) + { +/* if(_View._Oracle.Deconnexion()) + {*/ + this.setVisible(false); + _View.show(); + /* } + else + JMeuMeuHelpers.ShowDeconnexionError();*/ + } + } + else if(s.equals("Poulailler")) + { + ((GameField.Welcome)jPanel2.getComponent(0)).Hide(); + ((GameField.Poulailler)jPanel2.getComponent(1)).Show(); + ((GameField.Clapier)jPanel2.getComponent(2)).Hide(); + ((GameField.Paturage)jPanel2.getComponent(3)).Hide(); + ((GameField.Remise)jPanel2.getComponent(4)).Hide(); + ((GameField.Cooperative)jPanel2.getComponent(5)).Hide(); + ((GameField.Marche)jPanel2.getComponent(6)).Hide(); + } + else if(s.equals("Clapier")) + { + ((GameField.Welcome)jPanel2.getComponent(0)).Hide(); + ((GameField.Poulailler)jPanel2.getComponent(1)).Hide(); + ((GameField.Clapier)jPanel2.getComponent(2)).Show(); + ((GameField.Paturage)jPanel2.getComponent(3)).Hide(); + ((GameField.Remise)jPanel2.getComponent(4)).Hide(); + ((GameField.Cooperative)jPanel2.getComponent(5)).Hide(); + ((GameField.Marche)jPanel2.getComponent(6)).Hide(); + } + else if(s.equals("Paturage")) + { + ((GameField.Welcome)jPanel2.getComponent(0)).Hide(); + ((GameField.Poulailler)jPanel2.getComponent(1)).Hide(); + ((GameField.Clapier)jPanel2.getComponent(2)).Hide(); + ((GameField.Paturage)jPanel2.getComponent(3)).Show(); + ((GameField.Remise)jPanel2.getComponent(4)).Hide(); + ((GameField.Cooperative)jPanel2.getComponent(5)).Hide(); + ((GameField.Marche)jPanel2.getComponent(6)).Hide(); + } + else if(s.equals("Remise")) + { + ((GameField.Welcome)jPanel2.getComponent(0)).Hide(); + ((GameField.Poulailler)jPanel2.getComponent(1)).Hide(); + ((GameField.Clapier)jPanel2.getComponent(2)).Hide(); + ((GameField.Paturage)jPanel2.getComponent(3)).Hide(); + ((GameField.Remise)jPanel2.getComponent(4)).Show(); + ((GameField.Cooperative)jPanel2.getComponent(5)).Hide(); + ((GameField.Marche)jPanel2.getComponent(6)).Hide(); + } + else if(s.equals("Cooperative")) + { + ((GameField.Welcome)jPanel2.getComponent(0)).Hide(); + ((GameField.Poulailler)jPanel2.getComponent(1)).Hide(); + ((GameField.Clapier)jPanel2.getComponent(2)).Hide(); + ((GameField.Paturage)jPanel2.getComponent(3)).Hide(); + ((GameField.Remise)jPanel2.getComponent(4)).Hide(); + ((GameField.Cooperative)jPanel2.getComponent(5)).Show(); + ((GameField.Marche)jPanel2.getComponent(6)).Hide(); + } + else if(s.equals("Marche")) + { + ((GameField.Welcome)jPanel2.getComponent(0)).Hide(); + ((GameField.Poulailler)jPanel2.getComponent(1)).Hide(); + ((GameField.Clapier)jPanel2.getComponent(2)).Hide(); + ((GameField.Paturage)jPanel2.getComponent(3)).Hide(); + ((GameField.Remise)jPanel2.getComponent(4)).Hide(); + ((GameField.Cooperative)jPanel2.getComponent(5)).Hide(); + ((GameField.Marche)jPanel2.getComponent(6)).Show(); + } + else if(s.equals("Hibernation")) + { + + if(JMeuMeuHelpers.ShowQuestionMessage("Voulez-vous vraiment passer en hibernation ?") == 0) + { + if(_View._Oracle.Deconnexion()) + { + this.setVisible(false); + _View.show(); + } + } + } +}//GEN-LAST:event_ButtonActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new JMeuMeuGameField(null).setVisible(true); + } + }); + } + + private int GetEcus() + { + ResultSet RS = _View._Oracle.Query("SELECT ECUS FROM FERME"); + + int ecus = 0; + + try + { + ecus = RS.getInt(1); + } + catch(SQLException e) + { + JMeuMeuHelpers.ShowErrorMessage(e.getMessage()); + return 0; + } + + return ecus; + } + + public void SetEcus() + { + this.jLabel4.setText(Integer.toString(_View._Datas.ecus)); + } + + private String IsCowExist() + { + ResultSet RS = _View._Oracle.Query("SELECT ABREUVAGE_VACHE FROM FERME"); + + String x = null; + + try + { + x = RS.getString(1); + } + catch(SQLException e) + { + JMeuMeuHelpers.ShowErrorMessage(e.getMessage()); + return null; + } + + return x; + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JButton jButton4; + private javax.swing.JButton jButton5; + private javax.swing.JButton jButton6; + private javax.swing.JButton jButton7; + private javax.swing.JButton jButton8; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + + // End of variables declaration//GEN-END:variables + + private JMeuMeuView _View; + + private GameField.Welcome _Welcome; + private GameField.Poulailler _Poulailler; + private GameField.Clapier _Clapier; + private GameField.Paturage _Paturage; + private GameField.Remise _Remise; + private GameField.Cooperative _Cooperative; + private GameField.Marche _Marche; +} diff --git a/src/jmeumeu/JMeuMeuHelpers.java b/src/jmeumeu/JMeuMeuHelpers.java new file mode 100755 index 0000000..a9fdd14 --- /dev/null +++ b/src/jmeumeu/JMeuMeuHelpers.java @@ -0,0 +1,161 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package jmeumeu; + +import javax.swing.JOptionPane; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +/** + * + * @author Jeremy + */ +public class JMeuMeuHelpers { + + static public String ToString(char[] S) + { + String Result = ""; + for(int i = 0; i < S.length; i++) + Result += S[i]; + + return Result; + } + + static public boolean IsEmailAddress(String value) + { + Pattern pattern = Pattern.compile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"); + Matcher m = pattern.matcher(value); + + return m.matches(); + } + + static public void ShowErrorMessage(String ErrorMessage) + { + JOptionPane.showMessageDialog(null, ErrorMessage, JMeuMeuMessages.MessageBoxError, + JMeuMeuMessages.ERROR); + } + + static public void ShowInformationMessage(String InformationMessage) + { + JOptionPane.showMessageDialog(null, InformationMessage, JMeuMeuMessages.MessageBoxInformation, + JMeuMeuMessages.INFORMATION); + } + + static public int ShowQuestionMessage(String QuestionMessage) + { + return JOptionPane.showConfirmDialog(null, QuestionMessage, + JMeuMeuMessages.Message, + JMeuMeuMessages.YES_NO, JMeuMeuMessages.QUESTION); + } + + static public void ShowError(String message) + { + int i = Integer.parseInt(message.substring(4, 9)); + + switch(i) + { + case 20001: + ShowErrorMessage(JMeuMeuMessages.UserNameAlreadyExist); + break; + + case 20002: + ShowErrorMessage(JMeuMeuMessages.UserNameAlreadyExist); + break; + + case 20003: + ShowErrorMessage(JMeuMeuMessages.ImpossibleToConnect); + break; + + case 20111: + ShowErrorMessage(JMeuMeuMessages.NotEnoughMoney); + break; + + case 20112: + ShowErrorMessage(JMeuMeuMessages.NoCollectable); + break; + + case 20113: + ShowErrorMessage(JMeuMeuMessages.SendTooArticles); + break; + + case 20114: + ShowErrorMessage(JMeuMeuMessages.NoRights); + break; + + case 20115: + ShowErrorMessage(JMeuMeuMessages.OverflowLimit); + break; + + case 20116: + ShowErrorMessage(JMeuMeuMessages.ClosedCooperative); + break; + + case 20222: + ShowErrorMessage(JMeuMeuMessages.AnimalsAlreadyEat); + break; + + case 20223: + ShowErrorMessage(JMeuMeuMessages.AnimalsAlreadyDrink); + break; + + case 20224: + ShowErrorMessage(JMeuMeuMessages.NotEnoughAnimals); + break; + + case 20225: + ShowErrorMessage(JMeuMeuMessages.DirtyAnimal); + break; + + case 20226: + ShowErrorMessage(JMeuMeuMessages.IllAnimal); + break; + + case 20227: + ShowErrorMessage(JMeuMeuMessages.MaxCapacityReached); + break; + + case 20333: + ShowErrorMessage(JMeuMeuMessages.NoEgg); + break; + + case 20334: + ShowErrorMessage(JMeuMeuMessages.LessWeight); + break; + + case 20335: + ShowErrorMessage(JMeuMeuMessages.TooYoung); + break; + + case 20444: + ShowErrorMessage(JMeuMeuMessages.NoMilk); + break; + + case 6576: + ShowErrorMessage(JMeuMeuMessages.NoFunctionOrProc); + break; + + case 6550: + ShowErrorMessage(JMeuMeuMessages.WrongUserName); + break; + } + } + + static public void Enabled(javax.swing.JButton btn) + { + btn.setEnabled(true); + } + + static public void Disabled(javax.swing.JButton btn) + { + btn.setEnabled(false); + } + + static public void ShowDeconnexionError() + { + ShowErrorMessage(JMeuMeuMessages.CannotDeconnect); + } + +} diff --git a/src/jmeumeu/JMeuMeuMenuCreerCompteView.form b/src/jmeumeu/JMeuMeuMenuCreerCompteView.form new file mode 100755 index 0000000..42762df --- /dev/null +++ b/src/jmeumeu/JMeuMeuMenuCreerCompteView.form @@ -0,0 +1,186 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/jmeumeu/JMeuMeuMenuCreerCompteView.java b/src/jmeumeu/JMeuMeuMenuCreerCompteView.java new file mode 100755 index 0000000..9af1642 --- /dev/null +++ b/src/jmeumeu/JMeuMeuMenuCreerCompteView.java @@ -0,0 +1,273 @@ +/* + * JMeuMeuMenuCreerCompteView.java + * + * Created on 6 mai 2008, 11:46 + */ + +package jmeumeu; + + +/** + * + * @author Jeremy + */ +public class JMeuMeuMenuCreerCompteView extends javax.swing.JFrame { + + /** Creates new form JMeuMeuMenuCreerCompteView */ + public JMeuMeuMenuCreerCompteView(JMeuMeuView View) { + initComponents(); + this.setTitle("Création d'un compte"); + + _View = View; + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jTextField1 = new javax.swing.JTextField(); + jTextField2 = new javax.swing.JTextField(); + jTextField5 = new javax.swing.JTextField(); + jPasswordField1 = new javax.swing.JPasswordField(); + jPasswordField2 = new javax.swing.JPasswordField(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setName("Form"); // NOI18N + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(JMeuMeuMenuCreerCompteView.class); + jLabel1.setFont(resourceMap.getFont("lblCreateCompte.font")); // NOI18N + jLabel1.setText(resourceMap.getString("lblCreateCompte.text")); // NOI18N + jLabel1.setName("lblCreateCompte"); // NOI18N + + jLabel2.setText(resourceMap.getString("lblID.text")); // NOI18N + jLabel2.setName("lblID"); // NOI18N + + jLabel3.setText(resourceMap.getString("lblUserName.text")); // NOI18N + jLabel3.setName("lblUserName"); // NOI18N + + jLabel4.setText(resourceMap.getString("lblPwd.text")); // NOI18N + jLabel4.setName("lblPwd"); // NOI18N + + jLabel5.setText(resourceMap.getString("lblVerifPwd.text")); // NOI18N + jLabel5.setName("lblVerifPwd"); // NOI18N + + jLabel6.setText(resourceMap.getString("lblEmail.text")); // NOI18N + jLabel6.setName("lblEmail"); // NOI18N + + jButton1.setText(resourceMap.getString("btnCreerCompte.text")); // NOI18N + jButton1.setActionCommand(resourceMap.getString("btnCreerCompte.actionCommand")); // NOI18N + jButton1.setName("btnCreerCompte"); // NOI18N + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton2.setText(resourceMap.getString("btnCancel.text")); // NOI18N + jButton2.setName("btnCancel"); // NOI18N + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jTextField1.setText(resourceMap.getString("txtIdentifiant.text")); // NOI18N + jTextField1.setName("txtIdentifiant"); // NOI18N + + jTextField2.setText(resourceMap.getString("txtUserName.text")); // NOI18N + jTextField2.setName("txtUserName"); // NOI18N + + jTextField5.setText(resourceMap.getString("txtMail.text")); // NOI18N + jTextField5.setName("txtMail"); // NOI18N + + jPasswordField1.setText(resourceMap.getString("txtPassword.text")); // NOI18N + jPasswordField1.setName("txtPassword"); // NOI18N + + jPasswordField2.setText(resourceMap.getString("txtChkPwd.text")); // NOI18N + jPasswordField2.setName("txtChkPwd"); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(74, 74, 74) + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE) + .addGap(68, 68, 68)) + .addGroup(layout.createSequentialGroup() + .addGap(39, 39, 39) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3) + .addComponent(jLabel2) + .addComponent(jLabel4)) + .addGap(87, 87, 87) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jPasswordField1, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextField2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 186, Short.MAX_VALUE)))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addComponent(jButton1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton2)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel6) + .addGap(93, 93, 93) + .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel5) + .addGap(39, 39, 39) + .addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + this.setSize(100, 100); + pack(); + }// + +private void ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonActionPerformed + + String Action = evt.getActionCommand(); + + if(Action.equals("Annuler")) + { + this.dispose(); + JMeuMeuApp.getApplication().show(_View); + } + else if(Action.equals("CC")) + { + if(CheckValues()) + { + if(_View._Oracle.Connexion()) + { + if(_View._Oracle.callProc("Creation_Compte", getID()+"', '"+getUserName()+"','"+getPassword()+"','"+getEmail())) + { + JMeuMeuHelpers.ShowInformationMessage("Compte Crée avec Succès"); + } + } + } + } +}//GEN-LAST:event_ButtonActionPerformed + + private boolean CheckValues() + { + String Pass1 = ""; + String Pass2 = ""; + + Pass1 = JMeuMeuHelpers.ToString(jPasswordField1.getPassword()); + Pass2 = JMeuMeuHelpers.ToString(jPasswordField2.getPassword()); + + if(!Pass1.equals(Pass2)) + { + JMeuMeuHelpers.ShowErrorMessage(JMeuMeuMessages.WrongPassWords); + + return false; + } + + if(!JMeuMeuHelpers.IsEmailAddress(this.jTextField5.getText())) + { + JMeuMeuHelpers.ShowErrorMessage(JMeuMeuMessages.WrongEmailFormat); + + return false; + } + + return true; + } + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new JMeuMeuMenuCreerCompteView(null).setVisible(true); + } + }); + } + + public String getID() + { + return this.jTextField1.getText(); + } + + public String getUserName() + { + return this.jTextField2.getText(); + } + + public String getEmail() + { + return this.jTextField5.getText(); + } + + public String getPassword() + { + return JMeuMeuHelpers.ToString(this.jPasswordField1.getPassword()); + } + + private JMeuMeuView _View; + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JPasswordField jPasswordField1; + private javax.swing.JPasswordField jPasswordField2; + private javax.swing.JTextField jTextField1; + private javax.swing.JTextField jTextField2; + private javax.swing.JTextField jTextField5; + // End of variables declaration//GEN-END:variables + +} diff --git a/src/jmeumeu/JMeuMeuMessages.java b/src/jmeumeu/JMeuMeuMessages.java new file mode 100755 index 0000000..e907ca3 --- /dev/null +++ b/src/jmeumeu/JMeuMeuMessages.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package jmeumeu; + +import javax.swing.JOptionPane; + +/** + * + * @author Jeremy + */ +public class JMeuMeuMessages { + + public static String MessageBoxError = "Erreur JMeuMeu"; + public static String MessageBoxInformation = "Information JMeuMeu"; + public static String Message = "Message JMeuMeu"; + + public static String WrongPassWords = "Erreur !! Les mots de passe ne correspondent pas. Veuillez les resaisir."; + public static String WrongUserName = "Erreur !! Le nom d'utilisateur n'a pas été trouvé."; + public static String WrongPassword = "Erreur !! Le mot de passe est incorrect."; + public static String WrongEmailFormat = "Erreur !! La valeur entrée dans le champ Email ne correspond pas à un email."; + public static int ERROR = JOptionPane.ERROR_MESSAGE; + public static int QUESTION = JOptionPane.QUESTION_MESSAGE; + public static int INFORMATION = JOptionPane.INFORMATION_MESSAGE; + public static int YES_NO = JOptionPane.YES_NO_OPTION; + + public static String UserNameAlreadyExist = "Login deja utilisee"; + public static String InexistCompte = "Compte inexistant"; + public static String ImpossibleToConnect = "Connexion Impossible"; + public static String NotEnoughMoney = "Pas assez d'argent"; + public static String NoCollectable = "Article non collectionnable"; + public static String SendTooArticles = "Trop d'articles vendus"; + public static String NoRights = "Vous n'avez pas les droits necessaires"; + public static String OverflowLimit = "Depassement de la limite de ventes/achats par jour"; + public static String ClosedCooperative = "Cooperative fermé"; + public static String AnimalsAlreadyEat = "Animaux deja nourris"; + public static String AnimalsAlreadyDrink = "Animaux deja abreuve"; + public static String NotEnoughAnimals = "Pas assez d'animaux"; + public static String DirtyAnimal = "Animal sale"; + public static String IllAnimal = "Animal malade"; + public static String MaxCapacityReached = "Capacite maximal atteinte"; + public static String NoEgg = "Aucun oeuf"; + public static String LessWeight = "Trop maigre"; + public static String TooYoung = "Trop jeune"; + public static String NoMilk = "Pas de lait"; + + public static String NoFunctionOrProc = "ceci n'est pas un nom de fonction ou de procédure valide"; + + + public static String CannotDeconnect = "Erreur !! Ne peut se déconnecter"; +} diff --git a/src/jmeumeu/JMeuMeuOracleAccess.java b/src/jmeumeu/JMeuMeuOracleAccess.java new file mode 100755 index 0000000..9cc87dd --- /dev/null +++ b/src/jmeumeu/JMeuMeuOracleAccess.java @@ -0,0 +1,210 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package jmeumeu; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.ResultSet; + +/** + * + * @author Jeremy + */ +public class JMeuMeuOracleAccess { + + private Connection _Connection = null; + private Statement _Statement = null; + + //private String _url = "jdbc:oracle:thin:@panoramix:1521:depinfo"; + private String _url = "jdbc:oracle:thin:@localhost:1521:XE"; + private String _Student = "etud185"; + private String _PwdStudent = "9KKFGC38"; + private JMeuMeuDatas _Datas; + + public JMeuMeuOracleAccess() + { + _Datas = new JMeuMeuDatas(); + } + + public boolean Connexion() + { + // Enregistrement du driver + try + { + Class.forName ("oracle.jdbc.driver.OracleDriver"); + } + catch(ClassNotFoundException e) + { + JMeuMeuHelpers.ShowErrorMessage("ClassNotFoundException.\n" + e.getMessage()); + return false; + } + + // Connexion + try + { + // Open Connection + _Connection = DriverManager.getConnection(_url, _Student, _PwdStudent); + + // Open Statement + _Statement = _Connection.createStatement(); + } + catch (SQLException ex) + { + JMeuMeuHelpers.ShowErrorMessage(" SQLException caught : "+ ex.getMessage()); + return false; + } + + return true; + } + + public boolean Deconnexion() + { + try + { + // Close the statement + _Statement.close(); + + // Close Connection + _Connection.close(); + } + catch (SQLException ex) + { + JMeuMeuHelpers.ShowErrorMessage(" SQLException caught : "+ ex.getMessage()); + return false; + } + + return true; + } + + public void QueryUpdate(String Requete) + { + try + { + // Submit a query + _Statement.executeUpdate(Requete); + } + catch (SQLException ex) + { + JMeuMeuHelpers.ShowErrorMessage(" Query Exception : "+ ex.getMessage()); + } + } + + public ResultSet Query(String Requete) + { + ResultSet rs = null; + + try + { + // Submit a query + rs = _Statement.executeQuery(Requete); + } + catch (SQLException ex) + { + JMeuMeuHelpers.ShowErrorMessage("Query Exception : "+ ex.getMessage()); + return null; + } + + return rs; + } + + private ResultSet SelectAllFromFarme(String NAME_FARMER) + { + return Query("SELECT * FROM FERME WHERE NOM='" + NAME_FARMER + "'"); + } + + public void SetFarmDatas(String NAME_FARMER) + { + ResultSet RS = SelectAllFromFarme(NAME_FARMER); + + try + { + while(RS.next()) + { + _Datas.id_fermier = RS.getString(1); + _Datas.nom = RS.getString(2); + _Datas.mdp = RS.getString(3); + _Datas.mail = RS.getString(4); + _Datas.date_enregistrement = RS.getDate(5); + _Datas.date_connection = RS.getDate(6); + _Datas.ecus = RS.getInt(7); + _Datas.score = RS.getInt(8); + _Datas.classement = RS.getInt(9); + _Datas.hibernation = RS.getString(10); + _Datas.nb_achats_jour = RS.getInt(11); + _Datas.nb_male = RS.getInt(12); + _Datas.nb_femelle = RS.getInt(13); + _Datas.nb_gros = RS.getInt(14); + _Datas.nb_moyen = RS.getInt(15); + _Datas.nb_petit = RS.getInt(16); + _Datas.abreuvage_l = RS.getString(17); + _Datas.nb_abreuvage_l = RS.getInt(18); + _Datas.nourri_l = RS.getString(19); + _Datas.nb_jeune_l = RS.getInt(20); + _Datas.sale_l = RS.getString(21); + _Datas.nb_malade_l = RS.getInt(22); + _Datas.abreuvage_j = RS.getString(23); + _Datas.nb_abreuvage_j = RS.getInt(24); + _Datas.nourri_j = RS.getString(25); + _Datas.nb_jeune_j = RS.getInt(26); + _Datas.sale_j = RS.getString(27); + _Datas.nb_malade_j = RS.getInt(28); + _Datas.abreuvage_vache = RS.getString(29); + _Datas.nb_abreuvage_vache = RS.getInt(30); + _Datas.nourri_vache = RS.getString(31); + _Datas.nb_jeune_vache = RS.getInt(32); + _Datas.sale_vache = RS.getString(33); + _Datas.nb_malade_vache = RS.getInt(34); + _Datas.poids_vache = RS.getInt(35); + _Datas.age_vache = RS.getInt(36); + _Datas.nb_lait = RS.getInt(37); + } + } + catch(SQLException ex) + { + //JMeuMeuHelpers.ShowError(ex.getMessage()); + System.err.println(ex.getMessage()); + } + } + + public JMeuMeuDatas GetDatas() + { + return this._Datas; + } + + public boolean callProc(String proc, String args) + { + try + { + this._Statement.execute("call "+proc+"('" + args + "')"); + } + catch(SQLException ex) + { + JMeuMeuHelpers.ShowError(ex.getMessage()); + return false; + } + + return true; + } + + public ResultSet GetResultProc(String proc, String args) + { + try + { + // Submit a query + return _Statement.executeQuery("call "+proc+"("+args+")"); + } + catch (SQLException ex) + { + JMeuMeuHelpers.ShowErrorMessage("Query Exception : "+ ex.getMessage()); + return null; + } + } + + +} diff --git a/src/jmeumeu/JMeuMeuView.form b/src/jmeumeu/JMeuMeuView.form new file mode 100755 index 0000000..013818c --- /dev/null +++ b/src/jmeumeu/JMeuMeuView.form @@ -0,0 +1,230 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/jmeumeu/JMeuMeuView.java b/src/jmeumeu/JMeuMeuView.java new file mode 100755 index 0000000..b14d4a8 --- /dev/null +++ b/src/jmeumeu/JMeuMeuView.java @@ -0,0 +1,330 @@ +/* + * JMeuMeuView.java + */ + +package jmeumeu; + +import org.jdesktop.application.Action; +import org.jdesktop.application.SingleFrameApplication; +import org.jdesktop.application.FrameView; +import javax.swing.JDialog; +import javax.swing.JFrame; +import java.sql.ResultSet; +import java.sql.SQLException; + +/** + * The application's main frame. + */ +public class JMeuMeuView extends FrameView { + + public JMeuMeuView(SingleFrameApplication app) { + super(app); + this.getFrame().setTitle("Bienvenue"); + initComponents(); + imagePanel1.SetBackground(this.getFrame(), "./images/accueil.jpg"); + _Oracle = new JMeuMeuOracleAccess(); + } + + @Action + public void showAboutBox() { + if (aboutBox == null) { + JFrame mainFrame = JMeuMeuApp.getApplication().getMainFrame(); + aboutBox = new JMeuMeuAboutBox(mainFrame); + aboutBox.setLocationRelativeTo(mainFrame); + } + + JMeuMeuApp.getApplication().show(aboutBox); + } + + @Action + public void showCreateBox(JMeuMeuView View) + { + JFrame mainFrame = jmeumeu.JMeuMeuApp.getApplication().getMainFrame(); + + if(_CreateUser == null) + { + _CreateUser = new jmeumeu.JMeuMeuMenuCreerCompteView(View); + } + + JMeuMeuApp.getApplication().show(_CreateUser); + _CreateUser.setSize(430, 290); + _CreateUser.setLocationRelativeTo(mainFrame); + } + + @Action + public void showGameField(JMeuMeuView View) + { + if(_GameField == null) + { + JFrame mainFrame = JMeuMeuApp.getApplication().getMainFrame(); + _GameField = new jmeumeu.JMeuMeuGameField(View); + _GameField.setLocationRelativeTo(mainFrame); + } + + JMeuMeuApp.getApplication().show(_GameField); + } + + @Action + public void showSuppressUser(JMeuMeuView View) + { + if(_SuppressUser == null) + { + JFrame mainFrame = JMeuMeuApp.getApplication().getMainFrame(); + _SuppressUser = new jmeumeu.JMeuMeuDeleteUser(View); + _SuppressUser.setSize(100, 100); + _SuppressUser.setLocationRelativeTo(mainFrame); + } + + JMeuMeuApp.getApplication().show(_SuppressUser); + } + + @Action + public void hide() + { + JMeuMeuApp.getApplication().hide(this); + } + + public void show() + { + JMeuMeuApp.getApplication().show(this); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + mainPanel = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jPasswordField1 = new javax.swing.JPasswordField(); + imagePanel1 = new Components.ImagePanel(); + jButton4 = new javax.swing.JButton(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + jButton3 = new javax.swing.JButton(); + jButton5 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + + mainPanel.setMaximumSize(new java.awt.Dimension(424, 410)); + mainPanel.setMinimumSize(new java.awt.Dimension(424, 410)); + mainPanel.setName("mainPanel"); // NOI18N + mainPanel.setPreferredSize(new java.awt.Dimension(424, 410)); + + org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jmeumeu.JMeuMeuApp.class).getContext().getResourceMap(JMeuMeuView.class); + jLabel1.setFont(resourceMap.getFont("lblJMeuMeu.font")); // NOI18N + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText(resourceMap.getString("lblJMeuMeu.text")); // NOI18N + jLabel1.setName("lblJMeuMeu"); // NOI18N + + jTextField1.setText(resourceMap.getString("txtUserName.text")); // NOI18N + jTextField1.setName("txtUserName"); // NOI18N + jTextField1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField1ActionPerformed(evt); + } + }); + + jPasswordField1.setText(resourceMap.getString("txtPwd.text")); // NOI18N + jPasswordField1.setName("txtPwd"); // NOI18N + + imagePanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + imagePanel1.setMaximumSize(new java.awt.Dimension(407, 264)); + imagePanel1.setName("imagePanel1"); // NOI18N + imagePanel1.setPreferredSize(new java.awt.Dimension(407, 264)); + imagePanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N + jButton4.setActionCommand(resourceMap.getString("jButton4.actionCommand")); // NOI18N + jButton4.setName("jButton4"); // NOI18N + jButton4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jLabel2.setFont(resourceMap.getFont("lblUserName.font")); // NOI18N + jLabel2.setForeground(resourceMap.getColor("lblUserName.foreground")); // NOI18N + jLabel2.setText(resourceMap.getString("lblUserName.text")); // NOI18N + jLabel2.setName("lblUserName"); // NOI18N + + jLabel3.setFont(resourceMap.getFont("lblPwd.font")); // NOI18N + jLabel3.setForeground(resourceMap.getColor("lblPwd.foreground")); // NOI18N + jLabel3.setText(resourceMap.getString("lblPwd.text")); // NOI18N + jLabel3.setName("lblPwd"); // NOI18N + + jButton1.setText(resourceMap.getString("btnOK.text")); // NOI18N + jButton1.setName("btnOK"); // NOI18N + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton3.setText(resourceMap.getString("btnCreate.text")); // NOI18N + jButton3.setActionCommand(resourceMap.getString("btnCreate.actionCommand")); // NOI18N + jButton3.setName("btnCreate"); // NOI18N + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton5.setText(resourceMap.getString("jButton5.text")); // NOI18N + jButton5.setActionCommand(resourceMap.getString("jButton5.actionCommand")); // NOI18N + jButton5.setName("jButton5"); // NOI18N + jButton5.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + jButton2.setText(resourceMap.getString("btnAnnuler.text")); // NOI18N + jButton2.setName("btnAnnuler"); // NOI18N + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ButtonActionPerformed(evt); + } + }); + + javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel); + mainPanel.setLayout(mainPanelLayout); + mainPanelLayout.setHorizontalGroup( + mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(mainPanelLayout.createSequentialGroup() + .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(mainPanelLayout.createSequentialGroup() + .addGap(48, 48, 48) + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) + .addComponent(jButton4)) + .addGroup(mainPanelLayout.createSequentialGroup() + .addContainerGap() + .addComponent(imagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(mainPanelLayout.createSequentialGroup() + .addContainerGap() + .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(mainPanelLayout.createSequentialGroup() + .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(jLabel3)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jPasswordField1) + .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE))) + .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE) + .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE) + .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addContainerGap()) + ); + mainPanelLayout.setVerticalGroup( + mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(mainPanelLayout.createSequentialGroup() + .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(mainPanelLayout.createSequentialGroup() + .addContainerGap() + .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(jButton4))) + .addGroup(mainPanelLayout.createSequentialGroup() + .addGap(46, 46, 46) + .addComponent(imagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButton3)))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(jButton5) + .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton2) + .addComponent(jButton1)) + .addContainerGap(17, Short.MAX_VALUE)) + ); + + jButton4.getAccessibleContext().setAccessibleName(resourceMap.getString("jButton4.AccessibleContext.accessibleName")); // NOI18N + + setComponent(mainPanel); + }// //GEN-END:initComponents + +private void ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButtonActionPerformed + + String action = evt.getActionCommand(); + + if(action.equals("Quitter")) + { + if(JMeuMeuHelpers.ShowQuestionMessage("Voulez-vous quitter le jeu ?") == 0) + System.exit(0); + } + else if(action.equals("CreerCompte")) + { + showCreateBox(this); + hide(); + + } + else if(action.equals("Connexion")) + { + if(_Oracle.Connexion()) + { + String x = this.jTextField1.getText(); + String y = JMeuMeuHelpers.ToString(this.jPasswordField1.getPassword()); + + + if(_Oracle.callProc("Connection", x+"','"+y)) + { + _Oracle.SetFarmDatas(x); + this._Datas = this._Oracle.GetDatas(); + this.hide(); + this.showGameField(this); + } + } + } + else if(action.equals("About")) + { + this.showAboutBox(); + } + else if(action.equals("SuppCompte")) + { + showSuppressUser(this); + hide(); + } +}//GEN-LAST:event_ButtonActionPerformed + +private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed +// TODO add your handling code here: +}//GEN-LAST:event_jTextField1ActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private Components.ImagePanel imagePanel1; + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JButton jButton4; + private javax.swing.JButton jButton5; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JPasswordField jPasswordField1; + private javax.swing.JTextField jTextField1; + private javax.swing.JPanel mainPanel; + // End of variables declaration//GEN-END:variables + + private JDialog aboutBox; + private JFrame _CreateUser; + private JFrame _SuppressUser; + private JFrame _GameField; + public JMeuMeuDatas _Datas; + public JMeuMeuOracleAccess _Oracle; +} diff --git a/src/jmeumeu/resources/JMeuMeuAboutBox.properties b/src/jmeumeu/resources/JMeuMeuAboutBox.properties new file mode 100755 index 0000000..f5741c0 --- /dev/null +++ b/src/jmeumeu/resources/JMeuMeuAboutBox.properties @@ -0,0 +1,19 @@ +title = About: ${Application.title} ${Application.version} + +closeAboutBox.Action.text = &Close + +appDescLabel.text=A derivated game from myefarm.com + +versionLabel.text=Product Version\: + +#NOI18N +imageLabel.icon=about.png +jLabel1.text=Programmer : +#NOI18N +jLabel1.font=Tahoma-Bold-11 +jLabel2.text=Jeremy JANISZEWSKI +jLabel3.text=This project was a team project. +jLabel4.text=But without any reason, I was the only person to work on this project. +jLabel5.text=The others have provided 'I don't know JAVA' like reason. +jLabel6.text=Sadly, I cannot finished this project. It was interesting. +jLabel7.text=Adrien MALINGREY diff --git a/src/jmeumeu/resources/JMeuMeuApp.properties b/src/jmeumeu/resources/JMeuMeuApp.properties new file mode 100755 index 0000000..8c8c917 --- /dev/null +++ b/src/jmeumeu/resources/JMeuMeuApp.properties @@ -0,0 +1,11 @@ +# Application global resources + +Application.name = JMeuMeu +Application.title = JMEUMEU Staff +Application.version = 1.0 +Application.vendor = Sun Microsystems Inc. +Application.homepage = http\://appframework.dev.java.net/ +Application.description = A simple Java desktop application based on Swing Application Framework. +Application.vendorId = Sun +Application.id = ${Application.name} +Application.lookAndFeel = system diff --git a/src/jmeumeu/resources/JMeuMeuDeleteUser.properties b/src/jmeumeu/resources/JMeuMeuDeleteUser.properties new file mode 100755 index 0000000..95f394f --- /dev/null +++ b/src/jmeumeu/resources/JMeuMeuDeleteUser.properties @@ -0,0 +1,15 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. + +jButton2.text=Annuler +jButton1.text=Supprimer Compte +jTextField2.text=Identifiant +jLabel3.text=Identifiant +jLabel1.text=Suppression d'un Compte +#NOI18N +jLabel1.font=Tahoma 24-Bold-24 +#NOI18N +jLabel3.font=Tahoma-Bold-11 +#NOI18N +jLabel4.font=Tahoma-Bold-11 +jButton1.actionCommand=SupprimerCompte diff --git a/src/jmeumeu/resources/JMeuMeuGameField.properties b/src/jmeumeu/resources/JMeuMeuGameField.properties new file mode 100755 index 0000000..1aae574 --- /dev/null +++ b/src/jmeumeu/resources/JMeuMeuGameField.properties @@ -0,0 +1,41 @@ +jButton1.text=D\u00E9connexion +jButton1.actionCommand=Deconnexion +jButton2.text=Poulailler +jButton3.text=Clapier +jButton2.actionCommand=Poulailler +jButton4.text=Paturage +jButton5.text=Remise +jButton2.toolTipText=Affiche le formulaire concernant le poulailler +jButton3.toolTipText=Affiche le formulaire concernant le Clapier +jButton4.toolTipText=Affiche le formulaire concernant le Paturage +jButton5.toolTipText=Affiche le formulaire concernant la Remise +jButton1.toolTipText=Retourne au Menu de Connexion +jLabel1.text=Actions Autoris\u00E9es +#NOI18N +jLabel1.font=Tahoma-Bold-14 +jLabel2.text=Statistiques +#NOI18N +jLabel2.font=Tahoma-Bold-14 +jLabel3.AccessibleContext.accessibleName=Ecus +lblEcus.text=Ecus : +jLabel4.text=0 +#NOI18N +lblEcus.font=Tahoma-Bold-11 +jLabel4.AccessibleContext.accessibleName=lblNumEcus +lblPoints.text=Points : +#NOI18N +lblPoints.font=Tahoma-Bold-11 +lblNumPoints.text=0 +lblNumRank.text=0 +lblRank.text=Classement : +#NOI18N +lblRank.font=Tahoma-Bold-11 +jLabel9.text=eme +jButton6.text=Coop\u00E9rative +jButton6.actionCommand=Cooperative +jButton6.label=Cooperative +jButton7.text=March\u00E9 +jButton7.actionCommand=Marche +jButton8.actionCommand=Hibernation +jButton8.toolTipText=Passe en mode Hibernation +jButton8.text=Hiberner diff --git a/src/jmeumeu/resources/JMeuMeuMenuCreerCompteView.properties b/src/jmeumeu/resources/JMeuMeuMenuCreerCompteView.properties new file mode 100755 index 0000000..6bf54cd --- /dev/null +++ b/src/jmeumeu/resources/JMeuMeuMenuCreerCompteView.properties @@ -0,0 +1,17 @@ + +lblCreateCompte.text=Cr\u00E9ation d'un Compte +#NOI18N +lblCreateCompte.font=Tahoma-Bold-24 +lblID.text=Identifiant +lblUserName.text=Nom Utilisateur +lblPwd.text=Mot de Passe : +lblVerifPwd.text=Verification Mot de Passe +lblEmail.text=Adresse Email +btnCreerCompte.actionCommand=CC +btnCreerCompte.text=Creer Compte +btnCancel.text=Annuler +txtIdentifiant.text=Identifiant +txtUserName.text=NomUtilisateur +txtPassword.text=password +txtChkPwd.text=Password +txtMail.text=@mail diff --git a/src/jmeumeu/resources/JMeuMeuView.properties b/src/jmeumeu/resources/JMeuMeuView.properties new file mode 100755 index 0000000..bf87982 --- /dev/null +++ b/src/jmeumeu/resources/JMeuMeuView.properties @@ -0,0 +1,52 @@ + +# @Action resources + +showAboutBox.Action.text = &About... +showAboutBox.Action.shortDescription = Show the application's information dialog + +# status bar resources + +StatusBar.messageTimeout = 5000 +StatusBar.busyAnimationRate = 30 +StatusBar.idleIcon = busyicons/idle-icon.png +StatusBar.busyIcons[0] = busyicons/busy-icon0.png +StatusBar.busyIcons[1] = busyicons/busy-icon1.png +StatusBar.busyIcons[2] = busyicons/busy-icon2.png +StatusBar.busyIcons[3] = busyicons/busy-icon3.png +StatusBar.busyIcons[4] = busyicons/busy-icon4.png +StatusBar.busyIcons[5] = busyicons/busy-icon5.png +StatusBar.busyIcons[6] = busyicons/busy-icon6.png +StatusBar.busyIcons[7] = busyicons/busy-icon7.png +StatusBar.busyIcons[8] = busyicons/busy-icon8.png +StatusBar.busyIcons[9] = busyicons/busy-icon9.png +StatusBar.busyIcons[10] = busyicons/busy-icon10.png +StatusBar.busyIcons[11] = busyicons/busy-icon11.png +StatusBar.busyIcons[12] = busyicons/busy-icon12.png +StatusBar.busyIcons[13] = busyicons/busy-icon13.png +StatusBar.busyIcons[14] = busyicons/busy-icon14.png +lblJMeuMeu.text=Bienvenue sur JMeuMeu +#NOI18N +lblJMeuMeu.font=Tahoma-Bold-24 +lblUserName.text=Nom Utilisateur +lblPwd.text=Mot De Passe +txtUserName.text= +txtPwd.text= +btnOK.text=Connexion +btnAnnuler.text=Quitter +btnCreate.text=Creer Compte +btnCreate.label=CreerCompte +btnCreate.actionCommand=CreerCompte +#NOI18N +lblUserName.font=Tahoma-Bold-11 +#NOI18N +lblPwd.foreground=51, 0, 255 +#NOI18N +lblUserName.foreground=51, 0, 255 +#NOI18N +lblPwd.font=Tahoma-Bold-11 +jButton4.text=? +jButton4.actionCommand=About +jButton4.AccessibleContext.accessibleName=About +jButton5.label=CreerCompte +jButton5.actionCommand=SuppCompte +jButton5.text=Supprimer Compte diff --git a/src/jmeumeu/resources/about.png b/src/jmeumeu/resources/about.png new file mode 100755 index 0000000..e179f30 Binary files /dev/null and b/src/jmeumeu/resources/about.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon0.png b/src/jmeumeu/resources/busyicons/busy-icon0.png new file mode 100755 index 0000000..242c0c8 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon0.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon1.png b/src/jmeumeu/resources/busyicons/busy-icon1.png new file mode 100755 index 0000000..9f6f634 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon1.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon10.png b/src/jmeumeu/resources/busyicons/busy-icon10.png new file mode 100755 index 0000000..c4ef4a1 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon10.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon11.png b/src/jmeumeu/resources/busyicons/busy-icon11.png new file mode 100755 index 0000000..6eca1f5 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon11.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon12.png b/src/jmeumeu/resources/busyicons/busy-icon12.png new file mode 100755 index 0000000..e447ee8 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon12.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon13.png b/src/jmeumeu/resources/busyicons/busy-icon13.png new file mode 100755 index 0000000..848a6f1 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon13.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon14.png b/src/jmeumeu/resources/busyicons/busy-icon14.png new file mode 100755 index 0000000..7b3561d Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon14.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon2.png b/src/jmeumeu/resources/busyicons/busy-icon2.png new file mode 100755 index 0000000..c866e62 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon2.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon3.png b/src/jmeumeu/resources/busyicons/busy-icon3.png new file mode 100755 index 0000000..9be22fa Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon3.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon4.png b/src/jmeumeu/resources/busyicons/busy-icon4.png new file mode 100755 index 0000000..f07c20d Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon4.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon5.png b/src/jmeumeu/resources/busyicons/busy-icon5.png new file mode 100755 index 0000000..653fc9c Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon5.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon6.png b/src/jmeumeu/resources/busyicons/busy-icon6.png new file mode 100755 index 0000000..7035572 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon6.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon7.png b/src/jmeumeu/resources/busyicons/busy-icon7.png new file mode 100755 index 0000000..49fbc6e Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon7.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon8.png b/src/jmeumeu/resources/busyicons/busy-icon8.png new file mode 100755 index 0000000..e1a5a40 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon8.png differ diff --git a/src/jmeumeu/resources/busyicons/busy-icon9.png b/src/jmeumeu/resources/busyicons/busy-icon9.png new file mode 100755 index 0000000..8278012 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/busy-icon9.png differ diff --git a/src/jmeumeu/resources/busyicons/idle-icon.png b/src/jmeumeu/resources/busyicons/idle-icon.png new file mode 100755 index 0000000..50312f8 Binary files /dev/null and b/src/jmeumeu/resources/busyicons/idle-icon.png differ diff --git a/src/jmeumeu/resources/splash.png b/src/jmeumeu/resources/splash.png new file mode 100755 index 0000000..a1fbdc1 Binary files /dev/null and b/src/jmeumeu/resources/splash.png differ