org.openide.awt
Class MouseUtils.PopupMouseAdapter
java.lang.Object
|
+--java.awt.event.MouseAdapter
|
+--org.openide.awt.MouseUtils.PopupMouseAdapter
- All Implemented Interfaces:
- EventListener, MouseListener
- Enclosing class:
- MouseUtils
- public abstract static class MouseUtils.PopupMouseAdapter
- extends MouseAdapter
The PopupMouseAdapter implements a better popup menu invocation
mechanism. It should be used instead of invoking the popup in
mouseClicked because the mouseClicked does not work as "often" as
it should (i.e. sometimes it is not called).
The threshold that can be passed into the constructor
is the "sensitivity" of the mouse movement - if the mouse
move delta position (between mouse press and release) extends the
threshold, the menu should not be shown.
The default value is 5 which seems as a reasonable value for
the context menu invocation to be comfort for the user.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_THRESHOLD
public static final int DEFAULT_THRESHOLD
- The default threshold value
MouseUtils.PopupMouseAdapter
public MouseUtils.PopupMouseAdapter()
- Creates a new PopupMouseAdapter with default threshold
MouseUtils.PopupMouseAdapter
public MouseUtils.PopupMouseAdapter(int threshold)
- Creates a new PopupMouseAdapter with specified threshold
- Parameters:
threshold
- The threshold to be used
mousePressed
public void mousePressed(MouseEvent e)
- Overrides:
mousePressed
in class MouseAdapter
mouseReleased
public void mouseReleased(MouseEvent e)
- Overrides:
mouseReleased
in class MouseAdapter
showPopup
protected abstract void showPopup(MouseEvent evt)
- Called when the sequnce of mouse events should lead to actual
showing of the popup menu.
Should be redefined to show the menu.
param evt The mouse release event - should be used to obtain the
position of the popup menu
Built on December 12 2001. | Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.