|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.Graph2DViewActions
public class Graph2DViewActions
This class provides actions for Graph2DView
.
The easiest way to add the provided actions to an instance of Graph2DView is demonstrated below:
new Graph2DViewActions(view).install();However, the behavior may be tweaked a lot using the following technique:
Graph2DViewActions actions = new Graph2DViewActions(view); ActionMap amap = actions.createActionMap(); InputMap imap = actions.createDefaultInputMap(amap); view.getCanvasComponent().setActionMap(amap); view.getCanvasComponent().setInputMap(JComponent.WHEN_FOCUSED, imap);
Graph2DViewActions(Graph2DView)
,
install()
Nested Class Summary | |
---|---|
static class |
Graph2DViewActions.AbstractGroupingAction
Abstract base class for grouping related actions. |
static class |
Graph2DViewActions.AddPredecessorsAction
Action that adds a predecessor node to selected nodes. |
static class |
Graph2DViewActions.AddSuccessorsAction
Action that adds a successor node to selected nodes. |
static class |
Graph2DViewActions.CloseGroupsAction
Action that closes multiple group nodes. |
static class |
Graph2DViewActions.DeleteSelectionAction
Action that deletes selected elements of predefined types. |
static class |
Graph2DViewActions.DuplicateAction
Action that allows to duplicate nodes or edges. |
static class |
Graph2DViewActions.EditLabelAction
Action that opens the label editor for interactive text editing. |
static class |
Graph2DViewActions.FoldSelectionAction
Action that moves multiple nodes in a new folder node. |
static class |
Graph2DViewActions.GroupSelectionAction
Action that puts multiple nodes in a new group node. |
static class |
Graph2DViewActions.OpenFoldersAction
Action that closes multiple group nodes. |
static class |
Graph2DViewActions.SelectAllAction
Action that selects elements of predefined types. |
static class |
Graph2DViewActions.UnfoldSelectionAction
Action that removes the selected nodes from their folder. |
static class |
Graph2DViewActions.UngroupSelectionAction
Action that ungroups the selected nodes from their group. |
Field Summary | |
---|---|
static Object |
ADD_PREDECESSORS
ActionMap key for action returned by getAddPredecessorsAction() . |
static Object |
ADD_SUCCESSORS
ActionMap key for action returned by getAddSuccessorsAction() . |
static Object |
ALIGN_HORIZONTALLY
ActionMap key for action returned by getAlignHorizontallyAction() |
static Object |
ALIGN_VERTICALLY
ActionMap key for action returned by getAlignVerticallyAction() . |
static Object |
BOTTOM_ALIGN
ActionMap key for action returned by getBottomAlignAction() . |
static Object |
CLOSE_GROUPS
ActionMap key for action returned by getCloseGroupsAction() . |
static Object |
DELETE_SELECTION
ActionMap key for action returned by getDeleteSelectionAction() . |
static Object |
DISTRIBUTE_HORIZONTALLY
ActionMap key for action returned by getDistributeHorizontallyAction() . |
static Object |
DISTRIBUTE_VERTICALLY
ActionMap key for action returned by getDistributeVerticallyAction() . |
static Object |
DUPLICATE_GRAPH
ActionMap key for action returned by getDuplicateGraphAction() . |
static Object |
EDIT_LABEL
ActionMap key for action returned by getEditLabelAction() . |
static Object |
EDIT_NODE
ActionMap key for action returned by getEditNodeAction() . |
static Object |
FOCUS_BOTTOM_NODE
ActionMap key for action returned by getFocusBottomNodeAction() . |
static Object |
FOCUS_LEFT_NODE
ActionMap key for action returned by getFocusLeftNodeAction() . |
static Object |
FOCUS_RIGHT_NODE
ActionMap key for action returned by getFocusRightNodeAction() . |
static Object |
FOCUS_TOP_NODE
ActionMap key for action returned by getFocusTopNodeAction() . |
static Object |
FOLD_SELECTION
ActionMap key for action returned by getFoldSelectionAction() . |
static Object |
GROUP_SELECTION
ActionMap key for action returned by getGroupSelectionAction() . |
static Object |
LEFT_ALIGN
ActionMap key for action returned by getLeftAlignAction() . |
static Object |
OPEN_FOLDERS
ActionMap key for action returned by getOpenFoldersAction() . |
static Object |
RIGHT_ALIGN
ActionMap key for action returned by getRightAlignAction() . |
static Object |
SELECT_ALL
ActionMap key for action returned by getSelectAllAction() . |
static Object |
SELECT_BOTTOM_EDGE
ActionMap key for action returned by getSelectBottomEdgeAction() . |
static Object |
SELECT_LEFT_EDGE
ActionMap key for action returned by getSelectLeftEdgeAction() . |
static Object |
SELECT_RIGHT_EDGE
ActionMap key for action returned by getSelectRightEdgeAction() . |
static Object |
SELECT_TOP_EDGE
ActionMap key for action returned by getSelectTopEdgeAction() . |
static Object |
TOP_ALIGN
ActionMap key for action returned by getTopAlignAction() . |
static Object |
UNFOLD_SELECTION
ActionMap key for action returned by getUnfoldSelectionAction() . |
static Object |
UNGROUP_SELECTION
ActionMap key for action returned by getUngroupSelectionAction() . |
Constructor Summary | |
---|---|
Graph2DViewActions()
Creates a new instance that is not bound to any Graph2DView. |
|
Graph2DViewActions(Graph2DView view)
Creates a new instance of Graph2DViewActions for the given view. |
Method Summary | |
---|---|
ActionMap |
createActionMap()
Returns a new ActionMap that contains the actions provided by this class. |
InputMap |
createDefaultInputMap()
Returns a default key binding for the actions provided by this class. |
InputMap |
createDefaultInputMap(ActionMap amap)
Returns a default key binding for the actions provided by this class that are also bound by the given ActionMap. |
protected void |
deleteSelection(Graph2DView view)
Deprecated. Use Graph2DViewActions.DeleteSelectionAction.delete(Graph2DView) instead. |
protected void |
editNode(Graph2DView view)
Called by the EDIT_NODE action. |
Action |
getAddPredecessorsAction()
Returns an action that create children for selected nodes |
Action |
getAddSuccessorsAction()
Returns an action that create children for selected nodes |
Action |
getAlignHorizontallyAction()
|
Action |
getAlignVerticallyAction()
|
Action |
getBottomAlignAction()
|
Action |
getCloseGroupsAction()
Returns an action that closes one or more group nodes. |
Action |
getDeleteSelectionAction()
Returns an action that deletes the currently selected elements from the graph. |
Action |
getDistributeHorizontallyAction()
|
Action |
getDistributeVerticallyAction()
|
Action |
getDuplicateGraphAction()
Returns an action that duplicates selected graph. |
Action |
getEditLabelAction()
Returns an action that triggers the inline label editor. |
Action |
getEditNodeAction()
Returns an action that starts editing a selected node if the current ViewMode is either a suitable EditMode or CellEditorMode instance. |
Action |
getFocusBottomNodeAction()
Returns an action that selects a node that is below the currently selected node. |
Action |
getFocusLeftNodeAction()
Returns an action that selects a node that is to the left of the currently selected node. |
Action |
getFocusRightNodeAction()
Returns an action that selects a node that is to the right of the currently selected node. |
Action |
getFocusTopNodeAction()
Returns an action that selects a node that is above the currently selected node. |
Action |
getFoldSelectionAction()
Returns an action that folds the current selection. |
Action |
getGroupSelectionAction()
Returns an action that groups the current selection. |
Action |
getLeftAlignAction()
|
Action |
getOpenFoldersAction()
Returns an action that opens one or more folder nodes. |
Action |
getRightAlignAction()
|
Action |
getSelectAllAction()
Returns an action that selects the all nodes and bends or alternatively all edges if at least one edge is currently selected. |
Action |
getSelectBottomEdgeAction()
Returns an action that selects the bottommost edge connected to the currently selected node. |
Action |
getSelectLeftEdgeAction()
Returns an action that selects the leftmost edge connected to the currently selected node. |
Action |
getSelectRightEdgeAction()
Returns an action that selects the rightmost edge connected to the currently selected node. |
Action |
getSelectTopEdgeAction()
Returns an action that selects the topmost edge connected to the currently selected node. |
Action |
getTopAlignAction()
|
Action |
getUnfoldSelectionAction()
Returns an action that unfolds the current selection. |
Action |
getUngroupSelectionAction()
Returns an action that ungroups the current selection. |
protected Graph2DView |
getView(ActionEvent e)
Tries to obtain the associated view with the event. |
void |
install()
Install the actions provided by this instance into the view provided to the constructor |
void |
install(Graph2DView view)
Installs this instance into the given view using JComponent.WHEN_FOCUSED as the condition. |
void |
install(Graph2DView view,
int condition)
Installs the action into the given view using the specified condition. |
void |
install(int condition)
Installs the actions provided by this instance into the view provided to the constructor using the specified input condition. |
protected void |
selectAll(Graph2DView view)
Deprecated. Use Graph2DViewActions.SelectAllAction.select(Graph2DView) instead. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object FOCUS_RIGHT_NODE
getFocusRightNodeAction()
.
public static final Object EDIT_NODE
getEditNodeAction()
.
public static final Object FOCUS_LEFT_NODE
getFocusLeftNodeAction()
.
public static final Object FOCUS_TOP_NODE
getFocusTopNodeAction()
.
public static final Object FOCUS_BOTTOM_NODE
getFocusBottomNodeAction()
.
public static final Object SELECT_ALL
getSelectAllAction()
.
public static final Object TOP_ALIGN
getTopAlignAction()
.
public static final Object ALIGN_VERTICALLY
getAlignVerticallyAction()
.
public static final Object BOTTOM_ALIGN
getBottomAlignAction()
.
public static final Object DISTRIBUTE_VERTICALLY
getDistributeVerticallyAction()
.
public static final Object LEFT_ALIGN
getLeftAlignAction()
.
public static final Object ALIGN_HORIZONTALLY
getAlignHorizontallyAction()
public static final Object RIGHT_ALIGN
getRightAlignAction()
.
public static final Object DISTRIBUTE_HORIZONTALLY
getDistributeHorizontallyAction()
.
public static final Object SELECT_LEFT_EDGE
getSelectLeftEdgeAction()
.
public static final Object SELECT_RIGHT_EDGE
getSelectRightEdgeAction()
.
public static final Object SELECT_TOP_EDGE
getSelectTopEdgeAction()
.
public static final Object SELECT_BOTTOM_EDGE
getSelectBottomEdgeAction()
.
public static final Object DELETE_SELECTION
getDeleteSelectionAction()
.
public static final Object GROUP_SELECTION
getGroupSelectionAction()
.
public static final Object FOLD_SELECTION
getFoldSelectionAction()
.
public static final Object UNGROUP_SELECTION
getUngroupSelectionAction()
.
public static final Object UNFOLD_SELECTION
getUnfoldSelectionAction()
.
public static final Object OPEN_FOLDERS
getOpenFoldersAction()
.
public static final Object CLOSE_GROUPS
getCloseGroupsAction()
.
public static final Object EDIT_LABEL
getEditLabelAction()
.
public static final Object DUPLICATE_GRAPH
getDuplicateGraphAction()
.
public static final Object ADD_SUCCESSORS
getAddSuccessorsAction()
.
public static final Object ADD_PREDECESSORS
getAddPredecessorsAction()
.
Constructor Detail |
---|
public Graph2DViewActions()
Graph2DViewActions(Graph2DView)
.
public Graph2DViewActions(Graph2DView view)
install()
or install(int)
.
view
- the view acted upon.Method Detail |
---|
public void install(int condition)
constructor
using the specified input condition.
condition
- the condition as used in JComponent.setInputMap(int,javax.swing.InputMap)
Graph2DViewActions(Graph2DView)
public void install()
constructor
IllegalStateException
- if no view had been provided to the constructor.public void install(Graph2DView view)
JComponent.WHEN_FOCUSED
as the condition.
view
- the to install the actions forinstall(Graph2DView,int)
public void install(Graph2DView view, int condition)
view
- the view to install the actions for. This view needs to be the same instance as given in the
constructor {Graph2DViewActions(Graph2DView)
.condition
- the condition as used in JComponent.setInputMap(int,javax.swing.InputMap)
install(Graph2DView)
protected Graph2DView getView(ActionEvent e)
e
- The event for which to obtain the view. This is done by getting the parent of the source component.
public Action getEditNodeAction()
public Action getFocusLeftNodeAction()
public Action getFocusRightNodeAction()
public Action getFocusTopNodeAction()
public Action getFocusBottomNodeAction()
public Action getSelectLeftEdgeAction()
public Action getSelectRightEdgeAction()
public Action getSelectAllAction()
protected final void selectAll(Graph2DView view)
Graph2DViewActions.SelectAllAction.select(Graph2DView)
instead.
true
depending on the current selection states of edges,
nodes, and bends.
view
- the view to act uponpublic Action getSelectTopEdgeAction()
public Action getSelectBottomEdgeAction()
public Action getDeleteSelectionAction()
public Action getTopAlignAction()
public Action getLeftAlignAction()
public Action getRightAlignAction()
public Action getBottomAlignAction()
public Action getAlignVerticallyAction()
public Action getAlignHorizontallyAction()
public Action getDistributeHorizontallyAction()
public Action getDistributeVerticallyAction()
public Action getCloseGroupsAction()
public Action getOpenFoldersAction()
public Action getGroupSelectionAction()
public Action getFoldSelectionAction()
public Action getUngroupSelectionAction()
public Action getUnfoldSelectionAction()
protected final void deleteSelection(Graph2DView view)
Graph2DViewActions.DeleteSelectionAction.delete(Graph2DView)
instead.
view
- the view to act uponpublic Action getDuplicateGraphAction()
public Action getAddSuccessorsAction()
public Action getAddPredecessorsAction()
public Action getEditLabelAction()
public ActionMap createActionMap()
public InputMap createDefaultInputMap()
public InputMap createDefaultInputMap(ActionMap amap)
protected void editNode(Graph2DView view)
EDIT_NODE
action.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |