KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwtx > swing > ToolTipManager


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4  
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7  
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9  
10    $Log: ToolTipManager.java,v $
11    Revision 1.1 2004/05/05 12:43:21 bobintetley
12    Patches/new files from Laurent Martell
13
14  
15  */

16
17 package swingwtx.swing;
18
19 import swingwt.awt.event.ActionEvent;
20 import swingwt.awt.event.ActionListener;
21 import swingwt.awt.event.MouseAdapter;
22 import swingwt.awt.event.MouseEvent;
23 import swingwt.awt.event.MouseMotionListener;
24
25 /**
26  * @author Laurent Martell
27  */

28 public class ToolTipManager extends MouseAdapter implements MouseMotionListener {
29
30     final static ToolTipManager sharedInstance = new ToolTipManager();
31
32     ToolTipManager() {
33     }
34
35     boolean enabled;
36     public void setEnabled(boolean flag) {
37         enabled = flag;
38     }
39     public boolean isEnabled() {
40         return enabled;
41     }
42
43     protected boolean lightWeightPopupEnabled;
44     protected boolean heavyWeightPopupEnabled;
45     public void setLightWeightPopupEnabled(boolean enabled){
46         lightWeightPopupEnabled = enabled;
47     }
48     public boolean isLightWeightPopupEnabled() {
49         return lightWeightPopupEnabled;
50     }
51
52     String JavaDoc toolTipText;
53
54     Timer initialTimer = new Timer(1000,new insideTimerAction());
55     public void setInitialDelay(int milliseconds) {
56         initialTimer.setInitialDelay(milliseconds);
57     }
58     public int getInitialDelay() {
59         return initialTimer.getInitialDelay();
60     }
61
62     Timer dismissTimer = new Timer(1000,new outsideTimerAction());
63     public void setDismissDelay(int milliseconds) {
64         dismissTimer.setInitialDelay(milliseconds);
65     }
66     public int getDismissDelay() {
67         return dismissTimer.getInitialDelay();
68     }
69
70     Timer reshowTimer = new Timer(3000,new stillInsideTimerAction());
71     public void setReshowDelay(int milliseconds) {
72         reshowTimer.setInitialDelay(milliseconds);
73     }
74     public int getReshowDelay() {
75         return reshowTimer.getInitialDelay();
76     }
77
78     public static ToolTipManager sharedInstance() {
79         return sharedInstance;
80     }
81
82     public void registerComponent(JComponent component) { /* TODO */ }
83     public void unregisterComponent(JComponent component) { /* TODO */ }
84
85     public void mouseEntered(MouseEvent event) { /* TODO */ }
86     public void mouseExited(MouseEvent event) { /* TODO */ }
87     public void mousePressed(MouseEvent event) { /* TODO */ }
88     public void mouseDragged(MouseEvent event) { /* TODO */ }
89     public void mouseMoved(MouseEvent event) { /* TODO */ }
90
91     protected class insideTimerAction implements ActionListener {
92         public void actionPerformed(ActionEvent e) { /* TODO */ }
93     }
94
95     protected class outsideTimerAction implements ActionListener {
96         public void actionPerformed(ActionEvent e) { /* TODO */ }
97     }
98
99     protected class stillInsideTimerAction implements ActionListener {
100         public void actionPerformed(ActionEvent e) { /* TODO */ }
101     }
102 }
103
Popular Tags