KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hero > client > grapheditor > WFToolBar2


1 package hero.client.grapheditor;
2
3 /**
4  * WFToolBar2.java
5  *
6  *
7  * Created: Fri Aug 09 16:18:15 2002
8  *
9  * @version 1.0
10  */

11
12 import java.awt.Insets JavaDoc;
13 import java.awt.event.ActionEvent JavaDoc;
14 import java.awt.event.ActionListener JavaDoc;
15 import java.awt.Color JavaDoc;
16
17 import javax.swing.ImageIcon JavaDoc;
18 import javax.swing.JButton JavaDoc;
19
20 public class WFToolBar2 extends javax.swing.JToolBar JavaDoc {
21
22 static java.util.ResourceBundle JavaDoc resource = java.util.ResourceBundle.getBundle("resources.Traduction")/*#BundleType=List*/;
23
24     public WFToolBar2(final Frame frame, final WFManager manager) {
25
26         super.setFloatable(true);
27         this.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
28         this.setMargin(new Insets JavaDoc(0, 5, 0, 0));
29         this.setBackground(new Color JavaDoc(177,177,251));
30         JButton JavaDoc jb;
31
32         ClassLoader JavaDoc cl = frame.getClass().getClassLoader();
33
34         jb = new JButton JavaDoc(new ImageIcon JavaDoc(cl.getResource("images/Active.gif")));
35         jb.setToolTipText(resource.getString("wftoolbar2.new"));
36         jb.setBackground(new Color JavaDoc(177,177,251));
37         jb.setEnabled(manager.getPersistence().hasPermission());
38         jb.setMargin(new Insets JavaDoc(0, 0, 0, 0));
39         jb.addActionListener(new ActionListener JavaDoc() {
40             public void actionPerformed(ActionEvent JavaDoc e) {
41                 manager.addNode();
42             }
43         });
44
45         super.add(jb);
46
47         jb = new JButton JavaDoc(new ImageIcon JavaDoc(cl.getResource("images/grey.gif")));
48         jb.setToolTipText(resource.getString("wftoolbar2.subproc"));
49         jb.setBackground(new Color JavaDoc(177,177,251));
50         jb.setEnabled(manager.getPersistence().hasPermission());
51         jb.setMargin(new Insets JavaDoc(0, 0, 0, 0));
52         jb.addActionListener(new ActionListener JavaDoc() {
53             public void actionPerformed(ActionEvent JavaDoc e) {
54                 manager.addNodeSubProcess();
55             }
56         });
57
58         super.add(jb);
59
60         jb = new JButton JavaDoc(new ImageIcon JavaDoc(cl.getResource("images/Transition.gif")));
61         jb.setBackground(new Color JavaDoc(177,177,251));
62         jb.setToolTipText(resource.getString("wftoolbar2.edge"));
63         jb.setMargin(new Insets JavaDoc(0, 0, 0, 0));
64         jb.setEnabled(manager.getPersistence().hasPermission());
65         jb.addActionListener(new ActionListener JavaDoc() {
66             public void actionPerformed(ActionEvent JavaDoc e) {
67                 manager.addEdge();
68             }
69         });
70         super.add(jb);
71     }
72 }
73
Popular Tags