|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.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().install(view);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);
install(Graph2DView)![]() |
![]() |
![]() |
![]() |
| Field Summary | |
|---|---|
static Object |
DELETE_SELECTION
ActionMap key for action returned by getDeleteSelectionAction(). |
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 |
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(). |
| Constructor Summary | |
|---|---|
Graph2DViewActions()
Creates a new instance that can later be installed into a Graph2DView using the install(Graph2DView, int) methods. |
|
Graph2DViewActions(Graph2DView view)
Creates a new instance of Graph2DViewActions. |
|
| 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)
Called by the DELETE_SELECTION action. |
protected void |
editNode(Graph2DView view)
Called by the EDIT_NODE action. |
Action |
getDeleteSelectionAction()
Returns an action that deletes the currently selected elements from the 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()
|
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 |
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. |
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 this instance into the given view using the specified condition. |
protected void |
selectAll(Graph2DView view)
Called by the SELECT_ALL action |
| 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 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 EDIT_LABEL
getEditLabelAction().
| Constructor Detail |
|---|
public Graph2DViewActions()
install(Graph2DView, int) methods.
public Graph2DViewActions(Graph2DView view)
view - the view acted upon.| Method Detail |
|---|
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 to install the actions forcondition - the condition as used in JComponent.setInputMap(int, javax.swing.InputMap)install(Graph2DView)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 void selectAll(Graph2DView view)
SELECT_ALL action
view - public Action getSelectTopEdgeAction()
public Action getSelectBottomEdgeAction()
public Action getDeleteSelectionAction()
protected void deleteSelection(Graph2DView view)
DELETE_SELECTION action.
view - the view to act uponpublic Action getEditLabelAction()
public ActionMap createActionMap()
public InputMap createDefaultInputMap()
public InputMap createDefaultInputMap(ActionMap amap)
protected void editNode(Graph2DView view)
EDIT_NODE action.
view -
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||