Package org.kahina.core.control

Contains the basic Kahina event system.

See: Description

Package org.kahina.core.control Description

Contains the basic Kahina event system.

The Kahina event system is built around controllers, which process and distribute event objects generated by various components, and listeners, which can register with a controller for events of a given type, and provide callback methods which a controller can call to distribute events to interested parties.

A KahinaController is used to register listeners, receives newly generated events, and distributes these to interested listeners. A class implementing the KahinaListener interface is allowed to register with a KahinaController for interesting event types, then receiving any events of these types via a callback function.

All event types processed by a KahinaController need to inherit from KahinaEvent, which forces every KahinaEvent to provide some type information. For convenience, some common event types are predefined as string constants in KahinaEventTypes. Four very common event types are already implemented in the org.kahina.core package. The most important event type is the KahinaControlEvent, which is used to hand on user commands from GUI components to other parts of the system. A KahinaWarnEvent is used to relay the information that a warning should be displayed. To inform all components that a session should be saved or is being loaded, a KahinaSessionEvent is issued. A KahinaSystemEvent is used to handle other global operations such as a reapplication of all breakpoint patterns, a node count, or a user command to quit.