Search this API

y.view
Interface NodeStateChangeHandler

All Known Implementing Classes:
NodeStateChangeEdgeRouter

public interface NodeStateChangeHandler

Interface that allows to adjust a group/folder node state before/after group open/close operation. This interface contains two methods that should be called before and after the actual open/close action, i.e.:

   import y.view.NodeStateChangeHandler;

   Node groupNode = ...;

   NodeStateChangeHandler nsh = ...;
   //Actions to perform before closing the node
   nsh.preNodeStateChange(groupNode);

    HierarchyManager.getInstance(graph).closeGroup(groupNode); //or HierarchyManager.getInstance(graph).openFolder(groupNode);
   //Actions to perform before after the node
     nsh.postNodeStateChange(groupNode);
 

 
Your browser does not support SVG content.

Method Summary
 void postNodeStateChange(Node groupNode)
          Performs actions before after the node state.
 void preNodeStateChange(Node groupNode)
          Performs actions before changing the node state.
 

Method Detail

preNodeStateChange

void preNodeStateChange(Node groupNode)
Performs actions before changing the node state. Typically, this involves saving some state of the groupNode and/or the edges that may be touched by the state change.

Parameters:
groupNode - The group or folder node whose state is about to change.

postNodeStateChange

void postNodeStateChange(Node groupNode)
Performs actions before after the node state. This method should be called after the actual state change if preNodeStateChange(y.base.Node) has been called to change state related properties of the groupNode and/or its edges, as well as to clean up state that may have been stored by preNodeStateChange(y.base.Node).

Parameters:
groupNode - The group or folder node whose state has just changed.

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