]> ruin.nu Git - moosique.git/blobdiff - MooToolbar.java
varför vill det inte bli radbrytning???
[moosique.git] / MooToolbar.java
index a2a22431714c3061470d52e4cfd3797a56be1bf1..8ee350adf6fc8b8abacd0975f7c5a1865f23fa85 100644 (file)
@@ -1,18 +1,72 @@
 import javax.swing.*;
+import java.awt.event.*;
+import java.awt.*;
+import java.awt.Color;
 
-/*
- * 
- * 
- * @author  Andersson, Andreen, Lanneskog, Pehrson
- * @version 1
- */
-public class MooToolbar {
+public class MooToolbar extends JToolBar implements ActionListener     {
 
-       /* 
-        * Creates the toolbar.
-        */
-       public MooToolbar () {
+       public MooToolbar()     {
+       
+               rewind = createButton("images/rewind.gif", "rewind");
+               add(rewind);
+
+               playpause = createButton("images/play.gif", "play");
+               add(playpause);
+               
+               stop = createButton("images/stop.gif", "stop");
+               add(stop);
+               
+               fastforward = createButton("images/forward.gif", "fast forward");
+               add(fastforward);
+               
+               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 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) {}
+                                       
+                       /*if () {
+                       
+                       } else if () {
+                               
+                       
+                       } else if () {
+                       
+                       } else if () {
+                       
+                       }*/
+               private JButton rewind;
+               private JButton playpause;
+               private JButton stop;
+               private JButton fastforward;
+               private JButton meas;
+               private JButton beat;
+               private JButton tick;
+               private int measures = 1;
+               private int beats = 1;
+               private int ticks = 1;
 
-       }
 }