cib.util
Class ExtendedMouseAdapter

java.lang.Object
  extended by cib.util.ExtendedMouseAdapter
Direct Known Subclasses:
MouseStroke

public class ExtendedMouseAdapter
extends java.lang.Object

Delivers extended mouse events like 'mouse holding' and 'double clicked'. Obviously such events can only be delivered after a certain wait time. If the user is not interested in such extended events the standard MouseListener and MouseAdapter classes should be used. For an optimal runtime behavior it is important to specify the event filter properly. Although ExtendedMouseAdapter objects deliver the standard mouse events the class does not implement the MouseListener interface. Like with the standard MouseListener the ExtendedMouseAdapter must be extended to receive notification. This decision was made intentionally. Like standard MouseListeners ExtendedMouseListeners must be added to a data source via Component.addMouseListener(). Because ExtendedMouseListener is not of type MouseListener objects of this class cannot be passed directly. Instead the method ExtendedMouseListener.asMouseListener() must be used.

Version:
$Revision: 1717 $, $Author: svn-firmenich $, $Date: 2012-02-29 14:42:17 +0100 (Wed, 29. Feb 2012) $
Author:
Berthold Firmenich

Field Summary
static int HOLDING_EVENT
           
static int MULTI_CLICKED_EVENT
           
 
Constructor Summary
ExtendedMouseAdapter(int filter)
           
 
Method Summary
 javax.swing.event.MouseInputListener asMouseInputListener()
          This method allows to add an ExtendedMouseAdapter as a MouseListener to a component.
 void mouseClicked(java.awt.event.MouseEvent e)
          Mouse event 'Clicked' occurred.
 void mouseDragged(java.awt.event.MouseEvent e)
          Mouse event 'Dragged' occurred.
 void mouseEntered(java.awt.event.MouseEvent e)
          Mouse event 'Entered' occurred.
 void mouseExited(java.awt.event.MouseEvent e)
          Mouse event 'Exited' occurred.
 void mouseHolding(java.awt.event.MouseEvent e)
          Extended event 'Holding' occurred.
 void mouseMoved(java.awt.event.MouseEvent e)
          Mouse event 'Moved' occurred.
 void mousePressed(java.awt.event.MouseEvent e)
          Mouse event 'Pressed' occurred.
 void mouseReleased(java.awt.event.MouseEvent e)
          Mouse event 'Released' occurred.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOLDING_EVENT

public static final int HOLDING_EVENT
See Also:
Constant Field Values

MULTI_CLICKED_EVENT

public static final int MULTI_CLICKED_EVENT
See Also:
Constant Field Values
Constructor Detail

ExtendedMouseAdapter

public ExtendedMouseAdapter(int filter)
Method Detail

asMouseInputListener

public javax.swing.event.MouseInputListener asMouseInputListener()
This method allows to add an ExtendedMouseAdapter as a MouseListener to a component.

Returns:
the reference to a MouseListener implementation

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Mouse event 'Clicked' occurred. For a 'long click' the MouseEvent.getClickCount() method returns a value of 0. If the filter contains the MOUSE_MULIPLE_CLICKED_EVENT then only ONE SINGLE event will be delivered (as opposed to the standard where many clicked events are generated).

Parameters:
e -

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Mouse event 'Entered' occurred.

Parameters:
e -

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Mouse event 'Exited' occurred.

Parameters:
e -

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Mouse event 'Pressed' occurred.

Parameters:
e -

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Mouse event 'Released' occurred.

Parameters:
e -

mouseHolding

public void mouseHolding(java.awt.event.MouseEvent e)
Extended event 'Holding' occurred. This means, that the mouse is currently held down. Event will only be delivered if the filter contains the HOLDING_EVENT. Subsequent 'pressed' and 'clicked' events will be delivered as well.

Parameters:
e -

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Mouse event 'Dragged' occurred.

Parameters:
e -

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Mouse event 'Moved' occurred.

Parameters:
e -