]> ruin.nu Git - moosique.git/commitdiff
*** empty log message ***
authorBjörn Lanneskog <lannesko@itstud.chalmers.se>
Thu, 8 May 2003 16:52:12 +0000 (16:52 +0000)
committerBjörn Lanneskog <lannesko@itstud.chalmers.se>
Thu, 8 May 2003 16:52:12 +0000 (16:52 +0000)
MooToolbar.java

index 8ee350adf6fc8b8abacd0975f7c5a1865f23fa85..84f0c5377238292b3102e61fb5fa70c687e5e52c 100644 (file)
@@ -1,7 +1,6 @@
 import javax.swing.*;
 import java.awt.event.*;
 import java.awt.*;
-import java.awt.Color;
 
 public class MooToolbar extends JToolBar implements ActionListener     {
 
@@ -19,15 +18,25 @@ public class MooToolbar extends JToolBar implements ActionListener  {
                fastforward = createButton("images/forward.gif", "fast forward");
                add(fastforward);
                
-               meas = createProjIndButton("Mrs: \n" + measures);
-               add(meas);
+               meas = createProjIndLabel("Mrs");
+               beat = createProjIndLabel("Beat");
+               tick = createProjIndLabel("Tick");
                
-               beat = createProjIndButton("Beat: \n" + beats);
-               add(beat);
+               measvalue = createProjIndLabel("1");
+               beatvalue = createProjIndLabel("1");
+               ticksvalue = createProjIndLabel("1");
                
-               tick = createProjIndButton("Tick: \n" + ticks);
-               add(tick);
-
+               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) {
@@ -37,12 +46,12 @@ public class MooToolbar extends JToolBar implements ActionListener  {
                        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;
+               
+               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;
                }
                
                        
@@ -62,11 +71,11 @@ public class MooToolbar extends JToolBar implements ActionListener  {
                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;
-
+               private JLabel meas;
+               private JLabel beat;
+               private JLabel tick;
+               private JLabel measvalue;
+               private JLabel beatvalue;
+               private JLabel ticksvalue;
+               
 }