Skip to content
Snippets Groups Projects
Commit e987137f authored by PIQUEREZ Corentin's avatar PIQUEREZ Corentin
Browse files

thème sombre début, profs dans fenetre de précision en cours

parent e348baa1
No related branches found
No related tags found
No related merge requests found
......@@ -232,7 +232,7 @@ public class ShukanController
new ShukanTex (data);
else if (e.getSource()==bar.buttons[7]){
EventQueue.invokeLater(() -> {
ShukanParameters myParameters = new ShukanParameters("Changer de thème");
ShukanParameters myParameters = new ShukanParameters("Changer de thème", canvas);
myParameters.setSize(300, 300);
myParameters.setVisible(true);
});
......
......@@ -11,10 +11,12 @@ class ShukanParameters extends JFrame {
private JPanel pPrincipal,p, p1;
/** buttons of the graphic interface */
private JButton changerdetheme, theme1, theme2, theme3, retour, changertouches, changercouleurs;
/** view of the app */
private ShukanView canvas;
/** built a parameter window */
public ShukanParameters(String titre) {
public ShukanParameters(String titre, ShukanView canvas) {
super(titre);
this.canvas = canvas;
p = new JPanel(new GridBagLayout());
GridBagConstraints gbcprinc = new GridBagConstraints();
......@@ -41,11 +43,12 @@ class ShukanParameters extends JFrame {
theme1 = new JButton("Thème sombre");
theme1.setPreferredSize(new Dimension(150, 25));
/*theme1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEVent e) {
getContentPane().setBackground(Color.BLACK);
theme1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
canvas.setBackgroundColor(Color.BLACK);
}
});*/
});
theme2 = new JButton("Thème clair");
theme2.setPreferredSize(new Dimension(150, 25));
......
......@@ -65,7 +65,7 @@ public class ShukanView extends JPanel
/** Background color */
private final Color BACK_COLOR = Color.WHITE;
private Color BACK_COLOR = Color.WHITE;
/** Grid color */
private final Color GRID_COLOR = Color.BLACK;
/** Free module weeks color */
......@@ -377,6 +377,7 @@ public class ShukanView extends JPanel
int num_module = data.selectedModule();
int num_cursus = data.cursusNumber();
int num_semaine = data.selectedWeek()+data.startWeekNumber();
// affiche la fenetre si il y a cours pendant cette periode
if(data.isActiveWeek(num_semaine, num_module))
{
......@@ -385,6 +386,7 @@ public class ShukanView extends JPanel
int[] week_activities = data.scheduleInWeek(num_module, data.selectedWeek());
int[] activities = data.activities(num_module);
int nb_cours = week_activities.length;
boolean rajout_prof = false;
JPanel cours = new JPanel(new GridLayout(nb_cours*3, 1));
JLabel[] noms_cours = new JLabel[nb_cours];
......@@ -392,10 +394,17 @@ public class ShukanView extends JPanel
JLabel[] profs = new JLabel[nb_cours];
for (int i =0; i<nb_cours; i++)
{
String[] teachers = data.moduleTeachers(num_cursus, num_module, activities[week_activities[i]]);
String nom_profs = teachers[0];
for (int j = 1; j<teachers.length; j++)
{
nom_profs+=" / "+teachers[j];
}
System.out.println();
noms_cours[i] = new JLabel("Cours : "+data.activityName(activities[week_activities[i]]));
noms_cours[i].setFont(new Font(noms_cours[i].getFont().getFamily(), noms_cours[i].getFont().getStyle()+Font.BOLD, noms_cours[i].getFont().getSize()+10));
duree[i] = new JLabel(" Durée : "+data.activityDuration(activities[week_activities[i]])+"h");
profs[i] = new JLabel(" Professeur : "+data.subtitle(num_module));
profs[i] = new JLabel(" Professeur : "+ nom_profs);
cours.add(noms_cours[i]);
cours.add(duree[i]);
cours.add(profs[i]);
......@@ -407,5 +416,9 @@ public class ShukanView extends JPanel
}
}
/** change the background color */
public void setBackgroundColor(Color c){
BACK_COLOR = c;
repaint();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment