org.crosswire.bibledesktop.display.basic
Class URITipMgr
java.lang.Object
java.awt.event.MouseAdapter
org.crosswire.bibledesktop.display.basic.URITipMgr
- All Implemented Interfaces:
- ActionListener, MouseListener, MouseMotionListener, MouseWheelListener, EventListener, URIEventListener
public class URITipMgr
- extends MouseAdapter
- implements ActionListener, URIEventListener
How it works:
1. It keeps track of mouse movement.
2. It registers the URI entering event and starts a timer.
3. When the timer fires, a tip pops up, the timer stopped.
4. The timer is stopped when a URI leaving event is received.
5. Whenever mouse clicked outside the tip, it disappears.
6. Click in the tip to make it sticky, double-click to close.
7. If sticky, tip updates as the mouse enters another URI.
- Author:
- Yingjie Lan [lanyjie at yahoo dot com]
- See Also:
for license details.
The copyright to this program is held by it's authors.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
owner
private Component owner
txtView
private JTextPane txtView
scrView
private JScrollPane scrView
title
private TitledBorder title
popup
private Popup popup
sticky
private boolean sticky
lastx
private int lastx
lasty
private int lasty
event
private URIEvent event
timer
private Timer timer
converter
private Converter converter
URITipMgr
public URITipMgr(Component own,
Dimension dim)
setDelay
public void setDelay(int delay)
updateText
public void updateText()
showTip
void showTip()
hideTip
void hideTip(boolean stick)
interested
boolean interested(URIEvent ev)
- Parameters:
ev
- if we are interested in this event
activateURI
public void activateURI(URIEvent ev)
- Description copied from interface:
URIEventListener
- This method is called to indicate that an URI can be processed.
- Specified by:
activateURI
in interface URIEventListener
- Parameters:
ev
- Describes the URI
enterURI
public void enterURI(URIEvent ev)
- Description copied from interface:
URIEventListener
- This method is called to indicate that the mouse has entered the URI.
- Specified by:
enterURI
in interface URIEventListener
- Parameters:
ev
- Describes the URI
leaveURI
public void leaveURI(URIEvent ev)
- Description copied from interface:
URIEventListener
- This method is called to indicate that the mouse has left the URI.
- Specified by:
leaveURI
in interface URIEventListener
- Parameters:
ev
- Describes the URI
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed
in interface ActionListener
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDragged
in interface MouseMotionListener
- Overrides:
mouseDragged
in class MouseAdapter
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMoved
in interface MouseMotionListener
- Overrides:
mouseMoved
in class MouseAdapter
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClicked
in interface MouseListener
- Overrides:
mouseClicked
in class MouseAdapter
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExited
in interface MouseListener
- Overrides:
mouseExited
in class MouseAdapter