All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.desktop.GUIHandler

java.lang.Object
   |
   +----COM.ibm.desktop.GUIHandler

public class GUIHandler
extends Object
implements Serializable, ActionListener, ItemListener, MouseListener, WindowListener
GUIHandler provides default GUI and event management for the component controller. Specifically, it:
  • provides a parent frame for hosting the view
  • provides a default menu bar with File, Edit, View and Help menus
  • provides a default tool bar and tool buttons
  • provides a default status bar
  • provides default menu item and tool button event handlers
  • provides default window event handlers

     Copyright (c) Taligent, Inc.  1996 - 1997.
     Copyright (c) IBM Corporation 1996 - 1997.
     All Rights Reserved.
     


    Constructor Index

     o GUIHandler(ComponentController)

    Method Index

     o actionPerformed(ActionEvent)
    Invoked when the menu items are selected or when the tool buttons are pressed.
     o addAndDo(Command)
    A convenience method to add a command to the command processor and perform the command.
     o getApplicationName()
    A convenience method to get the application name.
     o getCommandProcessor()
    A convenience method to get the command processor.
     o getComponentController()
    Return the component controller.
     o getComponentFrame()
    Return the component frame.
     o getModel()
    A convenience method to get the model.
     o getModelSelection()
    A convenience method to get the model selection.
     o getPopupMenu()
    Return the popup menu.
     o getView()
    A convenience method to get the view.
     o handleAbout()
    Invoked by the Help->About ...
     o handleClose()
    Invoked by handleConfirmClose.
     o handleConfirmClose()
    Invoked by a File->Close menu action.
     o handleConfirmExit()
    Invoked by the File->Exit menu action.
     o handleConfirmNewModel()
    Display a confirmation dialog to give the user a chance to save model changes before invoking handleNewModel to create a new model instance.
     o handleConfirmOpen()
    Invoked by a File->Open menu action.
     o handleCopy()
    Invoked by the Edit->Copy menu action.
     o handleCreateEditMenu()
    Invoked by the framework to create an edit menu.
     o handleCreateFileMenu()
    Invoked by the framework to create a file menu.
     o handleCreateHelpMenu()
    Invoked by the framework during initialization.
     o handleCreateMenuBar()
    Invoked by the framework during initialization.
     o handleCreateMenus(MenuBar)
    Invoked by the framework during initialization.
     o handleCreatePopupMenu(MenuBar)
    Create a popup menu based on the menubar.
     o handleCreateStatusBar()
    Invoked by the framework during initialization.
     o handleCreateToolBar()
    Invoked by the framework during initialization.
     o handleCreateToolButtons(TToolBar)
    Invoked by the framework during initialization.
     o handleCreateViewMenu()
    Invoked by the framework to create a view menu.
     o handleCut()
    Invoked by the Edit->Cut menu action.
     o handleDelete()
    Invoked by the Edit->Delete menu action.
     o handleExit()
    Invoked by handleConfirmExit.
     o handleNew()
    Invoked by a File->New menu action.
     o handleNewInstance()
    Create a new instance of the application.
     o handleNewModel()
    Re-initialize the application with a new model instance.
     o handleOpen()
    Invoked by handleConfirmOpen.
     o handlePaste()
    Invoked by the Edit->Paste menu action.
     o handleRedo()
    Invoked by the Edit->Redo menu action.
     o handleSave()
    Invoked by a File->Save menu action.
     o handleSaveAs()
    Invoked by a File->SaveAs menu action.
     o handleSelectAll()
    Invoked by the Edit->SelectAll menu action.
     o handleUndo()
    Invoked by the Edit->Undo menu action.
     o itemStateChanged(ItemEvent)
    Invoked when the checkbox menu items in the tool bar popup menu change state.
     o mouseClicked(MouseEvent)
    Invoked when the mouse is clicked on the target.
     o mouseEntered(MouseEvent)
    Invoked when the mouse enters the target.
     o mouseExited(MouseEvent)
    Invoked when the mouse exits the target.
     o mousePressed(MouseEvent)
    Invoked when the mouse is pressed.
     o mouseReleased(MouseEvent)
    Invoked when the mouse is released.
     o setLocale(Locale)
    Change the locale of the program and update the GUI and the resource bundle based on the new locale.
     o windowActivated(WindowEvent)
    Invoked when the window is activated.
     o windowClosed(WindowEvent)
    Invoked when the window closed.
     o windowClosing(WindowEvent)
    Invoked when the window is closing.
     o windowDeactivated(WindowEvent)
    Invoked when the window is deactivated.
     o windowDeiconified(WindowEvent)
    Invoked when the window is deiconified.
     o windowIconified(WindowEvent)
    Invoked when the window is iconified.
     o windowOpened(WindowEvent)
    Invoked when the window is opened.

    Constructors

     o GUIHandler
     public GUIHandler(ComponentController controller)
    

    Methods

     o getComponentController
     public ComponentController getComponentController()
    
    Return the component controller.

     o getComponentFrame
     public ComponentFrame getComponentFrame()
    
    Return the component frame.

     o getPopupMenu
     public PopupMenu getPopupMenu()
    
    Return the popup menu.

     o getModel
     public final IModel getModel()
    
    A convenience method to get the model.

     o getView
     public final IView getView()
    
    A convenience method to get the view.

     o getModelSelection
     public final ModelSelection getModelSelection()
    
    A convenience method to get the model selection.

     o getApplicationName
     public final String getApplicationName()
    
    A convenience method to get the application name.

     o getCommandProcessor
     public final ICommandProcessor getCommandProcessor()
    
    A convenience method to get the command processor.

     o addAndDo
     public final void addAndDo(Command command)
    
    A convenience method to add a command to the command processor and perform the command.

     o setLocale
     public void setLocale(Locale locale)
    
    Change the locale of the program and update the GUI and the resource bundle based on the new locale. Override this method to update the client's resource bundle with the new locale before calling super.setLocale(locale).

     o actionPerformed
     public void actionPerformed(ActionEvent e)
    
    Invoked when the menu items are selected or when the tool buttons are pressed.

     o itemStateChanged
     public void itemStateChanged(ItemEvent e)
    
    Invoked when the checkbox menu items in the tool bar popup menu change state.

     o mousePressed
     public void mousePressed(MouseEvent e)
    
    Invoked when the mouse is pressed.

     o mouseReleased
     public void mouseReleased(MouseEvent e)
    
    Invoked when the mouse is released.

     o mouseClicked
     public void mouseClicked(MouseEvent e)
    
    Invoked when the mouse is clicked on the target.

     o mouseEntered
     public void mouseEntered(MouseEvent e)
    
    Invoked when the mouse enters the target.

     o mouseExited
     public void mouseExited(MouseEvent e)
    
    Invoked when the mouse exits the target.

     o windowClosed
     public void windowClosed(WindowEvent evt)
    
    Invoked when the window closed.

     o windowClosing
     public void windowClosing(WindowEvent e)
    
    Invoked when the window is closing.

     o windowDeiconified
     public void windowDeiconified(WindowEvent e)
    
    Invoked when the window is deiconified.

     o windowIconified
     public void windowIconified(WindowEvent e)
    
    Invoked when the window is iconified.

     o windowOpened
     public void windowOpened(WindowEvent e)
    
    Invoked when the window is opened.

     o windowActivated
     public void windowActivated(WindowEvent e)
    
    Invoked when the window is activated.

     o windowDeactivated
     public void windowDeactivated(WindowEvent e)
    
    Invoked when the window is deactivated.

     o handleCreateMenuBar
     protected MenuBar handleCreateMenuBar()
    
    Invoked by the framework during initialization. Override this method to create custom menu bar. Default implementation creates the File and Edit menus.

     o handleCreateFileMenu
     protected Menu handleCreateFileMenu()
    
    Invoked by the framework to create a file menu. Default implementation creates a default file menu. Override this method to customize the default file menu or create your custom file menu.

     o handleCreateEditMenu
     protected Menu handleCreateEditMenu()
    
    Invoked by the framework to create an edit menu. Default implementation creates a default edit menu. Override this method to customize the default edit menu or create your custom edit menu.

     o handleCreateViewMenu
     protected Menu handleCreateViewMenu()
    
    Invoked by the framework to create a view menu. Default implementation creates a default view menu. Override this method to customize the default view menu or create your custom view menu.

     o handleCreateHelpMenu
     protected Menu handleCreateHelpMenu()
    
    Invoked by the framework during initialization. Override this method to customize the help menu. Default implementation adds an about box menu item.

     o handleCreateMenus
     protected void handleCreateMenus(MenuBar menubar)
    
    Invoked by the framework during initialization. Override this method to add custom menus to the menu bar. There is no default implementation.

     o handleCreateToolBar
     protected TToolBar handleCreateToolBar()
    
    Invoked by the framework during initialization. Override this method to create custom tool bar. Default implementation creates a default tool bar.

     o handleCreateToolButtons
     protected void handleCreateToolButtons(TToolBar toolbar)
    
    Invoked by the framework during initialization. Override this method to add custom tool buttons to the tool bar. There is no default implementation.

     o handleCreateStatusBar
     protected TStatusBar handleCreateStatusBar()
    
    Invoked by the framework during initialization. Override this method to create custom status bar. Default implementation creates a default status bar.

     o handleCreatePopupMenu
     protected PopupMenu handleCreatePopupMenu(MenuBar menubar)
    
    Create a popup menu based on the menubar.

     o handleNew
     protected void handleNew()
    
    Invoked by a File->New menu action. Default implementation calls handleNewInstance to create a new instance of the application. If you want to re-initialize the application with a new model instance instead, override this method and call handleConfirmNewModel.

     o handleNewInstance
     protected void handleNewInstance()
    
    Create a new instance of the application.

     o handleConfirmNewModel
     protected void handleConfirmNewModel()
    
    Display a confirmation dialog to give the user a chance to save model changes before invoking handleNewModel to create a new model instance.

     o handleNewModel
     protected void handleNewModel()
    
    Re-initialize the application with a new model instance.

     o handleConfirmOpen
     protected void handleConfirmOpen()
    
    Invoked by a File->Open menu action. Default implementation displays a confirmation dialog to give the user a chance to save changes if the model is changed; otherwise, it displays a file open dialog and open a document.

     o handleOpen
     protected void handleOpen()
    
    Invoked by handleConfirmOpen. Display the file open dialog and open a document.

     o handleSave
     protected void handleSave()
    
    Invoked by a File->Save menu action. Default implementation saves the current document or saves contents as another document if there is no current document.

     o handleSaveAs
     protected void handleSaveAs()
    
    Invoked by a File->SaveAs menu action. Default implementation displays the file save dialog to save contents as another document.

     o handleConfirmClose
     protected void handleConfirmClose()
    
    Invoked by a File->Close menu action. Default implementation displays a confirmation dialog to give the user a chance to save changes if the model is changed; otherwise, it calls handleClose to close the frame.

     o handleClose
     protected void handleClose()
    
    Invoked by handleConfirmClose. Default implementation hides the component frame and closes the application window. Override this method to perform your own cleanup.

     o handleConfirmExit
     protected void handleConfirmExit()
    
    Invoked by the File->Exit menu action. Default implementation displays a confirmation dialog to give the user a chance to save changes if the model is changed; otherwise, it calls handleExit to exit the application.

     o handleExit
     protected void handleExit()
    
    Invoked by handleConfirmExit. Default implementation calls handleClose and exits.

     o handleUndo
     protected void handleUndo()
    
    Invoked by the Edit->Undo menu action. Default implementation undo the previous command.

     o handleRedo
     protected void handleRedo()
    
    Invoked by the Edit->Redo menu action. Default implementation redo the previous undo command.

     o handleCut
     protected void handleCut()
    
    Invoked by the Edit->Cut menu action. Default implementation deletes the current model selection and gives it to the clipboard.

     o handleCopy
     protected void handleCopy()
    
    Invoked by the Edit->Copy menu action. Default implementation copies the current model selection to the clipboard.

     o handlePaste
     protected void handlePaste()
    
    Invoked by the Edit->Paste menu action. Default implementation pastes the object from the clipboard into the current model selection.

     o handleDelete
     protected void handleDelete()
    
    Invoked by the Edit->Delete menu action. Default implementation deletes the current model selection.

     o handleSelectAll
     protected void handleSelectAll()
    
    Invoked by the Edit->SelectAll menu action. Override this method to select all objects in the model. Default implementation asks the current model selection to select all objects.

     o handleAbout
     protected void handleAbout()
    
    Invoked by the Help->About ... menu action. Override this method to show the about box. Default implementation displays a simple about box using the Application, Version, and Copyright resource strings from the resource file.


    All Packages  Class Hierarchy  This Package  Previous  Next  Index