jdk/src/share/classes/javax/swing/event/TreeModelListener.java
author malenkov
Wed, 30 Apr 2014 19:28:05 +0400
changeset 24544 c0133e7c7162
parent 23010 6dadb192ad81
child 25154 a4252397d312
permissions -rw-r--r--
8041917: unexcepted behavior of LineBorder while using Boolean variable true Reviewed-by: alexsch, serb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 21982
diff changeset
     2
 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.swing.event;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.EventListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * Defines the interface for an object that listens
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * to changes in a TreeModel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * For further information and examples see
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * <a
20455
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 5506
diff changeset
    35
 href="http://docs.oracle.com/javase/tutorial/uiswing/events/treemodellistener.html">How to Write a Tree Model Listener</a>,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * a section in <em>The Java Tutorial.</em>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * @author Rob Davis
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * @author Ray Ryan
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
public interface TreeModelListener extends EventListener {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * <p>Invoked after a node (or a set of siblings) has changed in some
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     * way. The node(s) have not changed locations in the tree or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * altered their children arrays, but other attributes have
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     * changed and may affect presentation. Example: the name of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     * file has changed, but it is in the same location in the file
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     * system.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * <p>To indicate the root has changed, childIndices and children
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * will be null. </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * <p>Use <code>e.getPath()</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * to get the parent of the changed node(s).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * <code>e.getChildIndices()</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * returns the index(es) of the changed node(s).</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    void treeNodesChanged(TreeModelEvent e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * <p>Invoked after nodes have been inserted into the tree.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * <p>Use <code>e.getPath()</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * to get the parent of the new node(s).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * <code>e.getChildIndices()</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * returns the index(es) of the new node(s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * in ascending order.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    void treeNodesInserted(TreeModelEvent e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * <p>Invoked after nodes have been removed from the tree.  Note that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * if a subtree is removed from the tree, this method may only be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * invoked once for the root of the removed subtree, not once for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * each individual set of siblings removed.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * <p>Use <code>e.getPath()</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * to get the former parent of the deleted node(s).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * <code>e.getChildIndices()</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * returns, in ascending order, the index(es)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * the node(s) had before being deleted.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    void treeNodesRemoved(TreeModelEvent e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * <p>Invoked after the tree has drastically changed structure from a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * given node down.  If the path returned by e.getPath() is of length
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * one and the first element does not identify the current root node
21982
fd6e5fe509df 8029264: [doclint] more doclint and tidy cleanup
yan
parents: 20455
diff changeset
    89
     * the first element should become the new root of the tree.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * <p>Use <code>e.getPath()</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * to get the path to the node.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * <code>e.getChildIndices()</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * returns null.</p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    void treeStructureChanged(TreeModelEvent e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
}