miSim

misim.util
Class GUIUtils

java.lang.Object
  |
  +--misim.util.GUIUtils

public class GUIUtils
extends java.lang.Object

Various static methods for creating GUI objects and laying them out.


Constructor Summary
GUIUtils()
           
 
Method Summary
static java.awt.Button addButtonToPanel(java.awt.Panel aPanel, int iMsg, java.awt.event.ActionListener actor)
          Convenience method for adding a new button to a panel
static java.awt.Button addButtonToPanel(java.awt.Panel aPanel, int iMsg, java.awt.event.ActionListener actor, boolean enabled)
          Convenience method for adding a new button to a panel
static java.awt.Button addButtonToPanel(java.awt.Panel aPanel, int iMsg, java.awt.event.ActionListener actor, java.lang.Object constraints)
          Convenience method for adding a new button to a panel
static java.awt.Button addButtonToPanel(java.awt.Panel aPanel, int iMsg, java.lang.String command, java.awt.event.ActionListener actor)
          Convenience method for adding a new button to a panel and set the button's action command
static java.awt.Button addButtonToPanel(java.awt.Panel aPanel, java.lang.String text, java.lang.String command, java.awt.event.ActionListener actor)
          Convenience method for adding a new button to a panel and set the button's action command
static java.awt.MenuItem addMenuItem(java.awt.PopupMenu popup, int iMsg, java.awt.event.ActionListener actor)
          Convenience method for adding a new menu item to a menu
static java.awt.TextField addTextToPanel(java.awt.Panel aPanel, int iLength)
          Convenience method for adding a new text field to a panel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GUIUtils

public GUIUtils()
Method Detail

addButtonToPanel

public static java.awt.Button addButtonToPanel(java.awt.Panel aPanel,
                                               int iMsg,
                                               java.lang.String command,
                                               java.awt.event.ActionListener actor)
Convenience method for adding a new button to a panel and set the button's action command
Parameters:
aPanel - The panel to add the button to
iMsg - The message id for the button
command - The action command for the button
actor - The action listener for the button
Returns:
The newly created button

addButtonToPanel

public static java.awt.Button addButtonToPanel(java.awt.Panel aPanel,
                                               int iMsg,
                                               java.awt.event.ActionListener actor)
Convenience method for adding a new button to a panel
Parameters:
aPanel - The panel to add the button to
iMsg - The messageId for the button
actor - The action listener for the button
Returns:
The newly created button

addButtonToPanel

public static java.awt.Button addButtonToPanel(java.awt.Panel aPanel,
                                               java.lang.String text,
                                               java.lang.String command,
                                               java.awt.event.ActionListener actor)
Convenience method for adding a new button to a panel and set the button's action command
Parameters:
aPanel - The panel to add the button to
text - The text for the button
command - The action command for the button
actor - The action listener for the button
Returns:
The newly created button

addButtonToPanel

public static java.awt.Button addButtonToPanel(java.awt.Panel aPanel,
                                               int iMsg,
                                               java.awt.event.ActionListener actor,
                                               boolean enabled)
Convenience method for adding a new button to a panel
Parameters:
aPanel - The panel to add the button to
iMsg - The messageId for the button
actor - The action listener for the button
enabled - True if the button is to be enabled, false otherwise
Returns:
The newly created button

addButtonToPanel

public static java.awt.Button addButtonToPanel(java.awt.Panel aPanel,
                                               int iMsg,
                                               java.awt.event.ActionListener actor,
                                               java.lang.Object constraints)
Convenience method for adding a new button to a panel
Parameters:
aPanel - The panel to add the button to
iMsg - The messageId for the button
actor - The action listener for the button
constraints - A layout constraints object
Returns:
The newly created button

addTextToPanel

public static java.awt.TextField addTextToPanel(java.awt.Panel aPanel,
                                                int iLength)
Convenience method for adding a new text field to a panel
Parameters:
aPanel - The panel to add the field to
iLength - The length of the text field
Returns:
The newly created text field

addMenuItem

public static java.awt.MenuItem addMenuItem(java.awt.PopupMenu popup,
                                            int iMsg,
                                            java.awt.event.ActionListener actor)
Convenience method for adding a new menu item to a menu
Parameters:
popup - The popup menu to add the menu item to
iMsg - The message id for the button
actor - The action listener for the button
Returns:
The newly created menu item

miSim