All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----jcsp.awt.event.EventIDFilter
_______________ eventIn | | idOut ---->----| EventIDfilter |--->--- |_______________|
Input Channels | ||
---|---|---|
eventIn | java.awt.AWTEvent | The event that the ID is required from |
Any other Class | If any other Object is sent down the eventIn Channel a ClassCastException will be thrown by the Runtime system. | |
Output Channels | ||
idOut | java.lang.Integer | The event ID of the AWTEvent Object sent down the eventIn Channel |
import jcsp.awt.*; import jcsp.awt.event.*; import jcsp.lang.*; : : { final Channel event = new One2OneChannel(); final Channel id = new One2OneChannel(); ActiveButton c = new ActiveButton("Active"); add(c); c.addFocusEventChannel(event); new Parallel(new CSProcess[] { c, new EventIDFilter(event, id), new CSProcess() { public void run() { while (true) { Object o = id.read(); System.out.println("FocusEvent ID='" + o); } } } }).run(); } }
public EventIDFilter(ChannelInput eventIn, ChannelOutput idOut)
public void run()
All Packages Class Hierarchy This Package Previous Next Index