|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.MouseAdapter
schmitzm.swing.event.SelectiveMouseAdapter
public class SelectiveMouseAdapter
Field Summary | |
---|---|
protected Map<MouseInputType,Boolean> |
activationMap
Holds the activation of the several MouseInputTypes . |
protected int |
dragButton
Holds the button the drag is performed with. |
protected Point |
dragLastPos
Holds the window position of last mouseDragged(MouseEvent)
call (e.g. to remove a dragging rectangle). |
protected Point |
dragStartPos
Holds the window position a drag is started on. |
Constructor Summary | |
---|---|
SelectiveMouseAdapter()
Creates a new mouse adapter. |
Method Summary | |
---|---|
int |
getDragButton()
Returns the button a drag is performed with. |
Point |
getDragLastPoint()
Returns the window selection of the last mouseDragged(MouseEvent)
call. |
Point |
getDragStartPoint()
Returns the start point of a drag or window selection. |
boolean |
isEnabled(MouseInputType type)
Returns whether a specific input action of the mouse adapter is enabled. |
void |
mouseClicked(MouseEvent e)
Calls performMouseClicked(MouseEvent) if the mouse
action is enabled for the click. |
void |
mouseDragged(MouseEvent e)
Calls performMouseDragged(MouseEvent) if the mouse
action is enabled for the drag. |
void |
mouseEntered(MouseEvent e)
Calls performMouseDragged(MouseEvent) in any case, because
enter, exit and move can not be specified by MouseInputType . |
void |
mouseExited(MouseEvent e)
Calls performMouseExited(MouseEvent) in any case, because
enter, exit and move can not be specified by MouseInputType . |
void |
mouseMoved(MouseEvent e)
Calls performMouseExited(MouseEvent) in any case, because
enter, exit and move can not be specified by MouseInputType . |
void |
mousePressed(MouseEvent e)
Stores the current mouse location in dragStartPos . |
void |
mouseReleased(MouseEvent e)
Calls performMouseReleased(MouseEvent) only in the
following cases
Startposition = Endposition and the mouse click action is activated
Startposition ! |
void |
mouseWheelMoved(MouseWheelEvent e)
Calls performMouseWheelMoved(MouseWheelEvent) if the mouse
action is enabled for mouse wheel events. |
void |
performMouseClicked(MouseEvent e)
Empty implementation. |
void |
performMouseDragged(MouseEvent e)
Empty implementation. |
void |
performMouseEntered(MouseEvent e)
Empty implementation. |
void |
performMouseExited(MouseEvent e)
Empty implementation. |
void |
performMouseMoved(MouseEvent e)
Empty implementation. |
void |
performMousePressed(MouseEvent e)
Empty implementation. |
void |
performMouseReleased(MouseEvent e)
Empty implementation. |
void |
performMouseWheelMoved(MouseWheelEvent e)
Empty implementation. |
void |
setEnabled(MouseInputType type,
boolean enabled)
Sets whether a specific input action of the mouse adapter is enabled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map<MouseInputType,Boolean> activationMap
MouseInputTypes
.
protected int dragButton
protected Point dragStartPos
protected Point dragLastPos
mouseDragged(MouseEvent)
call (e.g. to remove a dragging rectangle).
Constructor Detail |
---|
public SelectiveMouseAdapter()
Method Detail |
---|
public void setEnabled(MouseInputType type, boolean enabled)
type
- mouse input typeenabled
- true
to enable the actionpublic boolean isEnabled(MouseInputType type)
type
- mouse input typepublic Point getDragStartPoint()
public Point getDragLastPoint()
mouseDragged(MouseEvent)
call.
public int getDragButton()
MouseEvent.NOBUTTON
is returned!
call.
public final void mouseClicked(MouseEvent e)
performMouseClicked(MouseEvent)
if the mouse
action is enabled for the click.MouseInputType
(e.g. 3rd
mouse button) the perform-method is called generally.null
at the end of this method.
mouseClicked
in interface MouseListener
mouseClicked
in class MouseAdapter
public final void mouseDragged(MouseEvent e)
performMouseDragged(MouseEvent)
if the mouse
action is enabled for the drag.MouseInputType
(e.g. 3rd
mouse button) the perform-method is called generally.
mouseDragged
in interface MouseMotionListener
mouseDragged
in class MouseAdapter
public final void mouseEntered(MouseEvent e)
performMouseDragged(MouseEvent)
in any case, because
enter, exit and move can not be specified by MouseInputType
.
mouseEntered
in interface MouseListener
mouseEntered
in class MouseAdapter
public final void mouseExited(MouseEvent e)
performMouseExited(MouseEvent)
in any case, because
enter, exit and move can not be specified by MouseInputType
.
mouseExited
in interface MouseListener
mouseExited
in class MouseAdapter
public final void mouseMoved(MouseEvent e)
performMouseExited(MouseEvent)
in any case, because
enter, exit and move can not be specified by MouseInputType
.
mouseMoved
in interface MouseMotionListener
mouseMoved
in class MouseAdapter
public final void mousePressed(MouseEvent e)
dragStartPos
.
performMousePressed(MouseEvent)
is only called, if
the respective click action is enabled.MouseInputType
(e.g. 3rd
mouse button) the perform-method is called generally.
mousePressed
in interface MouseListener
mousePressed
in class MouseAdapter
public final void mouseReleased(MouseEvent e)
performMouseReleased(MouseEvent)
only in the
following cases
null
at the end of this method.
mouseReleased
in interface MouseListener
mouseReleased
in class MouseAdapter
public final void mouseWheelMoved(MouseWheelEvent e)
performMouseWheelMoved(MouseWheelEvent)
if the mouse
action is enabled for mouse wheel events.
mouseWheelMoved
in interface MouseWheelListener
mouseWheelMoved
in class MouseAdapter
public void performMouseClicked(MouseEvent e)
public void performMouseDragged(MouseEvent e)
public void performMouseEntered(MouseEvent e)
public void performMouseExited(MouseEvent e)
public void performMouseMoved(MouseEvent e)
public void performMousePressed(MouseEvent e)
public void performMouseReleased(MouseEvent e)
public void performMouseWheelMoved(MouseWheelEvent e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |