From: hche10x Date: Mon, 21 Aug 2006 20:05:17 +0000 (+0000) Subject: 1. Move resize funtions from IInternalFrame.java to Tools.java. X-Git-Tag: edk2-stable201903~24536 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=8792f60fcb339fedcc1a62b1da3dbb0cfc4b5d1b 1. Move resize funtions from IInternalFrame.java to Tools.java. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1337 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java index 0207e4104d..2508a895ff 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java @@ -17,7 +17,6 @@ package org.tianocore.frameworkwizard; import java.awt.event.ActionEvent; import java.awt.event.ComponentEvent; -import java.awt.event.ComponentListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.WindowEvent; @@ -55,6 +54,7 @@ import org.tianocore.frameworkwizard.common.Identifications.Identification; import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType; import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType; import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType; +import org.tianocore.frameworkwizard.common.find.FindPPIsResult; import org.tianocore.frameworkwizard.common.ui.IDefaultMutableTreeNode; import org.tianocore.frameworkwizard.common.ui.IDesktopManager; import org.tianocore.frameworkwizard.common.ui.IFrame; @@ -105,8 +105,7 @@ import org.tianocore.frameworkwizard.workspace.ui.SwitchWorkspace; It extends IFrame implements MouseListener, TreeSelectionListener, ComponentListener and MenuListener **/ -public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSelectionListener, ComponentListener, - MenuListener { +public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSelectionListener, MenuListener { /// /// Define class Serial Version UID /// @@ -217,8 +216,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele private JMenuItem jMenuItemEditSelectAll = null; - private JMenuItem jMenuItemEditFind = null; - private JMenuItem jMenuItemEditFindNext = null; private JMenu jMenuView = null; @@ -281,6 +278,20 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele private JMenuItem jMenuItemProjectCreateFar = null; + private JMenu jMenuEditFind = null; + + private JMenuItem jMenuItemEditFindPcd = null; + + private JMenuItem jMenuItemEditFindLibraryClass = null; + + private JMenuItem jMenuItemEditFindPpi = null; + + private JMenuItem jMenuItemEditFindProtocol = null; + + private JMenuItem jMenuItemEditFindGuid = null; + + private JMenuItem jMenuItemEditFindLibraryInstance = null; + /// /// A static definition for this class itself /// @@ -477,18 +488,18 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // jMenuEdit.add(getJMenuItemEditUndo()); jMenuEdit.add(getJMenuItemEditRedo()); - jMenuEdit.addSeparator(); + //jMenuEdit.addSeparator(); jMenuEdit.add(getJMenuItemEditCut()); jMenuEdit.add(getJMenuItemEditCopy()); jMenuEdit.add(getJMenuItemEditPaste()); jMenuEdit.add(getJMenuItemEditDelete()); - jMenuEdit.addSeparator(); + //jMenuEdit.addSeparator(); jMenuEdit.add(getJMenuItemEditSelectAll()); - jMenuEdit.add(getJMenuItemEditFind()); + jMenuEdit.add(getJMenuEditFind()); jMenuEdit.add(getJMenuItemEditFindNext()); - jMenuEdit.addSeparator(); + //jMenuEdit.addSeparator(); } return jMenuEdit; } @@ -654,6 +665,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuItemEditDelete = new JMenuItem(); jMenuItemEditDelete.setText("Delete"); jMenuItemEditDelete.setMnemonic('D'); + jMenuItemEditDelete.setVisible(false); + jMenuItemEditDelete.setEnabled(false); jMenuItemEditDelete.addActionListener(this); // //Disabled first when no module is open @@ -985,6 +998,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuItemEditUndo.setText("Undo"); jMenuItemEditUndo.setMnemonic('U'); jMenuItemEditUndo.setEnabled(false); + jMenuItemEditUndo.setVisible(false); jMenuItemEditUndo.addActionListener(this); } return jMenuItemEditUndo; @@ -1002,6 +1016,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuItemEditRedo.setText("Redo"); jMenuItemEditRedo.setMnemonic('R'); jMenuItemEditRedo.setEnabled(false); + jMenuItemEditRedo.setVisible(false); jMenuItemEditRedo.addActionListener(this); } return jMenuItemEditRedo; @@ -1019,6 +1034,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuItemEditCut.setText("Cut"); jMenuItemEditCut.setMnemonic('t'); jMenuItemEditCut.setEnabled(false); + jMenuItemEditCut.setVisible(false); jMenuItemEditCut.addActionListener(this); } return jMenuItemEditCut; @@ -1036,6 +1052,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuItemEditCopy.setText("Copy"); jMenuItemEditCopy.setMnemonic('C'); jMenuItemEditCopy.setEnabled(false); + jMenuItemEditCopy.setVisible(false); jMenuItemEditCopy.addActionListener(this); } return jMenuItemEditCopy; @@ -1053,6 +1070,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuItemEditPaste.setText("Paste"); jMenuItemEditPaste.setMnemonic('P'); jMenuItemEditPaste.setEnabled(false); + jMenuItemEditPaste.setVisible(false); jMenuItemEditPaste.addActionListener(this); } return jMenuItemEditPaste; @@ -1070,28 +1088,12 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuItemEditSelectAll.setText("Select All"); jMenuItemEditSelectAll.setMnemonic('A'); jMenuItemEditSelectAll.setEnabled(false); + jMenuItemEditSelectAll.setVisible(false); jMenuItemEditSelectAll.addActionListener(this); } return jMenuItemEditSelectAll; } - /** - This method initializes jMenuItemEditFind - - @return javax.swing.JMenuItem - - **/ - private JMenuItem getJMenuItemEditFind() { - if (jMenuItemEditFind == null) { - jMenuItemEditFind = new JMenuItem(); - jMenuItemEditFind.setText("Find"); - jMenuItemEditFind.setMnemonic('F'); - jMenuItemEditFind.setEnabled(false); - jMenuItemEditFind.addActionListener(this); - } - return jMenuItemEditFind; - } - /** This method initializes jMenuItemEditFindNext @@ -1104,6 +1106,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuItemEditFindNext.setText("Find Next"); jMenuItemEditFindNext.setMnemonic('n'); jMenuItemEditFindNext.setEnabled(false); + jMenuItemEditFindNext.setVisible(false); jMenuItemEditFindNext.addActionListener(this); } return jMenuItemEditFindNext; @@ -1642,6 +1645,119 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele return jMenuItemProjectCreateFar; } + /** + * This method initializes jMenuEditFind + * + * @return javax.swing.JMenu + */ + private JMenu getJMenuEditFind() { + if (jMenuEditFind == null) { + jMenuEditFind = new JMenu(); + jMenuEditFind.setText("Find"); + jMenuEditFind.setMnemonic('F'); + + jMenuEditFind.add(getJMenuItemEditFindPpi()); + jMenuEditFind.add(getJMenuItemEditFindProtocol()); + jMenuEditFind.add(getJMenuItemEditFindGuid()); + jMenuEditFind.add(getJMenuItemEditFindPcd()); + jMenuEditFind.addSeparator(); + + jMenuEditFind.add(getJMenuItemEditFindLibraryClass()); + jMenuEditFind.add(getJMenuItemEditFindLibraryInstance()); + } + return jMenuEditFind; + } + + /** + * This method initializes jMenuItemEditFindPcd + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindPcd() { + if (jMenuItemEditFindPcd == null) { + jMenuItemEditFindPcd = new JMenuItem(); + jMenuItemEditFindPcd.setText("All PCD entries"); + jMenuItemEditFindPcd.setMnemonic('P'); + jMenuItemEditFindPcd.addActionListener(this); + } + return jMenuItemEditFindPcd; + } + + /** + * This method initializes jMenuItemEditFindLibraryClass + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindLibraryClass() { + if (jMenuItemEditFindLibraryClass == null) { + jMenuItemEditFindLibraryClass = new JMenuItem(); + jMenuItemEditFindLibraryClass.setText("All Library Classes"); + jMenuItemEditFindLibraryClass.setMnemonic('C'); + jMenuItemEditFindLibraryClass.addActionListener(this); + } + return jMenuItemEditFindLibraryClass; + } + + /** + * This method initializes jMenuItemEditFindPpi + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindPpi() { + if (jMenuItemEditFindPpi == null) { + jMenuItemEditFindPpi = new JMenuItem(); + jMenuItemEditFindPpi.setText("All PPIs"); + jMenuItemEditFindPpi.setMnemonic('I'); + jMenuItemEditFindPpi.addActionListener(this); + } + return jMenuItemEditFindPpi; + } + + /** + * This method initializes jMenuItemEditFindProtocol + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindProtocol() { + if (jMenuItemEditFindProtocol == null) { + jMenuItemEditFindProtocol = new JMenuItem(); + jMenuItemEditFindProtocol.setText("All Protocols"); + jMenuItemEditFindProtocol.setMnemonic('r'); + jMenuItemEditFindProtocol.addActionListener(this); + } + return jMenuItemEditFindProtocol; + } + + /** + * This method initializes jMenuItemEditFindGuid + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindGuid() { + if (jMenuItemEditFindGuid == null) { + jMenuItemEditFindGuid = new JMenuItem(); + jMenuItemEditFindGuid.setText("All GUIDs"); + jMenuItemEditFindGuid.setMnemonic('G'); + jMenuItemEditFindGuid.addActionListener(this); + } + return jMenuItemEditFindGuid; + } + + /** + * This method initializes jMenuItemEditFindLibraryInstance + * + * @return javax.swing.JMenuItem + */ + private JMenuItem getJMenuItemEditFindLibraryInstance() { + if (jMenuItemEditFindLibraryInstance == null) { + jMenuItemEditFindLibraryInstance = new JMenuItem(); + jMenuItemEditFindLibraryInstance.setText("All Library Instances"); + jMenuItemEditFindLibraryInstance.setMnemonic('n'); + jMenuItemEditFindLibraryInstance.addActionListener(this); + } + return jMenuItemEditFindLibraryInstance; + } + /* (non-Javadoc) * @see org.tianocore.packaging.common.ui.IFrame#main(java.lang.String[]) * @@ -1692,7 +1808,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele this.setSize(DataType.MAIN_FRAME_PREFERRED_SIZE_WIDTH, DataType.MAIN_FRAME_PREFERRED_SIZE_HEIGHT); this.setResizable(true); this.setJMenuBar(getjJMenuBar()); - this.addComponentListener(this); this.setContentPane(getJContentPane()); this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- [" + Workspace.getCurrentWorkspace() + "]"); @@ -1730,67 +1845,71 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Operations of Menu // - if (arg0.getSource() == jMenuItemFileNew) { + if (arg0.getSource() == this.jMenuItemFileNew) { this.fileNew(); } - if (arg0.getSource() == jMenuItemFileOpen) { + if (arg0.getSource() == this.jMenuItemFileOpen) { this.open(); } - if (arg0.getSource() == jMenuItemFileClose) { + if (arg0.getSource() == this.jMenuItemFileClose) { this.close(); } - if (arg0.getSource() == jMenuItemFileCloseAll) { + if (arg0.getSource() == this.jMenuItemFileCloseAll) { this.closeAll(); } - if (arg0.getSource() == jMenuItemFileSave) { + if (arg0.getSource() == this.jMenuItemFileSave) { this.save(); } - if (arg0.getSource() == jMenuItemFileSaveAs) { + if (arg0.getSource() == this.jMenuItemFileSaveAs) { this.saveAs(); } - if (arg0.getSource() == jMenuItemFileSaveAll) { + if (arg0.getSource() == this.jMenuItemFileSaveAll) { this.saveAll(); } - if (arg0.getSource() == jMenuItemFileExit) { + if (arg0.getSource() == this.jMenuItemFileExit) { this.exit(); } - if (arg0.getSource() == jMenuItemProjectChangeWorkspace) { - changeWorkspace(); + if (arg0.getSource() == this.jMenuItemEditFindPpi) { + this.findPpi(); + } + + if (arg0.getSource() == this.jMenuItemProjectChangeWorkspace) { + this.changeWorkspace(); } - if (arg0.getSource() == jMenuItemProjectCreateFar) { - createFar(); + if (arg0.getSource() == this.jMenuItemProjectCreateFar) { + this.createFar(); } - if (arg0.getSource() == jMenuItemProjectInstallFar) { - installFar(); + if (arg0.getSource() == this.jMenuItemProjectInstallFar) { + this.installFar(); } - if (arg0.getSource() == jMenuItemProjectRemoveFar) { - removeFar(); + if (arg0.getSource() == this.jMenuItemProjectRemoveFar) { + this.removeFar(); } - if (arg0.getSource() == jMenuItemProjectUpdateFar) { - updateFar(); + if (arg0.getSource() == this.jMenuItemProjectUpdateFar) { + this.updateFar(); } - if (arg0.getSource() == jMenuItemToolsClone) { - cloneItem(); + if (arg0.getSource() == this.jMenuItemToolsClone) { + this.cloneItem(); } - if (arg0.getSource() == jMenuItemToolsToolChainConfiguration) { - setupToolChainConfiguration(); + if (arg0.getSource() == this.jMenuItemToolsToolChainConfiguration) { + this.setupToolChainConfiguration(); } - if (arg0.getSource() == jMenuItemHelpAbout) { + if (arg0.getSource() == this.jMenuItemHelpAbout) { About a = new About(this, true); int result = a.showDialog(); if (result == DataType.RETURN_TYPE_OK) { @@ -2014,8 +2133,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Add new MsaHeader node to the tree // - IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(), IDefaultMutableTreeNode.MODULE, - true, mid); + IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(), IDefaultMutableTreeNode.MODULE, true, + mid); // // First find the module belongs to which package // @@ -2276,26 +2395,13 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } } - public void componentHidden(ComponentEvent arg0) { - // TODO Auto-generated method stub - - } - - public void componentMoved(ComponentEvent arg0) { - // TODO Auto-generated method stub - - } - public void componentResized(ComponentEvent arg0) { - this.jSplitPane.setSize(this.getWidth() - DataType.MAIN_FRAME_WIDTH_SPACING, - this.getHeight() - DataType.MAIN_FRAME_HEIGHT_SPACING); - this.jSplitPane.validate(); - resizeDesktopPanel(); - } - - public void componentShown(ComponentEvent arg0) { - // TODO Auto-generated method stub - + if (this.jSplitPane != null) { + this.jSplitPane.setSize(this.getWidth() - DataType.MAIN_FRAME_WIDTH_SPACING, + this.getHeight() - DataType.MAIN_FRAME_HEIGHT_SPACING); + this.jSplitPane.validate(); + resizeDesktopPanel(); + } } /** @@ -2667,18 +2773,18 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele Log.err("Upddate MsaFiles of Package", e.getMessage()); return; } - + // // Update Global Data // GlobalData.openingModuleList.insertToOpeningModuleList(mid, smb.getMsa()); GlobalData.vModuleList.addElement(mid); - + // // Create new node on the tree // addModuleToTree(mid); - + // // Open the node // @@ -2989,6 +3095,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele System.exit(0); } + /** + To find all defined PPIs in workspace + + **/ + private void findPpi() { + FindPPIsResult fpr = FindPPIsResult.getInstance(); + fpr.setVisible(true); + } + /** Switch current workspace to others diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java index 30454ec1a3..9170c9c336 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java @@ -168,6 +168,10 @@ public class DataType { public static final int SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON = 30; public static final int SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON = 30; + + public static final int SPACE_TO_RIGHT_FOR_CLOSE_BUTTON = 240; + + public static final int SPACE_TO_BOTTOM_FOR_CLOSE_BUTTON = 25; public static final int SPACE_TO_RIGHT_FOR_PROTOCOL_NOTIFY = 25; diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java index a5345019ea..983201f5a0 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java @@ -15,6 +15,7 @@ package org.tianocore.frameworkwizard.common; +import java.awt.Component; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; @@ -494,4 +495,126 @@ public class Tools { PlatformIdentification id = new PlatformIdentification(name, guid, version, path); return id; } + + /** + * To reset the width of input component via container width + * + * @param c + * @param containerWidth + * + */ + public static void resizeComponentWidth(Component c, int containerWidth, int preferredWidth) { + int newWidth = c.getPreferredSize().width + (containerWidth - preferredWidth); + if (newWidth < c.getPreferredSize().width) { + newWidth = c.getPreferredSize().width; + } + c.setSize(new java.awt.Dimension(newWidth, c.getHeight())); + c.validate(); + } + + /** + * To reset the height of input component via container height + * + * @param c + * @param containerHeight + * + */ + public static void resizeComponentHeight(Component c, int containerHeight, int preferredHeight) { + int newHeight = c.getPreferredSize().height + (containerHeight - preferredHeight); + if (newHeight < c.getPreferredSize().height) { + newHeight = c.getPreferredSize().height; + } + c.setSize(new java.awt.Dimension(c.getWidth(), newHeight)); + c.validate(); + } + + /** + * To reset the size of input component via container size + * + * @param c + * @param containerWidth + * @param containerHeight + * + */ + public static void resizeComponent(Component c, int containerWidth, int containerHeight, int preferredWidth, + int preferredHeight) { + resizeComponentWidth(c, containerWidth, preferredWidth); + resizeComponentHeight(c, containerHeight, preferredHeight); + } + + /** + * To relocate the input component + * + * @param c + * @param containerWidth + * @param spaceToRight + * + */ + public static void relocateComponentX(Component c, int containerWidth, int preferredWidth, int spaceToRight) { + int intGapToRight = spaceToRight + c.getPreferredSize().width; + int newLocationX = containerWidth - intGapToRight; + if (newLocationX < preferredWidth - intGapToRight) { + newLocationX = preferredWidth - intGapToRight; + } + c.setLocation(newLocationX, c.getLocation().y); + c.validate(); + } + + /** + * To relocate the input component + * + * @param c + * @param containerHeight + * @param spaceToBottom + * + */ + public static void relocateComponentY(Component c, int containerHeight, int preferredHeight, int spaceToBottom) { + int intGapToBottom = spaceToBottom + c.getPreferredSize().height; + int newLocationY = containerHeight - intGapToBottom; + if (newLocationY < preferredHeight - spaceToBottom) { + newLocationY = preferredHeight - spaceToBottom; + } + c.setLocation(c.getLocation().x, newLocationY); + c.validate(); + } + + /** + * To relocate the input component + * + * @param c + * @param containerWidth + * @param containerHeight + * @param spaceToBottom + * @param spaceToRight + * + */ + public static void relocateComponent(Component c, int containerWidth, int containerHeight, int preferredWidht, + int preferredHeight, int spaceToRight, int spaceToBottom) { + relocateComponentX(c, containerWidth, preferredWidht, spaceToRight); + relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom); + } + + /** + Move the component to the center of screen + + @param c + @param width + + **/ + public static void centerComponent(Component c, int width) { + c.setLocation(width / 2 - c.getWidth() / 2, c.getLocation().y); + c.validate(); + } + + /** + Move the component to the center of screen and adjust the y location + + @param c + @param width + + **/ + public static void centerComponent(Component c, int width, int containerHeight, int preferredHeight, int spaceToBottom) { + relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom); + centerComponent(c, width); + } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java index 61d70d3043..198841941b 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java @@ -19,6 +19,8 @@ import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; @@ -30,7 +32,7 @@ import javax.swing.JOptionPane; It extends JFrame implements ActionListener and WindowListener **/ -public class IFrame extends JFrame implements ActionListener, WindowListener { +public class IFrame extends JFrame implements ActionListener, WindowListener, ComponentListener { /// /// Define class Serial Version UID @@ -77,6 +79,7 @@ public class IFrame extends JFrame implements ActionListener, WindowListener { this.setResizable(false); this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); this.addWindowListener(this); + this.addComponentListener(this); } /** @@ -238,4 +241,24 @@ public class IFrame extends JFrame implements ActionListener, WindowListener { public void showDialog() { this.setVisible(true); } + +public void componentResized(ComponentEvent arg0) { + // TODO Auto-generated method stub + +} + +public void componentMoved(ComponentEvent arg0) { + // TODO Auto-generated method stub + +} + +public void componentShown(ComponentEvent arg0) { + // TODO Auto-generated method stub + +} + +public void componentHidden(ComponentEvent arg0) { + // TODO Auto-generated method stub + +} } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java index b5f09da083..df58142728 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java @@ -15,7 +15,6 @@ package org.tianocore.frameworkwizard.common.ui; -import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ComponentEvent; @@ -154,104 +153,6 @@ public class IInternalFrame extends JInternalFrame implements ActionListener, Co } - /** - * To reset the width of input component via container width - * - * @param c - * @param containerWidth - * - */ - public void resizeComponentWidth(Component c, int containerWidth, int preferredWidth) { - int newWidth = c.getPreferredSize().width + (containerWidth - preferredWidth); - if (newWidth < c.getPreferredSize().width) { - newWidth = c.getPreferredSize().width; - } - c.setSize(new java.awt.Dimension(newWidth, c.getHeight())); - c.validate(); - } - - /** - * To reset the height of input component via container height - * - * @param c - * @param containerHeight - * - */ - public void resizeComponentHeight(Component c, int containerHeight, int preferredHeight) { - int newHeight = c.getPreferredSize().height + (containerHeight - preferredHeight); - if (newHeight < c.getPreferredSize().height) { - newHeight = c.getPreferredSize().height; - } - c.setSize(new java.awt.Dimension(c.getWidth(), newHeight)); - c.validate(); - } - - /** - * To reset the size of input component via container size - * - * @param c - * @param containerWidth - * @param containerHeight - * - */ - public void resizeComponent(Component c, int containerWidth, int containerHeight, int preferredWidth, - int preferredHeight) { - resizeComponentWidth(c, containerWidth, preferredWidth); - resizeComponentHeight(c, containerHeight, preferredHeight); - } - - /** - * To relocate the input component - * - * @param c - * @param containerWidth - * @param spaceToRight - * - */ - public void relocateComponentX(Component c, int containerWidth, int preferredWidth, int spaceToRight) { - int intGapToRight = spaceToRight + c.getPreferredSize().width; - int newLocationX = containerWidth - intGapToRight; - if (newLocationX < preferredWidth - intGapToRight) { - newLocationX = preferredWidth - intGapToRight; - } - c.setLocation(newLocationX, c.getLocation().y); - c.validate(); - } - - /** - * To relocate the input component - * - * @param c - * @param containerHeight - * @param spaceToBottom - * - */ - public void relocateComponentY(Component c, int containerHeight, int preferredHeight, int spaceToBottom) { - int intGapToBottom = spaceToBottom + c.getPreferredSize().height; - int newLocationY = containerHeight - intGapToBottom; - if (newLocationY < preferredHeight - spaceToBottom) { - newLocationY = preferredHeight - spaceToBottom; - } - c.setLocation(c.getLocation().x, newLocationY); - c.validate(); - } - - /** - * To relocate the input component - * - * @param c - * @param containerWidth - * @param containerHeight - * @param spaceToBottom - * @param spaceToRight - * - */ - public void relocateComponent(Component c, int containerWidth, int containerHeight, int preferredWidht, - int preferredHeight, int spaceToRight, int spaceToBottom) { - relocateComponentX(c, containerWidth, preferredWidht, spaceToRight); - relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom); - } - public void showStandard() { } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java index d1ec613c86..46b333efbe 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java @@ -449,12 +449,16 @@ public class ModuleBootModes extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java index 585eaec33f..85a4a93a5f 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java @@ -446,12 +446,16 @@ public class ModuleDataHubs extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java index e70933499a..c8f34c6d1d 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java @@ -514,12 +514,16 @@ public class ModuleEvents extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java index c90a6ba740..d885028bd8 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java @@ -592,12 +592,16 @@ public class ModuleExterns extends IInternalFrame implements ItemListener { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java index 472d501eac..3724525a24 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java @@ -442,12 +442,16 @@ public class ModuleGuids extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java index 27e2470731..a1efd28263 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java @@ -446,12 +446,16 @@ public class ModuleHiiPackages extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java index ca6cdc42f3..06ca286a2c 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java @@ -448,12 +448,16 @@ public class ModuleHobs extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java index 28cf57e582..1decd0fa32 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java @@ -458,12 +458,16 @@ public class ModuleLibraryClassDefinitions extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java index 85fe67ca3a..3531399a42 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java @@ -462,12 +462,16 @@ public class ModulePCDs extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java index 7464035ba8..563d3c88ea 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java @@ -456,12 +456,16 @@ public class ModulePackageDependencies extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java index 7ce181b707..793bf84937 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java @@ -491,12 +491,16 @@ public class ModulePpis extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java index b62338b211..bf728a5633 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java @@ -492,12 +492,16 @@ public class ModuleProtocols extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java index 644302f55e..26d43ab521 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java @@ -469,12 +469,16 @@ public class ModuleSourceFiles extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java index cabd9a3f2d..a9973c0696 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java @@ -446,12 +446,16 @@ public class ModuleSystemTables extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java index ed2f5aa0e1..4c2c10fbd3 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java @@ -221,7 +221,8 @@ public class ModuleVariables extends IInternalFrame { if (this.variables != null) { if (this.variables.getVariableList().size() > 0) { for (int index = 0; index < this.variables.getVariableList().size(); index++) { - String arg0 = Tools.convertUnicodeHexStringToString(variables.getVariableList().get(index).getVariableName()); + String arg0 = Tools.convertUnicodeHexStringToString(variables.getVariableList().get(index) + .getVariableName()); String arg1 = variables.getVariableList().get(index).getGuidCName(); String arg2 = null; if (variables.getVariableList().get(index).getUsage() != null) { @@ -448,12 +449,16 @@ public class ModuleVariables extends IInternalFrame { int intPreferredWidth = this.getJContentPane().getPreferredSize().width; int intPreferredHeight = this.getJContentPane().getPreferredSize().height; - resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight); - relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); - relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); - relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight, - DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); + Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight); + Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON); + Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON); + Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth, + intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON, + DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON); } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java index 5513cb3778..07081bcaee 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java @@ -1093,20 +1093,20 @@ public class MsaHeader extends IInternalFrame { int intCurrentWidth = this.getJContentPane().getWidth(); int intPreferredWidth = this.getJContentPane().getPreferredSize().width; - resizeComponentWidth(this.jTextFieldBaseName, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jTextFieldGuid, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jTextFieldVersion, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jScrollPaneLicense, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jTextFieldURL, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jScrollPaneCopyright, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jComboBoxBinaryModule, intCurrentWidth, intPreferredWidth); - resizeComponentWidth(this.jTextFieldOutputFileBasename, intCurrentWidth, intPreferredWidth); - - relocateComponentX(this.jButtonGenerateGuid, intCurrentWidth, intPreferredWidth, + Tools.resizeComponentWidth(this.jTextFieldBaseName, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldGuid, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldVersion, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPaneLicense, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldURL, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPaneCopyright, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jComboBoxBinaryModule, intCurrentWidth, intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldOutputFileBasename, intCurrentWidth, intPreferredWidth); + + Tools.relocateComponentX(this.jButtonGenerateGuid, intCurrentWidth, intPreferredWidth, DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON); } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java index 9ffefec4a4..94e2e96553 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java @@ -708,12 +708,12 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ public void componentResized(ComponentEvent arg0) { int intPreferredWidth = 500; - resizeComponentWidth(this.jTextFieldName, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldAdd, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth); - relocateComponentX(this.jButtonGen, this.getWidth(), this.getPreferredSize().width, 40); + Tools.resizeComponentWidth(this.jTextFieldName, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldAdd, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth); + Tools.relocateComponentX(this.jButtonGen, this.getWidth(), this.getPreferredSize().width, 40); } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java index faf0c79727..4e996b1399 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java @@ -734,16 +734,16 @@ public class SpdHeader extends IInternalFrame { int intPreferredWidth = 500; int intCurrentWidth = this.getJContentPane().getWidth(); - resizeComponentWidth(this.jTextFieldBaseName, intCurrentWidth,intPreferredWidth); - resizeComponentWidth(this.jTextFieldGuid, intCurrentWidth,intPreferredWidth); - resizeComponentWidth(this.jTextFieldVersion, intCurrentWidth,intPreferredWidth); - resizeComponentWidth(this.jTextFieldUrl, intCurrentWidth,intPreferredWidth); - resizeComponentWidth(this.jScrollPaneLicense, intCurrentWidth,intPreferredWidth); - resizeComponentWidth(this.jTextFieldCopyright, intCurrentWidth,intPreferredWidth); - resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth,intPreferredWidth); - resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth,intPreferredWidth); - resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth,intPreferredWidth); - relocateComponentX(this.jButtonGenerateGuid, intCurrentWidth, jButtonGenerateGuid.getWidth(),30); + Tools.resizeComponentWidth(this.jTextFieldBaseName, intCurrentWidth,intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldGuid, intCurrentWidth,intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldVersion, intCurrentWidth,intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldUrl, intCurrentWidth,intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPaneLicense, intCurrentWidth,intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldCopyright, intCurrentWidth,intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth,intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth,intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth,intPreferredWidth); + Tools.relocateComponentX(this.jButtonGenerateGuid, intCurrentWidth, jButtonGenerateGuid.getWidth(),30); } private JScrollPane getTopScrollPane() { diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java index 2a52e3121e..6b5e17ffc1 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java @@ -52,7 +52,7 @@ import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList; import org.tianocore.frameworkwizard.platform.ui.ListEditor; -import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile; +import org.tianocore.frameworkwizard.platform.ui.global.GlobalData; import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery; import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification; import org.tianocore.frameworkwizard.platform.ui.id.PackageIdentification; @@ -768,9 +768,9 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen public void componentResized(ComponentEvent arg0) { int intPreferredWidth = 500; - resizeComponentWidth(this.jTextFieldClass, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth-10); + Tools.resizeComponentWidth(this.jTextFieldClass, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth-10); } /** @@ -920,19 +920,19 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen private void getLibInstances(String libClass){ libNameGuidMap.clear(); try { - WorkspaceProfile.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE")); + GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE")); - Set spi = WorkspaceProfile.getPackageList(); + Set spi = GlobalData.getPackageList(); Iterator ispi = spi.iterator(); while (ispi.hasNext()) { PackageIdentification pi = (PackageIdentification) ispi.next(); - Set smi = WorkspaceProfile.getModules(pi); + Set smi = GlobalData.getModules(pi); Iterator ismi = smi.iterator(); while (ismi.hasNext()) { ModuleIdentification mi = (ModuleIdentification) ismi.next(); - Map m = WorkspaceProfile.getNativeMsa(mi); + Map m = GlobalData.getNativeMsa(mi); SurfaceAreaQuery.setDoc(m); Vector classProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi); for (int i = 0; i < classProduced.size(); ++i) { diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java index 9e25465ca1..b4ed73a3a5 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java @@ -485,9 +485,9 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{ public void componentResized(ComponentEvent arg0) { int intPreferredWidth = 500; - resizeComponentWidth(this.jScrollPaneMsa, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextField, this.getWidth(), intPreferredWidth); - relocateComponentX(this.jButtonBrowse, this.getWidth(), this.getPreferredSize().width, 25); + Tools.resizeComponentWidth(this.jScrollPaneMsa, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextField, this.getWidth(), intPreferredWidth); + Tools.relocateComponentX(this.jButtonBrowse, this.getWidth(), this.getPreferredSize().width, 25); } public static void main(String[] args){ diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java index 8b14758f01..342f13d6bf 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java @@ -593,10 +593,10 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe public void componentResized(ComponentEvent arg0) { int intPreferredWidth = 500; - resizeComponentWidth(this.jComboBoxSelect, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextField, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth); - relocateComponentX(this.jButtonBrowse, this.getWidth(), this.getPreferredSize().width, 30); + Tools.resizeComponentWidth(this.jComboBoxSelect, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextField, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth); + Tools.relocateComponentX(this.jButtonBrowse, this.getWidth(), this.getPreferredSize().width, 30); } public static void main(String[] args){ diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java index 76a4dea049..ec03392692 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java @@ -39,6 +39,7 @@ import javax.swing.table.TableModel; import org.tianocore.PackageSurfaceAreaDocument; import org.tianocore.frameworkwizard.common.DataValidation; +import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType; import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.StarLabel; @@ -606,14 +607,14 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ public void componentResized(ComponentEvent arg0) { int intPreferredWidth = 500; - resizeComponentWidth(this.jTextFieldC_Name, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldToken, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldTsGuid, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldDefaultValue, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldC_Name, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldToken, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldTsGuid, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldDefaultValue, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldDefaultValue, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldDefaultValue, this.getWidth(), intPreferredWidth); // relocateComponentX(this.jButtonClearAll, this.getWidth(), DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON); // relocateComponentX(this.jButtonRemove, this.getWidth(), DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON); // relocateComponentX(this.jButtonAdd, this.getWidth(), DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON); @@ -909,8 +910,8 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ JOptionPane.showMessageDialog(frame, "C_Name is NOT C_NameType."); return false; } - if (!DataValidation.isHexDoubleWordDataType(row[1].toString()) && - !DataValidation.isInt(row[1].toString(), Integer.MIN_VALUE, Integer.MAX_VALUE)) { + if (!(DataValidation.isHexDoubleWordDataType(row[1].toString()) || + DataValidation.isInt(row[1].toString(), 0, 0xffffffff))) { JOptionPane.showMessageDialog(frame, "Token is NOT correct."); return false; } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java index ea6171fac7..6c583f3c06 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java @@ -683,16 +683,16 @@ public class FpdHeader extends IInternalFrame { public void componentResized(ComponentEvent arg0) { int intPreferredWidth = 500; - resizeComponentWidth(this.jTextFieldBaseName, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldGuid, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldUrl, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jScrollPaneLicense, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldCopyright, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jScrollPaneDescription, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldSpecification, this.getWidth(), intPreferredWidth); - resizeComponentWidth(this.jTextFieldAbstract, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldBaseName, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldGuid, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldUrl, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPaneLicense, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldCopyright, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jScrollPaneDescription, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldSpecification, this.getWidth(), intPreferredWidth); + Tools.resizeComponentWidth(this.jTextFieldAbstract, this.getWidth(), intPreferredWidth); - relocateComponentX(this.jButtonGenerateGuid, this.getWidth(), jButtonGenerateGuid.getWidth(), 25); + Tools.relocateComponentX(this.jButtonGenerateGuid, this.getWidth(), jButtonGenerateGuid.getWidth(), 25); } }