]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java
1. Restructure module description on main UI
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / ui / IInternalFrame.java
index 0d15a014ee894b5087a40aa1e4883263e18a36dc..b5f09da0835ceab63005e78053b0238c96445e98 100644 (file)
@@ -24,13 +24,17 @@ import java.awt.event.FocusEvent;
 import java.awt.event.FocusListener;\r
 import java.awt.event.ItemEvent;\r
 import java.awt.event.ItemListener;\r
+import java.awt.event.MouseEvent;\r
+import java.awt.event.MouseListener;\r
 \r
 import javax.swing.JDesktopPane;\r
 import javax.swing.JFrame;\r
 import javax.swing.JInternalFrame;\r
 import javax.swing.JPanel;\r
-\r
-import org.tianocore.frameworkwizard.common.DataType;\r
+import javax.swing.event.ListSelectionEvent;\r
+import javax.swing.event.ListSelectionListener;\r
+import javax.swing.event.TableModelEvent;\r
+import javax.swing.event.TableModelListener;\r
 \r
 /**\r
  * The class is used to override JInternalFrame to provides customized\r
@@ -39,7 +43,8 @@ import org.tianocore.frameworkwizard.common.DataType;
  *\r
  * \r
  */\r
-public class IInternalFrame extends JInternalFrame implements ActionListener, ComponentListener, ItemListener, FocusListener {\r
+public class IInternalFrame extends JInternalFrame implements ActionListener, ComponentListener, ItemListener,\r
+                                                  FocusListener, ListSelectionListener, TableModelListener, MouseListener {\r
 \r
     // /\r
     // / Define class Serial Version UID\r
@@ -157,8 +162,7 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
      * \r
      */\r
     public void resizeComponentWidth(Component c, int containerWidth, int preferredWidth) {\r
-        int newWidth = c.getPreferredSize().width\r
-                       + (containerWidth - preferredWidth);\r
+        int newWidth = c.getPreferredSize().width + (containerWidth - preferredWidth);\r
         if (newWidth < c.getPreferredSize().width) {\r
             newWidth = c.getPreferredSize().width;\r
         }\r
@@ -190,7 +194,8 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
      * @param containerHeight\r
      * \r
      */\r
-    public void resizeComponent(Component c, int containerWidth, int containerHeight, int preferredWidth, int preferredHeight) {\r
+    public void resizeComponent(Component c, int containerWidth, int containerHeight, int preferredWidth,\r
+                                int preferredHeight) {\r
         resizeComponentWidth(c, containerWidth, preferredWidth);\r
         resizeComponentHeight(c, containerHeight, preferredHeight);\r
     }\r
@@ -206,7 +211,7 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
     public void relocateComponentX(Component c, int containerWidth, int preferredWidth, int spaceToRight) {\r
         int intGapToRight = spaceToRight + c.getPreferredSize().width;\r
         int newLocationX = containerWidth - intGapToRight;\r
-        if (newLocationX < preferredWidth -intGapToRight) {\r
+        if (newLocationX < preferredWidth - intGapToRight) {\r
             newLocationX = preferredWidth - intGapToRight;\r
         }\r
         c.setLocation(newLocationX, c.getLocation().y);\r
@@ -221,10 +226,11 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
      * @param spaceToBottom\r
      * \r
      */\r
-    public void relocateComponentY(Component c, int containerHeight, int spaceToBottom) {\r
-        int newLocationY = containerHeight - spaceToBottom;\r
-        if (newLocationY < DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT - spaceToBottom) {\r
-            newLocationY = DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT - spaceToBottom;\r
+    public void relocateComponentY(Component c, int containerHeight, int preferredHeight, int spaceToBottom) {\r
+        int intGapToBottom = spaceToBottom + c.getPreferredSize().height;\r
+        int newLocationY = containerHeight - intGapToBottom;\r
+        if (newLocationY < preferredHeight - spaceToBottom) {\r
+            newLocationY = preferredHeight - spaceToBottom;\r
         }\r
         c.setLocation(c.getLocation().x, newLocationY);\r
         c.validate();\r
@@ -240,10 +246,10 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
      * @param spaceToRight\r
      * \r
      */\r
-    public void relocateComponent(Component c, int containerWidth, int containerHeight, int spaceToBottom,\r
-                                  int spaceToRight, int preferredWidht, int preferredHeight) {\r
-        relocateComponentX(c, containerWidth, preferredWidht, spaceToBottom);\r
-        relocateComponentY(c, containerHeight, spaceToRight);\r
+    public void relocateComponent(Component c, int containerWidth, int containerHeight, int preferredWidht,\r
+                                  int preferredHeight, int spaceToRight, int spaceToBottom) {\r
+        relocateComponentX(c, containerWidth, preferredWidht, spaceToRight);\r
+        relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom);\r
     }\r
 \r
     public void showStandard() {\r
@@ -260,16 +266,51 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co
 \r
     public void itemStateChanged(ItemEvent arg0) {\r
         // TODO Auto-generated method stub\r
-        \r
+\r
     }\r
 \r
     public void focusGained(FocusEvent arg0) {\r
         // TODO Auto-generated method stub\r
-        \r
+\r
     }\r
 \r
     public void focusLost(FocusEvent arg0) {\r
         // TODO Auto-generated method stub\r
+\r
+    }\r
+\r
+    public void valueChanged(ListSelectionEvent arg0) {\r
+        // TODO Auto-generated method stub\r
+\r
+    }\r
+\r
+    public void tableChanged(TableModelEvent arg0) {\r
+        // TODO Auto-generated method stub\r
+\r
+    }\r
+\r
+    public void mouseClicked(MouseEvent arg0) {\r
+        // TODO Auto-generated method stub\r
+        \r
+    }\r
+\r
+    public void mouseEntered(MouseEvent arg0) {\r
+        // TODO Auto-generated method stub\r
+        \r
+    }\r
+\r
+    public void mouseExited(MouseEvent arg0) {\r
+        // TODO Auto-generated method stub\r
+        \r
+    }\r
+\r
+    public void mousePressed(MouseEvent arg0) {\r
+        // TODO Auto-generated method stub\r
+        \r
+    }\r
+\r
+    public void mouseReleased(MouseEvent arg0) {\r
+        // TODO Auto-generated method stub\r
         \r
     }\r
 }\r