View Javadoc

1   /*
2      Copyright 2002-2006 Martin van den Bemt
3   
4      Licensed under the Apache License, Version 2.0 (the "License");
5      you may not use this file except in compliance with the License.
6      You may obtain a copy of the License at
7   
8          http://www.apache.org/licenses/LICENSE-2.0
9   
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15  */
16  package org.xulux.guilayer.swing.extensions;
17  
18  import java.awt.Point;
19  import java.awt.event.MouseEvent;
20  import java.util.Hashtable;
21  import java.util.Vector;
22  
23  import javax.swing.JTree;
24  import javax.swing.tree.TreeModel;
25  import javax.swing.tree.TreeNode;
26  
27  /**
28   * 
29   * @author Martin van den Bemt
30   * @version $Id: XuluxJTree.java,v 1.1 2005/12/18 12:58:18 mvdb Exp $
31   */
32  public class XuluxJTree extends JTree {
33  
34      /**
35       * 
36       */
37      public XuluxJTree() {
38          super();
39  
40      }
41  
42      /**
43       * @param value
44       */
45      public XuluxJTree(Object[] value) {
46          super(value);
47  
48      }
49  
50      /**
51       * @param value
52       */
53      public XuluxJTree(Vector value) {
54          super(value);
55  
56      }
57  
58      /**
59       * @param value
60       */
61      public XuluxJTree(Hashtable value) {
62          super(value);
63  
64      }
65  
66      /**
67       * @param root
68       */
69      public XuluxJTree(TreeNode root) {
70          super(root);
71  
72      }
73  
74      /**
75       * @param root
76       * @param asksAllowsChildren
77       */
78      public XuluxJTree(TreeNode root, boolean asksAllowsChildren) {
79          super(root, asksAllowsChildren);
80  
81      }
82  
83      /**
84       * @param newModel
85       */
86      public XuluxJTree(TreeModel newModel) {
87          super(newModel);
88  
89      }
90  
91      /**
92       * @see javax.swing.JComponent#getToolTipLocation(java.awt.event.MouseEvent)
93       */
94      public Point getToolTipLocation(MouseEvent event) {
95        if (getToolTipText(event) == null) {
96          Point point = new Point(event.getX(), event.getY());
97          return point;
98        }
99        return super.getToolTipLocation(event);
100     }
101 
102 }