org.eclipse.gef.layout.algorithms

## Class TreeLayoutHelper.TreeListener

- java.lang.Object
- - org.eclipse.gef.layout.algorithms.TreeLayoutHelper.TreeListener

Enclosing class:
  TreeLayoutHelper

    public static class TreeLayoutHelper.TreeListener
    extends java.lang.Object

A superclass for listeners that can be added to this observer to get notification whenever the tree structure changes.

### Constructor Summary

Constructors
Constructor and Description
`TreeListener()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `defaultHandle(TreeLayoutHelper.TreeNode changedNode)` A convenience method that can be overridden if a listener reacts the same way to all events.
`void` `nodeAdded(TreeLayoutHelper.TreeNode newNode)` Called when new node is added to the tree structure.
`void` `nodeRemoved(TreeLayoutHelper.TreeNode removedNode)` Called when a node is removed from the tree structure.
`void` `parentChanged(TreeLayoutHelper.TreeNode node, TreeLayoutHelper.TreeNode previousParent)` Called when a node changes its parent.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TreeListener

    public TreeListener()

### Method Detail

#### nodeAdded

    public void nodeAdded(TreeLayoutHelper.TreeNode newNode)

Called when new node is added to the tree structure. The new node will not have any connections, so it will be a child of `Super Root`

Parameters:
  `newNode` - the added node

#### nodeRemoved

    public void nodeRemoved(TreeLayoutHelper.TreeNode removedNode)

Called when a node is removed from the tree structure. The given node no longer exists in the tree at the moment of call.

Parameters:
  `removedNode` - the removed node

#### parentChanged

    public void parentChanged(TreeLayoutHelper.TreeNode node,
                              TreeLayoutHelper.TreeNode previousParent)

Called when a node changes its parent.

Parameters:
  `node` - node that changes its parent
  `previousParent` - previous parent of the node

#### defaultHandle

    protected void defaultHandle(TreeLayoutHelper.TreeNode changedNode)

A convenience method that can be overridden if a listener reacts the same way to all events. By default it's called in every event handler and does nothing.

Parameters:
  `changedNode` - the node that has changed