|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.command.CommandRegistry
com.tensegrity.gui.swing.SwingCommandRegistry
The SwingCommandRegistry encapsulates the creation of all sorts of MenuItems, Buttons and Menu's. All these controls are associated with an Action, which triggers the underlying Command implementation. This class creates Actions for Commands and stores these in a internal Map. This ensures that there is only one Action for each Command (and vice versa).
| Nested Class Summary | |
static class |
SwingCommandRegistry.ActionCommand
Deprecated. This class has been moved to SwingCommandRegistry.ActionCommand |
| Constructor Summary | |
SwingCommandRegistry()
Creates a new SwingCommandRegistry. |
|
| Method Summary | |
javax.swing.JMenuItem |
addToMenu(javax.swing.JMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke ks,
java.lang.String iconurl,
java.lang.Class resourceClass,
UIManager uiManager)
Deprecated. Please use SwingUtil instead! |
javax.swing.JMenuItem |
addToMenu(javax.swing.JMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke ks,
UIManager uiManager)
Deprecated. Please use SwingUtil instead! |
javax.swing.JMenuItem |
addToMenu(javax.swing.JMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
java.lang.String iconurl,
java.lang.Class resourceClass,
UIManager uiManager)
Deprecated. Please use SwingUtil instead! |
javax.swing.JMenuItem |
addToMenu(javax.swing.JMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
UIManager uiManager)
Deprecated. Please use SwingUtil instead! |
javax.swing.JMenuItem |
addToMenu(javax.swing.JPopupMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke ks,
java.lang.String iconurl,
java.lang.Class resourceClass,
UIManager uiManager)
Deprecated. Please use SwingUtil instead! |
javax.swing.JMenuItem |
addToMenu(javax.swing.JPopupMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
java.lang.String iconurl,
java.lang.Class resourceClass,
UIManager uiManager)
Deprecated. Please use SwingUtil instead! |
javax.swing.JMenuItem |
addToMenu(javax.swing.JPopupMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
UIManager uiManager)
Deprecated. Please use SwingUtil instead! |
javax.swing.JButton |
addToToolBar(SwingToolBar toolbar,
Command command,
int index,
java.util.HashMap uiMap,
UIManager uiManager)
Deprecated. Please use SwingUtil instead! |
javax.swing.JButton |
addToToolBar(SwingToolBar toolbar,
Command command,
int index,
java.util.HashMap uiMap,
UIManager uiManager,
java.lang.String displayTextId)
Deprecated. Please use SwingUtil instead! |
javax.swing.JButton |
addToToolBar(SwingToolBar toolbar,
Command command,
java.lang.String iconurl,
int index,
java.lang.Class resourceClass)
Deprecated. Please use SwingUtil instead! |
javax.swing.JToggleButton |
addToToolBarToggleButton(SwingToolBar toolbar,
Command command,
int index,
java.util.HashMap uiMap,
UIManager uiManager)
Deprecated. Please use SwingUtil instead! |
javax.swing.JToggleButton |
addToToolBarToggleButton(SwingToolBar toolbar,
Command command,
int index,
java.util.HashMap uiMap,
UIManager uiManager,
java.lang.String displayTextId)
Deprecated. Please use SwingUtil instead! |
javax.swing.JToggleButton |
addToToolBarToggleButton(SwingToolBar toolbar,
Command command,
java.lang.String iconurl,
java.lang.String iconurlToggled,
java.lang.Class resourceClass)
Deprecated. Please use SwingUtil instead! |
javax.swing.JToggleButton |
addToToolBarToggleButton(SwingToolBar toolbar,
Command command,
java.lang.String iconurl,
java.lang.String iconurlToggled,
int index,
java.lang.Class resourceClass)
Deprecated. Please use SwingUtil instead! |
javax.swing.Action |
getAction(java.lang.String id)
The method getAction returns the action instance for a given command id. |
protected javax.swing.JMenuItem |
makeMenuItem(java.lang.String title,
javax.swing.Action action)
Deprecated. Please use SwingUtil instead! |
| Methods inherited from class com.tensegrity.generic.command.CommandRegistry |
clear, contains, dump, get, remove, size |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SwingCommandRegistry()
| Method Detail |
protected javax.swing.JMenuItem makeMenuItem(java.lang.String title,
javax.swing.Action action)
JMenuItem from the
given title and action.
title - the title of the new item.action - the action to be associated with the item.
public javax.swing.JToggleButton addToToolBarToggleButton(SwingToolBar toolbar,
Command command,
java.lang.String iconurl,
java.lang.String iconurlToggled,
java.lang.Class resourceClass)
iconurl and
iconurltoggled.
toolbar - the JToolBar to add to.command - the command to use to create a new Button from.iconurl - the url of the icon of this button.iconurlToggled - the url of the icon to use when toggled.resourceClass - the class required to load the icons.
public javax.swing.JToggleButton addToToolBarToggleButton(SwingToolBar toolbar,
Command command,
java.lang.String iconurl,
java.lang.String iconurlToggled,
int index,
java.lang.Class resourceClass)
iconurl and
iconurltoggled.
toolbar - the JToolBar to add to.command - the command to use to create a new Button from.iconurl - the url of the icon of this button.iconurlToggled - the url of the icon to use when toggled.index - Position where the button is addedresourceClass - the class required to load the icons.
public javax.swing.JToggleButton addToToolBarToggleButton(SwingToolBar toolbar,
Command command,
int index,
java.util.HashMap uiMap,
UIManager uiManager)
toolbar - the ToolBar to add the toggle button to.command - the command to associate with the toggle.index - the position where to add the toggle.uiMap - the uiMap to add the resulting control to.uiManager - the uiManager to retrieve strings from.
public javax.swing.JToggleButton addToToolBarToggleButton(SwingToolBar toolbar,
Command command,
int index,
java.util.HashMap uiMap,
UIManager uiManager,
java.lang.String displayTextId)
toolbar - the toolbar to add to.command - the command to use.index - the position within the toolbar.uiMap - the uiMap to add the resulting component,id-pair to.uiManager - UIManager to retrieve localized strings.displayTextId - the alternative text resource.
public javax.swing.JButton addToToolBar(SwingToolBar toolbar,
Command command,
java.lang.String iconurl,
int index,
java.lang.Class resourceClass)
toolbar - The JToolBar to add to.command - the Command to create the button from.iconurl - the url of the icon.index - position where to add the button to.resourceClass - the Class to laod the icon with.
public javax.swing.JButton addToToolBar(SwingToolBar toolbar,
Command command,
int index,
java.util.HashMap uiMap,
UIManager uiManager)
toolbar - The JToolBar to add to.command - the Command to create the button from.index - position where to add the button to.uiMap - the uiMap to add the new item to.uiManager - the UIManager which helps to retrieve the current text.
public javax.swing.JButton addToToolBar(SwingToolBar toolbar,
Command command,
int index,
java.util.HashMap uiMap,
UIManager uiManager,
java.lang.String displayTextId)
toolbar - The JToolBar to add to.command - the Command to create the button from.index - position where to add the button to.uiMap - the uiMap to add the new item to.uiManager - the UIManager which helps to retrieve the current text.displayTextId - Id of the text resource to use for the resulting control.
public javax.swing.JMenuItem addToMenu(javax.swing.JMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
UIManager uiManager)
JMenuItem to the given menu
by using the Action associated to the given id.
menu - the menu to add to.uiMap - the uiMap to add the new item to.id - the id to fetch the Action with.uiManager - the UIManager which helps to retrieve the current title.
JMenuItem from the menu.add call.
public javax.swing.JMenuItem addToMenu(javax.swing.JMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke ks,
UIManager uiManager)
JMenuItem to the given menu
by using the Action associated to the given id.
The given KeyStroke will be associated with the resulting MenuItem.
menu - the menu to add to.uiMap - the uiMap to add the new item to.id - the id to fetch the Action with.ks - the KeyStroke to be associated with this item.uiManager - the UIManager which helps to retrieve the current title.
JMenuItem from the menu.add call.
public javax.swing.JMenuItem addToMenu(javax.swing.JMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke ks,
java.lang.String iconurl,
java.lang.Class resourceClass,
UIManager uiManager)
JMenuItem to the given menu
by using the Action associated to the given id.
The given KeyStroke will be associated with the resulting MenuItem. If the
iconurl parameter is not null, the icon will be loaded an
set as Icon for the resulting MenuItem.
menu - the menu to add to.uiMap - the uiMap to add the new item to.id - the id to fetch the Action with.ks - the KeyStroke to be associated with this item.iconurl - the url of the icon to use.resourceClass - the class to load the icon with.uiManager - the UIManager which helps to retrieve the current title.
JMenuItem from the menu.add call.
public javax.swing.JMenuItem addToMenu(javax.swing.JMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
java.lang.String iconurl,
java.lang.Class resourceClass,
UIManager uiManager)
JMenuItem to the given menu
by using the Action associated to the given id.
If the iconurl parameter is not null, the icon will be
loaded an set as Icon for the resulting MenuItem.
menu - the menu to add to.uiMap - the uiMap to add the new item to.id - the id to fetch the Action with.iconurl - the url of the icon to use.resourceClass - the class to load the icon with.uiManager - the UIManager which helps to retrieve the current title.
JMenuItem from the menu.add call.
public javax.swing.JMenuItem addToMenu(javax.swing.JPopupMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
UIManager uiManager)
JMenuItem to the given
popupmenu by using the Action associated to the given
id.
menu - the menu to add to.uiMap - the uiMap to add the new item to.id - the id to fetch the Action with.uiManager - the UIManager which helps to retrieve the current title.
JMenuItem from the
popupmenu.add call.
public javax.swing.JMenuItem addToMenu(javax.swing.JPopupMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
java.lang.String iconurl,
java.lang.Class resourceClass,
UIManager uiManager)
JMenuItem to the given
popupmenu by using the Action associated to the given
id. If the iconurl parameter is not null, the
icon will be loaded and set.
menu - the menu to add to.uiMap - the uiMap to add the new item to.id - the id to fetch the Action with.iconurl - the url of the icon.resourceClass - the class to load the icon with.uiManager - the UIManager which helps to retrieve the current title.
JMenuItem from the
popupmenu.add call.
public javax.swing.JMenuItem addToMenu(javax.swing.JPopupMenu menu,
java.util.HashMap uiMap,
java.lang.String id,
javax.swing.KeyStroke ks,
java.lang.String iconurl,
java.lang.Class resourceClass,
UIManager uiManager)
JMenuItem to the given
popupmenu by using the Action associated to the given
id. If the iconurl parameter is not null, the
icon will be loaded and set.
menu - the menu to add to.uiMap - the uiMap to add the new item to.id - the id to fetch the Action with.ks - the KeyStroke to associate the item with.iconurl - the url of the icon.resourceClass - the class to load the icon with.uiManager - the UIManager which helps to retrieve the current title.
JMenuItem from the
popupmenu.add call.public javax.swing.Action getAction(java.lang.String id)
commandToAction method and returned.
id - the id of the command of which you want to retrieve the Action from.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||