Résolution #33 Bug ouverture/fermeture projet
This commit is contained in:
@@ -26,8 +26,10 @@ public class AppThinker {
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
//Création de la liste des modifications de la version actuelle
|
||||
changelog = new ArrayList<String>();
|
||||
changelog.add("Fenêtre A propos et fenêtre de changelog");
|
||||
changelog.add("2ème note de version");
|
||||
changelog.add("#30 Fenêtre A propos et fenêtre de changelog");
|
||||
changelog.add("#31 Bug résolu : édition d'une classe inexistante");
|
||||
changelog.add("#34 Rafraîchissement des labels de taille");
|
||||
changelog.add("#3 Création et affichage de liens");
|
||||
|
||||
AppThinkerSplashscreen splash = new AppThinkerSplashscreen();
|
||||
//Récupération des paramètres du logiciel
|
||||
|
||||
@@ -133,7 +133,7 @@ public class AppThinkerMenuBar extends JMenuBar {
|
||||
|
||||
public void addCompositionMenu(Composition composition){
|
||||
//Cette partie du menu est dynamique en fonction du type de composition affichée
|
||||
if(composition.getType() == Composition.UML_DIAGRAM){
|
||||
if(composition.getType().equals(Composition.UML_DIAGRAM)){
|
||||
_compositionMenu = new JMenu("Composition");
|
||||
UmlToolbar apptt = (UmlToolbar) composition.getToolbar();
|
||||
JMenuItem selectElement = new JMenuItem("Select");
|
||||
@@ -221,7 +221,7 @@ public class AppThinkerMenuBar extends JMenuBar {
|
||||
});
|
||||
_compositionMenu.add(inheritanceRelation);
|
||||
|
||||
this.add(_compositionMenu);
|
||||
this.add(_compositionMenu, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class AppThinkerSplashscreen extends JFrame {
|
||||
g2.drawString("Make your ideas come true", 285, 280);
|
||||
g2.setFont(new Font("Arial", Font.BOLD, 10));
|
||||
g2.drawString("We're getting things ready...", 5, 295);
|
||||
g2.drawString("V.BOULANGER (c) 2020 - Version 1.0.0-dev4", 305, 295);
|
||||
g2.drawString(AppThinker.developer + " © 2020 - Version " + AppThinker.version, 305, 295);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ public class AppThinkerWindow extends JFrame {
|
||||
this.setIconImage(img);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
this.setLocationRelativeTo(null);
|
||||
this._project = null;
|
||||
|
||||
this.setLayout(new BorderLayout());
|
||||
|
||||
@@ -55,11 +56,6 @@ public class AppThinkerWindow extends JFrame {
|
||||
|
||||
this.add(tabbedPane, BorderLayout.CENTER);*/
|
||||
|
||||
_contentPanel = new JPanel();
|
||||
_contentPanel.setLayout(new BorderLayout());
|
||||
|
||||
this.add(_contentPanel, BorderLayout.CENTER);
|
||||
|
||||
//Ajout de la statusbar à la fenêtre
|
||||
_statusbar = new AppThinkerStatusbar();
|
||||
this.add(_statusbar, BorderLayout.SOUTH);
|
||||
@@ -71,6 +67,8 @@ public class AppThinkerWindow extends JFrame {
|
||||
* Crée un nouveau Projet.
|
||||
*/
|
||||
public void newProject(){
|
||||
//Si un projet est ouvert, on le ferme d'abord
|
||||
if(_project != null) closeProject();
|
||||
_project = new Project();
|
||||
this.displayComposition(_project.getComposition());
|
||||
this._statusbar.setStatusMessage("The project has been created.");
|
||||
@@ -101,6 +99,8 @@ public class AppThinkerWindow extends JFrame {
|
||||
try {
|
||||
if (ois != null) {
|
||||
ois.close();
|
||||
//Si un projet est ouvert, on le ferme d'abord
|
||||
if(_project != null) closeProject();
|
||||
_project = project;
|
||||
this.displayComposition(_project.getComposition());
|
||||
this._statusbar.setStatusMessage("The project has been opened.");
|
||||
@@ -147,6 +147,9 @@ public class AppThinkerWindow extends JFrame {
|
||||
* @param composition La composition à afficher.
|
||||
*/
|
||||
public void displayComposition(Composition composition){
|
||||
_contentPanel = new JPanel();
|
||||
_contentPanel.setLayout(new BorderLayout());
|
||||
|
||||
_composition = composition;
|
||||
composition.setWindow(this);
|
||||
|
||||
@@ -160,6 +163,8 @@ public class AppThinkerWindow extends JFrame {
|
||||
_composition.setBackground(new Color(218, 233, 244));
|
||||
_contentPanel.add(compositionPane, BorderLayout.CENTER);
|
||||
|
||||
this.add(_contentPanel, BorderLayout.CENTER);
|
||||
|
||||
//Modification de la barre de statut
|
||||
_statusbar.setFileMessage(composition.getProject().getName());
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Composition extends JPanel implements MouseListener, MouseMotionLis
|
||||
}
|
||||
|
||||
/**
|
||||
* Paramètre la fenêtre enfant de la composition.
|
||||
* Paramètre la fenêtre parent de la composition.
|
||||
* @param window La fenêtre qui affiche la composition.
|
||||
*/
|
||||
public void setWindow(AppThinkerWindow window){
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.lang.Math;
|
||||
@@ -7,7 +8,7 @@ import java.lang.Math;
|
||||
/**
|
||||
* Cette classe permet d'afficher les éléments UML du projet.
|
||||
*/
|
||||
public class UmlDiagram extends Composition {
|
||||
public class UmlDiagram extends Composition implements Serializable {
|
||||
|
||||
private UmlToolbar _umlToolbar;
|
||||
private Object _selected;
|
||||
|
||||
Reference in New Issue
Block a user