01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Anton Avtamonov
19: * @version $Revision$
20: */package javax.swing.event;
21:
22: import java.util.EventObject;
23:
24: import javax.swing.tree.TreePath;
25:
26: public class TreeModelEvent extends EventObject {
27: protected TreePath path;
28: protected int[] childIndices;
29: protected Object[] children;
30:
31: public TreeModelEvent(final Object source, final Object[] path) {
32: this (source, path, new int[0], null);
33: }
34:
35: public TreeModelEvent(final Object source, final TreePath path) {
36: this (source, path, new int[0], null);
37: }
38:
39: public TreeModelEvent(final Object source, final Object[] path,
40: final int[] childIndices, final Object[] children) {
41:
42: this (source, new TreePath(path), childIndices, children);
43: }
44:
45: public TreeModelEvent(final Object source, final TreePath path,
46: final int[] childIndices, final Object[] children) {
47:
48: super (source);
49: this .path = path;
50: this .childIndices = childIndices;
51: this .children = children;
52: }
53:
54: public TreePath getTreePath() {
55: return path;
56: }
57:
58: public Object[] getPath() {
59: return path != null ? path.getPath() : null;
60: }
61:
62: public Object[] getChildren() {
63: return children != null ? (Object[]) children.clone() : null;
64: }
65:
66: public int[] getChildIndices() {
67: return childIndices != null ? (int[]) childIndices.clone()
68: : null;
69: }
70: }
|