+/** @file\r
+ \r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+ \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ \r
+ **/\r
package org.tianocore.migration;\r
\r
import java.awt.*;\r
private static final long serialVersionUID = 207759413522910399L;\r
\r
private String modulepath;\r
+ private ModuleInfo mi;\r
\r
- private JButton moduleButton , goButton;\r
+ private JButton moduleButton, goButton, msaEditorButton, criticButton;\r
private JTextField moduletext;\r
private JTextArea log;\r
private JFileChooser fc;\r
moduleButton = new JButton("Choose ModulePath");\r
moduleButton.addActionListener(this);\r
\r
+ msaEditorButton = new JButton("MsaEditor");\r
+ msaEditorButton.addActionListener(this);\r
+ \r
+ criticButton = new JButton("Critic");\r
+ criticButton.addActionListener(this);\r
+ \r
moduletext = new JTextField(30);\r
\r
filebox = new JCheckBox("Output to logfile", true);\r
modulePanel.add(filebox);\r
modulePanel.add(screenbox);\r
modulePanel.add(goButton);\r
+ modulePanel.add(msaEditorButton);\r
+ modulePanel.add(criticButton);\r
add(modulePanel);\r
\r
- log = new JTextArea(50,25);\r
+ log = new JTextArea(20,25);\r
log.setMargin(new Insets(5,5,5,5));\r
log.setEditable(false);\r
JScrollPane logScrollPane = new JScrollPane(log);\r
}\r
}\r
\r
- //---------------------------------------------------------------------------------------//\r
- \r
- /*\r
- public boolean getOption(String item) {\r
- if (item.matches("file")) {\r
- }\r
+ public String choose(String message, Object[] choicelist) {\r
+ return (String)JOptionPane.showInputDialog(this, message,"Choose",JOptionPane.PLAIN_MESSAGE,null,choicelist,choicelist[0]);\r
}\r
- */\r
\r
+ public String getInput(String message) {\r
+ return (String)JOptionPane.showInputDialog(message);\r
+ }\r
+\r
+ //---------------------------------------------------------------------------------------//\r
+\r
public void actionPerformed(ActionEvent e) {\r
if ( e.getSource() == moduleButton ) {\r
int ret = fc.showOpenDialog(this);\r
logfile = new PrintWriter(new BufferedWriter(new FileWriter(modulepath + File.separator + "migration.log")));\r
println("Project MsaGen");\r
println("Copyright (c) 2006, Intel Corporation");\r
- new ModuleInfo(modulepath, this, new Database());\r
+ mi = new ModuleInfo(modulepath, this, new Database());\r
logfile.flush();\r
} catch (Exception en) {\r
println(en.getMessage());\r
}\r
}\r
+ if ( e.getSource() == msaEditorButton) {\r
+ try {\r
+ MsaTreeEditor.init(mi, this);\r
+ } catch (Exception en) {\r
+ println(en.getMessage());\r
+ }\r
+ }\r
+ if ( e.getSource() == criticButton) {\r
+ try {\r
+ Critic.fireAt(modulepath);\r
+ } catch (Exception en) {\r
+ println(en.getMessage());\r
+ }\r
+ }\r
}\r
\r
public void itemStateChanged(ItemEvent e) {\r
fp.setOpaque(true);\r
frame.setContentPane(fp);\r
\r
- frame.setSize(800,600);\r
+ frame.pack();\r
frame.setVisible(true);\r
}\r
}
\ No newline at end of file