View Javadoc

1   // %1117664848296:hoplugins.conv%
2   /*
3    * Created on 16.05.2004
4    *
5    */
6   package hoplugins.conv;
7   
8   import java.awt.event.ActionEvent;
9   import java.awt.event.ActionListener;
10  
11  import javax.swing.JFileChooser;
12  import javax.swing.JOptionPane;
13  
14  
15  /***
16   * DOCUMENT ME!
17   *
18   * @author Thorsten Dietz
19   */
20  public final class CListener implements ActionListener {
21      //~ Methods ------------------------------------------------------------------------------------
22  
23      /***
24       * TODO Missing Method Documentation
25       *
26       * @param e TODO Missing Method Parameter Documentation
27       */
28      public void actionPerformed(ActionEvent e) {
29          String comand = e.getActionCommand();
30  
31          if (comand.equals(RSC.BUDDY_TO_HRF)) {
32              JOptionPane.showMessageDialog(null, RSC.getProperty("select_source_file"));
33  
34              CFileChooser chooser = CFileChooser.getInstance();
35  
36              int returnOpen = chooser.showOpenDialog(RSC.MINIMODEL.getGUI().getOwner4Dialog());
37  
38              if (returnOpen == JFileChooser.APPROVE_OPTION) {
39                  byte type = ((CFilter) chooser.getFileFilter()).getType();
40                  HrfMaker.convert(type, chooser.getSelectedFiles());
41              } // if ok 
42          }
43  
44          if (comand.equals(RSC.DB_TO_HRF)) {
45              DBToHrf conv = new DBToHrf();
46              conv.start(null, conv.getDestinationFolder(RSC.MINIMODEL.getGUI().getOwner4Dialog()));
47          }
48  
49          if (comand.equals(RSC.PROP_PLAYERS)) {
50              TxtExpDialog dialog = new TxtExpDialog(RSC.MINIMODEL.getGUI().getOwner4Dialog());
51              dialog.setVisible(true);
52          }
53      }
54  }