From b5df0be48126be527d7c113bff751a2371ea0431 Mon Sep 17 00:00:00 2001 From: Valentin Boulanger Date: Sun, 22 Nov 2020 15:55:26 +0100 Subject: [PATCH] Apport de modifications --- AppThinker/src/AppThinker.java | 8 ++-- AppThinker/src/AppThinkerGrid.java | 35 ++++++++++++++- AppThinker/src/AppThinkerMenuBar.java | 5 ++- AppThinker/src/AppThinkerStatusbar.java | 5 ++- AppThinker/src/AppThinkerToolbar.java | 5 ++- AppThinker/src/AppThinkerWindow.java | 56 +++++++++++++++++++++-- AppThinker/src/Project.java | 60 ++++++++++++------------- 7 files changed, 134 insertions(+), 40 deletions(-) diff --git a/AppThinker/src/AppThinker.java b/AppThinker/src/AppThinker.java index 881fa54..47e3177 100644 --- a/AppThinker/src/AppThinker.java +++ b/AppThinker/src/AppThinker.java @@ -1,12 +1,14 @@ import javax.swing.*; - +/** + * La classe principale du logiciel AppThinker. + * @author V.BOULANGER + */ public class AppThinker { //JavaDoc tags : @param @return @throws @author @version @see @since @serial @deprecated /** - * La classe principale de AppThinker + * La méthode principale exécutée * @param args Les arguments de la méthode principale. - * @author V.BOULANGER */ public static void main(String[] args) { AppThinkerWindow window = new AppThinkerWindow(); diff --git a/AppThinker/src/AppThinkerGrid.java b/AppThinker/src/AppThinkerGrid.java index b8fb48a..457529a 100644 --- a/AppThinker/src/AppThinkerGrid.java +++ b/AppThinker/src/AppThinkerGrid.java @@ -1,13 +1,46 @@ import javax.swing.*; import java.awt.*; +/** + * Affiche une grille pour l'affichage du projet. + * @author V.BOULANGER + */ public class AppThinkerGrid extends JPanel { /** * Constructeur de la classe AppThinkerGrid - * @author V.BOULANGER */ public AppThinkerGrid(){ this.setBackground(new Color(192, 192, 192)); } + + /** + * Affiche les éléments du projet dans la grille. + * @param project Projet à afficher. + */ + public void displayProject(Project project){ + + } + + /** + * Détruit tous les éléments de la grille. + */ + public void cleanProject(){ + + } + + /** + * Applique un zoom sur la grille. + * @param percent Pourcentage du zoom (1 - 500). + */ + public void zoom(int percent){ + + } + + /** + * Rafraîchit les modifications sur la grille. + */ + public void refresh(){ + this.updateUI(); + } } diff --git a/AppThinker/src/AppThinkerMenuBar.java b/AppThinker/src/AppThinkerMenuBar.java index ca8ce7f..85feb2c 100644 --- a/AppThinker/src/AppThinkerMenuBar.java +++ b/AppThinker/src/AppThinkerMenuBar.java @@ -2,11 +2,14 @@ import javax.imageio.ImageIO; import javax.swing.*; import java.awt.*; +/** + * Affiche une barre de menu en entête de la fenêtre. + * @author V.BOULANGER + */ public class AppThinkerMenuBar extends JMenuBar { /** * Constructeur de la classe AppThinkerMenuBar - * @author V.BOULANGER */ public AppThinkerMenuBar(){ diff --git a/AppThinker/src/AppThinkerStatusbar.java b/AppThinker/src/AppThinkerStatusbar.java index e8800e5..fda54a8 100644 --- a/AppThinker/src/AppThinkerStatusbar.java +++ b/AppThinker/src/AppThinkerStatusbar.java @@ -2,10 +2,13 @@ import javax.swing.*; import javax.swing.border.BevelBorder; import java.awt.*; +/** + * Affiche une barre de statut au pied de la fenêtre + * @author V.BOULANGER + */ public class AppThinkerStatusbar extends JPanel { /** * Constructeur de la classe AppThinkerStatusbar - * @author V.BOULANGER */ public AppThinkerStatusbar(){ //Création de la statusBar diff --git a/AppThinker/src/AppThinkerToolbar.java b/AppThinker/src/AppThinkerToolbar.java index 1b222e9..be07e91 100644 --- a/AppThinker/src/AppThinkerToolbar.java +++ b/AppThinker/src/AppThinkerToolbar.java @@ -1,10 +1,13 @@ import javax.swing.*; import java.awt.*; +/** + * Affiche une barre d'actions en haut de la fenêtre. + * @author V.BOULANGER + */ public class AppThinkerToolbar extends JPanel { /** * Constructeur de la classe AppThinkerToolbar - * @author V.BOULANGER */ public AppThinkerToolbar(){ //Création de la Toolbar diff --git a/AppThinker/src/AppThinkerWindow.java b/AppThinker/src/AppThinkerWindow.java index da376ee..2b10691 100644 --- a/AppThinker/src/AppThinkerWindow.java +++ b/AppThinker/src/AppThinkerWindow.java @@ -2,11 +2,16 @@ import javax.imageio.ImageIO; import javax.swing.*; import java.awt.*; +/** + * Affiche une fenêtre du logiciel. + * @author V.BOULANGER + */ public class AppThinkerWindow extends JFrame { + private Project _project; + private AppThinkerGrid _grid; /** * Constructeur de la classe AppThinkerWindow - * @author V.BOULANGER */ public AppThinkerWindow(){ //Paramétrage de la fenêtre @@ -27,12 +32,57 @@ public class AppThinkerWindow extends JFrame { this.add(toolbar, BorderLayout.NORTH); //Ajout de la grille à la fenêtre - AppThinkerGrid grid = new AppThinkerGrid(); - this.add(grid, BorderLayout.CENTER); + _grid = new AppThinkerGrid(); + this.add(_grid, BorderLayout.CENTER); //Ajout de la statusbar à la fenêtre AppThinkerStatusbar statusbar = new AppThinkerStatusbar(); this.add(statusbar, BorderLayout.SOUTH); this.pack(); } + + /** + * Crée un nouveau Projet. + */ + public void newProject(){ + this._project = new Project(); + this.setTitle("AppThinker | " + _project.getName()); + } + + /** + * Ouvre un projet existant dans la fenêtre. + * @param path Le chemin du projet à ouvrir. + */ + public void openProject(String path){ + + } + + /** + * Ferme le projet en cours. + */ + public void closeProject(){ + this._project = null; + } + + /** + * 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. + * @param path Le chemin de sauvegarde du projet. + */ + public void saveAsProject(String path){ + + } } diff --git a/AppThinker/src/Project.java b/AppThinker/src/Project.java index 3da2958..f27dd06 100644 --- a/AppThinker/src/Project.java +++ b/AppThinker/src/Project.java @@ -7,7 +7,7 @@ import java.util.List; */ public class Project { - private static int _projectId = 0; + public static int _projectId = 0; private int _id; private String _name; @@ -20,8 +20,7 @@ public class Project { private List _links; /** - * Crée une instance de Projet. - * @author V.BOULANGER + * Constructeur - Crée une instance de Projet. */ public Project(){ _projectId++; @@ -36,7 +35,7 @@ public class Project { } /** - * Crée une instance de Projet avec des paramètres déterminés. + * Constructeur - Crée une instance de Projet avec des paramètres déterminés. * @param name Le nom du projet. * @param author L'auteur du projet. * @param version La version du projet. @@ -44,7 +43,6 @@ public class Project { * @param path Chemin vers le ficher enregistré. * @param classes La liste des classes du projet. * @param links La liste des liens du projet. - * @author V.BOULANGER */ public Project(String name, String author, String version, String designation, String path, List classes, List links){ _projectId++; @@ -58,17 +56,9 @@ public class Project { _links = links; } - /** - * Récupère le nombre d'instances de Projet. - * @author V.BOULANGER - */ - public static int getProjectsNumber(){ - return _projectId; - } - /** * Récupère le numéro du Projet. - * @author V.BOULANGER + * @return Le numéro du projet. */ public int getId(){ return this._id; @@ -76,7 +66,7 @@ public class Project { /** * Récupère le nom du Projet. - * @author V.BOULANGER + * @return Le nom du projet. */ public String getName(){ return this._name; @@ -84,7 +74,7 @@ public class Project { /** * Paramètre le nom du Projet. - * @author V.BOULANGER + * @param name Le nom du projet. */ public void setName(String name){ this._name = name; @@ -92,7 +82,7 @@ public class Project { /** * Récupère l'auteur du Projet. - * @author V.BOULANGER + * @return L'auteur du projet. */ public String getAuthor(){ return this._author; @@ -100,7 +90,7 @@ public class Project { /** * Paramètre l'auteur du Projet. - * @author V.BOULANGER + * @param author L'auteur du projet. */ public void setAuthor(String author){ this._author = author; @@ -108,7 +98,7 @@ public class Project { /** * Récupère le numéro de version du Projet. - * @author V.BOULANGER + * @return Le numéro de version du projet. */ public String getVersion(){ return this._version; @@ -116,7 +106,7 @@ public class Project { /** * Paramètre le numéro de version du Projet. - * @author V.BOULANGER + * @param version Le numéro de version du projet. */ public void setVersion(String version){ this._version = version; @@ -124,7 +114,7 @@ public class Project { /** * Récupère la désignation du Projet. - * @author V.BOULANGER + * @return La désignation du projet. */ public String getDesignation(){ return this._designation; @@ -132,7 +122,7 @@ public class Project { /** * Paramètre la désignation du Projet. - * @author V.BOULANGER + * @param designation La désignation du projet. */ public void setDesignation(String designation){ this._designation = designation; @@ -140,7 +130,7 @@ public class Project { /** * Récupère la désignation du Projet. - * @author V.BOULANGER + * @return Le chemin du fichier du projet. */ public String getPath(){ return this._path; @@ -148,16 +138,23 @@ public class Project { /** * Paramètre la désignation du Projet. - * @author V.BOULANGER + * @param path Le chemin vers le fichier du projet. */ public void setPath(String path){ this._path = path; } + /** + * Récupère toutes les classes du projet. + * @return Les classes du projet. + */ + public List getClasses(){ + return this._classes; + } + /** * Ajoute une classe au projet. * @param c La classe à ajouter. - * @author V.BOULANGER */ public void addClass(Class c){ this._classes.add(c); @@ -166,7 +163,6 @@ public class Project { /** * Retire une classe du projet. * @param index L'index de la classe à retirer. - * @author V.BOULANGER */ public void removeClass(int index){ this._classes.remove(index); @@ -174,16 +170,22 @@ public class Project { /** * Supprime toutes les classes du projet. - * @author V.BOULANGER */ public void clearClasses(){ this._classes.clear(); } + /** + * Récupère tous les liens du projet. + * @return Les liens du projet. + */ + public List getLinks(){ + return this._links; + } + /** * Ajoute un lien au projet. * @param l Le lien à ajouter. - * @author V.BOULANGER */ public void addLink(Link l){ this._links.add(l); @@ -192,7 +194,6 @@ public class Project { /** * Retire un lien du projet. * @param index L'index du lien à retirer. - * @author V.BOULANGER */ public void removeLink(int index){ this._links.remove(index); @@ -200,7 +201,6 @@ public class Project { /** * Supprime tous les liens du projet. - * @author V.BOULANGER */ public void clearLinks(){ this._links.clear();