View Javadoc

1   package org.telscenter.pas.ui.evidence;
2   
3   import java.awt.LayoutManager;
4   import java.awt.Point;
5   import java.awt.event.MouseEvent;
6   
7   import javax.swing.JPanel;
8   
9   public class EvidencePanel extends JPanel {
10  
11  	public EvidencePanel(LayoutManager layout, boolean isDoubleBuffered) {
12  		super(layout, isDoubleBuffered);
13  		// TODO Auto-generated constructor stub
14  	}
15  
16  	public EvidencePanel(LayoutManager layout) {
17  		super(layout);
18  		// TODO Auto-generated constructor stub
19  	}
20  
21  	public EvidencePanel(boolean isDoubleBuffered) {
22  		super(isDoubleBuffered);
23  		// TODO Auto-generated constructor stub
24  	}
25  
26  	public EvidencePanel() {
27  		super();
28  		// TODO Auto-generated constructor stub
29  	}
30  	
31  	public String getToolTipText(MouseEvent event) {
32  		if (event.getID() != MouseEvent.MOUSE_MOVED)
33  	        return null;
34  	    else
35  	    {
36  	        Point p = event.getPoint();
37  	        StringBuffer buf = new StringBuffer();
38  	        // construct tool tip text for cursor at 'p'
39  	        buf.insert(0, "<html><body><b><p>Evidence Attribution:</p></b><blockquote>" + getToolTipText());
40  	        // add enclosing HTML verbage* so newlines are recognized
41  	        buf.append("</blockquote></body></html>");
42  	        return(buf.toString());
43  	    }
44  	}
45  	
46  	public Point getToolTipLocation(MouseEvent event) {
47  		 if (event.getID() != MouseEvent.MOUSE_MOVED)
48  		        return null;
49  		    else
50  		    {
51  		        Point p = event.getPoint();
52  		        // calculate tool tip location for cursor at 'p'
53  		        p.translate(1, 1+14); 
54  		        return (p);
55  		    }
56  	}
57  
58  }