1 4 package org.webdocwf.util.loader.wizard; 5 6 import java.awt.Toolkit ; 7 import java.awt.event.ActionEvent ; 8 9 import javax.swing.AbstractAction ; 10 import javax.swing.ImageIcon ; 11 import javax.swing.KeyStroke ; 12 13 18 public class StartOctopusGeneratorAction extends AbstractAction { 19 20 OctopusProjectFrame octopusProjectFrame; 21 24 public StartOctopusGeneratorAction(OctopusProjectFrame octopusProjectFrame, String label) { 25 this.octopusProjectFrame = octopusProjectFrame; 26 putValue(NAME, label); 27 putValue( 28 SMALL_ICON, 29 new ImageIcon ( 30 getClass().getClassLoader().getResource( 31 "org/webdocwf/util/loader/" + "wizard/images/StartGenerator.gif"))); 33 putValue(SHORT_DESCRIPTION, "Start the OctopusGenerator application"); 34 putValue(LONG_DESCRIPTION, "Start the OctopusGenerator application"); 35 putValue( 36 ACCELERATOR_KEY, 37 KeyStroke.getKeyStroke('G', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 38 putValue(MNEMONIC_KEY, new Integer ('G')); 39 } 40 41 45 public void actionPerformed(ActionEvent e) { 46 OctopusGeneratorData initData = null; 47 String errorMsg = null; 48 try { 49 octopusProjectFrame.setActiveTab(0); 50 initData = octopusProjectFrame.getGeneratorPanel().getOctopusGeneratorInit(); 51 octopusProjectFrame.getGeneratorPanel().getTraceArea().setText(""); 52 OctopusGeneratorThread runGenerator = 53 new OctopusGeneratorThread( 54 initData, 55 errorMsg, 56 octopusProjectFrame.getGeneratorPanel().getTraceArea()); 57 runGenerator.start(); 58 } catch (Exception ex) { 59 errorMsg = ex.getMessage(); 60 } 61 } 62 63 } 64 | Popular Tags |