diff --git a/bin/controleur/CtrlAccesListe.class b/bin/controleur/CtrlAccesListe.class new file mode 100644 index 0000000..9fb0dc9 Binary files /dev/null and b/bin/controleur/CtrlAccesListe.class differ diff --git a/bin/controleur/CtrlLogin.class b/bin/controleur/CtrlLogin.class new file mode 100644 index 0000000..0ff2cbf Binary files /dev/null and b/bin/controleur/CtrlLogin.class differ diff --git a/bin/vue/AfficherListeMembre.class b/bin/vue/AfficherListeMembre.class new file mode 100644 index 0000000..068db30 Binary files /dev/null and b/bin/vue/AfficherListeMembre.class differ diff --git a/bin/vue/Planning$1.class b/bin/vue/Planning$1.class index 03d1efb..c7c5166 100644 Binary files a/bin/vue/Planning$1.class and b/bin/vue/Planning$1.class differ diff --git a/bin/vue/Planning$2.class b/bin/vue/Planning$2.class index 48eb8b9..056679e 100644 Binary files a/bin/vue/Planning$2.class and b/bin/vue/Planning$2.class differ diff --git a/bin/vue/Planning$3.class b/bin/vue/Planning$3.class index 3015127..97b406c 100644 Binary files a/bin/vue/Planning$3.class and b/bin/vue/Planning$3.class differ diff --git a/bin/vue/Planning.class b/bin/vue/Planning.class index fb64412..3d1991a 100644 Binary files a/bin/vue/Planning.class and b/bin/vue/Planning.class differ diff --git a/src/controleur/CtrlAccesListe.java b/src/controleur/CtrlAccesListe.java new file mode 100644 index 0000000..8ea9df7 --- /dev/null +++ b/src/controleur/CtrlAccesListe.java @@ -0,0 +1,63 @@ +package controleur; +import java.awt.Container; +import java.awt.FlowLayout; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.swing.JFrame; + +import vue.Planning; + +import modele.Evenements; + + +public class CtrlAccesListe { + + public static void main(String[] args) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{ + Evenements e; + ResultSet r; + + JFrame f_planning ; + Planning p ; + + f_planning = new JFrame("Planning") ; + p = new Planning() ; + + Container c = f_planning.getContentPane(); + c.setLayout(new FlowLayout()); + + + + + + // cr�e le planning � la date actuelle + c.add(p); + /* + // c.add(new Planning(2012, 4, 20)) ; + p.color_date(11) ; + p.color_date(20) ;*/ + + f_planning.pack(); + // f_planning.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + f_planning.setVisible(true); + f_planning.setResizable(false) ; + + + e = new Evenements(); + + e.setEvenement("2012-11-20", 1, "toulouse"); + r = e.getEvenement(-1); + + while(r.next()) + { + String str[]=r.getString("dateE").split("-"); + + p.color_date(Integer.decode( str[2])); + + } + + + + } + +} diff --git a/src/controleur/CtrlLogin.java b/src/controleur/CtrlLogin.java new file mode 100644 index 0000000..d65d095 --- /dev/null +++ b/src/controleur/CtrlLogin.java @@ -0,0 +1,11 @@ +package controleur; + +public class CtrlLogin { + //attributs + + //Constructeurs + + //méthodes + + +} diff --git a/src/vue/AfficherListeMembre.java b/src/vue/AfficherListeMembre.java new file mode 100644 index 0000000..44d31ba --- /dev/null +++ b/src/vue/AfficherListeMembre.java @@ -0,0 +1,82 @@ +package vue; + + +import java.awt.BorderLayout; +import java.awt.GridLayout; +import java.awt.LayoutManager; +import java.util.Vector; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextField; + + +public class AfficherListeMembre extends JFrame +{ + + // Attributs pour les compsants de la fen�tre + + int x, y, h, l ; + private JLabel l_title ; + private JList liste ; + private JScrollPane jsp ; + private JPanel pan_0, pan_1, pan_2 ; + private JButton b_retour ; + + + public AfficherListeMembre (String title) + { + super(title); + + // D�finir la fen�tre elle-m�me + + this.setBounds (x, y, l, h); + this.setResizable(false); + this.setTitle(title) ; + this.setDefaultCloseOperation(EXIT_ON_CLOSE) ; + + // Cr�ation du Vector et la liste + + + Vector maListe = new Vector () ; + int nbC = 22 ; + + for (int i = 1 ; i < nbC ; i++) + maListe.add("Client " + i) ; + + liste = new JList(maListe) ; + + JScrollPane jsp = new JScrollPane(liste) ; + + + // Cr�er des composants et les ins�rer dans la fen�tre + + + this.l_title = new JLabel(" Liste des membres

") ; + this.b_retour = new JButton("Retour") ; + + this.pan_0 = new JPanel() ; + this.pan_1 = new JPanel() ; + this.pan_2 = new JPanel() ; + + + // Mise en place des composants + + pan_0.add(l_title) ; + + this.add(pan_0, BorderLayout.NORTH) ; + + pan_1.add(jsp); + + this.add(pan_1) ; + + pan_2.add(b_retour) ; + this.add(pan_2, BorderLayout.SOUTH) ; + } + + +} diff --git a/src/vue/Planning.java b/src/vue/Planning.java index 94e9a61..03462e1 100644 --- a/src/vue/Planning.java +++ b/src/vue/Planning.java @@ -48,7 +48,7 @@ public class Planning extends JPanel { super(); setYYMMDD(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)); - buildGUI(); + System.out.println(buildGUI()); recompute(); print_button() ; } @@ -62,7 +62,7 @@ public class Planning extends JPanel { public Planning(int year, int month, int today) { super(); setYYMMDD(year, month, today); - buildGUI(); + System.out.println(buildGUI()); recompute(); print_button() ; } @@ -73,13 +73,13 @@ public class Planning extends JPanel { dd = today; } - String[] months = { "Janvier", "Fevrier", "Mars", "Avril", "Mai", "Juin", - "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Decembre" }; + String[] months = { "Janvier", "F�vrier", "Mars", "Avril", "Mai", "Juin", + "Juillet", "Ao�t", "Septembre", "Octobre", "Novembre", "D�cembre" }; - /** Build the GUI. Assumes that setYYMMDD has been called. */ - private void buildGUI() { + + private String buildGUI() { getAccessibleContext().setAccessibleDescription( - "Calendrier non disponible, desole"); + "Calendrier non disponible, d�sol�"); setBorder(BorderFactory.createEtchedBorder()); setLayout(new BorderLayout()); @@ -97,6 +97,7 @@ public class Planning extends JPanel { int i = monthChoice.getSelectedIndex(); if (i >= 0) { mm = i; + System.out.println("Mois=" + mm); recompute(); } } @@ -120,6 +121,7 @@ public class Planning extends JPanel { if (i >= 0) { yy = Integer.parseInt(yearChoice.getSelectedItem() .toString()); + System.out.println("Annee=" + yy); recompute(); } } @@ -145,7 +147,7 @@ public class Planning extends JPanel { if (!num.equals("")) { // met le jour actuel d'une couleur setDayActive(Integer.parseInt(num)); - } + } } }; @@ -158,6 +160,8 @@ public class Planning extends JPanel { } add(BorderLayout.CENTER, bp); + + return (Integer.toString(yy) + Integer.toString(mm)) ; } public final static int dom[] = { 31, 28, 31, 30, /* jan fev mar avr */ @@ -192,8 +196,8 @@ public class Planning extends JPanel { for (int i = leadGap + 1 + daysInMonth; i < 6 * 7; i++) { labs[(i) / 7][(i) % 7].setText(""); } - - // Shade current day, only if current month + + if (thisYear == yy && mm == thisMonth) setDayActive(dd); @@ -217,7 +221,7 @@ public class Planning extends JPanel { /** Set l'ann�e, le mois et le jour */ public void setDate(int yy, int mm, int dd) { this.yy = yy; - this.mm = mm; // starts at 0, like Date + this.mm = mm; // commence a 0 this.dd = dd; recompute(); } @@ -236,7 +240,7 @@ public class Planning extends JPanel { private int activeDay = -1; - /** Set just the day, on the current month */ + public void setDayActive(int newDay) { clearDayActive(); @@ -267,7 +271,7 @@ public class Planning extends JPanel { // rajouter bouton inscrire / d�sinscrire, si jour dispo ou non this.b_inscrire = new JButton("S'inscrire") ; - this.b_desinscrire = new JButton("Se desinscrire") ; + this.b_desinscrire = new JButton("Se d�sinscrire") ; b_inscrire.setEnabled(true) ; b_desinscrire.setEnabled(false) ; @@ -290,7 +294,6 @@ public class Planning extends JPanel { public void color_date(int day) { setTaskDay(day) ; } + - - }