Files
Appthinker/AppThinker/src/AppThinkerWindow.java

125 lines
3.2 KiB
Java
Raw Normal View History

2020-11-21 15:01:19 +01:00
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
2020-11-22 15:55:26 +01:00
/**
* Affiche une fenêtre du logiciel.
* @author V.BOULANGER
*/
2020-11-21 15:01:19 +01:00
public class AppThinkerWindow extends JFrame {
2020-11-22 15:55:26 +01:00
private Project _project;
private AppThinkerMenuBar _menu;
private AppThinkerToolbar _toolbar;
2020-11-22 15:55:26 +01:00
private AppThinkerGrid _grid;
private AppThinkerStatusbar _statusbar;
2020-11-21 15:01:19 +01:00
/**
* Constructeur de la classe AppThinkerWindow
*/
public AppThinkerWindow(){
2020-11-21 16:28:55 +01:00
//Paramétrage de la fenêtre
2020-11-21 15:01:19 +01:00
this.setTitle("AppThinker");
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
Image img = null;
try { img = ImageIO.read(AppThinker.class.getResource("img/logoAppThinker.png")); } catch (Exception ex) { }
this.setIconImage(img);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
2020-11-21 19:46:43 +01:00
this.setLocationRelativeTo(null);
2020-11-21 15:01:19 +01:00
2020-11-21 16:28:55 +01:00
//Ajout du menu à la fenêtre
_menu = new AppThinkerMenuBar(this);
this.setJMenuBar(_menu);
2020-11-21 19:46:43 +01:00
//Ajout de la toolbar à la fenêtre
_toolbar = new AppThinkerToolbar(this);
this.add(_toolbar, BorderLayout.NORTH);
2020-11-21 19:46:43 +01:00
//Ajout de la grille à la fenêtre
2020-11-22 15:55:26 +01:00
_grid = new AppThinkerGrid();
this.add(_grid, BorderLayout.CENTER);
2020-11-21 19:46:43 +01:00
//Ajout de la statusbar à la fenêtre
_statusbar = new AppThinkerStatusbar();
this.add(_statusbar, BorderLayout.SOUTH);
2020-11-21 19:46:43 +01:00
this.pack();
2020-11-21 16:28:55 +01:00
}
2020-11-22 15:55:26 +01:00
/**
* Crée un nouveau Projet.
*/
public void newProject(){
this._project = new Project();
this.setTitle("AppThinker | " + _project.getName());
this._menu.enableEditing();
this._toolbar.enableEditing();
this._statusbar.setStatusMessage("Le projet a été créé.");
this._statusbar.setFileMessage(this._project.getName());
2020-11-22 15:55:26 +01:00
}
/**
* Ouvre un projet existant dans la fenêtre.
*/
public void openProject(){
2020-11-22 15:55:26 +01:00
}
/**
* Ferme le projet en cours.
*/
public void closeProject(){
this._project = null;
this.setTitle("AppThinker");
this._menu.disableEditing();
this._toolbar.disableEditing();
this._statusbar.setStatusMessage("Le projet a été fermé.");
this._statusbar.setFileMessage("Aucun projet ouvert");
2020-11-22 15:55:26 +01:00
}
/**
* Convertit le projet actuel en chaîne XML.
*/
public void convertToXml(){
}
/**
* Sauvegarde le projet en cours.
*/
public void saveProject(){
}
/**
* Sauvegarde le projet en cours à un autre emplacement.
*/
public void saveAsProject(){
2020-11-22 15:55:26 +01:00
}
/**
* Récupère la toolbar contenue dans la fenêtre.
* @return La toolbar contenue dans la fenêtre.
*/
public AppThinkerToolbar getToolbar(){
return this._toolbar;
}
/**
* Récupère la grille contenue dans la fenêtre.
* @return La grille contenue dans la fenêtre.
*/
public AppThinkerGrid getGrid(){
return this._grid;
}
/**
* Récupère la statusbar contenue dans la fenêtre.
* @return La statusbar contenue dans la fenêtre.
*/
public AppThinkerStatusbar getStatusbar(){
return this._statusbar;
}
2020-11-21 15:01:19 +01:00
}