Ajout de la barre menu

This commit is contained in:
2020-11-21 16:28:55 +01:00
parent 41c86e4ac5
commit f2e3925bea
20 changed files with 7904 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
import javax.swing.*;
public class AppThinker {
//JavaDoc tags : @param @return @throws @author @version @see @since @serial @deprecated

View File

@@ -0,0 +1,75 @@
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
public class AppThinkerMenuBar extends JMenuBar {
/**
* Constructeur de la classe AppThinkerMenuBar
* @author V.BOULANGER
*/
public AppThinkerMenuBar(){
//Création de la barre menu
JMenu fileMenu = new JMenu("Fichier");
fileMenu.setMnemonic( 'F' );
JMenuItem newProject = new JMenuItem("Nouveau projet");
newProject.setIcon(new ImageIcon(getClass().getResource("img/x16/newProject.png")));
fileMenu.add(newProject);
JMenuItem openProject = new JMenuItem("Ouvrir un projet existant");
openProject.setIcon(new ImageIcon(getClass().getResource("img/x16/openProject.png")));
fileMenu.add(openProject);
JMenuItem saveProject = new JMenuItem("Sauvegarder le projet");
saveProject.setIcon(new ImageIcon(getClass().getResource("img/x16/saveProject.png")));
fileMenu.add(saveProject);
JMenuItem saveAsProject = new JMenuItem("Sauvegarder le projet sous...");
saveAsProject.setIcon(new ImageIcon(getClass().getResource("img/x16/saveAsProject.png")));
fileMenu.add(saveAsProject);
JMenuItem quitMenu = new JMenuItem("Quitter");
quitMenu.setIcon(new ImageIcon(getClass().getResource("img/x16/quit.png")));
fileMenu.add(quitMenu);
this.add(fileMenu);
JMenu projectMenu = new JMenu("Projet");
projectMenu.setMnemonic( 'P' );
JMenuItem newClass = new JMenuItem("Nouvelle classe");
newClass.setIcon(new ImageIcon(getClass().getResource("img/x16/newClass.png")));
projectMenu.add(newClass);
JMenuItem newAssociation = new JMenuItem("Nouvelle association");
newAssociation.setIcon(new ImageIcon(getClass().getResource("img/x16/newAssociation.png")));
projectMenu.add(newAssociation);
JMenuItem newLink = new JMenuItem("Nouveau lien");
newLink.setIcon(new ImageIcon(getClass().getResource("img/x16/newLink.png")));
projectMenu.add(newLink);
JMenuItem editElement = new JMenuItem("Éditer");
editElement.setIcon(new ImageIcon(getClass().getResource("img/x16/edit.png")));
projectMenu.add(editElement);
JMenuItem deleteElement = new JMenuItem("Supprimer");
deleteElement.setIcon(new ImageIcon(getClass().getResource("img/x16/delete.png")));
projectMenu.add(deleteElement);
JMenuItem projectOptions = new JMenuItem("Options du projet");
projectOptions.setIcon(new ImageIcon(getClass().getResource("img/x16/settings.png")));
projectMenu.add(projectOptions);
this.add(projectMenu);
JMenu appMenu = new JMenu("AppThinker");
appMenu.setMnemonic( 'A' );
JMenuItem appSettings = new JMenuItem("Paramètres");
appSettings.setIcon(new ImageIcon(getClass().getResource("img/x16/settings.png")));
appMenu.add(appSettings);
JMenuItem appInfos = new JMenuItem("Informations");
appInfos.setIcon(new ImageIcon(getClass().getResource("img/x16/info.png")));
appMenu.add(appInfos);
JMenuItem appChangelog = new JMenuItem("Nouveautés");
appChangelog.setIcon(new ImageIcon(getClass().getResource("img/x16/news.png")));
appMenu.add(appChangelog);
this.add(appMenu);
}
}

View File

@@ -9,6 +9,7 @@ public class AppThinkerWindow extends JFrame {
* @author V.BOULANGER
*/
public AppThinkerWindow(){
//Paramétrage de la fenêtre
this.setTitle("AppThinker");
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
Image img = null;
@@ -18,6 +19,9 @@ public class AppThinkerWindow extends JFrame {
this.setLocation(0, 0);
this.setSize(500, 500);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
//Ajout du menu à la fenêtre
AppThinkerMenuBar menu = new AppThinkerMenuBar();
this.setJMenuBar(menu);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B