]> ruin.nu Git - moosique.git/blobdiff - MooToolbar.java
no message
[moosique.git] / MooToolbar.java
index 5eae4772a3b12120f0a4ea6777c500a4af00ae37..84f0c5377238292b3102e61fb5fa70c687e5e52c 100644 (file)
@@ -1,18 +1,81 @@
 import javax.swing.*;
+import java.awt.event.*;
+import java.awt.*;
 
-/**
- * 
- * 
- * @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 = createProjIndLabel("Mrs");
+               beat = createProjIndLabel("Beat");
+               tick = createProjIndLabel("Tick");
+               
+               measvalue = createProjIndLabel("1");
+               beatvalue = createProjIndLabel("1");
+               ticksvalue = createProjIndLabel("1");
+               
+               JPanel measbeattick = new JPanel();
+               measbeattick.setMaximumSize(new Dimension(80,40));
+               measbeattick.setLayout(new GridLayout(2,3));
+               measbeattick.add(meas);
+               measbeattick.add(beat);
+               measbeattick.add(tick);         
+               measbeattick.add(measvalue);
+               measbeattick.add(beatvalue);
+               measbeattick.add(ticksvalue);
+               
+               add(measbeattick);
+               }
+               
+               private JButton createButton(String imageLocation, String toolTip) {
+                       JButton button = new JButton (new ImageIcon(imageLocation));
+                       button.setToolTipText(toolTip);
+                       button.addActionListener(this);
+                       return button;
+               }
+               
+               
+               private JLabel createProjIndLabel(String title){
+                       JLabel titelvalue = new JLabel(title, JLabel.CENTER);
+                       titelvalue.setFont(new Font("Times New Roman", Font.PLAIN ,8));
+                       titelvalue.setHorizontalTextPosition(JLabel.CENTER);
+                       return titelvalue;
+               }
+               
+                       
+               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 JLabel meas;
+               private JLabel beat;
+               private JLabel tick;
+               private JLabel measvalue;
+               private JLabel beatvalue;
+               private JLabel ticksvalue;
+               
 }