Transférer les fichiers vers 'src/Test'
This commit is contained in:
parent
53481c883b
commit
da69910269
@ -127,9 +127,6 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
this.currentJTableUse = liste;
|
||||
|
||||
this.parent.updateTable(liste);
|
||||
|
||||
//forModal.add(liste);
|
||||
//BFrame frame = new BFrame(frameTitle, loca_x, loca_y, size_x, size_y, this.parent, forModal);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -545,6 +542,37 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
value = tm.getValueAt(cell[0], i);
|
||||
|
||||
if(Objects.equals(value, "[DEPLACER]")) {
|
||||
addMoveStudent(tm, cell, "[DEPLACER]");
|
||||
}
|
||||
|
||||
if(Objects.equals(value, "[AJOUTER]")) {
|
||||
addMoveStudent(tm, cell, "[AJOUTER]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void addMoveStudent(TableModel tm, int[] cell, String action){
|
||||
String[] stringSetAdd = {
|
||||
"Ajouter ",
|
||||
"Ajouter",
|
||||
"Nouveau groupe de l'eleve : "
|
||||
};
|
||||
String[] stringSetMove = {
|
||||
"Deplacer ",
|
||||
"Deplacer",
|
||||
"Deplacer l'eleve : "
|
||||
};
|
||||
String[] stringSet;
|
||||
|
||||
if (action == "[AJOUTER]"){
|
||||
stringSet = stringSetAdd;
|
||||
} else {
|
||||
stringSet = stringSetMove;
|
||||
}
|
||||
|
||||
JPanel forModal = new JPanel(new GridBagLayout());
|
||||
BLayout settings = new BLayout();
|
||||
|
||||
@ -555,7 +583,7 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
settings.setPositionX(0);
|
||||
settings.setPositionY(0);
|
||||
JLabel intro = new JLabel(
|
||||
"Deplacer " + tm.getValueAt(cell[0], 0) + " " +
|
||||
stringSet[0] + tm.getValueAt(cell[0], 0) + " " +
|
||||
tm.getValueAt(cell[0], 1) +
|
||||
" dans le groupe : "
|
||||
);
|
||||
@ -590,13 +618,13 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
|
||||
settings.setPositionX(6);
|
||||
settings.setPositionY(0);
|
||||
JButton moveBtn = new JButton("Deplacer");
|
||||
JButton moveBtn = new JButton(stringSet[1]);
|
||||
moveBtn.setActionCommand("crtll::ActionAddAndMoveGrup");
|
||||
moveBtn.addActionListener(this);
|
||||
forModal.add(moveBtn, settings);
|
||||
|
||||
DisplayModal(
|
||||
"Deplacer l'eleve : "
|
||||
stringSet[2]
|
||||
+ tm.getValueAt(cell[0], 0) + " " + tm.getValueAt(cell[0], 1),
|
||||
500,
|
||||
250,
|
||||
@ -604,14 +632,7 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
this.av.getY(),
|
||||
forModal
|
||||
);
|
||||
}
|
||||
|
||||
if(Objects.equals(value, "[AJOUTER]")) {
|
||||
System.out.println("Ajout");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.parent.updateTable(this.initTable());
|
||||
}
|
||||
|
||||
public JTable initTable() {
|
||||
@ -625,8 +646,7 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
Object[] info = {
|
||||
this.e.get(i).getNom(),
|
||||
this.e.get(i).getPrenom(),
|
||||
String.valueOf(this.e.get(i).getGroupe()),
|
||||
"[DEPLACER]"
|
||||
String.valueOf(this.e.get(i).getGroupe())
|
||||
};
|
||||
data[i] = info;
|
||||
}
|
||||
|
@ -26,8 +26,8 @@ public class CustomJButton extends JButton {
|
||||
private void init() {
|
||||
this.setFont(font);
|
||||
this.setFocusPainted(false);
|
||||
//this.setContentAreaFilled(false);
|
||||
this.setBorderPainted(false);
|
||||
this.setContentAreaFilled(false);
|
||||
//this.setBorderPainted(false);
|
||||
this.setBorder(new RoundedBorder(radius));
|
||||
}
|
||||
}
|
||||
|
29
src/Test/RoundedBorder.java
Normal file
29
src/Test/RoundedBorder.java
Normal file
@ -0,0 +1,29 @@
|
||||
package Test;
|
||||
|
||||
import javax.swing.border.Border;
|
||||
import java.awt.*;
|
||||
|
||||
public class RoundedBorder implements Border {
|
||||
|
||||
private int radius;
|
||||
|
||||
|
||||
RoundedBorder(int radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
|
||||
public Insets getBorderInsets(Component c) {
|
||||
return new Insets(this.radius+1, this.radius+1, this.radius+2, this.radius);
|
||||
}
|
||||
|
||||
|
||||
public boolean isBorderOpaque() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
|
||||
g.drawRoundRect(x, y, width-1, height-1, radius, radius);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user