//# 0 errors, 158 messages
//#
/*
    //#TreeScroller.java:1:1: class: com.dmdirc.addons.ui_swing.components.TreeScroller
    //#TreeScroller.java:1:1: method: com.dmdirc.addons.ui_swing.components.TreeScroller.com.dmdirc.addons.ui_swing.components.TreeScroller__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package com.dmdirc.addons.ui_swing.components;

import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;

import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;

/**
 * Utility class to provide mouse wheel scrolling to a JTree.
 */
public class TreeScroller implements MouseWheelListener {

    /** Tree to scroll. */
    private final DefaultTreeModel model;
    /** Tree to scroll. */
    private final TreeSelectionModel selectionModel;
    /** Root visible. */
    private final boolean rootVisible;
    /** Root node. */
    private final DefaultMutableTreeNode rootNode;
    /** Tree. */
    protected JTree tree;

    /**
     * Creates a new instance of TreeScroller.
     *
     * @param tree Tree to scroll over
     */
    public TreeScroller(final JTree tree) {
    //#TreeScroller.java:54: method: void com.dmdirc.addons.ui_swing.components.TreeScroller.com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)
    //#input(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): this
    //#input(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): tree
    //#output(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): this.model
    //#output(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): this.rootNode
    //#output(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): this.rootVisible
    //#output(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): this.selectionModel
    //#output(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): this.tree
    //#pre[2] (void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): tree != null
    //#presumption(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): javax.swing.JTree:getModel(...)@60 != null
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): init'ed(this.model)
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): init'ed(this.rootNode)
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): init'ed(this.rootVisible)
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): init'ed(this.selectionModel)
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): this.tree == tree
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)): this.tree != null
        this.tree = tree;
        this.model = (DefaultTreeModel) tree.getModel();
        this.selectionModel = tree.getSelectionModel();

        rootVisible = tree.isRootVisible();
        rootNode =
                (DefaultMutableTreeNode) tree.getModel().getRoot();

        tree.addMouseWheelListener(this);
    }
    //#TreeScroller.java:64: end of method: void com.dmdirc.addons.ui_swing.components.TreeScroller.com.dmdirc.addons.ui_swing.components.TreeScroller(JTree)

    /**
     * Creates a new instance of TreeScroller.
     *
     * @param model Tree model to scroll over
     * @param selectionModel Tree selection model to scroll over
     * @param rootVisible Is the root node visible
     */
    public TreeScroller(final DefaultTreeModel model,
            final TreeSelectionModel selectionModel, final boolean rootVisible) {
    //#TreeScroller.java:74: method: void com.dmdirc.addons.ui_swing.components.TreeScroller.com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)
    //#input(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): model
    //#input(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): rootVisible
    //#input(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): selectionModel
    //#input(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): this
    //#output(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): this.model
    //#output(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): this.rootNode
    //#output(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): this.rootVisible
    //#output(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): this.selectionModel
    //#pre[1] (void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): model != null
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): this.model == model
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): this.model != null
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): init'ed(this.rootNode)
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): this.rootVisible == rootVisible
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): init'ed(this.rootVisible)
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): this.selectionModel == selectionModel
    //#post(void com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)): init'ed(this.selectionModel)
        this.model = model;
        this.selectionModel = selectionModel;

        this.rootVisible = rootVisible;
        rootNode = (DefaultMutableTreeNode) model.getRoot();
    }
    //#TreeScroller.java:80: end of method: void com.dmdirc.addons.ui_swing.components.TreeScroller.com.dmdirc.addons.ui_swing.components.TreeScroller(DefaultTreeModel, TreeSelectionModel, bool)

    /**
     * {@inheritDoc}
     *
     * @param e Mouse wheel event
     */
    @Override
    public void mouseWheelMoved(final MouseWheelEvent e) {
        if (e.getWheelRotation() < 0) {
    //#TreeScroller.java:89: method: void com.dmdirc.addons.ui_swing.components.TreeScroller.mouseWheelMoved(MouseWheelEvent)
    //#TreeScroller.java:89: Warning: suspicious precondition
    //#    The precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.addons.ui_swing.components.TreeScroller
    //#    method: void mouseWheelMoved(MouseWheelEvent)
    //#    suspicious precondition index: [3]
    //#    Attribs:  Soft
    //#input(void mouseWheelMoved(MouseWheelEvent)): __Descendant_Table[com/dmdirc/addons/ui_swing/components/TreeScroller]
    //#input(void mouseWheelMoved(MouseWheelEvent)): __Descendant_Table[com/dmdirc/addons/ui_swing/components/desktopPane/DMDircDesktopPane$1]
    //#input(void mouseWheelMoved(MouseWheelEvent)): __Descendant_Table[others]
    //#input(void mouseWheelMoved(MouseWheelEvent)): __Dispatch_Table.changeFocus(Z)V
    //#input(void mouseWheelMoved(MouseWheelEvent)): __Dispatch_Table.setPath(Ljavax/swing/tree/TreePath;)V
    //#input(void mouseWheelMoved(MouseWheelEvent)): com/dmdirc/addons/ui_swing/components/desktopPane/DMDircDesktopPane$1.__Dispatch_Table.changeFocus(Z)V
    //#input(void mouseWheelMoved(MouseWheelEvent)): com/dmdirc/addons/ui_swing/components/desktopPane/DMDircDesktopPane$1.__Dispatch_Table.setPath(Ljavax/swing/tree/TreePath;)V
    //#input(void mouseWheelMoved(MouseWheelEvent)): e
    //#input(void mouseWheelMoved(MouseWheelEvent)): this
    //#input(void mouseWheelMoved(MouseWheelEvent)): this.__Tag
    //#input(void mouseWheelMoved(MouseWheelEvent)): this.model
    //#input(void mouseWheelMoved(MouseWheelEvent)): this.rootNode
    //#input(void mouseWheelMoved(MouseWheelEvent)): this.rootVisible
    //#input(void mouseWheelMoved(MouseWheelEvent)): this.selectionModel
    //#pre[1] (void mouseWheelMoved(MouseWheelEvent)): e != null
    //#pre[3] (void mouseWheelMoved(MouseWheelEvent)): (soft) this.__Tag in {com/dmdirc/addons/ui_swing/components/TreeScroller, com/dmdirc/addons/ui_swing/components/desktopPane/DMDircDesktopPane$1}
    //#pre[4] (void mouseWheelMoved(MouseWheelEvent)): (soft) this.model != null
    //#pre[7] (void mouseWheelMoved(MouseWheelEvent)): (soft) this.selectionModel != null
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.DefaultTreeModel:getRoot
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.TreeSelectionModel:setSelectionPath
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.DefaultMutableTreeNode:getPreviousNode
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.DefaultMutableTreeNode:getLastLeaf
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.DefaultMutableTreeNode:getNextNode
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.DefaultMutableTreeNode:getFirstChild
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.DefaultMutableTreeNode:getChildCount
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.TreeSelectionModel:isSelectionEmpty
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.DefaultMutableTreeNode:getChildAt
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.TreeSelectionModel:getSelectionPath
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.TreePath:getLastPathComponent
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.DefaultTreeModel:getPathToRoot
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:javax.swing.tree.TreePath
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:setPath
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:com.dmdirc.addons.ui_swing.framemanager.tree.TreeViewNode:getFrameContainer
    //#unanalyzed(void mouseWheelMoved(MouseWheelEvent)): Effects-of-calling:com.dmdirc.FrameContainer:activateFrame
    //#test_vector(void mouseWheelMoved(MouseWheelEvent)): java.awt.event.MouseWheelEvent:getWheelRotation(...)@89: {0..4_294_967_295}, {-2_147_483_648..-1}
            changeFocus(true);
        } else {
            changeFocus(false);
        }
    }
    //#TreeScroller.java:94: end of method: void com.dmdirc.addons.ui_swing.components.TreeScroller.mouseWheelMoved(MouseWheelEvent)

    /**
     * Activates the node above or below the active node in the tree.
     *
     * @param direction true = up, false = down.
     */
    public void changeFocus(final boolean direction) {
        DefaultMutableTreeNode thisNode;
        DefaultMutableTreeNode nextNode;

        if (rootNode == null) {
    //#TreeScroller.java:105: method: void com.dmdirc.addons.ui_swing.components.TreeScroller.changeFocus(bool)
    //#TreeScroller.java:105: Warning: suspicious precondition
    //#    The precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.addons.ui_swing.components.TreeScroller
    //#    method: void changeFocus(bool)
    //#    suspicious precondition index: [5]
    //#    Attribs:  Soft
    //#input(void changeFocus(bool)): __Descendant_Table[com/dmdirc/addons/ui_swing/components/TreeScroller]
    //#input(void changeFocus(bool)): __Descendant_Table[com/dmdirc/addons/ui_swing/components/desktopPane/DMDircDesktopPane$1]
    //#input(void changeFocus(bool)): __Descendant_Table[others]
    //#input(void changeFocus(bool)): __Dispatch_Table.setPath(Ljavax/swing/tree/TreePath;)V
    //#input(void changeFocus(bool)): com/dmdirc/addons/ui_swing/components/desktopPane/DMDircDesktopPane$1.__Dispatch_Table.setPath(Ljavax/swing/tree/TreePath;)V
    //#input(void changeFocus(bool)): direction
    //#input(void changeFocus(bool)): this
    //#input(void changeFocus(bool)): this.__Tag
    //#input(void changeFocus(bool)): this.model
    //#input(void changeFocus(bool)): this.rootNode
    //#input(void changeFocus(bool)): this.rootVisible
    //#input(void changeFocus(bool)): this.selectionModel
    //#pre[5] (void changeFocus(bool)): (soft) this.__Tag in {com/dmdirc/addons/ui_swing/components/TreeScroller, com/dmdirc/addons/ui_swing/components/desktopPane/DMDircDesktopPane$1}
    //#pre[6] (void changeFocus(bool)): (soft) this.model != null
    //#pre[9] (void changeFocus(bool)): (soft) this.selectionModel != null
    //#presumption(void changeFocus(bool)): javax.swing.tree.DefaultMutableTreeNode:getChildAt(...)@119 != null
    //#presumption(void changeFocus(bool)): javax.swing.tree.TreePath:getLastPathComponent(...)@122 != null
    //#presumption(void changeFocus(bool)): javax.swing.tree.TreeSelectionModel:getSelectionPath(...)@122 != null
    //#unanalyzed(void changeFocus(bool)): Effects-of-calling:javax.swing.tree.DefaultTreeModel:getRoot
    //#unanalyzed(void changeFocus(bool)): Effects-of-calling:javax.swing.tree.TreeSelectionModel:setSelectionPath
    //#unanalyzed(void changeFocus(bool)): Effects-of-calling:javax.swing.tree.DefaultMutableTreeNode:getPreviousNode
    //#unanalyzed(void changeFocus(bool)): Effects-of-calling:javax.swing.tree.DefaultMutableTreeNode:getLastLeaf
    //#unanalyzed(void changeFocus(bool)): Effects-of-calling:javax.swing.tree.DefaultMutableTreeNode:getNextNode
    //#unanalyzed(void changeFocus(bool)): Effects-of-calling:javax.swing.tree.DefaultMutableTreeNode:getFirstChild
    //#unanalyzed(void changeFocus(bool)): Effects-of-calling:javax.swing.tree.TreePath:getLastPathComponent
    //#unanalyzed(void changeFocus(bool)): Effects-of-calling:com.dmdirc.addons.ui_swing.framemanager.tree.TreeViewNode:getFrameContainer
    //#unanalyzed(void changeFocus(bool)): Effects-of-calling:com.dmdirc.FrameContainer:activateFrame
    //#test_vector(void changeFocus(bool)): direction: {0}, {1}
    //#test_vector(void changeFocus(bool)): this.rootNode: Inverse{null}, Addr_Set{null}
    //#test_vector(void changeFocus(bool)): this.rootVisible: {1}, {0}
    //#test_vector(void changeFocus(bool)): javax.swing.tree.DefaultMutableTreeNode:getChildCount(...)@110: {-2_147_483_648..-1, 1..4_294_967_295}, {0}
    //#test_vector(void changeFocus(bool)): javax.swing.tree.TreeSelectionModel:isSelectionEmpty(...)@115: {0}, {1}
            //no root node or root node not visible
            return;
        }

        if (!rootVisible && rootNode.getChildCount() == 0) {
            //root node has no children
            return;
        }

        if (selectionModel.isSelectionEmpty()) {
            if (rootVisible) {
                thisNode = rootNode;
            } else {
                thisNode = (DefaultMutableTreeNode) rootNode.getChildAt(0);
            }
        } else {
            thisNode = (DefaultMutableTreeNode) selectionModel.getSelectionPath().getLastPathComponent();
        }

        //are we going up or down?
        if (direction) {
            //up
            nextNode = changeFocusUp(thisNode);
        } else {
            //down
            nextNode = changeFocusDown(thisNode);
        }
        setPath(new TreePath(model.getPathToRoot(nextNode)));
    }
    //#TreeScroller.java:134: end of method: void com.dmdirc.addons.ui_swing.components.TreeScroller.changeFocus(bool)

    /**
     * Sets the tree selection path.
     *
     * @param path Path
     */
    protected void setPath(final TreePath path) {
        selectionModel.setSelectionPath(path);
    //#TreeScroller.java:142: method: void com.dmdirc.addons.ui_swing.components.TreeScroller.setPath(TreePath)
    //#input(void setPath(TreePath)): path
    //#input(void setPath(TreePath)): this
    //#input(void setPath(TreePath)): this.selectionModel
    //#pre[3] (void setPath(TreePath)): this.selectionModel != null
    }
    //#TreeScroller.java:143: end of method: void com.dmdirc.addons.ui_swing.components.TreeScroller.setPath(TreePath)

    /**
     * Changes the tree focus up.
     *
     * @param node Start node
     *
     * @return next node
     */
    private DefaultMutableTreeNode changeFocusUp(final DefaultMutableTreeNode node) {
        DefaultMutableTreeNode nextNode;

        nextNode = node.getPreviousNode();
    //#TreeScroller.java:155: method: DefaultMutableTreeNode com.dmdirc.addons.ui_swing.components.TreeScroller.changeFocusUp(DefaultMutableTreeNode)
    //#input(DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): node
    //#input(DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): this
    //#input(DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): this.model
    //#input(DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): this.rootNode
    //#input(DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): this.rootVisible
    //#output(DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): return_value
    //#pre[1] (DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): node != null
    //#pre[3] (DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): (soft) this.model != null
    //#pre[4] (DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): (soft) this.rootNode != null
    //#post(DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): init'ed(return_value)
    //#test_vector(DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): this.rootVisible: {1}, {0}
    //#test_vector(DefaultMutableTreeNode changeFocusUp(DefaultMutableTreeNode)): javax.swing.tree.DefaultMutableTreeNode:getPreviousNode(...)@155: Addr_Set{null}, Inverse{null}

        if (nextNode == null || (nextNode == model.getRoot() && !rootVisible)) {
            nextNode = rootNode.getLastLeaf();
        }

        return nextNode;
    //#TreeScroller.java:161: end of method: DefaultMutableTreeNode com.dmdirc.addons.ui_swing.components.TreeScroller.changeFocusUp(DefaultMutableTreeNode)
    }

    /**
     * Changes the tree focus down.
     *
     * @param node Start node
     *
     * @return next node
     */
    private DefaultMutableTreeNode changeFocusDown(final DefaultMutableTreeNode node) {
        DefaultMutableTreeNode nextNode;

        nextNode = node.getNextNode();
    //#TreeScroller.java:174: method: DefaultMutableTreeNode com.dmdirc.addons.ui_swing.components.TreeScroller.changeFocusDown(DefaultMutableTreeNode)
    //#input(DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): node
    //#input(DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): this
    //#input(DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): this.model
    //#input(DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): this.rootNode
    //#input(DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): this.rootVisible
    //#output(DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): return_value
    //#pre[1] (DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): node != null
    //#pre[3] (DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): (soft) this.model != null
    //#pre[4] (DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): (soft) this.rootNode != null
    //#post(DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): init'ed(return_value)
    //#test_vector(DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): this.rootVisible: {1}, {0}
    //#test_vector(DefaultMutableTreeNode changeFocusDown(DefaultMutableTreeNode)): javax.swing.tree.DefaultMutableTreeNode:getNextNode(...)@174: Inverse{null}, Addr_Set{null}

        if (nextNode == null && !rootVisible) {
            nextNode =
                    (DefaultMutableTreeNode) rootNode.getFirstChild();
        } else if (nextNode == null) {
            nextNode = (DefaultMutableTreeNode) model.getRoot();
        }

        return nextNode;
    //#TreeScroller.java:183: end of method: DefaultMutableTreeNode com.dmdirc.addons.ui_swing.components.TreeScroller.changeFocusDown(DefaultMutableTreeNode)
    }
}
    //#output(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/TreeScroller]
    //#output(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Dispatch_Table.changeFocus(Z)V
    //#output(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Dispatch_Table.changeFocusDown(Ljavax/swing/tree/DefaultMutableTreeNode;)Ljavax/swing/tree/DefaultMutableTreeNode;
    //#output(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Dispatch_Table.changeFocusUp(Ljavax/swing/tree/DefaultMutableTreeNode;)Ljavax/swing/tree/DefaultMutableTreeNode;
    //#output(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Dispatch_Table.mouseWheelMoved(Ljava/awt/event/MouseWheelEvent;)V
    //#output(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Dispatch_Table.setPath(Ljavax/swing/tree/TreePath;)V
    //#post(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/TreeScroller] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Dispatch_Table.changeFocus(Z)V == &changeFocus
    //#post(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Dispatch_Table.changeFocusDown(Ljavax/swing/tree/DefaultMutableTreeNode;)Ljavax/swing/tree/DefaultMutableTreeNode; == &changeFocusDown
    //#post(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Dispatch_Table.changeFocusUp(Ljavax/swing/tree/DefaultMutableTreeNode;)Ljavax/swing/tree/DefaultMutableTreeNode; == &changeFocusUp
    //#post(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Dispatch_Table.mouseWheelMoved(Ljava/awt/event/MouseWheelEvent;)V == &mouseWheelMoved
    //#post(com.dmdirc.addons.ui_swing.components.TreeScroller__static_init): __Dispatch_Table.setPath(Ljavax/swing/tree/TreePath;)V == &setPath
    //#TreeScroller.java:: end of method: com.dmdirc.addons.ui_swing.components.TreeScroller.com.dmdirc.addons.ui_swing.components.TreeScroller__static_init
    //#TreeScroller.java:: end of class: com.dmdirc.addons.ui_swing.components.TreeScroller
