new file: bin/controleur/CtrlAccesListe.class

new file:   bin/controleur/CtrlLogin.class
	new file:   bin/vue/AfficherListeMembre.class
	modified:   bin/vue/Planning$1.class
	modified:   bin/vue/Planning$2.class
	modified:   bin/vue/Planning$3.class
	modified:   bin/vue/Planning.class
	new file:   src/controleur/CtrlAccesListe.java
	new file:   src/controleur/CtrlLogin.java
	new file:   src/vue/AfficherListeMembre.java
	modified:   src/vue/Planning.java
This commit is contained in:
Quentin
2013-12-08 10:13:32 +01:00
parent 3fdf7aae3a
commit 2906c578bf
11 changed files with 174 additions and 15 deletions

View File

@ -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<63>e le planning <20> 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]));
}
}
}

View File

@ -0,0 +1,11 @@
package controleur;
public class CtrlLogin {
//attributs
//Constructeurs
//méthodes
}

View File

@ -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<65>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<65>tre elle-m<>me
this.setBounds (x, y, l, h);
this.setResizable(false);
this.setTitle(title) ;
this.setDefaultCloseOperation(EXIT_ON_CLOSE) ;
// Cr<43>ation du Vector et la liste
Vector <String> maListe = new Vector <String>() ;
int nbC = 22 ;
for (int i = 1 ; i < nbC ; i++)
maListe.add("Client " + i) ;
liste = new JList<String>(maListe) ;
JScrollPane jsp = new JScrollPane(liste) ;
// Cr<43>er des composants et les ins<6E>rer dans la fen<65>tre
this.l_title = new JLabel("<html> Liste des membres <br> <br>") ;
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) ;
}
}

View File

@ -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<EFBFBD>vrier", "Mars", "Avril", "Mai", "Juin",
"Juillet", "Ao<EFBFBD>t", "Septembre", "Octobre", "Novembre", "D<EFBFBD>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<EFBFBD>sol<EFBFBD>");
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<6E>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<EFBFBD>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) ;
}
}