org.proteinshader.gui.listeners.menubar
Class FileMenuListenerFactory

java.lang.Object
  extended by org.proteinshader.gui.listeners.menubar.FileMenuListenerFactory

public class FileMenuListenerFactory
extends Object

Creates all event listeners needed by the FileMenu of the MainMenuBar.


Constructor Summary
FileMenuListenerFactory(Mediator mediator)
          Constructs a FileMenuListenerFactory.
 
Method Summary
 ActionListener createImageFileMenuItemListener()
          Creates an action listener for the "PNG File..." menu item.
 ActionListener createOpenMenuItemListener()
          Creates an action listener for the "Open" menu item.
 ActionListener createQuitMenuItemListener()
          Creates an action listener for the "Quit" menu item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileMenuListenerFactory

public FileMenuListenerFactory(Mediator mediator)
Constructs a FileMenuListenerFactory.

Parameters:
mediator - the centralized Mediator object that listeners call on to accomplish their task.
Method Detail

createOpenMenuItemListener

public ActionListener createOpenMenuItemListener()
Creates an action listener for the "Open" menu item. When the action listener is called, it will obtain a filename from the user and then call on the Mediator to read the file and create a new Structure.

Returns:
The action listener.

createImageFileMenuItemListener

public ActionListener createImageFileMenuItemListener()
Creates an action listener for the "PNG File..." menu item. When the action listener is called, it will save the current canvas image to a ".png" file. The images will be saved in the FileMenu.IMAGES_DIRECTORY, which will be created if it does not already exist.

Returns:
The action listener.

createQuitMenuItemListener

public ActionListener createQuitMenuItemListener()
Creates an action listener for the "Quit" menu item. When the action listener is called, it will terminate the program.

Returns:
The action listener.


Copyright © 2007-2008