|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractAction y.view.Graph2DViewActions.AbstractGroupingAction y.view.Graph2DViewActions.GroupSelectionAction
public static class Graph2DViewActions.GroupSelectionAction
Action that puts multiple nodes in a new group node.
Field Summary |
---|
Fields inherited from class y.view.Graph2DViewActions.AbstractGroupingAction |
---|
view |
Fields inherited from class javax.swing.AbstractAction |
---|
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
---|---|
Graph2DViewActions.GroupSelectionAction()
Creates a new GroupSelectionAction that has no default view. |
|
Graph2DViewActions.GroupSelectionAction(Graph2DView view)
Creates a new GroupSelectionAction |
Method Summary | |
---|---|
protected boolean |
acceptNode(Graph2D graph,
Node node)
Check whether a node should be changed by this action. |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
protected void |
assignGroupName(Node groupNode,
Graph2DView view)
Assigns a name to the group node. |
protected Node |
createEmptyGroupNode(Graph2DView view)
Creates an empty group node that is positioned at the center of the view. |
protected java.lang.String |
createFolderName(Node folderNode,
Graph2DView view)
Creates a name for the group node when it is in folded state. |
protected java.lang.String |
createGroupName(Node groupNode,
Graph2DView view)
Creates a name for the group node when it is in opened state. |
protected Node |
createGroupNode(NodeList nodesToGroup,
Graph2DView view)
Creates a new group node. |
protected Node |
createGroupNodeWithChildren(NodeList nodesToGroup,
Graph2DView view)
Creates a group node from nodesToGroup . |
void |
groupSelection(Graph2DView view)
Groups all nodes for which acceptNode(Graph2D,y.base.Node) returns true. |
boolean |
isEmptySelectionEnabled()
Returns whether an empty group node should be created if the list of accepted nodes is empty. |
protected void |
postNodeStateChange(Node groupNode,
Graph2D g)
Performs necessary actions immediately after the node has been closed. |
protected void |
preNodeStateChange(Node groupNode,
Graph2D g)
Performs necessary actions immediately before the node is closed. |
void |
setEmptySelectionEnabled(boolean allowEmptySelection)
Sets whether an empty group node should be created if the list of accepted nodes is empty. |
Methods inherited from class y.view.Graph2DViewActions.AbstractGroupingAction |
---|
getHierarchyManager, getNodeStateChangeHandler, getView, isReselectNodes, setNodeStateChangeHandler, setReselectNodes |
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Graph2DViewActions.GroupSelectionAction()
GroupSelectionAction
that has no default view. Invoking this constructor is equivalent
to: new GroupSelectionAction(null)
public Graph2DViewActions.GroupSelectionAction(Graph2DView view)
GroupSelectionAction
view
- the default view that is used if the actual view cannot be determined from the information provided
by an ActionEvent
.Method Detail |
---|
public void actionPerformed(java.awt.event.ActionEvent e)
public void groupSelection(Graph2DView view)
acceptNode(Graph2D,y.base.Node)
returns true.
view
- The view where all information is used from.protected Node createGroupNode(NodeList nodesToGroup, Graph2DView view)
createEmptyGroupNode(Graph2DView)
if nodesToGroup is empty and isEmptySelectionEnabled()
returns true
or createGroupNodeWithChildren(y.base.NodeList,
Graph2DView)
. If nodesToGroup is empty and isEmptySelectionEnabled()
returns false
then no
node is created and null
is returned.
null
.isEmptySelectionEnabled()
protected void assignGroupName(Node groupNode, Graph2DView view)
createGroupName(y.base.Node,Graph2DView)
and createFolderName(y.base.Node,Graph2DView)
protected java.lang.String createFolderName(Node folderNode, Graph2DView view)
protected java.lang.String createGroupName(Node groupNode, Graph2DView view)
protected Node createEmptyGroupNode(Graph2DView view)
isEmptySelectionEnabled()
protected Node createGroupNodeWithChildren(NodeList nodesToGroup, Graph2DView view)
nodesToGroup
.
protected boolean acceptNode(Graph2D graph, Node node)
node
should be included in the group. This implementation returns
true iff the node is currently selected.
node
should be grouped.protected void preNodeStateChange(Node groupNode, Graph2D g)
preNodeStateChange
in class Graph2DViewActions.AbstractGroupingAction
protected void postNodeStateChange(Node groupNode, Graph2D g)
postNodeStateChange
in class Graph2DViewActions.AbstractGroupingAction
public boolean isEmptySelectionEnabled()
false
.
setEmptySelectionEnabled(boolean)
,
acceptNode(Graph2D,y.base.Node)
,
createEmptyGroupNode(Graph2DView)
public void setEmptySelectionEnabled(boolean allowEmptySelection)
false
.
allowEmptySelection
- whether an empty group node should be created if the list of accepted nodes is empty.isEmptySelectionEnabled()
,
acceptNode(Graph2D,y.base.Node)
,
createEmptyGroupNode(Graph2DView)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |