diff --git a/.classpath b/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..e193839730fbbed44b37f9212d87cc2a54fa1252 --- /dev/null +++ b/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000000000000000000000000000000000000..d585975859333b422b1e5f1b4f461fcff7b4902f --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + tp-j-desktop-pane-alassane + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000000000000000000000000000000000..654c1750cd616af1513cfe582c11d97cad5788d5 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..cb635b1c2a6bee7b1279cac6db56bd9ee2f6c271 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..14b697b7bbb0d85e8d8ee19141a2a92d9ce211be --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/README.md b/README.md index 5094ba607e1311c5c798c8cdec36b41fc37f5a1d..bc5ae76819f073b6f731672568be46b18d9a8e4e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# Tp8IHM - +Internationalisation et Externalisation des ressources \ No newline at end of file diff --git a/default.xml b/default.xml new file mode 100644 index 0000000000000000000000000000000000000000..6be3a73500ca41e3ab7c14ef7b87fa9d53c3c39b --- /dev/null +++ b/default.xml @@ -0,0 +1,16 @@ + + + +on +on +on +on +on +auto +on +on +auto +auto +on +auto + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..632557749ecfd34cec37ec23f4f5325c65e335c6 --- /dev/null +++ b/pom.xml @@ -0,0 +1,44 @@ + + 4.0.0 + + edu.mermet + tp8ihm + 1.0-SNAPSHOT + jar + + tp8ihm + http://maven.apache.org + + + UTF-8 + 1.8 + 1.8 + + + + + junit + junit + 4.12 + test + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + edu.mermet.tp8.Application + + + + + + + diff --git a/src/image/question_icon.png b/src/image/question_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d6d1fef3ab5f8dd377369889c3ac0b6e6a81eae3 Binary files /dev/null and b/src/image/question_icon.png differ diff --git a/src/main/java/edu/mermet/tp8/Application.java b/src/main/java/edu/mermet/tp8/Application.java new file mode 100644 index 0000000000000000000000000000000000000000..70571831e92303ae66e8f4b0caa6d981b6efa8dd --- /dev/null +++ b/src/main/java/edu/mermet/tp8/Application.java @@ -0,0 +1,377 @@ +package edu.mermet.tp8; + + +import java.awt.event.KeyEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Locale; +import java.util.Properties; + +import javax.swing.Action; +import javax.swing.ButtonGroup; +import javax.swing.JDesktopPane; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JRadioButtonMenuItem; +import javax.swing.SwingUtilities; + +import edu.mermet.tp8.actions.ActionAfficherBoutons; +import edu.mermet.tp8.actions.ActionAfficherCommentFaire; +import edu.mermet.tp8.actions.ActionAfficherConfig; +import edu.mermet.tp8.actions.ActionAfficherConversion; +import edu.mermet.tp8.actions.ActionAfficherDiaporama; +import edu.mermet.tp8.actions.ActionAfficherTexte; +import edu.mermet.tp8.actions.ActionQuitter; +import edu.mermet.tp8.fenetres.AbstractFenetreInterne; +import edu.mermet.tp8.fenetres.FenetreBoutons; +import edu.mermet.tp8.fenetres.FenetreConversion; +import edu.mermet.tp8.fenetres.FenetreDiaporama; +import edu.mermet.tp8.fenetres.FenetreSuggestion; +import edu.mermet.tp8.fenetres.FenetreTexte; + +/** + * + * @author brunomermet + */ +public class Application extends JFrame { + AbstractFenetreInterne conversion; + AbstractFenetreInterne texte; + AbstractFenetreInterne diaporama; + AbstractFenetreInterne boutons; + private Action actionQuitter; + private Action actionAfficherConversion; + private Action actionAfficherTexte; + private Action actionAfficherDiaporama; + private Action actionAfficherBoutons; + private Action actionAfficherCommentFaire; + private Action actionAfficherConfig; + + + private JMenu menuFichier; + private JMenu menuApplications; + private JMenu menuAides; + + static JMenuItem itemConversion, itemTexte, itemDiaporama, itemBoutons; + + public Application(String utilisateur) { + super("multi-fenêtres"); + this.setContentPane(new JDesktopPane()); + + Application.ajouterUtilisateur(utilisateur); + // ****** Barre de menu ****** + JMenuBar barre = new JMenuBar(); + // ------ menu Fichier ------ + menuFichier = new JMenu("Fichier"); + menuFichier.setMnemonic(KeyEvent.VK_F); + actionQuitter = new ActionQuitter(this); + JMenuItem quitter = new JMenuItem(actionQuitter); + menuFichier.add(quitter); + barre.add(menuFichier); + this.setJMenuBar(barre); + // ------ menu Applications ------ + menuApplications = new JMenu("Applications"); + menuApplications.setMnemonic(KeyEvent.VK_A); + actionAfficherConversion = new ActionAfficherConversion(this); + itemConversion = new JMenuItem(actionAfficherConversion); + menuApplications.add(itemConversion); + actionAfficherTexte = new ActionAfficherTexte(this); + itemTexte = new JMenuItem(actionAfficherTexte); + menuApplications.add(itemTexte); + actionAfficherDiaporama = new ActionAfficherDiaporama(this); + itemDiaporama = new JMenuItem(actionAfficherDiaporama); + menuApplications.add(itemDiaporama); + actionAfficherBoutons = new ActionAfficherBoutons(this); + itemBoutons = new JMenuItem(actionAfficherBoutons); + menuApplications.add(itemBoutons); + barre.add(menuApplications); + + // ------ menu Aide ------ + menuAides = new JMenu("Aide"); + menuAides.setMnemonic(KeyEvent.VK_M); + actionAfficherCommentFaire = new ActionAfficherCommentFaire(this); + JMenuItem itemCommentFaire = new JMenuItem(actionAfficherCommentFaire); + menuAides.add(itemCommentFaire); + actionAfficherConfig = new ActionAfficherConfig(this,actionAfficherConfig,utilisateur); + JMenuItem itemConfig = new JMenuItem(actionAfficherConfig); + menuAides.add(itemConfig); + barre.add(menuAides); + // ****** Fin barre de menu ****** + + + // ****** Création des fenêtres ****** + // ------ fenêtre conversion ------ + conversion = new FenetreConversion(this, actionAfficherConversion); + this.add(conversion); + // ------ fenêtre texte ------ + texte = new FenetreTexte(this, actionAfficherTexte); + this.add(texte); + // ------ fenêtre diaporama ------ + diaporama = new FenetreDiaporama(this, actionAfficherDiaporama); + this.add(diaporama); + // ------ fenêtre boutons ------ + boutons = new FenetreBoutons(this,actionAfficherBoutons); + this.add(boutons); + + // ****** Fin création fenêtres ****** + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setSize(600,300); + this.setLocationRelativeTo(null); + + Application.popSuggestion(utilisateur); + setVisible(true); + + + + + + + + } + + public Action getActionAfficherCommentFaire() { + return actionAfficherCommentFaire; + } + + public Action getActionAfficherConfig() { + return actionAfficherConfig; + } + + public void enableConversion(boolean b) { + actionAfficherConversion.setEnabled(b); + } + + public void enableTexte(boolean b) { + actionAfficherTexte.setEnabled(b); + } + + public void enableDiaporama(boolean b) { + actionAfficherDiaporama.setEnabled(b); + } + + public void enableBoutons(boolean b) { + actionAfficherBoutons.setEnabled(b); + } + + public Action getActionAfficherConversion() { + return actionAfficherConversion; + } + + public Action getActionAfficherTexte() { + return actionAfficherTexte; + } + + public Action getActionAfficherDiaporama() { + return actionAfficherDiaporama; + } + + public void afficherBoutons() { + boutons.setVisible(true); + } + public void afficherConversion() { + conversion.setVisible(true); + } + public void afficherDiaporama() { + diaporama.setVisible(true); + } + public void afficherTexte() { + texte.setVisible(true); + } + + /** + * Ajoute un utilisateur s'il n'existe pas déjà, et initialise ses options de + * configuration par défaut. + * + * @param utilisateur + */ + public static void ajouterUtilisateur(String utilisateur) { + + File f = new File(utilisateur + ".xml"); + if (!f.exists()) { + OutputStream os = null; + Properties prop = new Properties(); + prop.setProperty("conversion", "auto"); + prop.setProperty("saisie", "auto"); + prop.setProperty("diaporama", "auto"); + prop.setProperty("boutons", "auto"); + + prop.setProperty("key_conversion", "on"); + prop.setProperty("key_saisie", "on"); + prop.setProperty("key_diaporama", "on"); + prop.setProperty("key_boutons", "on"); + + prop.setProperty("info_conversion", "on"); + prop.setProperty("info_saisie", "on"); + prop.setProperty("info_diaporama", "on"); + prop.setProperty("info_boutons", "on"); + try { + os = new FileOutputStream(utilisateur + ".xml"); + prop.storeToXML(os, null); + os.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + /** + * Lit l'option de configuration passée en paramètre appartenant à l'utilisateur + * passé en paramètre également. + * + * @param utilisateur + * @param donnee + */ + public static String lireConfig(String utilisateur, String donnee) { + + try { + Properties prop = new Properties(); + prop.loadFromXML(new FileInputStream(utilisateur + ".xml")); + return prop.getProperty(donnee); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * Modifie l'option de configuration passée en paramètre appartenant à + * l'utilisateur passé en paramètre également. + * + * @param utilisateur + * @param donnee + * @param valeur + */ + public static void modifierConfig(String utilisateur, String donnee, String valeur) { + + try { + + Properties oldProp = new Properties(); + oldProp.loadFromXML(new FileInputStream(utilisateur + ".xml")); + + Properties prop = new Properties(); + + prop.setProperty("conversion", oldProp.getProperty("conversion")); + prop.setProperty("saisie", oldProp.getProperty("saisie")); + prop.setProperty("diaporama", oldProp.getProperty("diaporama")); + prop.setProperty("boutons", oldProp.getProperty("boutons")); + + prop.setProperty("key_conversion", oldProp.getProperty("key_conversion")); + prop.setProperty("key_saisie", oldProp.getProperty("key_saisie")); + prop.setProperty("key_diaporama", oldProp.getProperty("key_diaporama")); + prop.setProperty("key_boutons", oldProp.getProperty("key_boutons")); + + prop.setProperty("info_conversion", oldProp.getProperty("info_conversion")); + prop.setProperty("info_saisie", oldProp.getProperty("info_saisie")); + prop.setProperty("info_diaporama", oldProp.getProperty("info_diaporama")); + prop.setProperty("info_boutons", oldProp.getProperty("info_boutons")); + + switch(oldProp.getProperty("conversion")){ + case "auto" : itemConversion.setEnabled(true); break; + case "on" : itemConversion.setEnabled(true); break; + case "off" : itemConversion.setEnabled(false); break; + } + + switch(oldProp.getProperty("saisie")){ + case "auto" : itemTexte.setEnabled(true); break; + case "on" : itemTexte.setEnabled(true); break; + case "off" : itemTexte.setEnabled(false); break; + } + + switch(oldProp.getProperty("diaporama")){ + case "auto" : itemDiaporama.setEnabled(true); break; + case "on" : itemDiaporama.setEnabled(true); break; + case "off" : itemDiaporama.setEnabled(false); break; + } + + switch(oldProp.getProperty("boutons")){ + case "auto" : itemBoutons.setEnabled(true); break; + case "on" : itemBoutons.setEnabled(true); break; + case "off" : itemBoutons.setEnabled(false); break; + } + + prop.setProperty(donnee, valeur); + + OutputStream os = new FileOutputStream(utilisateur + ".xml"); + prop.storeToXML(os, null); + os.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * Lit l'option de configuration passée en paramètre appartenant à l'utilisateur + * passé en paramètre également. + * + * @param utilisateur + * @param donnee + */ + public static void popSuggestion(String utilisateur) { + + try { + ArrayList alSuggestion = new ArrayList(); + Properties prop = new Properties(); + prop.loadFromXML(new FileInputStream(utilisateur + ".xml")); + if (prop.getProperty("key_conversion").equals("on")) + alSuggestion.add("key_conversion"); + if (prop.getProperty("key_saisie").equals("on")) + alSuggestion.add("key_saisie"); + if (prop.getProperty("key_diaporama").equals("on")) + alSuggestion.add("key_diaporama"); + if (prop.getProperty("key_boutons").equals("on")) + alSuggestion.add("key_boutons"); + if (prop.getProperty("info_conversion").equals("on")) + alSuggestion.add("info_conversion"); + if (prop.getProperty("info_saisie").equals("on")) + alSuggestion.add("info_saisie"); + if (prop.getProperty("info_diaporama").equals("on")) + alSuggestion.add("info_diaporama"); + if (prop.getProperty("info_boutons").equals("on")) + alSuggestion.add("info_boutons"); + + int rand = (int) (Math.random() * alSuggestion.size()); + new FenetreSuggestion(alSuggestion.get(rand), utilisateur); + + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + + public void enableCommentFaire(boolean b) { + actionAfficherCommentFaire.setEnabled(b); + } + + public void enableConfig(boolean b) { + actionAfficherConfig.setEnabled(b); + } + + + + + + public static void main(String[] args) { +// SwingUtilities.invokeLater(Application::new); + if (args.length == 1) + new Application(args[0]); + else + new Application("default"); + } + +} diff --git a/src/main/java/edu/mermet/tp8/Ressource.java b/src/main/java/edu/mermet/tp8/Ressource.java new file mode 100644 index 0000000000000000000000000000000000000000..5e4184428d314f6b1f99139cd238e2a7ddbfcfa0 --- /dev/null +++ b/src/main/java/edu/mermet/tp8/Ressource.java @@ -0,0 +1,36 @@ +package edu.mermet.tp8; + +public enum Ressource { + TITRE("titre"), + ACTION_QUITTER("actionQuitter"), + ACTION_DIAPORAMA("actionDiaporama"), + ACTION_BOUTONS("actionBoutons"), + ACTION_TEXTE("actionTexte"), + ACTION_CONVERSION("actionConversion"), + MENU_FICHIER("menuFichier"), + MENU_APPLICATIONS("menuApplications"), + MENU_LANGUES("menuLangues"), + LANGUE_DEFAUT("langueDefaut"), + LANGUE_FRANCAIS("langueFrancais"), + LANGUE_ANGLAIS("langueAnglais"), + FEN_TEXTE_TITRE("fenTexteTitre"), + FEN_TEXTE_GRAS("fenTexteGras"), + FEN_TEXTE_ROUGE("fenTexteRouge"), + FEN_TEXTE_STYLE("fenTexteStyle"), + FEN_BOUTONS_TITRE("fenBoutonsTitre"), + FEN_CONV_TITRE("fenConvTitre"), + FEN_CONV_ERR_FORMAT("fenConvErrFormat"), + FEN_CONV_CONVERTIR("fenConvConvertir"), + FEN_DIAPO_TITRE("fenDiapoTitre"); + + + + private String nom; + Ressource(String leNom) { + nom = leNom; + } + + public String getNom() { + return nom; + } +} diff --git a/src/main/java/edu/mermet/tp8/actions/ActionAfficherBoutons.java b/src/main/java/edu/mermet/tp8/actions/ActionAfficherBoutons.java new file mode 100644 index 0000000000000000000000000000000000000000..ce9ad4e709165ebc51d13277e13ab772518fac93 --- /dev/null +++ b/src/main/java/edu/mermet/tp8/actions/ActionAfficherBoutons.java @@ -0,0 +1,33 @@ +package edu.mermet.tp8.actions; + +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.KeyStroke; + +import edu.mermet.tp8.Application; + +public class ActionAfficherBoutons extends AbstractAction { + /** + * + */ + private final Application application; + + public ActionAfficherBoutons(Application application) { + super("Boutons"); + this.application = application; + putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.CTRL_DOWN_MASK)); + putValue(Action.MNEMONIC_KEY,KeyEvent.VK_B); + } + + @Override + public void actionPerformed(ActionEvent ae) { + application.afficherBoutons(); + } + +} diff --git a/src/main/java/edu/mermet/tp8/actions/ActionAfficherCommentFaire.java b/src/main/java/edu/mermet/tp8/actions/ActionAfficherCommentFaire.java new file mode 100644 index 0000000000000000000000000000000000000000..5f4449f420ac807599ee4c7d71bb33b372583179 --- /dev/null +++ b/src/main/java/edu/mermet/tp8/actions/ActionAfficherCommentFaire.java @@ -0,0 +1,37 @@ +package edu.mermet.tp8.actions; + +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.beans.PropertyChangeListener; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.KeyStroke; + +import org.w3c.dom.views.AbstractView; + +import edu.mermet.tp8.Application; +import edu.mermet.tp8.dialogue.DialogueHowTo; + +public class ActionAfficherCommentFaire extends AbstractAction { + Application app; + DialogueHowTo dht; + + + public ActionAfficherCommentFaire(Application application) { + super("Comment faire ?"); + app = application; + putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_DOWN_MASK)); + putValue(Action.MNEMONIC_KEY, KeyEvent.VK_U); + } + + @Override + public void actionPerformed(ActionEvent ae) { + dht = new DialogueHowTo(app); +// commentFaire.setVisible(true); + app.enableCommentFaire(false); + } + + +} diff --git a/src/main/java/edu/mermet/tp8/actions/ActionAfficherConfig.java b/src/main/java/edu/mermet/tp8/actions/ActionAfficherConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..ffcf50677d61bd5b6dd6e1c3ee4909f0ea5a6ecf --- /dev/null +++ b/src/main/java/edu/mermet/tp8/actions/ActionAfficherConfig.java @@ -0,0 +1,36 @@ +package edu.mermet.tp8.actions; + +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.beans.PropertyChangeListener; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.KeyStroke; + +import edu.mermet.tp8.Application; +import edu.mermet.tp8.dialogue.DialogueConfig; + +public class ActionAfficherConfig extends AbstractAction { + Application app; + DialogueConfig dc; + String user; + Action afconf; + public ActionAfficherConfig(Application application,Action af,String utilisateur) { + super("Configurer les menus"); + app = application; + user = utilisateur; + afconf = af; + putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.CTRL_DOWN_MASK)); + putValue(Action.MNEMONIC_KEY,KeyEvent.VK_G); + } + + @Override + public void actionPerformed(ActionEvent ae) { + dc = new DialogueConfig(app,afconf,user); + app.enableConfig(false); +// commentFaire.setVisible(true); +// enableCommentFaire(false); + } +} diff --git a/src/main/java/edu/mermet/tp8/actions/ActionAfficherConversion.java b/src/main/java/edu/mermet/tp8/actions/ActionAfficherConversion.java new file mode 100644 index 0000000000000000000000000000000000000000..3251936e12a00b8beb59f5ebb8a7e778f3972170 --- /dev/null +++ b/src/main/java/edu/mermet/tp8/actions/ActionAfficherConversion.java @@ -0,0 +1,30 @@ +package edu.mermet.tp8.actions; + +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.KeyStroke; + +import edu.mermet.tp8.Application; + +public class ActionAfficherConversion extends AbstractAction { + /** + * + */ + private final Application application; + + public ActionAfficherConversion(Application application) { + super("Conversion"); + this.application = application; + putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_DOWN_MASK)); + putValue(Action.MNEMONIC_KEY,KeyEvent.VK_C); + } + + @Override + public void actionPerformed(ActionEvent ae) { + application.afficherConversion(); + } +} diff --git a/src/main/java/edu/mermet/tp8/actions/ActionAfficherDiaporama.java b/src/main/java/edu/mermet/tp8/actions/ActionAfficherDiaporama.java new file mode 100644 index 0000000000000000000000000000000000000000..2f829b1480b29cb9ac5ca4bd1a17e6936cac1fb4 --- /dev/null +++ b/src/main/java/edu/mermet/tp8/actions/ActionAfficherDiaporama.java @@ -0,0 +1,30 @@ +package edu.mermet.tp8.actions; + +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.KeyStroke; + +import edu.mermet.tp8.Application; + +public class ActionAfficherDiaporama extends AbstractAction { + /** + * + */ + private final Application application; + + public ActionAfficherDiaporama(Application application) { + super("Diaporama"); + this.application = application; + putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_DOWN_MASK)); + putValue(Action.MNEMONIC_KEY,KeyEvent.VK_D); + } + + @Override + public void actionPerformed(ActionEvent ae) { + application.afficherDiaporama(); + } +} diff --git a/src/main/java/edu/mermet/tp8/actions/ActionAfficherTexte.java b/src/main/java/edu/mermet/tp8/actions/ActionAfficherTexte.java new file mode 100644 index 0000000000000000000000000000000000000000..44d9698da445671424fe75d62b214edf2531f1fe --- /dev/null +++ b/src/main/java/edu/mermet/tp8/actions/ActionAfficherTexte.java @@ -0,0 +1,30 @@ +package edu.mermet.tp8.actions; + +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.KeyStroke; + +import edu.mermet.tp8.Application; + +public class ActionAfficherTexte extends AbstractAction { + /** + * + */ + private final Application application; + + public ActionAfficherTexte(Application application) { + super("Saisie de texte"); + this.application = application; + putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK)); + putValue(Action.MNEMONIC_KEY,KeyEvent.VK_T); + } + + @Override + public void actionPerformed(ActionEvent ae) { + application.afficherTexte(); + } +} diff --git a/src/main/java/edu/mermet/tp8/actions/ActionQuitter.java b/src/main/java/edu/mermet/tp8/actions/ActionQuitter.java new file mode 100644 index 0000000000000000000000000000000000000000..de13493641d12db00c227af532bae5653d551128 --- /dev/null +++ b/src/main/java/edu/mermet/tp8/actions/ActionQuitter.java @@ -0,0 +1,30 @@ +package edu.mermet.tp8.actions; + +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.KeyStroke; + +import edu.mermet.tp8.Application; + +public class ActionQuitter extends AbstractAction { + /** + * + */ + private final Application application; + + public ActionQuitter(Application application) { + super("Quitter"); + this.application = application; + putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_Q, InputEvent.CTRL_DOWN_MASK)); + putValue(Action.MNEMONIC_KEY,KeyEvent.VK_Q); + } + + @Override + public void actionPerformed(ActionEvent ae) { + System.exit(0); + } +} diff --git a/src/main/java/edu/mermet/tp8/dialogue/DialogueConfig.java b/src/main/java/edu/mermet/tp8/dialogue/DialogueConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..bdd923008196ca7fe59a9f0cda5bf8004e77909f --- /dev/null +++ b/src/main/java/edu/mermet/tp8/dialogue/DialogueConfig.java @@ -0,0 +1,208 @@ +package edu.mermet.tp8.dialogue; + +import java.awt.BorderLayout; +import java.awt.Container; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.io.IOException; + +import javax.swing.Action; +import javax.swing.BoxLayout; +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JEditorPane; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.SwingConstants; + +import edu.mermet.tp8.Application; + +public class DialogueConfig extends JDialog { + + private static final long serialVersionUID = 1L; + private static final int LARGEUR = 300; + private static final int HAUTEUR = 400; + + private JPanel panelLabel, panelConfig, panelButtons; + + private JLabel labelConv; + private JLabel labelSaisie; + private JLabel labelDiapo; + private JLabel labelButton; + + private ButtonGroup groupConv; + private JRadioButton autoConv, afficheConv, cacheConv; + + private ButtonGroup groupSaisie; + private JRadioButton autoSaisie, afficheSaisie, cacheSaisie; + + private ButtonGroup groupDiapo; + private JRadioButton autoDiapo, afficheDiapo, cacheDiapo; + + private ButtonGroup groupButton; + private JRadioButton autoButton, afficheButton, cacheButton; + + private JButton valider, annuler; + + + private String option_conversion; + private String option_saisie; + private String option_diaporama; + private String option_boutons; + private String utilisateur; + + public DialogueConfig(Application appli,Action a,String user) { + super(appli, "Configurer les menus?"); + init(a,user); + setSize(LARGEUR, HAUTEUR); +// pack(); + setDefaultCloseOperation(DISPOSE_ON_CLOSE); + setVisible(true); + } + + + public void init(Action a, String utilisateur) { + this.utilisateur = utilisateur; + + this.option_conversion = Application.lireConfig(utilisateur, "conversion"); + this.option_saisie = Application.lireConfig(utilisateur, "saisie"); + this.option_diaporama = Application.lireConfig(utilisateur, "diaporama"); + this.option_boutons = Application.lireConfig(utilisateur, "boutons"); + + this.panelLabel = new JPanel(new GridLayout(4, 1)); + this.panelConfig = new JPanel(new GridLayout(4, 3)); + this.panelButtons = new JPanel(new FlowLayout()); + + this.labelConv = new JLabel("Conversion Celsius/Farenheit"); + this.labelConv.setHorizontalAlignment(SwingConstants.TRAILING); + this.groupConv = new ButtonGroup(); + this.autoConv = new JRadioButton("Auto", option_conversion.equals("auto")); + this.afficheConv = new JRadioButton("Affiché", option_conversion.equals("on")); + this.cacheConv = new JRadioButton("Caché", option_conversion.equals("off")); + this.groupConv.add(this.autoConv); + this.groupConv.add(this.afficheConv); + this.groupConv.add(this.cacheConv); + + this.labelSaisie = new JLabel("Saisie de texte"); + this.labelSaisie.setHorizontalAlignment(SwingConstants.TRAILING); + this.groupSaisie = new ButtonGroup(); + this.autoSaisie = new JRadioButton("Auto", option_saisie.equals("auto")); + this.afficheSaisie = new JRadioButton("Affiché", option_saisie.equals("on")); + this.cacheSaisie = new JRadioButton("Caché", option_saisie.equals("off")); + this.groupSaisie.add(this.autoSaisie); + this.groupSaisie.add(this.afficheSaisie); + this.groupSaisie.add(this.cacheSaisie); + + this.labelDiapo = new JLabel("Diaporama"); + this.labelDiapo.setHorizontalAlignment(SwingConstants.TRAILING); + this.groupDiapo = new ButtonGroup(); + this.autoDiapo = new JRadioButton("Auto", option_diaporama.equals("auto")); + this.afficheDiapo = new JRadioButton("Affiché", option_diaporama.equals("on")); + this.cacheDiapo = new JRadioButton("Caché", option_diaporama.equals("off")); + this.groupDiapo.add(this.autoDiapo); + this.groupDiapo.add(this.afficheDiapo); + this.groupDiapo.add(this.cacheDiapo); + + this.labelButton = new JLabel("Boutons"); + this.labelButton.setHorizontalAlignment(SwingConstants.TRAILING); + this.groupButton = new ButtonGroup(); + this.autoButton = new JRadioButton("Auto", option_boutons.equals("auto")); + this.afficheButton = new JRadioButton("Affiché", option_boutons.equals("on")); + this.cacheButton = new JRadioButton("Caché", option_boutons.equals("off")); + this.groupButton.add(this.autoButton); + this.groupButton.add(this.afficheButton); + this.groupButton.add(this.cacheButton); + + this.panelLabel.add(this.labelConv); + this.panelConfig.add(this.autoConv); + this.panelConfig.add(this.afficheConv); + this.panelConfig.add(this.cacheConv); + + this.panelLabel.add(this.labelSaisie); + this.panelConfig.add(this.autoSaisie); + this.panelConfig.add(this.afficheSaisie); + this.panelConfig.add(this.cacheSaisie); + + this.panelLabel.add(this.labelDiapo); + this.panelConfig.add(this.autoDiapo); + this.panelConfig.add(this.afficheDiapo); + this.panelConfig.add(this.cacheDiapo); + + this.panelLabel.add(this.labelButton); + this.panelConfig.add(this.autoButton); + this.panelConfig.add(this.afficheButton); + this.panelConfig.add(this.cacheButton); + + this.valider = new JButton("Valider"); + this.valider.addActionListener(event -> { + if (autoConv.isSelected()) + Application.modifierConfig(utilisateur, "conversion", "auto"); + if (afficheConv.isSelected()) + Application.modifierConfig(utilisateur, "conversion", "on"); + if (cacheConv.isSelected()) + Application.modifierConfig(utilisateur, "conversion", "off"); + if (autoSaisie.isSelected()) + Application.modifierConfig(utilisateur, "saisie", "auto"); + if (afficheSaisie.isSelected()) + Application.modifierConfig(utilisateur, "saisie", "on"); + if (cacheSaisie.isSelected()) + Application.modifierConfig(utilisateur, "saisie", "off"); + if (autoDiapo.isSelected()) + Application.modifierConfig(utilisateur, "diaporama", "auto"); + if (afficheDiapo.isSelected()) + Application.modifierConfig(utilisateur, "diaporama", "on"); + if (cacheDiapo.isSelected()) + Application.modifierConfig(utilisateur, "diaporama", "off"); + if (autoButton.isSelected()) + Application.modifierConfig(utilisateur, "boutons", "auto"); + if (afficheButton.isSelected()) + Application.modifierConfig(utilisateur, "boutons", "on"); + if (cacheButton.isSelected()) + Application.modifierConfig(utilisateur, "boutons", "off"); + + option_conversion = Application.lireConfig(utilisateur, "conversion"); + option_saisie = Application.lireConfig(utilisateur, "saisie"); + option_diaporama = Application.lireConfig(utilisateur, "diaporama"); + option_boutons = Application.lireConfig(utilisateur, "boutons"); + }); + this.annuler = new JButton("Annuler"); + this.annuler.addActionListener(event -> { + if (option_conversion.equals("auto")) + autoConv.setSelected(true); + if (option_conversion.equals("on")) + afficheConv.setSelected(true); + if (option_conversion.equals("off")) + cacheConv.setSelected(true); + if (option_saisie.equals("auto")) + autoSaisie.setSelected(true); + if (option_saisie.equals("on")) + afficheSaisie.setSelected(true); + if (option_saisie.equals("off")) + cacheSaisie.setSelected(true); + if (option_diaporama.equals("auto")) + autoDiapo.setSelected(true); + if (option_diaporama.equals("on")) + afficheDiapo.setSelected(true); + if (option_diaporama.equals("off")) + cacheDiapo.setSelected(true); + if (option_boutons.equals("auto")) + autoButton.setSelected(true); + if (option_boutons.equals("on")) + afficheButton.setSelected(true); + if (option_boutons.equals("off")) + cacheButton.setSelected(true); + }); + this.panelButtons.add(this.valider); + this.panelButtons.add(this.annuler); + + this.add(this.panelLabel); + this.add(this.panelConfig, BorderLayout.EAST); + this.add(this.panelButtons, BorderLayout.SOUTH); + + pack(); + } + +} diff --git a/src/main/java/edu/mermet/tp8/dialogue/DialogueHowTo.java b/src/main/java/edu/mermet/tp8/dialogue/DialogueHowTo.java new file mode 100644 index 0000000000000000000000000000000000000000..3b2764be87acae3a93942f3372f02fc5963b5a2f --- /dev/null +++ b/src/main/java/edu/mermet/tp8/dialogue/DialogueHowTo.java @@ -0,0 +1,105 @@ +package edu.mermet.tp8.dialogue; + +import java.awt.BorderLayout; +import java.awt.Container; +import java.io.IOException; +import java.util.ArrayList; + +import javax.swing.Action; +import javax.swing.BoxLayout; +import javax.swing.DefaultListModel; +import javax.swing.JDialog; +import javax.swing.JEditorPane; +import javax.swing.JList; +import javax.swing.JScrollPane; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; + +import edu.mermet.tp8.Application; + +public class DialogueHowTo extends JDialog { + private static final long serialVersionUID = 1L; + private static final int LARGEUR = 500; + private static final int HAUTEUR = 400; + + private JEditorPane zoneTxt; + private JList liste; + private ArrayList alInstructions; + private DefaultListModel listModel; + + public DialogueHowTo(Application appli) { + super(appli, "Comment Faire ?",false); + init(); + setSize(LARGEUR, HAUTEUR); +// pack(); + setDefaultCloseOperation(DISPOSE_ON_CLOSE); + setVisible(true); + } + + + public void init() { + + BorderLayout layout = new BorderLayout(); + layout.setHgap(10); + this.setLayout(layout); + + this.listModel = new DefaultListModel(); + this.alInstructions = new ArrayList(); + this.listModel.addElement("Conversion Celsius → Farenheit"); + this.alInstructions.add("Pour convertir une température du Celsius au Farenheit," + + " sélectionnez l'item Conversion Celsius/Farenheit" + + " dans le menu Applications." + + "

