JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / jalview / appletgui / Tooltip.js
1 Clazz.declarePackage ("jalview.appletgui");\r
2 Clazz.load (null, "jalview.appletgui.Tooltip", ["awt2swing.Frame", "java.applet.Applet", "java.awt.Toolkit"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.tip = null;\r
5 this.lastTip = "";\r
6 this.setPosition = false;\r
7 this.owner = null;\r
8 this.mainContainer = null;\r
9 this.mainLayout = null;\r
10 this.shown = false;\r
11 this.VERTICAL_OFFSET = 20;\r
12 this.HORIZONTAL_ENLARGE = 10;\r
13 this.fontHeight = 0;\r
14 this.linkImage = null;\r
15 this.fm = null;\r
16 Clazz.instantialize (this, arguments);\r
17 }, jalview.appletgui, "Tooltip");\r
18 Clazz.defineMethod (c$, "setVisible", \r
19 function (b) {\r
20 }, "~B");\r
21 Clazz.makeConstructor (c$, \r
22 function (tip, owner) {\r
23 this.owner = owner;\r
24 this.setTip (tip);\r
25 var url = this.getClass ().getResource ("/images/link.gif");\r
26 if (url != null) {\r
27 this.linkImage = java.awt.Toolkit.getDefaultToolkit ().getImage (url);\r
28 }}, "~S,java.awt.Component");\r
29 Clazz.defineMethod (c$, "setTip", \r
30 function (tip) {\r
31 System.err.println ("Tooltip: " + tip);\r
32 }, "~S");\r
33 Clazz.defineMethod (c$, "setTipLocation", \r
34 function (evt) {\r
35 }, "java.awt.event.MouseEvent");\r
36 Clazz.defineMethod (c$, "removeToolTip", \r
37  function () {\r
38 });\r
39 Clazz.defineMethod (c$, "mouseEntered", \r
40 function (me) {\r
41 this.setTipLocation (me);\r
42 }, "java.awt.event.MouseEvent");\r
43 Clazz.defineMethod (c$, "mouseExited", \r
44 function (me) {\r
45 this.removeToolTip ();\r
46 }, "java.awt.event.MouseEvent");\r
47 Clazz.defineMethod (c$, "mousePressed", \r
48 function (me) {\r
49 this.removeToolTip ();\r
50 }, "java.awt.event.MouseEvent");\r
51 Clazz.defineMethod (c$, "mouseReleased", \r
52 function (me) {\r
53 }, "java.awt.event.MouseEvent");\r
54 Clazz.defineMethod (c$, "mouseClicked", \r
55 function (me) {\r
56 }, "java.awt.event.MouseEvent");\r
57 Clazz.defineMethod (c$, "mouseMoved", \r
58 function (me) {\r
59 if (!this.shown) {\r
60 this.setTipLocation (me);\r
61 } else if (this.setPosition) {\r
62 this.setTipLocation (me);\r
63 }}, "java.awt.event.MouseEvent");\r
64 Clazz.defineMethod (c$, "mouseDragged", \r
65 function (me) {\r
66 }, "java.awt.event.MouseEvent");\r
67 });\r