net.infonode.docking.mouse
Class DockingWindowActionMouseButtonListener

java.lang.Object
  extended by net.infonode.docking.mouse.DockingWindowActionMouseButtonListener
All Implemented Interfaces:
java.io.Serializable, MouseButtonListener

public class DockingWindowActionMouseButtonListener
extends java.lang.Object
implements MouseButtonListener, java.io.Serializable

A MouseButtonListener that performs a DockingWindowAction. The action is not performed if the mouse button event has been consumed.

Since:
IDW 1.3.0
Version:
$Revision: 1.9 $
Author:
$Author: jesper $
See Also:
Serialized Form

Field Summary
private  DockingWindowAction action
           
private  int button
           
private  boolean consumeEvent
           
private  int eventId
           
private  int keyMask
           
static MouseButtonListener MIDDLE_BUTTON_CLOSE_LISTENER
          A listener that closes a window when its tab is clicked with the middle mouse button.
private static int MODIFIER_MASK
           
private static long serialVersionUID
           
 
Constructor Summary
DockingWindowActionMouseButtonListener(int button, DockingWindowAction action)
          Creates a listener which performs an action when a mouse button is clicked.
DockingWindowActionMouseButtonListener(int eventId, int button, DockingWindowAction action)
          Creates a listener which performs an action when a mouse button is pressed, released or clicked.
DockingWindowActionMouseButtonListener(int eventId, int button, int keyMask, DockingWindowAction action, boolean consumeEvent)
          Creates a listener which performs an action when a mouse button is pressed, released or clicked, with an additional key mask.
 
Method Summary
 void mouseButtonEvent(java.awt.event.MouseEvent event)
          A mouse button event occured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

MODIFIER_MASK

private static final int MODIFIER_MASK
See Also:
Constant Field Values

MIDDLE_BUTTON_CLOSE_LISTENER

public static final MouseButtonListener MIDDLE_BUTTON_CLOSE_LISTENER
A listener that closes a window when its tab is clicked with the middle mouse button.


eventId

private int eventId

button

private int button

keyMask

private int keyMask

action

private DockingWindowAction action

consumeEvent

private boolean consumeEvent
Constructor Detail

DockingWindowActionMouseButtonListener

public DockingWindowActionMouseButtonListener(int button,
                                              DockingWindowAction action)
Creates a listener which performs an action when a mouse button is clicked. The event is not consumed when the action is performed.

Parameters:
button - when this mouse button is clicked the action is performed , must be MouseEvent.BUTTON1, MouseEvent.BUTTON2 or MouseEvent.BUTTON3
action - the action to perform

DockingWindowActionMouseButtonListener

public DockingWindowActionMouseButtonListener(int eventId,
                                              int button,
                                              DockingWindowAction action)
Creates a listener which performs an action when a mouse button is pressed, released or clicked. The event is not consumed when the action is performed.

Parameters:
eventId - the event type for which to perform the action, must be MouseEvent.MOUSE_PRESSED, MouseEvent.MOUSE_RELEASED or MouseEvent.MOUSE_CLICKED
button - when this mouse button for which the action is performed , must be MouseEvent.BUTTON1, MouseEvent.BUTTON2 or MouseEvent.BUTTON3
action - the action to perform

DockingWindowActionMouseButtonListener

public DockingWindowActionMouseButtonListener(int eventId,
                                              int button,
                                              int keyMask,
                                              DockingWindowAction action,
                                              boolean consumeEvent)
Creates a listener which performs an action when a mouse button is pressed, released or clicked, with an additional key mask.

Parameters:
eventId - the event type for which to perform the action, must be MouseEvent.MOUSE_PRESSED, MouseEvent.MOUSE_RELEASED or MouseEvent.MOUSE_CLICKED
button - when this mouse button for which the action is performed , must be MouseEvent.BUTTON1, MouseEvent.BUTTON2 or MouseEvent.BUTTON3
keyMask - the keys that must be pressed for the action to be performed, must be 0 or an or'ed combination of the key down masks found in InputEvent.
action - the action to perform
consumeEvent - if true the event is consumed when the action is performed
Method Detail

mouseButtonEvent

public void mouseButtonEvent(java.awt.event.MouseEvent event)
Description copied from interface: MouseButtonListener
A mouse button event occured.

Specified by:
mouseButtonEvent in interface MouseButtonListener
Parameters:
event - the mouse button event