public void act(XmlAction pAction) {
            if (pAction instanceof ChangeRootNodeAction) {
                ChangeRootNodeAction rootNodeAction = (ChangeRootNodeAction) pAction;
                NodeAdapter focussed = controller.getNodeFromID(rootNodeAction
                        .getNode());
                if (focussed.isRoot()) {
                    // node is already root. Everything ok.
                    return;
                }
                /*
				 * moving the hooks: 1. new interface method: movehook 2. change
				 * root node from old to new node copying text, decoration, etc.
				 * 3. deactivate all root hooks. this is possibly the best
				 * solution as it is consequent. Method 3 is chosen.
				 */
                MindMapNode oldRoot = mMap.getRootNode();
                oldRoot.removeAllHooks();
                // change the root node:
                mMap.changeRoot(focussed);
                // remove all viewers:
                Vector nodes = new Vector();
                nodes.add(focussed);
                while (!nodes.isEmpty()) {
                    MindMapNode child = (MindMapNode) nodes.firstElement();
                    logger.fine("Removing viewers for " + child);
                    nodes.remove(0);
                    nodes.addAll(child.getChildren());
                    Collection viewers = new Vector(child.getViewers());
                    for (Iterator it = viewers.iterator(); it.hasNext(); ) {
                        NodeView viewer = (NodeView) it.next();
                        child.removeViewer(viewer);
                    }
                }

                MapView mapView = controller.getView();
                for (int i = mapView.getComponentCount() - 1; i >= 0; i--) {
                    Component comp = mapView.getComponent(i);
                    if (comp instanceof NodeView
                            || comp instanceof NodeMotionListenerView) {
                        mapView.remove(comp);
                    }
                }
                mapView.initRoot();
                mapView.add(mapView.getRoot());
                mapView.doLayout();
                controller.nodeChanged(focussed);
                logger.fine("layout done.");
                controller.select(focussed,
                        Tools.getVectorWithSingleElement(focussed));
                controller.centerNode(focussed);
                controller.obtainFocusForSelected();
            }
        }