|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.skeleton.swing.SwingGraphPanelPopupMenuSource
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.
This class also provides several addToMenu() utility methods
to be used in order to add items to the popup menu.
| Field Summary | |
protected ApplicationFrame |
applicationFrame
applicationFrame reference |
protected PopupMenu |
popupmenu
popupmenu reference |
| Constructor Summary | |
SwingGraphPanelPopupMenuSource(ApplicationFrame applicationFrame)
Initializes the SwingGraphPanelPopupMenuSource instance. |
|
| Method Summary | |
protected void |
addToMenu(PopupMenu popupmenu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke stroke,
java.lang.String iconurl,
java.lang.Class referenceClass)
The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action. |
protected void |
addToMenu(PopupMenu popupmenu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke stroke,
java.lang.String iconurl,
java.lang.String defaulticon)
The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action. |
protected void |
addToMenu(PopupMenu popupmenu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke stroke,
java.lang.String iconurl,
java.lang.String defaulticon,
java.lang.Class referenceClass)
The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action. |
protected void |
addToMenu(PopupMenu popupmenu,
java.util.HashMap uiMap,
java.lang.String id,
java.lang.String iconurl,
java.lang.String defaulticon)
Adds a new Item to the parameter Menu. |
protected void |
addToMenu(PopupMenu popupmenu,
java.util.HashMap uiMap,
java.lang.String id,
java.lang.String iconurl,
java.lang.String defaulticon,
java.lang.Class referenceClass)
Adds a new Item to the parameter Menu. |
void |
create()
This callback triggers a (re)creation of the popup menu. |
SwingMenu |
createMenu(java.lang.String idText)
Utility method creating and returning a SwingMenu |
void |
destroy()
Does nothing. |
protected void |
destroyBeforeCreating()
This method method has to be called has a first thing in the
create() method before the popup menu creation in order to
ensure that the UIMap is not overloaded. |
PopupMenuMarkup |
getPopupMenu(java.lang.Object eventObject)
Returns the internal JPopupMenu instance of this class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final ApplicationFrame applicationFrame
protected PopupMenu popupmenu
| Constructor Detail |
public SwingGraphPanelPopupMenuSource(ApplicationFrame applicationFrame)
SwingGraphPanelPopupMenuSource instance.
applicationFrame - Application context for this MenuSource.| Method Detail |
public PopupMenuMarkup getPopupMenu(java.lang.Object eventObject)
JPopupMenu instance of this class.
getPopupMenu in interface JPopupMenuSourceeventObject - an optional instance of MouseEvent.
JPopupMenu instance of this class.JPopupMenuSource.getPopupMenu(Object),
popupmenupublic SwingMenu createMenu(java.lang.String idText)
SwingMenu
idText - the ID for the UIManager as used for the
text of the resulting SwingMenu.
public void create()
JPopupMenuSourceWithUpdateUI
create in interface JPopupMenuSourceWithUpdateUIpublic void destroy()
destroy in interface JPopupMenuSourceWithUpdateUIJPopupMenuSourceWithUpdateUI.destroy()protected void destroyBeforeCreating()
create() method before the popup menu creation in order to
ensure that the UIMap is not overloaded.
protected final void addToMenu(PopupMenu popupmenu,
java.util.HashMap uiMap,
java.lang.String id,
java.lang.String iconurl,
java.lang.String defaulticon)
com.tensegrity.skeleton.Skeleton.
popupmenu - target SwingPopupMenu to add a new item to.uiMap - map to add the resulting menu item to (required for language switch)id - ID of the text for the new item.iconurl - url of the icon.defaulticon - url to the default icon used in windows LNF.
protected final void addToMenu(PopupMenu popupmenu,
java.util.HashMap uiMap,
java.lang.String id,
java.lang.String iconurl,
java.lang.String defaulticon,
java.lang.Class referenceClass)
popupmenu - target SwingPopupMenu to add a new item to.uiMap - map to add the resulting menu item to (required for language switch)id - ID of the text for the new item.iconurl - url of the icon.defaulticon - url to the default icon used in windows LNF.referenceClass - Class used as reference in order to retrieve the images.
protected final void addToMenu(PopupMenu popupmenu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke stroke,
java.lang.String iconurl,
java.lang.Class referenceClass)
popupmenu - target SwingPopupMenu to add a new item to.uiMap - map to add the resulting menu item to (required for language switch)id - ID of the text for the new item.stroke - KeyStroke for the new item.iconurl - url of the icon.referenceClass - Class used as reference in order to retrieve the
images
protected final void addToMenu(PopupMenu popupmenu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke stroke,
java.lang.String iconurl,
java.lang.String defaulticon,
java.lang.Class referenceClass)
popupmenu - target SwingPopupMenu to add a new item to.uiMap - map to add the resulting menu item to (required for language switch)id - ID of the text for the new item.stroke - KeyStroke for the new item.iconurl - url of the icon.defaulticon - url to the default icon used in windows LNF.referenceClass - Class used as reference in order to retrieve the
images
protected final void addToMenu(PopupMenu popupmenu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke stroke,
java.lang.String iconurl,
java.lang.String defaulticon)
com.tensegrity.skeleton.Skeleton.
popupmenu - target SwingPopupMenu to add a new item to.uiMap - map to add the resulting menu item to (required for language switch)id - ID of the text for the new item.stroke - KeyStroke for the new item.iconurl - url of the icon.defaulticon - url to the default icon used in windows LNF.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||