X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FMigrationTools%2Forg%2Ftianocore%2Fmigration%2FFirstPanel.java;h=9f853e42f2e53cea900fa9a2b358d4cd1467db36;hp=5bd9cf1ce4f1c078544110cf5b168f45a5f56bba;hb=90503bad37fea5edf22531754c203f77268dfa36;hpb=b02824125f2a6d9e6f9ea50447d182334060c5cb diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java b/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java index 5bd9cf1ce4..9f853e42f2 100644 --- a/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java +++ b/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java @@ -25,8 +25,9 @@ public class FirstPanel extends JPanel implements ActionListener, UI { private static final long serialVersionUID = 207759413522910399L; private String modulepath; + private ModuleInfo mi; - private JButton moduleButton , goButton; + private JButton moduleButton, goButton, msaEditorButton; private JTextField moduletext; private JTextArea log; private JFileChooser fc; @@ -43,6 +44,9 @@ public class FirstPanel extends JPanel implements ActionListener, UI { moduleButton = new JButton("Choose ModulePath"); moduleButton.addActionListener(this); + msaEditorButton = new JButton("MsaEditor"); + msaEditorButton.addActionListener(this); + moduletext = new JTextField(30); filebox = new JCheckBox("Output to logfile", true); @@ -54,9 +58,10 @@ public class FirstPanel extends JPanel implements ActionListener, UI { modulePanel.add(filebox); modulePanel.add(screenbox); modulePanel.add(goButton); + modulePanel.add(msaEditorButton); add(modulePanel); - log = new JTextArea(50,25); + log = new JTextArea(20,25); log.setMargin(new Insets(5,5,5,5)); log.setEditable(false); JScrollPane logScrollPane = new JScrollPane(log); @@ -96,15 +101,16 @@ public class FirstPanel extends JPanel implements ActionListener, UI { } } - //---------------------------------------------------------------------------------------// - - /* - public boolean getOption(String item) { - if (item.matches("file")) { - } + public String choose(String message, Object[] choicelist) { + return (String)JOptionPane.showInputDialog(this, message,"Choose",JOptionPane.PLAIN_MESSAGE,null,choicelist,choicelist[0]); } - */ + public String getInput(String message) { + return (String)JOptionPane.showInputDialog(message); + } + + //---------------------------------------------------------------------------------------// + public void actionPerformed(ActionEvent e) { if ( e.getSource() == moduleButton ) { int ret = fc.showOpenDialog(this); @@ -119,12 +125,19 @@ public class FirstPanel extends JPanel implements ActionListener, UI { logfile = new PrintWriter(new BufferedWriter(new FileWriter(modulepath + File.separator + "migration.log"))); println("Project MsaGen"); println("Copyright (c) 2006, Intel Corporation"); - new ModuleInfo(modulepath, this, new Database()); + mi = new ModuleInfo(modulepath, this, new Database()); logfile.flush(); } catch (Exception en) { println(en.getMessage()); } } + if ( e.getSource() == msaEditorButton) { + try { + MsaTreeEditor.init(mi, this); + } catch (Exception en) { + println(en.getMessage()); + } + } } public void itemStateChanged(ItemEvent e) { @@ -152,7 +165,7 @@ public class FirstPanel extends JPanel implements ActionListener, UI { fp.setOpaque(true); frame.setContentPane(fp); - frame.setSize(800,600); + frame.pack(); frame.setVisible(true); } } \ No newline at end of file