$
This commit is contained in:
parent
f6253edc8c
commit
c37363dce6
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -47,6 +47,7 @@ public class AdminView extends BFrame {
|
|||||||
addStudGrup.setActionCommand("TODO");
|
addStudGrup.setActionCommand("TODO");
|
||||||
this.add(addStudGrup, settings);
|
this.add(addStudGrup, settings);
|
||||||
|
|
||||||
|
this.setResizable(false);
|
||||||
this.openBFrame();
|
this.openBFrame();
|
||||||
this.refreshBFrame();
|
this.refreshBFrame();
|
||||||
}
|
}
|
||||||
|
@ -117,6 +117,7 @@ public class BFrame extends JFrame {
|
|||||||
frame.getContentPane().add(scrollPane);
|
frame.getContentPane().add(scrollPane);
|
||||||
scrollPane.setViewportView(content);
|
scrollPane.setViewportView(content);
|
||||||
|
|
||||||
|
frame.setResizable(false);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,17 +3,16 @@ package Test;
|
|||||||
import API.Etudiant;
|
import API.Etudiant;
|
||||||
import API.Groupe;
|
import API.Groupe;
|
||||||
|
|
||||||
import javax.swing.JTable;
|
import javax.swing.*;
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.event.ListSelectionEvent;
|
import javax.swing.event.ListSelectionEvent;
|
||||||
import javax.swing.ListSelectionModel;
|
|
||||||
import javax.swing.event.ListSelectionListener;
|
import javax.swing.event.ListSelectionListener;
|
||||||
import javax.swing.table.TableModel;
|
import javax.swing.table.TableModel;
|
||||||
|
import java.awt.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import javax.swing.JPanel;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class Controller implements ActionListener, ListSelectionListener {
|
public class Controller implements ActionListener, ListSelectionListener {
|
||||||
private final BDatabase db;
|
private final BDatabase db;
|
||||||
@ -97,6 +96,21 @@ public class Controller implements ActionListener, ListSelectionListener {
|
|||||||
BFrame frame = new BFrame(frameTitle, loca_x, loca_y, size_x, size_y, parent, forModal);
|
BFrame frame = new BFrame(frameTitle, loca_x, loca_y, size_x, size_y, parent, forModal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pour afficher une modale classique pour plus de liberte (panel a creer au prealable)
|
||||||
|
*
|
||||||
|
* @param parent La fenetre qui sera bloque
|
||||||
|
* @param frameTitle Le titre de la fenetre
|
||||||
|
* @param size_x Taille en x
|
||||||
|
* @param size_y Taille en y
|
||||||
|
* @param loca_x Localisation en x
|
||||||
|
* @param loca_y Localisation en y
|
||||||
|
* @param forModal Le panel a mettre dans la fenetre (libre)
|
||||||
|
* */
|
||||||
|
private void DisplayModal(BFrame parent, String frameTitle, int size_x, int size_y, int loca_x, int loca_y, JPanel forModal, Object... data) {
|
||||||
|
BFrame frame = new BFrame(frameTitle, loca_x, loca_y, size_x, size_y, parent, forModal);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
String command = e.getActionCommand();
|
String command = e.getActionCommand();
|
||||||
@ -262,19 +276,42 @@ public class Controller implements ActionListener, ListSelectionListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void valueChanged(ListSelectionEvent e) {
|
public void valueChanged(ListSelectionEvent e) {
|
||||||
int[] cell;
|
if(!e.getValueIsAdjusting()) {
|
||||||
|
int[] cell = this.currentJTableUse.getSelectedRows();
|
||||||
|
int collumnCount = this.currentJTableUse.getColumnCount();
|
||||||
Object value;
|
Object value;
|
||||||
|
System.out.println(e.getSource());
|
||||||
|
|
||||||
if (!e.getValueIsAdjusting()) {
|
if(cell.length > 0) {
|
||||||
cell = this.currentJTableUse.getSelectedRows();
|
for(int i = 0; i < collumnCount; i++) {
|
||||||
if (cell.length > 0) {
|
|
||||||
for (int i=0; i < 3; i++) {
|
|
||||||
TableModel tm = this.currentJTableUse.getModel();
|
TableModel tm = this.currentJTableUse.getModel();
|
||||||
value = tm.getValueAt(cell[0], i);
|
value = tm.getValueAt(cell[0], i);
|
||||||
System.out.print(value + " ");
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println();
|
if(Objects.equals(value, "[DEPLACER]")) {
|
||||||
|
JPanel forModal = new JPanel(new GridBagLayout());
|
||||||
|
BLayout settings = new BLayout();
|
||||||
|
|
||||||
|
JLabel l = new JLabel("test");
|
||||||
|
forModal.add(l);
|
||||||
|
|
||||||
|
DisplayModal(
|
||||||
|
this.av,
|
||||||
|
"Deplacer l'eleve : " + tm.getValueAt(cell[0], 0) + " " + tm.getValueAt(cell[0], 1),
|
||||||
|
500,
|
||||||
|
250,
|
||||||
|
this.av.getX(),
|
||||||
|
this.av.getY(),
|
||||||
|
forModal,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Position toujours similaire { cell[0] = Nom (String), cell[1] = Prenom (String), cell[2] = Groupe (String) }
|
||||||
|
*/
|
||||||
|
tm.getValueAt(cell[0], 0),
|
||||||
|
tm.getValueAt(cell[0], 1),
|
||||||
|
tm.getValueAt(cell[0], 2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,6 +116,7 @@ public class ProfView extends BFrame {
|
|||||||
searchTLetters.setActionCommand("pv::SearchStudentPer3Letters");
|
searchTLetters.setActionCommand("pv::SearchStudentPer3Letters");
|
||||||
this.add(searchTLetters, settings);
|
this.add(searchTLetters, settings);
|
||||||
|
|
||||||
|
this.setResizable(false);
|
||||||
this.openBFrame();
|
this.openBFrame();
|
||||||
this.refreshBFrame();
|
this.refreshBFrame();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user