diff --git a/AppThinker.mdzip b/AppThinker.mdzip index 4565c98..99321dd 100644 Binary files a/AppThinker.mdzip and b/AppThinker.mdzip differ diff --git a/AppThinker.mdzip.bak b/AppThinker.mdzip.bak index dc0a922..ff33863 100644 Binary files a/AppThinker.mdzip.bak and b/AppThinker.mdzip.bak differ diff --git a/AppThinker/app.properties b/AppThinker/app.properties deleted file mode 100644 index 5a83524..0000000 --- a/AppThinker/app.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Sat Dec 19 19:42:31 CET 2020 -isFirstLaunch=false diff --git a/AppThinker/src/AppThinker.java b/AppThinker/src/AppThinker.java index 839e97a..2ef9dff 100644 --- a/AppThinker/src/AppThinker.java +++ b/AppThinker/src/AppThinker.java @@ -1,3 +1,4 @@ +import javax.swing.*; import java.io.*; import java.util.ArrayList; import java.util.List; @@ -10,13 +11,13 @@ import java.util.Properties; public class AppThinker { //JavaDoc tags : @param @return @throws @author @version @see @since @serial @deprecated - public static String version = "1.0.0-dev5"; + public static String version = "1.0.0-dev6"; public static String dateVersion = "27/12/2020"; public static List changelog; public static String developer = "V. BOULANGER"; public static Properties appProperties = new Properties(); - private static AppThinkerWindow _window; + private static AppThinkerSplashscreen _splash; /** * La méthode principale exécutée. @@ -26,19 +27,13 @@ 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(); - 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"); - changelog.add("#33 Bug d'ouverture/fermeture d'un projet résolu"); - changelog.add("#32 Bug déplacement d'une classe en dehors du diagramme résolu"); - changelog.add("#9 Modification des propriétés d'un lien."); + changelog.add("#37 Manage user preferences"); - AppThinkerSplashscreen splash = new AppThinkerSplashscreen(); + _splash = new AppThinkerSplashscreen(); //Récupération des paramètres du logiciel loadConfiguration(); Thread.sleep(3000); - splash.dispose(); + _splash.dispose(); _window = new AppThinkerWindow(); //Si le logiciel s'ouvre pour la 1ère fois, on affiche la fenêtre de changelog @@ -67,13 +62,19 @@ public class AppThinker { //Chargement des préférences du logiciel appProperties.load(input); } catch (final IOException ex) { - ex.printStackTrace(); + //Fichier de préférences utilisateur introuvable. Restauration des préférences par défaut. + /*storeConfiguration(); + appProperties.setProperty("isFirstLaunch", "true"); + appProperties.setProperty("compositionDefaultSizeX", "3000"); + appProperties.setProperty("compositionDefaultSizeY", "3000"); + storeConfiguration();*/ + JOptionPane.showMessageDialog(null, "User preferences file 'app.properties' not found. The default configuration has been restored.", "app.properties not found", JOptionPane.ERROR_MESSAGE); } finally { if (input != null) { try { input.close(); } catch (final IOException e) { - e.printStackTrace(); + JOptionPane.showMessageDialog(null, "Erreur not found", "app.properties not found", JOptionPane.ERROR_MESSAGE); } } } @@ -88,9 +89,9 @@ public class AppThinker { output = new FileOutputStream("app.properties"); //Enregistrement des propriétés du logiciel appProperties.store(output, null); - } catch (final IOException io) { - io.printStackTrace(); + //io.printStackTrace(); + JOptionPane.showMessageDialog(null, "erreur de sauvegarde"); } finally { if (output != null) { try { diff --git a/AppThinker/src/AppThinkerSplashscreen.java b/AppThinker/src/AppThinkerSplashscreen.java index a720fa7..fcf9231 100644 --- a/AppThinker/src/AppThinkerSplashscreen.java +++ b/AppThinker/src/AppThinkerSplashscreen.java @@ -12,7 +12,7 @@ public class AppThinkerSplashscreen extends JFrame { */ public AppThinkerSplashscreen(){ this.setTitle("AppThinker - Starting"); - this.setMinimumSize(new Dimension(533, 300)); + this.setMinimumSize(new Dimension(600, 300)); Image img = null; try { img = ImageIO.read(AppThinker.class.getResource("img/logoAppThinker.png")); } catch (Exception ex) { } this.setIconImage(img); @@ -29,7 +29,7 @@ public class AppThinkerSplashscreen extends JFrame { g2.setRenderingHints(rh); Image img = null; try { img = ImageIO.read(AppThinker.class.getResource("img/splashscreen.png")); } catch (Exception ex) { } - g2.drawImage(img, 0, 0, 533, 300, this); + g2.drawImage(img, 0, 0, 600, 300, this); /*Informations du logiciel*/ g2.setColor(new Color(63, 169, 245)); g2.setFont(new Font("Arial", Font.BOLD, 40)); diff --git a/AppThinker/src/Composition.java b/AppThinker/src/Composition.java index 86992c5..925409a 100644 --- a/AppThinker/src/Composition.java +++ b/AppThinker/src/Composition.java @@ -26,7 +26,8 @@ public class Composition extends JPanel implements MouseListener, MouseMotionLis _project = project; this.addMouseListener(this); this.addMouseMotionListener(this); - this.setPreferredSize(new Dimension(3000,3000)); + this.setPreferredSize(new Dimension(3000, 3000)); + //this.setPreferredSize(new Dimension(Integer.parseInt(AppThinker.appProperties.getProperty("compositionDefaultSizeX")), Integer.parseInt(AppThinker.appProperties.getProperty("compositionDefaultSizeY")))); } /** diff --git a/AppThinker/src/META-INF/MANIFEST.MF b/AppThinker/src/META-INF/MANIFEST.MF new file mode 100644 index 0000000..3b1da6b --- /dev/null +++ b/AppThinker/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: AppThinker +