]> ruin.nu Git - moosique.git/blobdiff - MooMenu.java
inte helt klar
[moosique.git] / MooMenu.java
index ab055a9a1959046e361f0f16b219b6596023070d..8d1caeaa11ec4a2e5a5b8413841401b0b60c5f7d 100644 (file)
@@ -110,15 +110,13 @@ public class MooMenu extends JMenuBar implements ActionListener {
        }
        
        /**
-       * creates a JFrame popupmenu, containing diffrent choices
-       * @param title  the title of the JFrame
-       * @param labelone       the first label of two
-       * @param labeltwo       the second label of two
-       * @return trackframe    the JFrame to popup....ffaaaaaaaaaaaaaaaan!
+       * creates a JDialog popupmenu, containing diffrent choices
+       * @param title          the title of the dialog
+       * @return trackframe    the JDialog....ffaaaaaaaaaaaaaaaan!
        */
-       
-               
-       
+       //private JDialog makeDialog(String title){
+       //      
+       //}
        /**
         * checks if the fileformat is compatible with our program
         * @param f     the file to check
@@ -196,41 +194,13 @@ public class MooMenu extends JMenuBar implements ActionListener {
                        
                } else if (command == "Add track...") {
                
-                       JFrame frame = new JFrame("Add track");
-                       JPanel panel = new JPanel();
-                       //panel.setPreferredSize(new Dimension(250,400));
-                       panel.setLayout(new GridLayout(2,2));
-                       frame.setContentPane(panel);
-                       
-                       JLabel top = new JLabel("Name of track", JLabel.CENTER);
-                       top.setFont(new Font("Times new Roman", Font.BOLD, 10));
-                       panel.add(top);
-                       
-                       JTextField field = new JTextField(5);
-                       panel.add(field);
-                      
-                       JLabel bottom = new JLabel("Add it after",JLabel.CENTER);
-                       bottom.setFont(new Font("Times new Roman", Font.BOLD, 10));
-                       panel.add(bottom);
-                       
-                       JComboBox tracklist = new JComboBox();
-                       panel.add(tracklist);
-                       
-                       
-                       frame.pack();
-                       frame.show();
+                       MooDialog what = new MooDialog(MooDialog.ADD_TRACK);
                        
                        Moosique.getSequence().createTrack();
                        
                } else if (command == "Delete track...") {
-                       
-                       JFrame frame = new JFrame("Delete track");
-                       JPanel panel = new JPanel();
-                       panel.setPreferredSize(new Dimension(250,400));
-                       frame.setContentPane(panel);
-                       
-                       frame.pack();
-                       frame.show();
+               
+                       MooDialog what = new MooDialog(MooDialog.DELETE_TRACK);
                        
                        /* Let the user select a track from a list.
                        seq = Moosique.getSequence();
@@ -238,25 +208,11 @@ public class MooMenu extends JMenuBar implements ActionListener {
                        */
                } else if (command == "Copy track...") {
                
-                       JFrame frame = new JFrame("Copy track");
-                       JPanel panel = new JPanel();
-                       panel.setPreferredSize(new Dimension(250,400));
-                       frame.setContentPane(panel);
+                       MooDialog what = new MooDialog(MooDialog.COPY_TRACK);
                        
-                       frame.pack();
-                       frame.show();
-               
                } else if (command == "Move track...") {
                
-                       JFrame frame = new JFrame("Move track");
-                       JPanel panel = new JPanel();
-                       panel.setPreferredSize(new Dimension(250,400));
-                       panel.setLayout(new GridLayout(2,2));
-                       frame.setContentPane(panel);
-                       
-                       frame.pack();
-                       frame.show();
-               
+                       MooDialog what = new MooDialog(MooDialog.MOVE_TRACK);
 
                } else if (command == "Insert measure...") {