2022-06-19 21:01:30 +02:00
|
|
|
package fenetres;
|
2022-05-23 21:01:17 +02:00
|
|
|
|
|
|
|
import java.awt.Font;
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
|
|
|
|
import javax.swing.ImageIcon;
|
|
|
|
import javax.swing.JButton;
|
|
|
|
import javax.swing.JFrame;
|
|
|
|
import javax.swing.JLabel;
|
|
|
|
import javax.swing.SwingConstants;
|
|
|
|
|
|
|
|
import MEPTL.commandes;
|
2022-05-28 21:08:52 +02:00
|
|
|
import java.awt.SystemColor;
|
2022-05-23 21:01:17 +02:00
|
|
|
|
2022-05-25 09:30:49 +02:00
|
|
|
public class mainApp extends JFrame implements ActionListener{
|
2022-05-23 21:01:17 +02:00
|
|
|
|
|
|
|
|
2022-05-25 09:30:49 +02:00
|
|
|
/**
|
|
|
|
*
|
2022-05-23 21:01:17 +02:00
|
|
|
*/
|
2022-05-25 09:30:49 +02:00
|
|
|
private static final long serialVersionUID = 1L;
|
2022-05-23 21:01:17 +02:00
|
|
|
|
2022-05-25 09:30:49 +02:00
|
|
|
private JFrame frmEvalwriter;
|
2022-05-23 21:01:17 +02:00
|
|
|
|
2022-05-25 09:30:49 +02:00
|
|
|
JButton btnCreate;
|
|
|
|
JButton actCharge;
|
2022-05-24 18:25:41 +02:00
|
|
|
|
2022-05-25 09:30:49 +02:00
|
|
|
/**
|
|
|
|
* Launch the application.
|
|
|
|
*/
|
|
|
|
public static void main(String[] args) {
|
|
|
|
commandes.console=false;
|
2022-06-13 17:43:41 +02:00
|
|
|
try {
|
|
|
|
mainApp window = new mainApp();
|
2022-11-24 21:49:39 +01:00
|
|
|
System.out.println(commandes.os);
|
2022-06-13 17:43:41 +02:00
|
|
|
window.frmEvalwriter.setVisible(true);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
2022-05-25 09:30:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create the application.
|
|
|
|
*/
|
|
|
|
public mainApp() {
|
|
|
|
initialize();
|
|
|
|
}
|
2022-05-23 21:01:17 +02:00
|
|
|
|
2022-05-25 09:30:49 +02:00
|
|
|
/**
|
|
|
|
* Initialize the contents of the frame.
|
|
|
|
*/
|
|
|
|
private void initialize() {
|
2022-06-09 09:13:46 +02:00
|
|
|
|
2022-05-26 20:10:24 +02:00
|
|
|
|
2022-05-25 09:30:49 +02:00
|
|
|
frmEvalwriter = new JFrame();
|
|
|
|
frmEvalwriter.setResizable(false);
|
|
|
|
frmEvalwriter.setTitle("analyseWriter");
|
2022-06-01 21:38:37 +02:00
|
|
|
frmEvalwriter.setBounds(100, 100, 500, 380);
|
2022-06-09 09:13:46 +02:00
|
|
|
int screenWidth = (int) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getWidth();
|
|
|
|
int screenHeight = (int) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getHeight();
|
|
|
|
frmEvalwriter.setLocation(( (screenWidth) - frmEvalwriter.getWidth()) / 2, (screenHeight - frmEvalwriter.getHeight()) / 2);
|
|
|
|
|
2022-05-25 09:30:49 +02:00
|
|
|
frmEvalwriter.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
|
|
|
frmEvalwriter.getContentPane().setLayout(null);
|
|
|
|
ImageIcon img = new ImageIcon(getClass().getResource("/evalwriter.png") );
|
2022-05-26 20:10:24 +02:00
|
|
|
frmEvalwriter.setIconImage(img.getImage());
|
2022-05-25 09:30:49 +02:00
|
|
|
|
2022-06-11 12:10:28 +02:00
|
|
|
btnCreate = new JButton("Créer ou modifier un fichier d'analyse");
|
2022-05-28 19:13:25 +02:00
|
|
|
btnCreate.setHorizontalAlignment(SwingConstants.LEFT);
|
|
|
|
btnCreate.setIcon(new ImageIcon(mainApp.class.getResource("/resources/fichierAnalyseModif.png")));
|
2022-06-01 21:38:37 +02:00
|
|
|
btnCreate.setFont(new Font("Arial", Font.BOLD, 16));
|
2022-05-25 09:30:49 +02:00
|
|
|
btnCreate.addActionListener(this);
|
|
|
|
|
2022-06-01 21:38:37 +02:00
|
|
|
btnCreate.setBounds(34, 180, 420, 60);
|
2022-05-25 09:30:49 +02:00
|
|
|
frmEvalwriter.getContentPane().add(btnCreate);
|
|
|
|
|
2022-06-01 21:38:37 +02:00
|
|
|
actCharge = new JButton("Evaluer les fichiers des étudiants");
|
2022-05-28 19:13:25 +02:00
|
|
|
actCharge.setHorizontalAlignment(SwingConstants.LEFT);
|
|
|
|
actCharge.setIcon(new ImageIcon(mainApp.class.getResource("/resources/evaluate.png")));
|
2022-05-28 21:08:52 +02:00
|
|
|
actCharge.setBackground(SystemColor.inactiveCaption);
|
2022-05-25 09:30:49 +02:00
|
|
|
actCharge.addActionListener(this);
|
2022-06-01 21:38:37 +02:00
|
|
|
actCharge.setFont(new Font("Arial", Font.BOLD, 16));
|
|
|
|
actCharge.setBounds(34, 110, 420, 60);
|
2022-05-25 09:30:49 +02:00
|
|
|
frmEvalwriter.getContentPane().add(actCharge);
|
|
|
|
|
|
|
|
JLabel lblNewLabel = new JLabel();
|
|
|
|
ImageIcon img2 = new ImageIcon(getClass().getResource("/accueil.png") );
|
|
|
|
lblNewLabel.setIcon(img2);
|
|
|
|
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
lblNewLabel.setFont(new Font("Pacifico", Font.PLAIN, 26));
|
2022-06-01 21:38:37 +02:00
|
|
|
lblNewLabel.setBounds(10, 25, 470, 74);
|
2022-05-25 09:30:49 +02:00
|
|
|
frmEvalwriter.getContentPane().add(lblNewLabel);
|
2022-05-31 19:37:46 +02:00
|
|
|
|
2022-06-10 12:24:43 +02:00
|
|
|
JButton btnNewButton = new JButton("Version & Documentation");
|
2022-06-09 09:13:46 +02:00
|
|
|
btnNewButton.setHorizontalAlignment(SwingConstants.LEFT);
|
2022-05-31 19:37:46 +02:00
|
|
|
btnNewButton.addActionListener(new ActionListener() {
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
2022-06-19 21:01:30 +02:00
|
|
|
about.getInstance();
|
2022-05-31 19:37:46 +02:00
|
|
|
}
|
|
|
|
});
|
2022-06-01 21:38:37 +02:00
|
|
|
btnNewButton.setFont(new Font("Arial", Font.PLAIN, 14));
|
2022-05-31 19:37:46 +02:00
|
|
|
btnNewButton.setIcon(new ImageIcon(mainApp.class.getResource("/resources/apropos.png")));
|
2022-06-10 12:24:43 +02:00
|
|
|
btnNewButton.setBounds(34, 270, 200, 60);
|
2022-05-31 19:37:46 +02:00
|
|
|
frmEvalwriter.getContentPane().add(btnNewButton);
|
2022-06-10 12:24:43 +02:00
|
|
|
|
|
|
|
JButton btnTutoriels = new JButton("Tutoriels");
|
|
|
|
btnTutoriels.addActionListener(new ActionListener() {
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
try {
|
|
|
|
String url = "https://www.youtube.com/channel/UCBSfItcCVnbRJdQbVE9ppjQ";
|
|
|
|
java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
|
|
|
|
}
|
|
|
|
catch (java.io.IOException e1) {
|
|
|
|
System.out.println(e1.getMessage());
|
|
|
|
}
|
|
|
|
System.out.println( "Affiche les tutoriels." );
|
|
|
|
}
|
|
|
|
});
|
|
|
|
btnTutoriels.setIcon(new ImageIcon(mainApp.class.getResource("/resources/tutoriel.png")));
|
|
|
|
btnTutoriels.setHorizontalAlignment(SwingConstants.LEFT);
|
|
|
|
btnTutoriels.setFont(new Font("Arial", Font.PLAIN, 14));
|
|
|
|
btnTutoriels.setBounds(254, 270, 200, 60);
|
|
|
|
frmEvalwriter.getContentPane().add(btnTutoriels);
|
2022-05-25 09:30:49 +02:00
|
|
|
}
|
2022-05-23 21:01:17 +02:00
|
|
|
|
2022-05-24 18:25:41 +02:00
|
|
|
|
2022-05-25 09:30:49 +02:00
|
|
|
@Override
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
if(e.getSource()==btnCreate) {
|
2022-06-19 21:01:30 +02:00
|
|
|
create.getInstance();
|
2022-05-28 19:13:25 +02:00
|
|
|
frmEvalwriter.dispose();
|
2022-05-25 09:30:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if(e.getSource()==actCharge) {
|
2022-05-25 18:21:23 +02:00
|
|
|
if(!commandes.console) System.out.println( "Début chargement du fichier d'analyse." );
|
2022-06-06 09:50:45 +02:00
|
|
|
new evaluate();
|
2022-05-25 09:30:49 +02:00
|
|
|
frmEvalwriter.dispose();
|
|
|
|
}
|
|
|
|
|
2022-06-19 21:01:30 +02:00
|
|
|
}
|
2022-05-25 09:30:49 +02:00
|
|
|
}
|