X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooMenu.java;h=64e63009dea8bb3b50fe41205307b4cff51c556e;hb=9f707c235c36921753665933a6b959bfa1027fff;hp=cac3be4fc1189fb4034de8699e922c88e8a02621;hpb=4e7d6f8b7dd7fbcef2282674b5442d78cf220489;p=moosique.git diff --git a/MooMenu.java b/MooMenu.java index cac3be4..64e6300 100644 --- a/MooMenu.java +++ b/MooMenu.java @@ -1,25 +1,98 @@ import javax.swing.*; -/* - * - * - * @author Andersson, Andreen, Lanneskog, Pehrson - * @version 1 - */ - -public class MooMenu { - - /* - * Creates the menus. - */ - public MooMenu () { - +public class MooMenu extends JMenuBar +{ + // empty contructor that anropar the createMooMenu in the mainmethod + public MooMenu() + { + + add(createFileMenu()); + add(createEditMenu()); + add(createSequenceMenu()); + add(createTrackMenu()); + add(createNoteMenu()); + add(createHelpMenu()); } - /* - * - */ - public void () { + // creates the filemenu + private JMenu createFileMenu() + { + JMenu file = new JMenu("File"); + + JMenuItem neww = new JMenuItem("New"); + file.add(neww); + JMenuItem open = new JMenuItem("Open"); + file.add(open); + JMenuItem saveas = new JMenuItem("Save as..."); + file.add(saveas); + JMenuItem save = new JMenuItem("Save"); + file.add(save); + JMenuItem exporttomidi = new JMenuItem("Export to MIDI..."); + file.add(exporttomidi); + JMenuItem exit = new JMenuItem("Exit"); + file.add(exit); + return file; + } + // creates the editmenu + private JMenu createEditMenu() + { + JMenu edit = new JMenu("Edit"); + + JMenuItem copy = new JMenuItem("Copy"); + edit.add(copy); + JMenuItem cut = new JMenuItem("Cut"); + edit.add(cut); + JMenuItem paste = new JMenuItem("Paste"); + edit.add(paste); + JMenuItem selectall = new JMenuItem("Select All"); + edit.add(selectall); + JMenuItem invertselection = new JMenuItem("Invert selection"); + edit.add(invertselection); + return edit; + } + + //creates the sequencemenu + private JMenu createSequenceMenu() + { + + JMenu sequence = new JMenu("Sequence"); + return sequence; + } + + // creates the trackmenu + private JMenu createTrackMenu() + { + JMenu track = new JMenu("Track"); + + JMenuItem play = new JMenuItem("Play"); + track.add(play); + JMenuItem newtrack = new JMenuItem("New track..."); + track.add(newtrack); + + return track; + } + + // creates the notemenu + private JMenu createNoteMenu() + { + JMenu note = new JMenu("Note"); + return note; } + + // creates the aboutmenu + private JMenu createHelpMenu() + { + JMenu help = new JMenu("Help"); + + JMenuItem contents = new JMenuItem("Contents"); + help.add(contents); + JMenuItem gettingstarted = new JMenuItem("Getting started"); + help.add(gettingstarted); + JMenuItem about = new JMenuItem("About"); + help.add(about); + + return help; + } + }