com.tensegrity.skeleton.swt
Class SwtGraphPanelPopupMenuSource

java.lang.Object
  extended bycom.tensegrity.skeleton.swt.SwtGraphPanelPopupMenuSource
All Implemented Interfaces:
JPopupMenuSource, JPopupMenuSourceWithUpdateUI

public class SwtGraphPanelPopupMenuSource
extends java.lang.Object
implements JPopupMenuSourceWithUpdateUI

This class provides the popup menus for the drawing areas. Note that since the application frame only holds one instance of popup menu source shared among all the GraphPanels the destroy method overridden in this class does nothing. Override the destroyBeforeCreating() method instead in order to ensure that the UIMap does not get overloaded when doing Look And Feel switches.

Version:
$Id: SwtGraphPanelPopupMenuSource.java,v 1.8 2004/10/11 10:31:47 MichaelKegel Exp $
Author:
S�bastien Guyon

Field Summary
protected  ApplicationFrame applicationFrame
          applicationFrame reference
protected  SwtPopupMenu popupmenu
          popupmenu reference
 
Constructor Summary
SwtGraphPanelPopupMenuSource(ApplicationFrame applicationFrame)
          Initializes the SwtGraphPanelPopupMenuSource instance.
 
Method Summary
 void create()
          This callback triggers a (re)creation of the popup menu.
 void destroy()
          This callback triggers cleanup and destroying of the popup menu.
protected  void destroyBeforeCreating()
           Called from the create() method it disposes and sets to null the local SwtPopupMenu instance.
 PopupMenuMarkup getPopupMenu(java.lang.Object eventObject)
          Returns the current popup menu of the popup source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applicationFrame

protected final ApplicationFrame applicationFrame
applicationFrame reference


popupmenu

protected SwtPopupMenu popupmenu
popupmenu reference

Constructor Detail

SwtGraphPanelPopupMenuSource

public SwtGraphPanelPopupMenuSource(ApplicationFrame applicationFrame)
Initializes the SwtGraphPanelPopupMenuSource instance.

Parameters:
applicationFrame - Application context for this MenuSource.
Method Detail

getPopupMenu

public PopupMenuMarkup getPopupMenu(java.lang.Object eventObject)
Description copied from interface: JPopupMenuSource
Returns the current popup menu of the popup source.

Specified by:
getPopupMenu in interface JPopupMenuSource
Parameters:
eventObject - the mouse-event that triggered the request.
Returns:
the current popup menu of the popup source.
See Also:
JPopupMenuSource.getPopupMenu(java.lang.Object)

create

public void create()
Description copied from interface: JPopupMenuSourceWithUpdateUI
This callback triggers a (re)creation of the popup menu.

Specified by:
create in interface JPopupMenuSourceWithUpdateUI

destroy

public void destroy()
Description copied from interface: JPopupMenuSourceWithUpdateUI
This callback triggers cleanup and destroying of the popup menu.

Specified by:
destroy in interface JPopupMenuSourceWithUpdateUI
See Also:
com.tensegrity.gui.swt.SwtPopupMenuSourceWithUpdateUI#destroy()

destroyBeforeCreating

protected void destroyBeforeCreating()

Called from the create() method it disposes and sets to null the local SwtPopupMenu instance.



Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.