new look
authoralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Aug 2006 05:45:43 +0000 (05:45 +0000)
committeralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Aug 2006 05:45:43 +0000 (05:45 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1346 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
Tools/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java

index 8c07783cd4aaef7af414d31928518327bf56678b..8c428087d669283ac0aa5870697c62ede84ef008 100644 (file)
@@ -18,7 +18,7 @@ import java.io.*;
 import java.util.*;\r
 import javax.swing.*;\r
 \r
-public final class FirstPanel extends JPanel implements ActionListener, UI {\r
+public final class FirstPanel extends JPanel implements ActionListener, ItemListener, UI {\r
        /**\r
         *  Define class Serial Version UID\r
         */\r
@@ -31,12 +31,17 @@ public final class FirstPanel extends JPanel implements ActionListener, UI {
        private JTextField moduletext;\r
        private JTextArea log;\r
        private JFileChooser fc;\r
-       private JCheckBox filebox, screenbox;\r
+       private JCheckBox filebox, screenbox, mibox, criticbox, defaultpathbox;\r
        \r
        private boolean tofile = true, toscreen = true;\r
        private PrintWriter logfile;\r
 \r
        FirstPanel() throws Exception {\r
+        GridBagLayout gridbag = new GridBagLayout();\r
+        setLayout(gridbag);\r
+        \r
+               GridBagConstraints cst = new GridBagConstraints();\r
+               \r
                goButton = new JButton("Go");\r
                goButton.addActionListener(this);\r
                goButton.setActionCommand("go");\r
@@ -53,22 +58,53 @@ public final class FirstPanel extends JPanel implements ActionListener, UI {
                moduletext = new JTextField(30);\r
                \r
                filebox = new JCheckBox("Output to logfile", true);\r
+               filebox.addItemListener(this);\r
                screenbox = new JCheckBox("Specify logfile", false);\r
+               screenbox.addItemListener(this);\r
+               mibox = new JCheckBox("Show ModuleInfo", false);\r
+               mibox.addItemListener(this);\r
+               criticbox = new JCheckBox("Run Critic", true);\r
+               criticbox.addItemListener(this);\r
+               defaultpathbox = new JCheckBox("Use Default Output Path", true);\r
+               defaultpathbox.addItemListener(this);\r
                \r
         JPanel modulePanel = new JPanel();\r
         modulePanel.add(moduleButton);\r
         modulePanel.add(moduletext);\r
-        modulePanel.add(filebox);\r
-        modulePanel.add(screenbox);\r
         modulePanel.add(goButton);\r
         //modulePanel.add(msaEditorButton);\r
-        modulePanel.add(criticButton);\r
+        cst.gridx = 0;\r
+        cst.gridy = 0;\r
+        //cst.gridwidth = GridBagConstraints.REMAINDER;\r
+        gridbag.setConstraints(modulePanel, cst);\r
         add(modulePanel);\r
 \r
-        log = new JTextArea(20,25);\r
+        cst.gridx = 1;\r
+        cst.gridy = 0;\r
+        gridbag.setConstraints(criticButton, cst);\r
+        add(criticButton);\r
+        \r
+        JPanel checkboxPanel = new JPanel();\r
+        checkboxPanel.setLayout(new BoxLayout(checkboxPanel, BoxLayout.Y_AXIS));\r
+        checkboxPanel.add(filebox);\r
+        checkboxPanel.add(screenbox);\r
+        checkboxPanel.add(mibox);\r
+        checkboxPanel.add(criticbox);\r
+        checkboxPanel.add(defaultpathbox);\r
+        cst.gridx = 1;\r
+        cst.gridy = 1;\r
+        //cst.gridheight = 2;\r
+        gridbag.setConstraints(checkboxPanel, cst);\r
+        add(checkboxPanel);\r
+        \r
+        log = new JTextArea(10,20);\r
         log.setMargin(new Insets(5,5,5,5));\r
         log.setEditable(false);\r
         JScrollPane logScrollPane = new JScrollPane(log);\r
+        cst.gridx = 0;\r
+        cst.gridy = 1;\r
+        cst.fill = GridBagConstraints.BOTH;\r
+        gridbag.setConstraints(logScrollPane, cst);\r
         add(logScrollPane);\r
         \r
                fc = new JFileChooser();\r
@@ -155,8 +191,36 @@ public final class FirstPanel extends JPanel implements ActionListener, UI {
     }\r
     \r
     public void itemStateChanged(ItemEvent e) {\r
-       if (e.getStateChange() == ItemEvent.DESELECTED) {\r
-               System.out.println("changed");\r
+       if (e.getSource() == filebox) {\r
+               if (e.getStateChange() == ItemEvent.DESELECTED) {\r
+                       System.out.println("filebox DESELECTED");\r
+               } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
+                       System.out.println("filebox SELECTED");\r
+               }\r
+       } else if (e.getSource() == screenbox) {\r
+               if (e.getStateChange() == ItemEvent.DESELECTED) {\r
+                       System.out.println("screenbox DESELECTED");\r
+               } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
+                       System.out.println("screenbox SELECTED");\r
+               }\r
+       } else if (e.getSource() == mibox) {\r
+               if (e.getStateChange() == ItemEvent.DESELECTED) {\r
+                       System.out.println("mibox DESELECTED");\r
+               } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
+                       System.out.println("mibox SELECTED");\r
+               }\r
+       } else if (e.getSource() == criticbox) {\r
+               if (e.getStateChange() == ItemEvent.DESELECTED) {\r
+                       System.out.println("criticbox DESELECTED");\r
+               } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
+                       System.out.println("criticbox SELECTED");\r
+               }\r
+       } else if (e.getSource() == defaultpathbox) {\r
+               if (e.getStateChange() == ItemEvent.DESELECTED) {\r
+                       System.out.println("defaultpathbox DESELECTED");\r
+               } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
+                       System.out.println("defaultpathbox SELECTED");\r
+               }\r
        }\r
     }\r
 \r
@@ -175,7 +239,8 @@ public final class FirstPanel extends JPanel implements ActionListener, UI {
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r
 \r
         FirstPanel fp = new FirstPanel();\r
-               fp.setLayout(new BoxLayout(fp, BoxLayout.Y_AXIS));\r
+               //fp.setLayout(new GridBagLayout());\r
+               //fp.setLayout(new BoxLayout(fp, BoxLayout.Y_AXIS));\r
                fp.setOpaque(true);\r
         frame.setContentPane(fp);\r
 \r
index 0d48be52ebcd883c616182a4b4092e9a2c972cf5..d6119e6e45eee3634e03600dd77ee5614bb171b4 100644 (file)
@@ -1,3 +1,15 @@
+/** @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
 public class MigrationTool {\r
index 5eb688ce0e8d9e90770737933b0b896315af0d08..7bdf0281199ca2c57c6b25fcbab17bc79b62106b 100644 (file)
@@ -5,8 +5,6 @@ import java.awt.event.*;
 import javax.swing.*;\r
 import javax.swing.tree.*;\r
 \r
-import org.tianocore.ModuleSurfaceAreaDocument;\r
-\r
 public class MsaTreeEditor extends JPanel {\r
        /**\r
         *  Define class Serial Version UID\r