1 package hero.client.grapheditor; 2 3 11 12 import java.awt.Insets ; 13 import java.awt.event.ActionEvent ; 14 import java.awt.event.ActionListener ; 15 import java.awt.Color ; 16 17 import javax.swing.ImageIcon ; 18 import javax.swing.JButton ; 19 20 public class WFToolBar2 extends javax.swing.JToolBar { 21 22 static java.util.ResourceBundle resource = java.util.ResourceBundle.getBundle("resources.Traduction"); 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 (0, 5, 0, 0)); 29 this.setBackground(new Color (177,177,251)); 30 JButton jb; 31 32 ClassLoader cl = frame.getClass().getClassLoader(); 33 34 jb = new JButton (new ImageIcon (cl.getResource("images/Active.gif"))); 35 jb.setToolTipText(resource.getString("wftoolbar2.new")); 36 jb.setBackground(new Color (177,177,251)); 37 jb.setEnabled(manager.getPersistence().hasPermission()); 38 jb.setMargin(new Insets (0, 0, 0, 0)); 39 jb.addActionListener(new ActionListener () { 40 public void actionPerformed(ActionEvent e) { 41 manager.addNode(); 42 } 43 }); 44 45 super.add(jb); 46 47 jb = new JButton (new ImageIcon (cl.getResource("images/grey.gif"))); 48 jb.setToolTipText(resource.getString("wftoolbar2.subproc")); 49 jb.setBackground(new Color (177,177,251)); 50 jb.setEnabled(manager.getPersistence().hasPermission()); 51 jb.setMargin(new Insets (0, 0, 0, 0)); 52 jb.addActionListener(new ActionListener () { 53 public void actionPerformed(ActionEvent e) { 54 manager.addNodeSubProcess(); 55 } 56 }); 57 58 super.add(jb); 59 60 jb = new JButton (new ImageIcon (cl.getResource("images/Transition.gif"))); 61 jb.setBackground(new Color (177,177,251)); 62 jb.setToolTipText(resource.getString("wftoolbar2.edge")); 63 jb.setMargin(new Insets (0, 0, 0, 0)); 64 jb.setEnabled(manager.getPersistence().hasPermission()); 65 jb.addActionListener(new ActionListener () { 66 public void actionPerformed(ActionEvent e) { 67 manager.addEdge(); 68 } 69 }); 70 super.add(jb); 71 } 72 } 73 | Popular Tags |