Entrez ensuite une valeur dans le champs Celsius," + + " et appuyez sur la touche ENTER du clavier" + + " ou sur le bouton Convertir."); + this.listModel.addElement("Conversion Farenheit → Celsius"); + this.alInstructions.add("Pour convertir une température du Farenheit au Celsius," + + " sélectionnez l'item Conversion Celsius/Farenheit" + + " dans le menu Applications." + + "

Entrez ensuite une valeur dans le champs Farenheit," + + " et appuyez sur la touche ENTER du clavier" + + " ou sur le bouton Convertir."); + this.listModel.addElement("Mettre du texte en gras"); + this.alInstructions.add("Pour mettre du texte en gras," + + " sélectionnez l'item Saisie de texte" + + " dans le menu Applications." + + "

Entrez ensuite le texte désiré dans la zone de texte " + + " qui vous est présentée." + + " Au choix, vous pouvez cliquer sur la case gras," + + " ou bien cliquer sur l'item correspondant dans le menu Style."); + this.listModel.addElement("Changer la couleur du texte"); + this.alInstructions.add("Pour changer la couleur du texte," + + " sélectionnez l'item Saisie de texte" + + " dans le menu Applications." + + "

Entrez ensuite le texte désiré dans la zone de texte " + + " qui vous est présentée." + + " Au choix, vous pouvez cliquer sur la case rouge," + + " ou bien cliquer sur l'item correspondant dans le menu Style."); + + this.liste = new JList(); + + liste.setModel(this.listModel); + liste.addListSelectionListener(new ListSelectionListener() { + public void valueChanged(ListSelectionEvent evt) { + jList1ValueChanged(evt); + } + }); + + this.zoneTxt = new JEditorPane("text/html", this.alInstructions.get(0)); + this.zoneTxt.setEditable(false); + + this.liste.setSelectedIndex(0); + + this.add(this.liste, BorderLayout.WEST); + this.add(this.zoneTxt, BorderLayout.CENTER); + + this.setSize(500, 200); + } + + private void jList1ValueChanged(ListSelectionEvent evt) { + if (this.liste.getSelectedIndex() < this.alInstructions.size()) { + this.zoneTxt.setText(this.alInstructions.get(this.liste.getSelectedIndex())); + } + } + +} diff --git a/src/main/java/edu/mermet/tp8/fenetres/AbstractFenetreInterne.java b/src/main/java/edu/mermet/tp8/fenetres/AbstractFenetreInterne.java new file mode 100644 index 0000000000000000000000000000000000000000..e62bf3a6530a164887305ae6a46c2438120a4edb --- /dev/null +++ b/src/main/java/edu/mermet/tp8/fenetres/AbstractFenetreInterne.java @@ -0,0 +1,33 @@ +package edu.mermet.tp8.fenetres; + +import javax.swing.Action; +import javax.swing.JInternalFrame; +import javax.swing.event.InternalFrameAdapter; +import javax.swing.event.InternalFrameEvent; + +import edu.mermet.tp8.Application; + +/** + * + * @author brunomermet + */ +public abstract class AbstractFenetreInterne extends JInternalFrame { + private Action action; + public AbstractFenetreInterne(Application appli, Action monAction, String nom) { + super(nom, true,true,true,true); + action = monAction; + this.setDefaultCloseOperation(HIDE_ON_CLOSE); + this.addInternalFrameListener(new EcouteurFenetre()); + } + + private class EcouteurFenetre extends InternalFrameAdapter { + @Override + public void internalFrameClosing(InternalFrameEvent ife) { + action.setEnabled(true); + } + @Override + public void internalFrameActivated(InternalFrameEvent ife) { + action.setEnabled(false); + } + } +} diff --git a/src/main/java/edu/mermet/tp8/fenetres/FenetreBoutons.java b/src/main/java/edu/mermet/tp8/fenetres/FenetreBoutons.java new file mode 100644 index 0000000000000000000000000000000000000000..20a75f46a7d0d7352dffac4fe2b58298724730df --- /dev/null +++ b/src/main/java/edu/mermet/tp8/fenetres/FenetreBoutons.java @@ -0,0 +1,32 @@ +package edu.mermet.tp8.fenetres; + +import java.awt.FlowLayout; + +import javax.swing.Action; +import javax.swing.JButton; + +import edu.mermet.tp8.Application; + +/** + * + * @author brunomermet + */ +public class FenetreBoutons extends AbstractFenetreInterne { + private JButton boutonTexte; + private JButton boutonDiaporama; + private JButton boutonDegres; + + public FenetreBoutons(Application appli, Action action) { + super(appli, action, "Boutons"); + setTitle("Boutons"); + setLayout(new FlowLayout()); + boutonTexte = new JButton(appli.getActionAfficherTexte()); + boutonDiaporama = new JButton(appli.getActionAfficherDiaporama()); + boutonDegres = new JButton(appli.getActionAfficherConversion()); + add(boutonDegres); + add(boutonTexte); + add(boutonDiaporama); + pack(); + } + +} diff --git a/src/main/java/edu/mermet/tp8/fenetres/FenetreConversion.java b/src/main/java/edu/mermet/tp8/fenetres/FenetreConversion.java new file mode 100644 index 0000000000000000000000000000000000000000..0b44ebc740cf9f175b62b0db665cf5c1f6d5e0c2 --- /dev/null +++ b/src/main/java/edu/mermet/tp8/fenetres/FenetreConversion.java @@ -0,0 +1,155 @@ +package edu.mermet.tp8.fenetres; + +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.Image; +import java.awt.event.ActionEvent; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; +import edu.mermet.tp8.Application; + +/** + * + * @author brunomermet + */ +public class FenetreConversion extends AbstractFenetreInterne { + /** + * + */ + private static final long serialVersionUID = 1L; + private JTextField champCelsius; + private JTextField champFarenheit; + private JButton boutonConvertir; + private Action actionConvertir; + private boolean celsiusAFocus; + + private JButton aideCelsius; + private JButton aideFarenheit; + + public FenetreConversion(Application appli, Action action) { + super(appli, action, "Conversion celsius/Farenheit"); + this.setSize(new Dimension(100, 50)); + this.setLayout(new GridLayout(3, 1)); + + // Création de l'icône + java.net.URL imgURL = getClass().getResource("question_icon.png"); + Image image = new ImageIcon(imgURL).getImage().getScaledInstance(15, 15, java.awt.Image.SCALE_SMOOTH); + ImageIcon icon = new ImageIcon(image); + + ////// Ligne Celsius + JPanel ligneCelsius = new JPanel(); + ligneCelsius.setLayout(new FlowLayout(FlowLayout.TRAILING)); + JLabel labCelsius = new JLabel("Celsius :"); + champCelsius = new JTextField(15); + champCelsius.addFocusListener(new EcouteurFocus(true)); + champCelsius.setToolTipText("Valeur en degré Celsius"); + labCelsius.setLabelFor(champCelsius); + + aideCelsius = new JButton(); // Bouton "?" (Celsius) + aideCelsius.setIcon(icon); + aideCelsius.setPreferredSize(new Dimension(20, 20)); + aideCelsius.addActionListener(event -> JOptionPane.showMessageDialog(this, "Valeur en degré Celsius", "Aide", + JOptionPane.INFORMATION_MESSAGE)); + + ligneCelsius.add(labCelsius); + ligneCelsius.add(champCelsius); + ligneCelsius.add(aideCelsius); + this.add(ligneCelsius); + celsiusAFocus = true; + + ////// Ligne Farenheit + JPanel ligneFarenheit = new JPanel(); + ligneFarenheit.setLayout(new FlowLayout(FlowLayout.TRAILING)); + JLabel labFarenheit = new JLabel("Farenheit :"); + champFarenheit = new JTextField(15); + champFarenheit.addFocusListener(new EcouteurFocus(false)); + champFarenheit.setToolTipText("Valeur en degré Farenheit"); + labFarenheit.setLabelFor(champFarenheit); + + aideFarenheit = new JButton(); // Bouton "?" (Farenheit) + aideFarenheit.setIcon(icon); + aideFarenheit.setPreferredSize(new Dimension(20, 20)); + aideFarenheit.addActionListener(event -> JOptionPane.showMessageDialog(this, "Valeur en degré Farenheit", + "Aide", JOptionPane.INFORMATION_MESSAGE)); + + ligneFarenheit.add(labFarenheit); + ligneFarenheit.add(champFarenheit); + ligneFarenheit.add(aideFarenheit); + this.add(ligneFarenheit); + + JPanel ligneValider = new JPanel(); + ligneValider.setLayout(new FlowLayout(FlowLayout.CENTER)); + actionConvertir = new ActionConvertir(); + boutonConvertir = new JButton(actionConvertir); + ligneValider.add(boutonConvertir); + this.add(ligneValider); + + pack(); + getRootPane().setDefaultButton(boutonConvertir); + } + + private class EcouteurFocus implements FocusListener { + private boolean aStocker; + + public EcouteurFocus(boolean b) { + aStocker = b; + } + + @Override + public void focusGained(FocusEvent fe) { + celsiusAFocus = aStocker; + } + + @Override + public void focusLost(FocusEvent fe) { + return; + } + } + + private class ActionConvertir extends AbstractAction { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ActionConvertir() { + super("Convertir"); + } + + @Override + public void actionPerformed(ActionEvent ae) { + double tempCelsius = 0; + double tempFarenheit = 0; + if (celsiusAFocus) { + try { + tempCelsius = Double.parseDouble(champCelsius.getText()); + tempFarenheit = 9. / 5 * tempCelsius + 32; + champFarenheit.setText("" + tempFarenheit); + } catch (NumberFormatException nfe) { + champFarenheit.setText("Format incorrect"); + } + } else { + try { + tempFarenheit = Double.parseDouble(champFarenheit.getText()); + tempCelsius = (tempFarenheit - 32) * 5. / 9; + champCelsius.setText("" + tempCelsius); + } catch (NumberFormatException nfe) { + champCelsius.setText("Format incorrect"); + } + + } + } + } + +} diff --git a/src/main/java/edu/mermet/tp8/fenetres/FenetreDiaporama.java b/src/main/java/edu/mermet/tp8/fenetres/FenetreDiaporama.java new file mode 100644 index 0000000000000000000000000000000000000000..9ebc198093890cde314791f63299b3824b4e7a40 --- /dev/null +++ b/src/main/java/edu/mermet/tp8/fenetres/FenetreDiaporama.java @@ -0,0 +1,87 @@ +package edu.mermet.tp8.fenetres; + +import java.awt.BorderLayout; +import java.awt.Image; +import java.net.MalformedURLException; +import java.net.URL; + +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; + +import edu.mermet.tp8.Application; + +/** + * + * @author brunomermet + */ +public class FenetreDiaporama extends AbstractFenetreInterne { + ImageIcon [] images; + String[] textes; + JLabel affichage; + Defilement defilement; + private int indiceCourant = 0; + public FenetreDiaporama(Application appli, Action action) { + super(appli, action,"Diaporama"); + setTitle("Diaporama"); + images = new ImageIcon[3]; + try { + images[0] = new ImageIcon(new ImageIcon(new URL("http://bruno.mermet.pagesperso-orange.fr/Personnel/Anes/Randos/TourDeLaHague/10bocage.jpg")).getImage().getScaledInstance(300, -1, Image.SCALE_DEFAULT)); + images[1] = new ImageIcon(new ImageIcon(new URL("http://bruno.mermet.pagesperso-orange.fr/Personnel/Anes/Randos/TourDeLaHague/12baieEcalgrain.jpg")).getImage().getScaledInstance(300, -1, Image.SCALE_DEFAULT)); + images[2] = new ImageIcon(new ImageIcon(new URL("http://bruno.mermet.pagesperso-orange.fr/Personnel/Anes/Randos/TourDeLaHague/15cote.jpg")).getImage().getScaledInstance(300, -1, Image.SCALE_DEFAULT)); + } catch (MalformedURLException ex) { + images[0] = null; + images[1] = null; + images[2] = null; + } + + JPanel panneauTexte = new JPanel(); + affichage = new JLabel(); + panneauTexte.add(affichage); + affichage.setIcon(images[0]); + JScrollPane ascenseurs = new JScrollPane(affichage); + add(ascenseurs,BorderLayout.CENTER); + setSize(300,300); + + } + class Defilement implements Runnable { + private boolean arrete; + public Defilement() { + arrete = false; + } + @Override + public void run() { + while (!arrete) { + try { + Thread.sleep(2000); + } + catch (InterruptedException iex) { + } + indiceCourant++; + indiceCourant = indiceCourant % 3; + affichage.setIcon(images[indiceCourant]); + } + } + public void arreter() { + arrete = true; + } + } + + @Override + public void setVisible(boolean b) { + super.setVisible(b); + if (b) { + defilement = new Defilement(); + Thread thread = new Thread(defilement); + thread.start(); + } + else { + if (defilement != null) { + defilement.arreter(); + } + } + } + +} diff --git a/src/main/java/edu/mermet/tp8/fenetres/FenetreSuggestion.java b/src/main/java/edu/mermet/tp8/fenetres/FenetreSuggestion.java new file mode 100644 index 0000000000000000000000000000000000000000..e254417d674604ff74d2d0e06935e1c264161c3c --- /dev/null +++ b/src/main/java/edu/mermet/tp8/fenetres/FenetreSuggestion.java @@ -0,0 +1,75 @@ +package edu.mermet.tp8.fenetres; + +import java.awt.BorderLayout; + +import javax.swing.JButton; +import javax.swing.JEditorPane; +import javax.swing.JFrame; +import javax.swing.JPanel; + +import edu.mermet.tp8.Application; + +public class FenetreSuggestion extends JFrame { + + /** + * + */ + private static final long serialVersionUID = 1L; + private JEditorPane zoneTxt; + private JButton fermer; + private JButton arreter; + + public FenetreSuggestion(String txt, String utilisateur) { + super("Suggestion du jour"); + this.setUndecorated(true); + + String suggestion = "Texte par défaut"; + switch (txt) { + case "key_conversion": + suggestion = "Appuyez sur CTRL + C pour ouvrir la fenêtre de conversion."; + break; + case "key_saisie": + suggestion = "Appuyez sur CTRL + T pour ouvrir la fenêtre de saisie de texte."; + break; + case "key_diaporama": + suggestion = "Appuyez sur CTRL + D pour ouvrir la fenêtre diaporama."; + break; + case "key_boutons": + suggestion = "Appuyez sur CTRL + B pour ouvrir la fenêtre des boutons."; + break; + case "info_conversion": + suggestion = "L'option 'Conversion Celsius/Farenheit' permet de convertir des degrés de températures d'une unité de mesure à une autre."; + break; + case "info_saisie": + suggestion = "L'option 'Saisie de texte' permet d'écrire et de modifier la forme d'un texte."; + break; + case "info_diaporama": + suggestion = "L'option 'Diaporama' permet d'afficher un diaporama du Cotentin."; + break; + case "info_boutons": + suggestion = "L'option 'Boutons' permet d'ouvrir toutes les autres fenêtres plus facilement."; + break; + } + this.zoneTxt = new JEditorPane("text/html", suggestion); + this.zoneTxt.setEditable(false); + + this.fermer = new JButton("Fermer"); + this.fermer.addActionListener(event -> this.dispose()); + this.arreter = new JButton("Ne plus afficher"); + this.arreter.addActionListener(event -> { + Application.modifierConfig(utilisateur, txt, "off"); + this.dispose(); + }); + + JPanel panelSud = new JPanel(); + panelSud.add(this.fermer); + panelSud.add(this.arreter); + + this.add(this.zoneTxt, BorderLayout.CENTER); + this.add(panelSud, BorderLayout.SOUTH); + pack(); + this.setLocationRelativeTo(null); + this.setVisible(true); + } + +} diff --git a/src/main/java/edu/mermet/tp8/fenetres/FenetreTexte.java b/src/main/java/edu/mermet/tp8/fenetres/FenetreTexte.java new file mode 100644 index 0000000000000000000000000000000000000000..cb967173218cc5846d2caef257eae0b8b0484ab5 --- /dev/null +++ b/src/main/java/edu/mermet/tp8/fenetres/FenetreTexte.java @@ -0,0 +1,111 @@ +package edu.mermet.tp8.fenetres; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.JCheckBox; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.KeyStroke; + +import edu.mermet.tp8.Application; + +/** + * + * @author brunomermet + */ +public class FenetreTexte extends AbstractFenetreInterne { + private JCheckBox gras; + private JCheckBox rouge; + private Action actionGras; + private Action actionRouge; + private JTextArea texte; + private JMenu style; + public FenetreTexte(Application appli, Action action) { + super(appli, action, "Texte"); + setTitle("Texte"); + actionGras = new ActionGras(); + gras = new JCheckBox(actionGras); + actionRouge = new ActionRouge(); + rouge = new JCheckBox(actionRouge); + JPanel panneauBouton = new JPanel(); + panneauBouton.add(gras); + panneauBouton.add(rouge); + add(panneauBouton,BorderLayout.NORTH); + texte = new JTextArea(6,20); + texte.setLineWrap(true); + texte.setWrapStyleWord(true); + JScrollPane panneauTexte = new JScrollPane(texte); + add(panneauTexte,BorderLayout.CENTER); + JMenuBar barre = new JMenuBar(); + style = new JMenu("Style"); + JMenuItem itemGras = new JCheckBoxMenuItem(actionGras); + style.add(itemGras); + JMenuItem itemRouge = new JCheckBoxMenuItem(actionRouge); + style.add(itemRouge); + barre.add(style); + this.setJMenuBar(barre); + pack(); + } + + + + private class ActionGras extends AbstractAction { + private boolean gras; + public ActionGras() { + super("Gras"); + gras = false; + putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.CTRL_DOWN_MASK)); + putValue(Action.SELECTED_KEY,false); + } + + @Override + public void actionPerformed(ActionEvent ae) { + Font police = texte.getFont(); + if (!gras) { + police = police.deriveFont(Font.BOLD);//|Font.ITALIC); + //police = police.deriveFont((float)24.0); + } + else { + police = police.deriveFont(Font.PLAIN); + } + gras = !gras; + putValue(Action.SELECTED_KEY,gras); + texte.setFont(police); + } + } + + private class ActionRouge extends AbstractAction { + private boolean rouge; + public ActionRouge() { + super("Rouge"); + rouge = false; + putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_DOWN_MASK)); + putValue(Action.SELECTED_KEY,false); + + } + + @Override + public void actionPerformed(ActionEvent ae) { + if (!rouge) { + texte.setForeground(Color.RED); + } + else { + texte.setForeground(Color.BLACK); + } + rouge = !rouge; + } + } + +} diff --git a/src/main/java/edu/mermet/tp8/fenetres/question_icon.png b/src/main/java/edu/mermet/tp8/fenetres/question_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d6d1fef3ab5f8dd377369889c3ac0b6e6a81eae3 Binary files /dev/null and b/src/main/java/edu/mermet/tp8/fenetres/question_icon.png differ diff --git a/target/classes/edu/mermet/tp8/Application.class b/target/classes/edu/mermet/tp8/Application.class new file mode 100644 index 0000000000000000000000000000000000000000..0c7631dc5258820bcebf0157e0b991f49085bc56 Binary files /dev/null and b/target/classes/edu/mermet/tp8/Application.class differ diff --git a/target/classes/edu/mermet/tp8/Ressource.class b/target/classes/edu/mermet/tp8/Ressource.class new file mode 100644 index 0000000000000000000000000000000000000000..4d997efd78341dc444ac0d55f6f35e7bb0d7d241 Binary files /dev/null and b/target/classes/edu/mermet/tp8/Ressource.class differ diff --git a/target/classes/edu/mermet/tp8/actions/ActionAfficherBoutons.class b/target/classes/edu/mermet/tp8/actions/ActionAfficherBoutons.class new file mode 100644 index 0000000000000000000000000000000000000000..32de9c3c10bdd79ef37a89514efe07455e608f9a Binary files /dev/null and b/target/classes/edu/mermet/tp8/actions/ActionAfficherBoutons.class differ diff --git a/target/classes/edu/mermet/tp8/actions/ActionAfficherCommentFaire.class b/target/classes/edu/mermet/tp8/actions/ActionAfficherCommentFaire.class new file mode 100644 index 0000000000000000000000000000000000000000..fd45b165cf93f1a516012d3dba0f000f0998e550 Binary files /dev/null and b/target/classes/edu/mermet/tp8/actions/ActionAfficherCommentFaire.class differ diff --git a/target/classes/edu/mermet/tp8/actions/ActionAfficherConfig.class b/target/classes/edu/mermet/tp8/actions/ActionAfficherConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..8485e01e996845ec3ca88e7849bf32a8cb1492b3 Binary files /dev/null and b/target/classes/edu/mermet/tp8/actions/ActionAfficherConfig.class differ diff --git a/target/classes/edu/mermet/tp8/actions/ActionAfficherConversion.class b/target/classes/edu/mermet/tp8/actions/ActionAfficherConversion.class new file mode 100644 index 0000000000000000000000000000000000000000..c900eea86857540f4855ddf3e20f97c62a117356 Binary files /dev/null and b/target/classes/edu/mermet/tp8/actions/ActionAfficherConversion.class differ diff --git a/target/classes/edu/mermet/tp8/actions/ActionAfficherDiaporama.class b/target/classes/edu/mermet/tp8/actions/ActionAfficherDiaporama.class new file mode 100644 index 0000000000000000000000000000000000000000..553be47f99c1ffc6736581914df29219ef320737 Binary files /dev/null and b/target/classes/edu/mermet/tp8/actions/ActionAfficherDiaporama.class differ diff --git a/target/classes/edu/mermet/tp8/actions/ActionAfficherTexte.class b/target/classes/edu/mermet/tp8/actions/ActionAfficherTexte.class new file mode 100644 index 0000000000000000000000000000000000000000..c9557e2bca19c05ffa59d0e41ed33124d9eb29fc Binary files /dev/null and b/target/classes/edu/mermet/tp8/actions/ActionAfficherTexte.class differ diff --git a/target/classes/edu/mermet/tp8/actions/ActionQuitter.class b/target/classes/edu/mermet/tp8/actions/ActionQuitter.class new file mode 100644 index 0000000000000000000000000000000000000000..838cb1368b3dc5a435841a655e7fd5e1c8a33f2a Binary files /dev/null and b/target/classes/edu/mermet/tp8/actions/ActionQuitter.class differ diff --git a/target/classes/edu/mermet/tp8/dialogue/DialogueConfig.class b/target/classes/edu/mermet/tp8/dialogue/DialogueConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..9ea4abca254774170edc6328aaa19f2f1619e825 Binary files /dev/null and b/target/classes/edu/mermet/tp8/dialogue/DialogueConfig.class differ diff --git a/target/classes/edu/mermet/tp8/dialogue/DialogueHowTo$1.class b/target/classes/edu/mermet/tp8/dialogue/DialogueHowTo$1.class new file mode 100644 index 0000000000000000000000000000000000000000..f710b94bf935e6d543abe493b37b15bbe7a6843b Binary files /dev/null and b/target/classes/edu/mermet/tp8/dialogue/DialogueHowTo$1.class differ diff --git a/target/classes/edu/mermet/tp8/dialogue/DialogueHowTo.class b/target/classes/edu/mermet/tp8/dialogue/DialogueHowTo.class new file mode 100644 index 0000000000000000000000000000000000000000..acb9de609044cdaaaa9d60ecdd3a867751ccf12c Binary files /dev/null and b/target/classes/edu/mermet/tp8/dialogue/DialogueHowTo.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/AbstractFenetreInterne$1.class b/target/classes/edu/mermet/tp8/fenetres/AbstractFenetreInterne$1.class new file mode 100644 index 0000000000000000000000000000000000000000..0f0fbcbd4a64e3b5becc9d0b45a804fb247624ea Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/AbstractFenetreInterne$1.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/AbstractFenetreInterne$EcouteurFenetre.class b/target/classes/edu/mermet/tp8/fenetres/AbstractFenetreInterne$EcouteurFenetre.class new file mode 100644 index 0000000000000000000000000000000000000000..099b8e17d0dee7bc575c721f60270cd13b6f7e5a Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/AbstractFenetreInterne$EcouteurFenetre.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/AbstractFenetreInterne.class b/target/classes/edu/mermet/tp8/fenetres/AbstractFenetreInterne.class new file mode 100644 index 0000000000000000000000000000000000000000..2333bc382704a52a0a6533c1c230f376a61390c8 Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/AbstractFenetreInterne.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/FenetreBoutons.class b/target/classes/edu/mermet/tp8/fenetres/FenetreBoutons.class new file mode 100644 index 0000000000000000000000000000000000000000..9faa467acff88f6fc40d0c844cb0563ef4035b53 Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/FenetreBoutons.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/FenetreConversion$ActionConvertir.class b/target/classes/edu/mermet/tp8/fenetres/FenetreConversion$ActionConvertir.class new file mode 100644 index 0000000000000000000000000000000000000000..77645c3cc074c09c2c1532c3cb992efd7d622824 Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/FenetreConversion$ActionConvertir.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/FenetreConversion$EcouteurFocus.class b/target/classes/edu/mermet/tp8/fenetres/FenetreConversion$EcouteurFocus.class new file mode 100644 index 0000000000000000000000000000000000000000..5435ccb218d9e3e8d9e4a14d0ec7dc5dc0d93c77 Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/FenetreConversion$EcouteurFocus.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/FenetreConversion.class b/target/classes/edu/mermet/tp8/fenetres/FenetreConversion.class new file mode 100644 index 0000000000000000000000000000000000000000..e3369e7a76ba06c171f93738b68346c901470c42 Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/FenetreConversion.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/FenetreDiaporama$Defilement.class b/target/classes/edu/mermet/tp8/fenetres/FenetreDiaporama$Defilement.class new file mode 100644 index 0000000000000000000000000000000000000000..577efce59b1b94416a5a47857c4e489c333210ce Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/FenetreDiaporama$Defilement.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/FenetreDiaporama.class b/target/classes/edu/mermet/tp8/fenetres/FenetreDiaporama.class new file mode 100644 index 0000000000000000000000000000000000000000..98863c95fa6b17f4ffb5aa7cc9ce4e58a4d6eafc Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/FenetreDiaporama.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/FenetreSuggestion.class b/target/classes/edu/mermet/tp8/fenetres/FenetreSuggestion.class new file mode 100644 index 0000000000000000000000000000000000000000..25c9e4346cfc4e850bed3240f1f0d10221e279aa Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/FenetreSuggestion.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/FenetreTexte$ActionGras.class b/target/classes/edu/mermet/tp8/fenetres/FenetreTexte$ActionGras.class new file mode 100644 index 0000000000000000000000000000000000000000..e4bfc3776de6e0e4772ac29b38e16962b8305b9d Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/FenetreTexte$ActionGras.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/FenetreTexte$ActionRouge.class b/target/classes/edu/mermet/tp8/fenetres/FenetreTexte$ActionRouge.class new file mode 100644 index 0000000000000000000000000000000000000000..dbf6c3d0f7e365e7f45315a273fd8490b234e55c Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/FenetreTexte$ActionRouge.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/FenetreTexte.class b/target/classes/edu/mermet/tp8/fenetres/FenetreTexte.class new file mode 100644 index 0000000000000000000000000000000000000000..b19253e021c30e567046e961b2273fee9909836b Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/FenetreTexte.class differ diff --git a/target/classes/edu/mermet/tp8/fenetres/question_icon.png b/target/classes/edu/mermet/tp8/fenetres/question_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d6d1fef3ab5f8dd377369889c3ac0b6e6a81eae3 Binary files /dev/null and b/target/classes/edu/mermet/tp8/fenetres/question_icon.png differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000000000000000000000000000000000000..6d987117304b5b7aca113407ac71ed4b4ed80d95 --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Mar 11 09:55:46 CET 2022 +groupId=edu.mermet +artifactId=tp8ihm +version=1.0-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000000000000000000000000000000000000..32bf6f9cdb2a9a0afae95220714e508ba5249f3f --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +edu/mermet/tp8/fenetres/AbstractFenetreInterne$1.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000000000000000000000000000000000000..451d22455275586858d0da5b27e74e88a5af9316 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,17 @@ +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/actions/ActionAfficherConfig.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/Ressource.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/actions/ActionQuitter.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/actions/ActionAfficherDiaporama.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/fenetres/FenetreConversion.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/actions/ActionAfficherBoutons.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/fenetres/FenetreBoutons.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/fenetres/FenetreTexte.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/actions/ActionAfficherCommentFaire.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/fenetres/AbstractFenetreInterne.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/dialogue/DialogueConfig.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/Application.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/actions/ActionAfficherConversion.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/dialogue/DialogueHowTo.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/actions/ActionAfficherTexte.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/fenetres/FenetreSuggestion.java +/home/etudiant/ga213971/Bureau/IHM/Code/tp-j-desktop-pane-alassane/src/main/java/edu/mermet/tp8/fenetres/FenetreDiaporama.java diff --git a/target/tp8ihm-1.0-SNAPSHOT.jar b/target/tp8ihm-1.0-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..d5898403e3a392d15ff8bf38740ea11bdc8ed705 Binary files /dev/null and b/target/tp8ihm-1.0-SNAPSHOT.jar differ