Class MouseEvent
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class MouseEvent

public class netscape.application.MouseEvent
    extends netscape.application.Event
{
    /* Fields
     */
    public final static int MOUSE_DOWN;
    public final static int MOUSE_DRAGGED;
    public final static int MOUSE_ENTERED;
    public final static int MOUSE_EXITED;
    public final static int MOUSE_MOVED;
    public final static int MOUSE_UP;

    public int x;
    public int y;

    /* Constructors
     */
    public MouseEvent();
    public MouseEvent(long, int, int, int, int);

    /* Methods
     */
    public int clickCount();
    public boolean isAltKeyDown();
    public boolean isControlKeyDown();
    public boolean isMetaKeyDown();
    public boolean isShiftKeyDown();
    public int modifiers();
    public RootView rootView();
    public void setClickCount(int);
    public void setModifiers(int);
    public void setRootView(RootView);
    public String toString();
}
Event subclass used for all mouse events.

Fields

x

  public int x
The MouseEvent's X-coordinate, relative to the origin of the View in which the event occurred.

y

  public int y
The MouseEvent's Y-coordinate, relative to the origin of the View in which the event occurred.

MOUSE_DOWN

  public final static int MOUSE_DOWN
Mouse "down" event.

MOUSE_DRAGGED

  public final static int MOUSE_DRAGGED
Mouse "dragged" event.

MOUSE_UP

  public final static int MOUSE_UP
Mouse "up" event.

MOUSE_ENTERED

  public final static int MOUSE_ENTERED
Mouse "entered" event.

MOUSE_MOVED

  public final static int MOUSE_MOVED
Mouse "moved" event.

MOUSE_EXITED

  public final static int MOUSE_EXITED
Mouse "exited" event.

Constructors

MouseEvent

  public MouseEvent()
Constructs a MouseEvent.

MouseEvent

  public MouseEvent(long timeStamp,
                    int type,
                    int x,
                    int y,
                    int modifiers)
Constructs a MouseEvent of type type, with coordinates (x, y), and the modifier bitmask modifiers, representing the modifier keys the user held down during the mouse event, such as the Shift key.

Methods

setClickCount

  public void setClickCount(int count)
Sets the MouseEvent's "click" count. An event type of type MOUSE_DOWN and click count of 2 represents a double-click, for example.

clickCount

  public int clickCount()
Returns the MouseEvent's click count.
See Also:
setClickCount

setModifiers

  public void setModifiers(int modifiers)
Sets the MouseEvent's modifiers, the bitmask describing the keys the user held down when the mouse event occurred.

modifiers

  public int modifiers()
Returns the MouseEvent's modifier bitmask.
See Also:
setModifiers

isShiftKeyDown

  public boolean isShiftKeyDown()
Returns true if the user held down the Shift key during the mouse event.

isControlKeyDown

  public boolean isControlKeyDown()
Returns true if the user held down the Control key during the mouse event.

isMetaKeyDown

  public boolean isMetaKeyDown()
Returns true if the user held down the Meta key during the mouse event.

isAltKeyDown

  public boolean isAltKeyDown()
Returns true if the user held down the Alternate key during the mouse event.

setRootView

  public void setRootView(RootView rootView)
Sets the RootView in which the MouseEvent occurred.

rootView

  public RootView rootView()
Returns the RootView in which the MouseEvent occurred.
See Also:
setRootView

toString

  public String toString()
Returns the MouseEvent's String representation.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index