| java.lang.Object com.jgraph.editor.JGraphEditorFactory
JGraphEditorFactory | public class JGraphEditorFactory (Code) | | Class that creates the UI elements of a JGraph editor. It uses the actions
and tools from the
JGraphEditorFactory.kit to create menu bars, toolbars, toolboxes and
popup menus.
|
Method Summary | |
public Object | addMethod(JGraphEditorFactoryMethod method) Adds the specified factory method.
Parameters: method - The factory method to add. | protected void | configureAbstractButton(AbstractButton button, String name) Hook for subclassers to configure a toolbox button for tool . | public void | configureActionItem(AbstractButton button, JGraphEditorAction action) Hook for subclassers to configure an action item for action . | protected void | configureMenuBar(Container menu, Node configuration) Hook for subclassers to configure a new menu based on
configuration . | protected void | configureToolBar(Container toolBar, Node configuration) Hook for subclassers to configure a toolbar with
configuration . | protected void | configureToolbox(JGraphEditorToolbox toolbox, Node configuration) Hook for subclassers to configure a new toolbox based on
configuration . | public PropertyChangeListener | createActionChangeListener(AbstractButton button) Returns a new property change listener that updates button
according to property change events.
Parameters: button - The button to create the listener for. | public JGraphEditorDiagramPane | createDiagramPane(JGraphEditorDiagram diagram) Returns a new diagram pane for the specified diagram by creating a new
graph using the
JGraphEditorFactory.createGraph(GraphLayoutCache) method and
wrapping it up in a
JGraphEditorDiagramPane .
Parameters: diagram - The diagram that contains the graph to be used. | public JGraph | createGraph(GraphLayoutCache cache) Returns a new graph for the specified cache . | protected Container | createMenu(Node configuration) Hook for subclassers to create a new menu. | public JMenuBar | createMenuBar(Node configuration) Returns a new
JMenuBar configured using
JGraphEditorFactory.configureMenuBar(Container,Node) .
Parameters: configuration - The configuration to create the menubar with. | public AbstractButton | createMenuItem(Node configuration, boolean radio) Returns a new
JCheckBoxMenuItem or
JMenuItem configured
using
JGraphEditorFactory.configureActionItem(AbstractButton,JGraphEditorAction) .
Parameters: configuration - The configuration to create the menu item with. Parameters: radio - Whether the created item should be aJRadioButtonMenuItem. | public JPopupMenu | createPopupMenu(Node configuration) Returns a new
JPopupMenu configured using
JGraphEditorFactory.configureMenuBar(Container,Node) .
Parameters: configuration - The configuration to create the popup menu with. | public JScrollPane | createScrollPane(Component component) Returns a new
JScrollPane containing the specified component. | public JSplitPane | createSplitPane(Component first, Component second, int orientation) Returns a new
JSplitPane containing the specified component with
the specified orientation. | public JTabbedPane | createTabbedPane(int tabPlacement) Returns a new empty
JTabbedPane . | public JToolBar | createToolBar(Node configuration) Returns a new
JToolBar configured using
JGraphEditorFactory.configureToolBar(Container,Node) .
Parameters: configuration - The configuration to create the toolbar with. | protected AbstractButton | createToolBarButton(Node configuration) Returns a new
JToggleButton or
JButton configured using
JGraphEditorFactory.configureActionItem(AbstractButton,JGraphEditorAction) and
JGraphEditorFactory.configureAbstractButton(AbstractButton,String) (in this order).
Parameters: configuration - The configuration to create the toolbar with. | public JGraphEditorToolbox | createToolbox(Node configuration) Returns a new
JGraphEditorToolbox configured using
JGraphEditorFactory.configureToolbox(JGraphEditorToolbox,Node) .
Parameters: configuration - The configuration to create the toolbox with. | protected AbstractButton | createToolboxButton(JGraphEditorTool tool) Returns a new
JToggleButton button configured for
tool by calling
JGraphEditorFactory.configureAbstractButton(AbstractButton,String) .
Parameters: tool - The tool to create the toolbox button for. | public Component | executeMethod(String factoryMethod) Shortcut method to
JGraphEditorFactory.executeMethod(String,Node) with a null
configuration.
Parameters: factoryMethod - The name of the factory method to executed. | public Component | executeMethod(String factoryMethod, Node configuration) Executes
JGraphEditorFactoryMethod.createInstance(Node) on the
factory method under factoryMethod passing
configuration along as an argument and returns the return
value of the invoked method.
Parameters: factoryMethod - The name of the factory method to executed. Parameters: configuration - The configuration to pass toJGraphEditorFactoryMethod.createInstance(Node). | public JGraphEditorAction | getAction(String key) Returns the action for the resource under key+SUFFIX_ACTION
from the editor kit. | protected String | getKey(Node node) Shortcut method to
JGraphEditorSettings.getKeyAttributeValue(Node) . | public JGraphEditorKit | getKit() Returns the editor kit. | public JGraphEditorFactoryMethod | getMethod(String name) Returns the factory method for the specified name or null
if no such factory method can be found.
Parameters: name - The name that identifies the factory method. | protected String | getString(String key) Shortcut method to
JGraphEditorResources.getString(String) . | public JGraphEditorTool | getTool(String key) Returns the tool for the resource under key+SUFFIX_TOOL
from the editor kit. | public void | setKit(JGraphEditorKit kit) Sets the editor kit to provide actions and tools. |
ITEMTYPE_MENUBAR | final protected static int ITEMTYPE_MENUBAR(Code) | | Constant for menubar creation.
|
ITEMTYPE_TOOLBAR | final protected static int ITEMTYPE_TOOLBAR(Code) | | Constant for toolbar creation.
|
NODENAME_GROUP | final public static String NODENAME_GROUP(Code) | | Defines the nodename for groups.
|
NODENAME_ITEM | final public static String NODENAME_ITEM(Code) | | Defines the nodename for items.
|
NODENAME_MENU | final public static String NODENAME_MENU(Code) | | Defines the nodename for menus.
|
NODENAME_SEPARATOR | final public static String NODENAME_SEPARATOR(Code) | | Defines the nodename for separators.
|
SEPARATOR | final protected static Component SEPARATOR(Code) | | Shared separator instance.
|
SUFFIX_ACTION | final public static String SUFFIX_ACTION(Code) | | Defines the suffix for actionname resources. This is used to replace the
default action name, which is its key, eg.
openFile.label=Open... .
|
SUFFIX_ICON | final public static String SUFFIX_ICON(Code) | | Defines the suffix for icon resources, eg.
open.icon=/com/jgraph/pad/images/open.gif .
|
SUFFIX_LABEL | final public static String SUFFIX_LABEL(Code) | | Defines the suffix for label resources, eg.
open.label=Open... .
|
SUFFIX_MNEMONIC | final public static String SUFFIX_MNEMONIC(Code) | | Defines the suffix for mnemonic resources, eg.
open.mnemonic=o .
|
SUFFIX_SHORTCUT | final public static String SUFFIX_SHORTCUT(Code) | | Defines the suffix for shortcut resources, eg.
open.shortcut=control O .
|
SUFFIX_TOOL | final public static String SUFFIX_TOOL(Code) | | Defines the suffix for toolname resources. This is used to replace the
default tool name, which is its key, eg.
openFile.label=Open... .
|
SUFFIX_TOOLTIP | final public static String SUFFIX_TOOLTIP(Code) | | Defines the suffix for tooltip resources, eg.
open.tooltip=Open a file .
|
factoryMethods | protected Map factoryMethods(Code) | | Holds the (name, factory method) pairs
|
JGraphEditorFactory | public JGraphEditorFactory()(Code) | | Constructs an empty factory.
|
JGraphEditorFactory | public JGraphEditorFactory(JGraphEditorKit kit)(Code) | | Constructs a factory for the specified kit.
|
addMethod | public Object addMethod(JGraphEditorFactoryMethod method)(Code) | | Adds the specified factory method.
Parameters: method - The factory method to add. Returns the previous factory method for name . |
configureAbstractButton | protected void configureAbstractButton(AbstractButton button, String name)(Code) | | Hook for subclassers to configure a toolbox button for tool .
Parameters: button - The button to be configured. Parameters: name - The name of the tool or action to configure the button for. |
configureActionItem | public void configureActionItem(AbstractButton button, JGraphEditorAction action)(Code) | | Hook for subclassers to configure an action item for action .
Valid action items are toolbar buttons and menu items, but not toolbox
buttons.
Parameters: button - The button to be configured. Parameters: action - The action to configure the button for. |
configureMenuBar | protected void configureMenuBar(Container menu, Node configuration)(Code) | | Hook for subclassers to configure a new menu based on
configuration . This is used for menubars and submenus.
Parameters: menu - The menu to be configured. Parameters: configuration - The configuration to configure the menubar with. See Also: JGraphEditorFactory.createMenuItem(Node,boolean) |
configureToolBar | protected void configureToolBar(Container toolBar, Node configuration)(Code) | | Hook for subclassers to configure a toolbar with
configuration .
Parameters: toolBar - The toolBar to be configured. Parameters: configuration - The configuration to configure the toolbar with. |
createActionChangeListener | public PropertyChangeListener createActionChangeListener(AbstractButton button)(Code) | | Returns a new property change listener that updates button
according to property change events.
Parameters: button - The button to create the listener for. Returns a new property change listener for actions. |
createMenu | protected Container createMenu(Node configuration)(Code) | | Hook for subclassers to create a new menu. This implementation returns a
new instance of
JMenuBar .
Parameters: configuration - The configuration to create the menu with. Returns a new menubar. |
createScrollPane | public JScrollPane createScrollPane(Component component)(Code) | | Returns a new
JScrollPane containing the specified component.
Returns a new scrollpane containing the specified component. |
createSplitPane | public JSplitPane createSplitPane(Component first, Component second, int orientation)(Code) | | Returns a new
JSplitPane containing the specified component with
the specified orientation.
Returns a new splitpane containing the the specified components. |
getMethod | public JGraphEditorFactoryMethod getMethod(String name)(Code) | | Returns the factory method for the specified name or null
if no such factory method can be found.
Parameters: name - The name that identifies the factory method. Returns the factory method under name ornull . |
setKit | public void setKit(JGraphEditorKit kit)(Code) | | Sets the editor kit to provide actions and tools.
Parameters: kit - The kit to set. |
|
|