Sauvegarde 110320211843

This commit is contained in:
2021-03-11 18:44:34 +01:00
parent ba3db7a2e1
commit 5e373abe65
7 changed files with 23 additions and 20 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,2 +0,0 @@
#Sat Dec 19 19:42:31 CET 2020
isFirstLaunch=false

View File

@@ -1,3 +1,4 @@
import javax.swing.*;
import java.io.*; import java.io.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -10,13 +11,13 @@ import java.util.Properties;
public class AppThinker { public class AppThinker {
//JavaDoc tags : @param @return @throws @author @version @see @since @serial @deprecated //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 String dateVersion = "27/12/2020";
public static List<String> changelog; public static List<String> changelog;
public static String developer = "V. BOULANGER"; public static String developer = "V. BOULANGER";
public static Properties appProperties = new Properties(); public static Properties appProperties = new Properties();
private static AppThinkerWindow _window; private static AppThinkerWindow _window;
private static AppThinkerSplashscreen _splash;
/** /**
* La méthode principale exécutée. * La méthode principale exécutée.
@@ -26,19 +27,13 @@ public class AppThinker {
public static void main(String[] args) throws InterruptedException { public static void main(String[] args) throws InterruptedException {
//Création de la liste des modifications de la version actuelle //Création de la liste des modifications de la version actuelle
changelog = new ArrayList<String>(); changelog = new ArrayList<String>();
changelog.add("#30 Fenêtre A propos et fenêtre de changelog"); changelog.add("#37 Manage user preferences");
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.");
AppThinkerSplashscreen splash = new AppThinkerSplashscreen(); _splash = new AppThinkerSplashscreen();
//Récupération des paramètres du logiciel //Récupération des paramètres du logiciel
loadConfiguration(); loadConfiguration();
Thread.sleep(3000); Thread.sleep(3000);
splash.dispose(); _splash.dispose();
_window = new AppThinkerWindow(); _window = new AppThinkerWindow();
//Si le logiciel s'ouvre pour la 1ère fois, on affiche la fenêtre de changelog //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 //Chargement des préférences du logiciel
appProperties.load(input); appProperties.load(input);
} catch (final IOException ex) { } 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 { } finally {
if (input != null) { if (input != null) {
try { try {
input.close(); input.close();
} catch (final IOException e) { } 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"); output = new FileOutputStream("app.properties");
//Enregistrement des propriétés du logiciel //Enregistrement des propriétés du logiciel
appProperties.store(output, null); appProperties.store(output, null);
} catch (final IOException io) { } catch (final IOException io) {
io.printStackTrace(); //io.printStackTrace();
JOptionPane.showMessageDialog(null, "erreur de sauvegarde");
} finally { } finally {
if (output != null) { if (output != null) {
try { try {

View File

@@ -12,7 +12,7 @@ public class AppThinkerSplashscreen extends JFrame {
*/ */
public AppThinkerSplashscreen(){ public AppThinkerSplashscreen(){
this.setTitle("AppThinker - Starting"); this.setTitle("AppThinker - Starting");
this.setMinimumSize(new Dimension(533, 300)); this.setMinimumSize(new Dimension(600, 300));
Image img = null; Image img = null;
try { img = ImageIO.read(AppThinker.class.getResource("img/logoAppThinker.png")); } catch (Exception ex) { } try { img = ImageIO.read(AppThinker.class.getResource("img/logoAppThinker.png")); } catch (Exception ex) { }
this.setIconImage(img); this.setIconImage(img);
@@ -29,7 +29,7 @@ public class AppThinkerSplashscreen extends JFrame {
g2.setRenderingHints(rh); g2.setRenderingHints(rh);
Image img = null; Image img = null;
try { img = ImageIO.read(AppThinker.class.getResource("img/splashscreen.png")); } catch (Exception ex) { } 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*/ /*Informations du logiciel*/
g2.setColor(new Color(63, 169, 245)); g2.setColor(new Color(63, 169, 245));
g2.setFont(new Font("Arial", Font.BOLD, 40)); g2.setFont(new Font("Arial", Font.BOLD, 40));

View File

@@ -26,7 +26,8 @@ public class Composition extends JPanel implements MouseListener, MouseMotionLis
_project = project; _project = project;
this.addMouseListener(this); this.addMouseListener(this);
this.addMouseMotionListener(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"))));
} }
/** /**

View File

@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: AppThinker