Search this API

y.view
Class Graph2DViewActions.AbstractGroupingAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by y.view.Graph2DViewActions.AbstractGroupingAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
Graph2DViewActions.CloseGroupsAction, Graph2DViewActions.FoldSelectionAction, Graph2DViewActions.GroupSelectionAction, Graph2DViewActions.OpenFoldersAction, Graph2DViewActions.UnfoldSelectionAction, Graph2DViewActions.UngroupSelectionAction
Enclosing class:
Graph2DViewActions

public abstract static class Graph2DViewActions.AbstractGroupingAction
extends javax.swing.AbstractAction

Abstract base class for grouping related actions.

See Also:
Serialized Form
 

Field Summary
protected  Graph2DView 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
protected Graph2DViewActions.AbstractGroupingAction(java.lang.String name, Graph2DView view)
           
 
Method Summary
protected  HierarchyManager getHierarchyManager(Graph2D graph)
          Return the hierarchy manager to use.
 NodeStateChangeHandler getNodeStateChangeHandler()
          Returns a NodeStateChangeHandler instance that will convert the edge state over the grouping operation.
protected  Graph2DView getView(java.awt.event.ActionEvent e)
          Determines the view in which to change graph elements.
 boolean isReselectNodes()
          Return whether previously selected group nodes should stay selected after closing them.
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 setNodeStateChangeHandler(NodeStateChangeHandler nodeStateChangeHandler)
          Sets the NodeStateChangeHandler instance that will convert the edge state over the grouping operation.
 void setReselectNodes(boolean reselectNodes)
          Set whether previously selected group nodes should stay selected after closing them.
 
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
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

view

protected final Graph2DView view
Constructor Detail

Graph2DViewActions.AbstractGroupingAction

protected Graph2DViewActions.AbstractGroupingAction(java.lang.String name,
                                                    Graph2DView view)
Method Detail

getNodeStateChangeHandler

public NodeStateChangeHandler getNodeStateChangeHandler()
Returns a NodeStateChangeHandler instance that will convert the edge state over the grouping operation.

Returns:
The NodeStateChangeHandler instance that will convert the edge state over the grouping operation.

setNodeStateChangeHandler

public void setNodeStateChangeHandler(NodeStateChangeHandler nodeStateChangeHandler)
Sets the NodeStateChangeHandler instance that will convert the edge state over the grouping operation.

Parameters:
nodeStateChangeHandler - The NodeStateChangeHandler instance that will convert the edge state over the grouping operation.

getHierarchyManager

protected HierarchyManager getHierarchyManager(Graph2D graph)
Return the hierarchy manager to use.

Parameters:
graph -
Returns:
A hierarchy manager instance suitable for this action.

getView

protected Graph2DView getView(java.awt.event.ActionEvent e)
Determines the view in which to change graph elements.

Parameters:
e - the ActionEvent that triggers the deletion of graph elements.
Returns:
the view in which to change graph elements.
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent), Graph2DViewActions.AbstractGroupingAction(String, y.view.Graph2DView)

isReselectNodes

public boolean isReselectNodes()
Return whether previously selected group nodes should stay selected after closing them.

Default value is true.

Returns:
true iff previously selected group nodes should stay selected

setReselectNodes

public void setReselectNodes(boolean reselectNodes)
Set whether previously selected group nodes should stay selected after closing them.

Default value is true.

Parameters:
reselectNodes - true iff previously selected group nodes should stay selected

preNodeStateChange

protected void preNodeStateChange(Node groupNode,
                                  Graph2D g)
Performs necessary actions immediately before the node is closed.

This method delegates to getNodeStateChangeHandler() if one is present. It is called before the actual hierarchy operation is performed.


postNodeStateChange

protected void postNodeStateChange(Node groupNode,
                                   Graph2D g)
Performs necessary actions immediately after the node has been closed.

This method delegates to getNodeStateChangeHandler() if one is present. It is called after the actual hierarchy operation is performed.


© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.