org.isb.metanodes.actions
Class ActionFactory

java.lang.Object
  extended by org.isb.metanodes.actions.ActionFactory

public class ActionFactory
extends Object

This class creates and returns AbstractActions that can be added to GUI elements for applying meta-node operations to a graph. Most of these actions have special requirements, so they can only be created using this factory to minimize users having to deal with implementation details.


Constructor Summary
ActionFactory()
           
 
Method Summary
static AbstractAction createCollapseSelectedNodesAction(boolean collapse_existent_parents, boolean collapse_all, boolean collapse_recursively, boolean create_meta_relationship_edges, String title)
          Creates and returns an AbstractAction to collapse nodes that are selected in the current CyNetwork.
static AbstractAction createUncollapseSelectedNodesAction(boolean recursive, boolean temporary, boolean newNetwork, String title)
          Creates and returns an AbstractAction that uncollapses selected meta-nodes in the current CyNetwork.
static void setMetaNodeAttributesHandler(MetaNodeAttributesHandler handler)
          Sets the default MetaNodeAttributesHandler that should be used to transfer node and edge attributes from children nodes and edges to meta-nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionFactory

public ActionFactory()
Method Detail

setMetaNodeAttributesHandler

public static void setMetaNodeAttributesHandler(MetaNodeAttributesHandler handler)
Sets the default MetaNodeAttributesHandler that should be used to transfer node and edge attributes from children nodes and edges to meta-nodes. If none is set, MetaNodeModelerFactory.DEFAULT_MN_ATTRIBUTES_HANDLER will be used.

Parameters:
MetaNodeAttributesHandler - the handler

createCollapseSelectedNodesAction

public static AbstractAction createCollapseSelectedNodesAction(boolean collapse_existent_parents,
                                                               boolean collapse_all,
                                                               boolean collapse_recursively,
                                                               boolean create_meta_relationship_edges,
                                                               String title)
Creates and returns an AbstractAction to collapse nodes that are selected in the current CyNetwork.

Parameters:
collapse_existent_parents - whether or not the existent parent meta-nodes of the selected nodes should be collapsed instead of creating new meta-nodes for them
collapse_recursively - if collapse_existent_parents is true, whether to find the top-level parents of the selected nodes and collapse them, or just find the immediate parents and collapse them
create_meta_relationship_edges - whether or not "sharedMember" edges between meta-nodes and "childOf" edges between meta-nodes and their children should be created
title - the title of the action (displayed on buttons, menus, etc)
Returns:
an AbstractAction that collapses selected nodes and edges contained in the given CyWindow

createUncollapseSelectedNodesAction

public static AbstractAction createUncollapseSelectedNodesAction(boolean recursive,
                                                                 boolean temporary,
                                                                 boolean newNetwork,
                                                                 String title)
Creates and returns an AbstractAction that uncollapses selected meta-nodes in the current CyNetwork.

Parameters:
recursive - whether or not the selected meta-nodes should be uncollapsed all the way down to their lowest level in the graph
temporary - if false, the meta-nodes (parent nodes) will be permanently removed after they are uncollapsed
title - the title of the action (displayed on buttons, menus, etc).
Returns:
an AbstractAction that uncollapses selected nodes