]> ruin.nu Git - moosique.git/blobdiff - MooToolbar.java
varför vill det inte bli radbrytning???
[moosique.git] / MooToolbar.java
index 2415b3bbbbbd97af56e0807c2c59b53fb5865e3a..8ee350adf6fc8b8abacd0975f7c5a1865f23fa85 100644 (file)
@@ -1,7 +1,9 @@
 import javax.swing.*;
 import java.awt.event.*;
+import java.awt.*;
+import java.awt.Color;
 
-public class MooToolbar extends JToolBar       {
+public class MooToolbar extends JToolBar implements ActionListener     {
 
        public MooToolbar()     {
        
@@ -17,44 +19,54 @@ public class MooToolbar extends JToolBar    {
                fastforward = createButton("images/forward.gif", "fast forward");
                add(fastforward);
                
-               meas = createProgressIndikator("meas");
+               meas = createProjIndButton("Mrs: \n" + measures);
                add(meas);
+               
+               beat = createProjIndButton("Beat: \n" + beats);
+               add(beat);
+               
+               tick = createProjIndButton("Tick: \n" + ticks);
+               add(tick);
+
                }
                
                private JButton createButton(String imageLocation, String toolTip) {
                        JButton button = new JButton (new ImageIcon(imageLocation));
                        button.setToolTipText(toolTip);
+                       button.addActionListener(this);
                        return button;
                }
                
-               private JPanel createProgressIndikator(String name) {
-                       JPanel panel = new JPanel();
-                       JLabel label = new JLabel(name);
-                       JComboBox combo = new JComboBox();
-                       add(label);
-                       add(combo);
-                       return panel;
-                       
-               
+               private JButton createProjIndButton(String title){
+                       JButton abutton = new JButton(title);
+                       abutton.setFont(new Font("Times New Roman", Font.PLAIN ,8));
+                       abutton.setMinimumSize(new Dimension(30,22));
+                       abutton.setVerticalTextPosition(AbstractButton.CENTER);
+                       return abutton;
                }
                
-               /*public void actionPerformed(ActionEvent e) {
-                       String but = e.getActionCommand();
                        
-                       if (but == "rewind") {
+               public void actionPerformed(ActionEvent e) {}
+                                       
+                       /*if () {
                        
-                       } else if (but == "images/play.gif") {
-                               JOptionPane.showMessageDialog(null, "playing");
+                       } else if () {
+                               
                        
-                       } else if (but == "stop") {
+                       } else if () {
                        
-                       } else if (but == "rewind") {
+                       } else if () {
                        
-                       }
-               }*/
+                       }*/
                private JButton rewind;
                private JButton playpause;
                private JButton stop;
                private JButton fastforward;
-               private JPanel meas;
+               private JButton meas;
+               private JButton beat;
+               private JButton tick;
+               private int measures = 1;
+               private int beats = 1;
+               private int ticks = 1;
+
 }