From 83c3edf41adc9a5ae904331bc230fc1536fdeeb4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Lanneskog?= Date: Fri, 16 May 2003 16:16:39 +0000 Subject: [PATCH] *** empty log message *** --- MooDialog.java | 22 +++++++++++----------- MooMenu.java | 39 ++++++++++++++++++++++++++++++++++----- 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/MooDialog.java b/MooDialog.java index 4185d4c..8230578 100644 --- a/MooDialog.java +++ b/MooDialog.java @@ -4,7 +4,7 @@ import java.awt.event.*; import javax.sound.midi.*; import java.beans.*; -/* +/** * The GUI-class representing the popupdialogs in the Track menu. * * @author Björn Lanneskog @@ -22,7 +22,7 @@ public class MooDialog extends JDialog { MOVE_TRACK = 4, JUMP = 5; - /* + /** * Constructor of the dialogs. */ public MooDialog(int type) { @@ -66,8 +66,8 @@ public class MooDialog extends JDialog { } } - /* - * Builds the add track popupdialog + /** + * Builds the add track popupdialog. */ private void makeAddDialog(Container pane, Track[] tracks) { @@ -101,8 +101,8 @@ public class MooDialog extends JDialog { setVisible(true); } - /* - * Builds the delete track popupdialog + /** + * Builds the delete track popupdialog. */ private void makeDelDialog(Container pane, Track[] tracks) { @@ -130,8 +130,8 @@ public class MooDialog extends JDialog { setVisible(true); } - /* - * Builds the copy track popupdialog + /** + * Builds the copy track popupdialog. */ private void makeCopyDialog(Container pane, Track[] tracks) { @@ -166,7 +166,7 @@ public class MooDialog extends JDialog { setVisible(true); } - /* + /** * Builds the move track popupdialog */ private void makeMoveDialog(Container pane, Track[] tracks) { @@ -202,8 +202,8 @@ public class MooDialog extends JDialog { setVisible(true); } - /* - * Builds the jump popupdialog + /** + * Builds the jump popupdialog. */ private void makeJumpDialog(Container pane) { diff --git a/MooMenu.java b/MooMenu.java index 5d8dd36..f51af1a 100644 --- a/MooMenu.java +++ b/MooMenu.java @@ -71,13 +71,24 @@ public class MooMenu extends JMenuBar implements ActionListener { addItem(help, "Getting started"); addItem(help, "About"); } - + /** + * Creats a menu in the menubar. + * @param name The name of the menu. + * @param mnemnic The shortcut-key to access the menu. + * @return menu The menu created. + */ private JMenu createMenu(String name, int mnemonic) { JMenu menu = new JMenu(name); menu.setMnemonic(mnemonic); return menu; } + /** + * Creats a menuitem in the menu. + * @param menu The menu where to add the menuitem. + * @param name The name of the menuitem. + * @return item The menuitem created. + */ private JMenuItem addItem(JMenu menu, String name) { JMenuItem item = new JMenuItem(name); item.addActionListener(this); @@ -85,6 +96,13 @@ public class MooMenu extends JMenuBar implements ActionListener { return item; } + /** + * Creats a menuitem in the menu. + * @param menu The menu to where to add the menuitem. + * @param name The name of the menuitem. + * @param key The keystroke to access this menuitem. + * @return item The menuitem created. + */ private JMenuItem addItem(JMenu menu, String name, String key) { JMenuItem item = new JMenuItem(name); item.setAccelerator(KeyStroke.getKeyStroke(key)); @@ -93,6 +111,14 @@ public class MooMenu extends JMenuBar implements ActionListener { return item; } + /** + * Creats a menuitem in the menu. + * @param menu The menu to where to add the menuitem. + * @param name The name of the menuitem. + * @param key The keystroke to access this menuitem. + * @param mask The keyboard mask. + * @return item The menuitem created. + */ private JMenuItem addItem(JMenu menu, String name, int key, int mask) { JMenuItem item = new JMenuItem(name); item.setAccelerator(KeyStroke.getKeyStroke(key, mask)); @@ -108,7 +134,10 @@ public class MooMenu extends JMenuBar implements ActionListener { } return false; } - + /** + * Gets the users command of takes and properiate action + * @param e the action perfomed + */ public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); Sequence seq; @@ -204,15 +233,15 @@ public class MooMenu extends JMenuBar implements ActionListener { } else if (command == "Transpose...") { } else if (command == "Contents") { - // contents to be filled in + JOptionPane.showMessageDialog(this, "här kommer contents komma"); } else if (command == "Getting started") { - // getting started to be filled in + JOptionPane.showMessageDialog(null, "här kommer getting started komma"); } else if (command == "About") { - // about to be filled in + JOptionPane.showMessageDialog(null, "här kommer about att komma"); } } -- 2.39.2