KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > debugger > gui > AJThreadGroupTreeMouseListener


1 /* -*- Mode: JDE; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  *
3  * This file is part of the debugger and core tools for the AspectJ(tm)
4  * programming language; see http://aspectj.org
5  *
6  * The contents of this file are subject to the Mozilla Public License
7  * Version 1.1 (the "License"); you may not use this file except in
8  * compliance with the License. You may obtain a copy of the License at
9  * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is AspectJ.
17  *
18  * The Initial Developer of the Original Code is Xerox Corporation. Portions
19  * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
20  * All Rights Reserved.
21  */

22
23 package org.aspectj.debugger.gui;
24
25 import org.aspectj.debugger.base.*;
26
27 import java.awt.event.MouseListener JavaDoc;
28 import java.awt.event.MouseEvent JavaDoc;
29 import javax.swing.SwingUtilities JavaDoc;
30 import javax.swing.tree.TreePath JavaDoc;
31 import com.sun.jdi.*;
32
33 public class AJThreadGroupTreeMouseListener implements MouseListener JavaDoc {
34
35     private AJTree tree = null;
36
37     public AJThreadGroupTreeMouseListener(AJTree tree) {
38         this.tree = tree;
39     }
40
41     public void mouseClicked(MouseEvent JavaDoc e) {
42         int row = tree.getRowForLocation(e.getX(), e.getY());
43         TreePath JavaDoc path = tree.getPathForLocation(e.getX(), e.getY());
44         if (row == -1) {
45             return;
46         }
47         AJTreeNode node = (AJTreeNode) path.getLastPathComponent();
48         if (SwingUtilities.isLeftMouseButton(e)) {
49             node.leftMouseButton(e);
50         } else if (SwingUtilities.isMiddleMouseButton(e)) {
51             node.middleMouseButton(e);
52         } else if (SwingUtilities.isRightMouseButton(e)) {
53             node.rightMouseButton(e);
54         }
55     }
56
57     public void mousePressed(MouseEvent JavaDoc e) {
58         //TODO: Implement this java.awt.event.MouseListener method
59
}
60
61     public void mouseReleased(MouseEvent JavaDoc e) {
62         //TODO: Implement this java.awt.event.MouseListener method
63
}
64
65     public void mouseEntered(MouseEvent JavaDoc e) {
66         //TODO: Implement this java.awt.event.MouseListener method
67
}
68
69     public void mouseExited(MouseEvent JavaDoc e) {
70         //TODO: Implement this java.awt.event.MouseListener method
71
}
72 }
Popular Tags