org.graffiti.util
Class DesktopMenuManager

java.lang.Object
  extended by org.graffiti.util.DesktopMenuManager
All Implemented Interfaces:
EventListener, MenuListener

public class DesktopMenuManager
extends Object
implements MenuListener

Manages menu entries for the internal frames contained in a desktop pane. A MenuManager is associated with a JDesktopPane and a JMenu. The associated menu is always updated to contain entries for all internal frames in the desktop pane. Selecting such a frame entry selects the corresponding internal frame. In addition, actions for arranging the frames are added to the menu.

Version:
$Revision: 5768 $ $Date: 2008-11-17 15:30:14 +0100 (Mon, 17 Nov 2008) $
Author:
Michael Forster

Nested Class Summary
(package private)  class DesktopMenuManager.FrameMenuItem
          A menu item associated to a frame.
 
Constructor Summary
DesktopMenuManager(JDesktopPane desktop, JMenu menu, Comparator<JInternalFrame> order)
          Create a MenuManager object and associate it with a desktop and a menu.
 
Method Summary
 void dispose()
          Dispose this manager.
 void menuCanceled(MenuEvent e)
          Ignored.
 void menuDeselected(MenuEvent e)
          Ignored.
 void menuSelected(MenuEvent e)
          Updates the associated menu.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DesktopMenuManager

public DesktopMenuManager(JDesktopPane desktop,
                          JMenu menu,
                          Comparator<JInternalFrame> order)
Create a MenuManager object and associate it with a desktop and a menu.

Parameters:
desktop - The associated desktop
menu - The associated menu
order - Comparator used to order the window menu items.
Throws:
NullPointerException - if a passed parameter is null
Method Detail

dispose

public void dispose()
Dispose this manager. Reset the menu, remove all listeners and make this class eligible for garbage collection.


menuCanceled

public void menuCanceled(MenuEvent e)
Ignored.

Specified by:
menuCanceled in interface MenuListener
See Also:
MenuListener.menuCanceled(javax.swing.event.MenuEvent)

menuDeselected

public void menuDeselected(MenuEvent e)
Ignored.

Specified by:
menuDeselected in interface MenuListener
See Also:
MenuListener.menuDeselected(javax.swing.event.MenuEvent)

menuSelected

public void menuSelected(MenuEvent e)
Updates the associated menu.

Specified by:
menuSelected in interface MenuListener
See Also:
MenuListener.menuSelected(javax.swing.event.MenuEvent)


Generated at 2012-05-30 11:00:36 PM CEST