Class EventLoop
All Packages Class Hierarchy This Package Previous Next Index
Class EventLoop
public class netscape.application.EventLoop
extends java.lang.Object
implements java.lang.Runnable
{
/* Constructors
*/
public EventLoop();
/* Methods
*/
public void addEvent(Event);
public void addEventAndWait(Event);
public Object filterEvents(EventFilter);
public Event getNextEvent();
public synchronized boolean isRunning();
public Event peekNextEvent();
public void processEvent(Event);
public void removeEvent(Event);
public void run();
public synchronized void stopRunning();
public synchronized String toString();
}
Class for managing a sequence of Events. In general, you never create
an EventLoop. Instead you retrieve the main one from the Application.
- See Also:
- eventLoop
Constructors
EventLoop
public EventLoop()
- Constructs an EventLoop.
Methods
addEvent
public void addEvent(Event anEvent)
- Places anEvent on the EventLoop's event queue.
removeEvent
public void removeEvent(Event anEvent)
- Removes all occurences of anEvent from the event queue.
filterEvents
public Object filterEvents(EventFilter filter)
- Allows an object to search or modify the EventLoop's Vector of
outstanding events. Upon calling filterEvents(), filter
receives a filterEvents() message, with
the events Vector as an argument. The EventLoop locks the Vector
before calling the filter's filterEvents() method, so no other
threads can modify its contents. This method returns the results of
the filter's filterEvents() method.
- See Also:
- filterEvents
getNextEvent
public Event getNextEvent()
- Removes and returns the next Event from the EventLoop's event queue.
peekNextEvent
public Event peekNextEvent()
- Returns the next Event from the EventLoop's event queue, but does
not remove it.
processEvent
public void processEvent(Event nextEvent)
- This method is called to process each Event as the EventLoop removes
it from its queue.
run
public void run()
- Runnable interface method implemented to process Events as they
appear in the queue.
stopRunning
public synchronized void stopRunning()
- Stops the EventLoop once control returns from processing the current
Event. This method might be called from the AWT thread.
isRunning
public synchronized boolean isRunning()
- Returns true if the EventLoop is currently running.
addEventAndWait
public void addEventAndWait(Event event)
- Adds event to the EventLoop's event queue and waits for the main
application thread to process it. This method should only be called
from within threads other than the main thread.
toString
public synchronized String toString()
- Returns the EventLoop's String representation.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index