Line | Hits | Source |
---|---|---|
1 | /* | |
2 | * Copyright (c) 2003, the JUNG Project and the Regents of the University of | |
3 | * California All rights reserved. | |
4 | * | |
5 | * This software is open-source under the BSD license; see either "license.txt" | |
6 | * or http://jung.sourceforge.net/license.txt for a description. | |
7 | * | |
8 | */ | |
9 | package edu.uci.ics.jung.visualization.control; | |
10 | ||
11 | import java.awt.event.MouseEvent; | |
12 | import java.awt.event.MouseListener; | |
13 | ||
14 | public abstract class AbstractPopupGraphMousePlugin extends AbstractGraphMousePlugin | |
15 | implements MouseListener { | |
16 | ||
17 | public AbstractPopupGraphMousePlugin() { | |
18 | 0 | this(MouseEvent.BUTTON3_MASK); |
19 | 0 | } |
20 | public AbstractPopupGraphMousePlugin(int modifiers) { | |
21 | 0 | super(modifiers); |
22 | 0 | } |
23 | public void mousePressed(MouseEvent e) { | |
24 | 0 | if(e.isPopupTrigger()) { |
25 | 0 | handlePopup(e); |
26 | 0 | e.consume(); |
27 | } | |
28 | 0 | } |
29 | ||
30 | /** | |
31 | * if this is the popup trigger, process here, otherwise | |
32 | * defer to the superclass | |
33 | */ | |
34 | public void mouseReleased(MouseEvent e) { | |
35 | 0 | if(e.isPopupTrigger()) { |
36 | 0 | handlePopup(e); |
37 | 0 | e.consume(); |
38 | } | |
39 | 0 | } |
40 | ||
41 | /** | |
42 | * @param e | |
43 | */ | |
44 | protected abstract void handlePopup(MouseEvent e); | |
45 | ||
46 | public void mouseClicked(MouseEvent e) { | |
47 | 0 | } |
48 | ||
49 | public void mouseEntered(MouseEvent e) { | |
50 | 0 | } |
51 | ||
52 | public void mouseExited(MouseEvent e) { | |
53 | 0 | } |
54 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |