@@ -1,4 +1,6 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* La classe principale du logiciel AppThinker.
|
||||
* @author V.BOULANGER
|
||||
@@ -6,12 +8,78 @@ import javax.swing.*;
|
||||
public class AppThinker {
|
||||
//JavaDoc tags : @param @return @throws @author @version @see @since @serial @deprecated
|
||||
|
||||
private static Project _project;
|
||||
private static AppThinkerWindow _window;
|
||||
|
||||
/**
|
||||
* La méthode principale exécutée
|
||||
* @param args Les arguments de la méthode principale.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
AppThinkerWindow window = new AppThinkerWindow();
|
||||
window.setVisible(true);
|
||||
_window = new AppThinkerWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère la fenêtre de l'application
|
||||
* @return La fenêtre de l'application.
|
||||
*/
|
||||
public static AppThinkerWindow getWindow(){
|
||||
return _window;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crée un nouveau Projet.
|
||||
*/
|
||||
public static void newProject(){
|
||||
_project = new Project();
|
||||
_window.setTitle("AppThinker | " + _project.getName());
|
||||
_window.getMenubar().enableEditing();
|
||||
_window.getToolbar().enableEditing();
|
||||
_window.getStatusbar().setStatusMessage("Le projet a été créé.");
|
||||
_window.getStatusbar().setFileMessage(_project.getName());
|
||||
_window.setGrid(_project.getGrid());
|
||||
AppThinker.getProject().getGrid().getDiagram().displayDiagram();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ouvre un projet existant dans la fenêtre.
|
||||
*/
|
||||
public static void openProject(){
|
||||
//_window.getGrid().repaint();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sauvegarde le projet en cours.
|
||||
*/
|
||||
public static void saveProject(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sauvegarde le projet en cours à un autre emplacement.
|
||||
*/
|
||||
public static void saveAsProject(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ferme le projet en cours.
|
||||
*/
|
||||
public static void closeProject(){
|
||||
_window.setTitle("AppThinker");
|
||||
_window.getMenubar().disableEditing();
|
||||
_window.getToolbar().disableEditing();
|
||||
_window.getStatusbar().setStatusMessage("Le projet a été fermé.");
|
||||
_window.getStatusbar().setFileMessage("Aucun projet ouvert");
|
||||
_window.remove(_project.getGrid());
|
||||
_project = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère le projet en cours.
|
||||
* @return Le projet en cours.
|
||||
*/
|
||||
public static Project getProject(){
|
||||
return _project;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user