2020-11-21 16:28:55 +01:00
|
|
|
import javax.swing.*;
|
2020-11-29 18:56:04 +01:00
|
|
|
import java.awt.*;
|
|
|
|
|
|
2020-11-22 15:55:26 +01:00
|
|
|
/**
|
|
|
|
|
* La classe principale du logiciel AppThinker.
|
|
|
|
|
* @author V.BOULANGER
|
|
|
|
|
*/
|
2020-11-21 15:01:19 +01:00
|
|
|
public class AppThinker {
|
|
|
|
|
//JavaDoc tags : @param @return @throws @author @version @see @since @serial @deprecated
|
|
|
|
|
|
2020-11-29 18:56:04 +01:00
|
|
|
private static Project _project;
|
|
|
|
|
private static AppThinkerWindow _window;
|
|
|
|
|
|
2020-11-21 15:01:19 +01:00
|
|
|
/**
|
2020-11-22 15:55:26 +01:00
|
|
|
* La méthode principale exécutée
|
2020-11-21 15:01:19 +01:00
|
|
|
* @param args Les arguments de la méthode principale.
|
|
|
|
|
*/
|
|
|
|
|
public static void main(String[] args) {
|
2020-11-29 18:56:04 +01:00
|
|
|
_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());
|
2020-12-07 22:18:54 +01:00
|
|
|
_window.getMenubar().setProjectEnable(true);
|
|
|
|
|
_project.getUmlDiagram().getToolbar().setEnabled(true);
|
|
|
|
|
_window.getStatusbar().setStatusMessage("The project was created.");
|
2020-11-29 18:56:04 +01:00
|
|
|
_window.getStatusbar().setFileMessage(_project.getName());
|
2020-12-07 22:18:54 +01:00
|
|
|
_window.setProject(_project);
|
2020-12-05 16:16:49 +01:00
|
|
|
AppThinker.getProject().getUmlDiagram().displayDiagram();
|
2020-11-29 18:56:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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");
|
2020-12-07 22:18:54 +01:00
|
|
|
_window.getMenubar().setProjectEnable(false);
|
|
|
|
|
_project.getUmlDiagram().getToolbar().setEnabled(false);
|
|
|
|
|
_window.getStatusbar().setStatusMessage("The project has been closed.");
|
|
|
|
|
_window.getStatusbar().setFileMessage("No open project.");
|
|
|
|
|
_window.clearProject();
|
2020-11-29 18:56:04 +01:00
|
|
|
_project = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Récupère le projet en cours.
|
|
|
|
|
* @return Le projet en cours.
|
|
|
|
|
*/
|
|
|
|
|
public static Project getProject(){
|
|
|
|
|
return _project;
|
2020-11-21 15:01:19 +01:00
|
|
|
}
|
|
|
|
|
}
|