ibm.techexplorer.awt.event
Class MouseEvent

java.lang.Object
  |
  +--ibm.techexplorer.util.EventObject
        |
        +--ibm.techexplorer.awt.AWTEvent
              |
              +--ibm.techexplorer.awt.event.InputEvent
                    |
                    +--ibm.techexplorer.awt.event.MouseEvent

public class MouseEvent
extends InputEvent

Description

This event encapsulates mouse movement and press/release information. Depending on the type of the event (MOUSE_CLICKED, MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_MOVED, MOUSE_ENTERED, MOUSE_EXITED, and MOUSE_DRAGGED), a method from either ibm.techexplorer.awt.event.MouseListener or ibm.techexplorer.awt.event.MouseMotionListener will be invoked.

In order for a Java object to receive mouse event notifications, the Java object must register a class that implements the ibm.techexplorer.awt.event.MouseListener or ibm.techexplorer.awt.event.MouseMotionListener interface. Alternatively, a mouse event listener could make use of a ibm.techexplorer.awt.event.MouseAdaptor or ibm.techexplorer.awt.event.MouseMotionAdaptor class.

The techexplorer AWT supports up to a three button mouse and four modifier keys. The mapping between the four modifier keys and the keyboard, as well as mouse button modifiers are platform dependent. The behavior of these modifiers is the same as in Java 1.1. However, due to the platform dependent nature of the key and button modifiers, the exact behavior of these modifiers is not well defined.

The sequence of techexplorer mouse events follow those of Java 1.1, namely: MOUSE_ENTERED and MOUSE_EXIT; and MOUSE_PRESSED, MOUSE_RELEASED and MOUSE_CLICKED. Mouse coordinates (x,y) are relative to the upper left hand corner of the techexplorer instance. The click count event attribute is only valid for MOUSE_CLICKED, MOUSE_PRESSED, and MOUSE_RELEASED event types.

Current Restriction:The mouse dragged event is not sent when the mouse leaves a techexplorer instance region. This information is useful in drag-and-drop operations and is planned for a future release of the techexplorer Java API.

See Also:
AWTEvent, MouseListener, MouseMotionListener

Field Summary
static int MOUSE_CLICKED
          Event identifier indicating that a mouse button was pressed and released.
static int MOUSE_DRAGGED
          Event identifier indicating mouse motion while a button was pressed.
static int MOUSE_ENTERED
          Event identifier indicating the mouse has entered a techexplorer region.
static int MOUSE_EXITED
          Event identifier indicating the mouse has departed a techexplorer region.
static int MOUSE_MOVED
          Event identifier indicating mouse motion.
static int MOUSE_PRESSED
          Event identifier indicating that a mouse button was pressed.
static int MOUSE_RELEASED
          Event identifier indicating that a mouse button was released.
 
Fields inherited from class ibm.techexplorer.awt.event.InputEvent
ALT_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, CTRL_MASK, META_MASK, modifiers, SHIFT_MASK
 
Fields inherited from class ibm.techexplorer.awt.AWTEvent
FOCUS_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK
 
Fields inherited from class ibm.techexplorer.util.EventObject
documentName, id, listenerClass, objectName, source
 
Constructor Summary
MouseEvent(java.lang.Object source, java.lang.String documentName, java.lang.String listenerClass, java.lang.String objectName, int id, int modifiers, int x, int y, int clickCount, techexplorer plugin, int nodPathList, int nodSelectionList)
          Constructs a MouseEvent object with the specified techexplorer source instance, document source identifier, listener class, document object name, event type, modifiers, click coordinates and click count.
 
Method Summary
 int getClickCount()
          Retrieve the number of mouse clicks associated with this event.
 NodeList getNodePathList()
          Retrieve the DOM NodeList hierachy for the techexplorer object.
 NodeList getNodeSelectionList()
          Retrieve the DOM NodeList for all nodes in the current selection.
 java.awt.Point getPoint()
          Retrieve the x,y position of the mouse click relative to the techexplorer instance.
 int getX()
          Retrieve the x position of the mouse click relative to the techexplorer instance.
 int getY()
          Retrieve the y position of the mouse click relative to the techexplorer instance.
 
Methods inherited from class ibm.techexplorer.awt.event.InputEvent
getModifiers, isAltDown, isControlDown, isShiftDown
 
Methods inherited from class ibm.techexplorer.util.EventObject
getDocumentName, getID, getListenerClass, getObjectName, getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOUSE_CLICKED

public static final int MOUSE_CLICKED
Event identifier indicating that a mouse button was pressed and released.

MOUSE_PRESSED

public static final int MOUSE_PRESSED
Event identifier indicating that a mouse button was pressed.

MOUSE_RELEASED

public static final int MOUSE_RELEASED
Event identifier indicating that a mouse button was released.

MOUSE_MOVED

public static final int MOUSE_MOVED
Event identifier indicating mouse motion.

MOUSE_ENTERED

public static final int MOUSE_ENTERED
Event identifier indicating the mouse has entered a techexplorer region.

MOUSE_EXITED

public static final int MOUSE_EXITED
Event identifier indicating the mouse has departed a techexplorer region.

MOUSE_DRAGGED

public static final int MOUSE_DRAGGED
Event identifier indicating mouse motion while a button was pressed.
Constructor Detail

MouseEvent

public MouseEvent(java.lang.Object source,
                  java.lang.String documentName,
                  java.lang.String listenerClass,
                  java.lang.String objectName,
                  int id,
                  int modifiers,
                  int x,
                  int y,
                  int clickCount,
                  techexplorer plugin,
                  int nodPathList,
                  int nodSelectionList)
Constructs a MouseEvent object with the specified techexplorer source instance, document source identifier, listener class, document object name, event type, modifiers, click coordinates and click count.
Parameters:
source - The object where the event originated.
documentName - The name of the document that triggered the event.
listenerClass - The category of listeners that will receive notification of this event.
objectName - The name of the document object that triggered the event.
id - Event identifier (MOUSE_CLICKED, MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_MOVED, MOUSE_ENTERED, MOUSE_EXITED, and MOUSE_DRAGGED)
x - The x position of the mouse click.
y - The y position of the mouse click.
clickCount - The number of mouse clicks.
nodPathList -  
nodSelectionList -  
Method Detail

getClickCount

public int getClickCount()
Retrieve the number of mouse clicks associated with this event.
Returns:
The number of mouse clicks.

getPoint

public java.awt.Point getPoint()
Retrieve the x,y position of the mouse click relative to the techexplorer instance.
Returns:
The x,y position (Point) of the mouse click.

getX

public int getX()
Retrieve the x position of the mouse click relative to the techexplorer instance.
Returns:
The x position of the mouse click.

getY

public int getY()
Retrieve the y position of the mouse click relative to the techexplorer instance.
Returns:
The y position of the mouse click.

getNodePathList

public NodeList getNodePathList()
Retrieve the DOM NodeList hierachy for the techexplorer object.
Returns:
The DOM NodeList hierachy.

getNodeSelectionList

public NodeList getNodeSelectionList()
Retrieve the DOM NodeList for all nodes in the current selection.
Returns:
The DOM NodeList for all nodes in the current selection.