Class Event
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Event

public class netscape.application.Event
    extends java.lang.Object
    implements java.lang.Cloneable
{
    /* Constructors
     */
    public Event();
    public Event(long);

    /* Methods
     */
    public Object clone();
    public EventProcessor processor();
    public void setProcessor(EventProcessor);
    public void setTimeStamp(long);
    public void setType(int);
    public long timeStamp();
    public int type();
}
Abstract Object subclass representing a user or program action, such as a mouse click, key press, and so on. Events are created in response to these actions and directed to the application's EventLoop. The EventLoop removes each Event and forwards it to the Event's processor, the object responsible for determining which object should ultimately receive the Event. In most cases, this object is the application itself.

In general, you never work directly with the event processing mechanism. However, if you do need to create an Event subclass requiring special processing, you can set the Event subclass' processor to the object that knows how to process it, and hand the Event to the application's EventLoop using the code:

    Application.application().eventLoop().addEvent(newEvent);
See Also:
MouseEvent, KeyEvent, EventLoop, Application

Constructors

Event

  public Event()
Constructs an Event, setting its time stamp to the current time.

Event

  public Event(long timeStamp)
Constructs an Event, setting its time stamp to timeStamp.

Methods

setType

  public void setType(int aType)
Sets the Event's type to aType.

type

  public int type()
Returns the Event's type.
See Also:
setType

setTimeStamp

  public void setTimeStamp(long timeStamp)
Sets the Event's time stamp to timeStamp. You will almost never call this method. Instead, construct an Event with the correct time stamp.
See Also:
Event(long)

timeStamp

  public long timeStamp()
Returns the Event's time stamp.

setProcessor

  public void setProcessor(EventProcessor aProcessor)
Sets the Event's processor to aProcessor, the object that determines how to respond to the Event once it has been removed from the EventLoop.
See Also:
EventProcessor

processor

  public EventProcessor processor()
Returns the Event's processor.
See Also:
setProcessor

clone

  public Object clone()
Clones the Event.
Overrides:
clone in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index