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:
parent
3fdf7aae3a
commit
2906c578bf
BIN
bin/controleur/CtrlAccesListe.class
Normal file
BIN
bin/controleur/CtrlAccesListe.class
Normal file
Binary file not shown.
BIN
bin/controleur/CtrlLogin.class
Normal file
BIN
bin/controleur/CtrlLogin.class
Normal file
Binary file not shown.
BIN
bin/vue/AfficherListeMembre.class
Normal file
BIN
bin/vue/AfficherListeMembre.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
63
src/controleur/CtrlAccesListe.java
Normal file
63
src/controleur/CtrlAccesListe.java
Normal 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<EFBFBD>e le planning <EFBFBD> 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]));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
11
src/controleur/CtrlLogin.java
Normal file
11
src/controleur/CtrlLogin.java
Normal file
@ -0,0 +1,11 @@
|
||||
package controleur;
|
||||
|
||||
public class CtrlLogin {
|
||||
//attributs
|
||||
|
||||
//Constructeurs
|
||||
|
||||
//méthodes
|
||||
|
||||
|
||||
}
|
82
src/vue/AfficherListeMembre.java
Normal file
82
src/vue/AfficherListeMembre.java
Normal 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<EFBFBD>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<EFBFBD>finir la fen<EFBFBD>tre elle-m<EFBFBD>me
|
||||
|
||||
this.setBounds (x, y, l, h);
|
||||
this.setResizable(false);
|
||||
this.setTitle(title) ;
|
||||
this.setDefaultCloseOperation(EXIT_ON_CLOSE) ;
|
||||
|
||||
// Cr<EFBFBD>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<EFBFBD>er des composants et les ins<EFBFBD>rer dans la fen<EFBFBD>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) ;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
||||
@ -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 */
|
||||
@ -193,7 +197,7 @@ public class Planning extends JPanel {
|
||||
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<EFBFBD>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) ;
|
||||
@ -292,5 +296,4 @@ public class Planning extends JPanel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user