]> ruin.nu Git - moosique.git/blob - MooToolbar.java
*** empty log message ***
[moosique.git] / MooToolbar.java
1 import javax.swing.*;
2 import java.awt.event.*;
3 import java.awt.*;
4
5 public class MooToolbar extends JToolBar implements ActionListener      {
6
7         public MooToolbar()     {
8         
9                 rewind = createButton("images/rewind.gif", "rewind");
10                 add(rewind);
11
12                 playpause = createButton("images/play.gif", "play");
13                 add(playpause);
14                 
15                 stop = createButton("images/stop.gif", "stop");
16                 add(stop);
17                 
18                 fastforward = createButton("images/forward.gif", "fast forward");
19                 add(fastforward);
20                 
21                 meas = createProjIndLabel("Mrs");
22                 beat = createProjIndLabel("Beat");
23                 tick = createProjIndLabel("Tick");
24                 
25                 measvalue = createProjIndLabel("1");
26                 beatvalue = createProjIndLabel("1");
27                 ticksvalue = createProjIndLabel("1");
28                 
29                 JPanel measbeattick = new JPanel();
30                 measbeattick.setMaximumSize(new Dimension(80,40));
31                 measbeattick.setLayout(new GridLayout(2,3));
32                 measbeattick.add(meas);
33                 measbeattick.add(beat);
34                 measbeattick.add(tick);         
35                 measbeattick.add(measvalue);
36                 measbeattick.add(beatvalue);
37                 measbeattick.add(ticksvalue);
38                 
39                 add(measbeattick);
40                 }
41                 
42                 private JButton createButton(String imageLocation, String toolTip) {
43                         JButton button = new JButton (new ImageIcon(imageLocation));
44                         button.setToolTipText(toolTip);
45                         button.addActionListener(this);
46                         return button;
47                 }
48                 
49                 
50                 private JLabel createProjIndLabel(String title){
51                         JLabel titelvalue = new JLabel(title, JLabel.CENTER);
52                         titelvalue.setFont(new Font("Times New Roman", Font.PLAIN ,8));
53                         titelvalue.setHorizontalTextPosition(JLabel.CENTER);
54                         return titelvalue;
55                 }
56                 
57                         
58                 public void actionPerformed(ActionEvent e) {}
59                                         
60                         /*if () {
61                         
62                         } else if () {
63                                 
64                         
65                         } else if () {
66                         
67                         } else if () {
68                         
69                         }*/
70                 private JButton rewind;
71                 private JButton playpause;
72                 private JButton stop;
73                 private JButton fastforward;
74                 private JLabel meas;
75                 private JLabel beat;
76                 private JLabel tick;
77                 private JLabel measvalue;
78                 private JLabel beatvalue;
79                 private JLabel ticksvalue;
80                 
81 }