analyseWriter/src/app/mainApp.java

139 lines
4.1 KiB
Java
Raw Normal View History

package app;
2022-05-25 09:30:49 +02:00
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
2022-05-25 09:30:49 +02:00
import java.awt.Toolkit;
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-25 09:30:49 +02:00
public class mainApp extends JFrame implements ActionListener{
//public static final String LOOK_AND_FEEL_1 = "javax.swing.plaf.nimbus.NimbusLookAndFeel";
2022-05-25 09:30:49 +02:00
/**
*
*/
2022-05-25 09:30:49 +02:00
private static final long serialVersionUID = 1L;
2022-05-25 09:30:49 +02:00
private JFrame frmEvalwriter;
// public static JFrame Creer ;
2022-05-25 09:30:49 +02:00
JButton btnCreate;
JButton actCharge;
JButton aPropos;
private JButton btnCrerUnFichier;
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;
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();
}
2022-05-25 09:30:49 +02:00
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frmEvalwriter = new JFrame();
frmEvalwriter.setIconImage(Toolkit.getDefaultToolkit().getImage(mainApp.class.getResource("/resources/evalwriter.ico")));
frmEvalwriter.setResizable(false);
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") );
setIconImage(img.getImage());
btnCreate = new JButton("Modifier un fichier d'analyse");
btnCreate.setFont(new Font("Tahoma", Font.PLAIN, 14));
btnCreate.addActionListener(this);
btnCreate.setBounds(34, 163, 470, 50);
frmEvalwriter.getContentPane().add(btnCreate);
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));
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));
lblNewLabel.setBounds(34, 11, 470, 74);
frmEvalwriter.getContentPane().add(lblNewLabel);
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);
}
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) {
// Creer = new create();
frmEvalwriter.dispose();
}
if(e.getSource()==actCharge) {
if(!commandes.console) System.out.println( "Début chargement du fichier d'analyse." );
new filechooserXML();
// tree.setModel(utils.getTree().getModel()) ;
// textNodeSelect.setText("Le chargement de la nouvelle structure est réussi.");
// create.this.MAJToolBar();
2022-05-25 09:30:49 +02:00
new evaluate();
frmEvalwriter.dispose();
}
if(e.getSource()==aPropos) {
new about();
}
}
2022-05-25 09:30:49 +02:00
}