analyseWriter/src/app/mainApp.java

141 lines
4.2 KiB
Java
Raw Normal View History

package app;
import java.awt.EventQueue;
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;
import java.awt.Color;
2022-05-24 18:25:41 +02:00
import java.awt.Toolkit;
@SuppressWarnings("serial")
public class mainApp extends JFrame implements ActionListener {
//public static final String LOOK_AND_FEEL_1 = "javax.swing.plaf.nimbus.NimbusLookAndFeel";
private JFrame frmEvalwriter;
2022-05-24 18:25:41 +02:00
// public static JFrame Creer ;
JButton btnCreate;
JButton actCharge;
2022-05-24 18:25:41 +02:00
JButton aPropos;
private JButton btnCrerUnFichier;
/**
* Launch the application.
*/
public static void main(String[] args) {
2022-05-24 18:25:41 +02:00
commandes.console=false;
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
mainApp window = new mainApp();
window.frmEvalwriter.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public mainApp() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frmEvalwriter = new JFrame();
2022-05-24 18:25:41 +02:00
frmEvalwriter.setIconImage(Toolkit.getDefaultToolkit().getImage(mainApp.class.getResource("/resources/evalwriter.ico")));
frmEvalwriter.setResizable(false);
2022-05-24 18:25:41 +02:00
frmEvalwriter.setTitle("analyseWriter");
frmEvalwriter.setBounds(100, 100, 555, 457);
frmEvalwriter.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frmEvalwriter.getContentPane().setLayout(null);
ImageIcon img = new ImageIcon(getClass().getResource("/evalwriter.png") );
2022-05-24 18:25:41 +02:00
setIconImage(img.getImage());
2022-05-24 18:25:41 +02:00
btnCreate = new JButton("Modifier un fichier d'analyse");
btnCreate.setFont(new Font("Tahoma", Font.PLAIN, 14));
btnCreate.addActionListener(this);
2022-05-24 18:25:41 +02:00
btnCreate.setBounds(34, 163, 470, 50);
frmEvalwriter.getContentPane().add(btnCreate);
2022-05-24 18:25:41 +02:00
actCharge = new JButton("Charge le fichier d'analyse pour évaluer les fichiers des étudiants");
actCharge.setBackground(Color.PINK);
actCharge.addActionListener(this);
actCharge.setFont(new Font("Tahoma", Font.PLAIN, 14));
2022-05-24 18:25:41 +02:00
actCharge.setBounds(34, 96, 470, 45);
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-05-24 18:25:41 +02:00
lblNewLabel.setBounds(34, 11, 470, 74);
frmEvalwriter.getContentPane().add(lblNewLabel);
2022-05-24 18:25:41 +02:00
aPropos = new JButton("A Propos");
aPropos.addActionListener(this);
aPropos.setFont(new Font("Tahoma", Font.PLAIN, 14));
aPropos.setBounds(34, 326, 161, 50);
frmEvalwriter.getContentPane().add(aPropos);
btnCrerUnFichier = new JButton("Créer un fichier d'analyse à partir d'un fichier ODF");
btnCrerUnFichier.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
btnCrerUnFichier.setFont(new Font("Tahoma", Font.PLAIN, 14));
btnCrerUnFichier.setBounds(34, 235, 470, 50);
frmEvalwriter.getContentPane().add(btnCrerUnFichier);
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==btnCreate) {
// Creer = new create();
frmEvalwriter.dispose();
}
if(e.getSource()==actCharge) {
2022-05-24 18:25:41 +02:00
if(!commandes.console) System.out.println( "Début chargement du fichier d'analyse." );
new filechooserXML();
if(commandes.fichierAnalyseValide) System.out.println("Le chargement du fichier d'analyse est réussi.");
// tree.setModel(utils.getTree().getModel()) ;
// textNodeSelect.setText("Le chargement de la nouvelle structure est réussi.");
// create.this.MAJToolBar();
2022-05-24 18:25:41 +02:00
if(!commandes.console) System.out.println( "Fin chargement du fichier d'analyse" );
new evaluate();
frmEvalwriter.dispose();
}
if(e.getSource()==aPropos) {
new about();
}
2022-05-24 18:25:41 +02:00
}
}