I am trying to create a custom ActionEvent. When I try to dispatch the event, the scene.dipatchEvent is asking me for a EventDispatcherChain object. I am not doing anything complex to actually create an implementation of a new EventDispatcherChain. How would I get default EventDispatcherChain so I can pass it to scene.dispatchEvent ?
EventType
public class SquirrelEventType extends EventType<SquirrelActionEvent> {
public SquirrelEventType() {
super("Squirrel.NotifyPreloader");
}
}
Event
public class SquirrelActionEvent extends ActionEvent {
private Preloader.PreloaderNotification preloaderNotification;
private String details;
private double progress;
/**
*
*/
public SquirrelActionEvent(double progress){
preloaderNotification = new Preloader.ProgressNotification(progress);
}
public PreloaderNotification getPreloaderNotification() {
return preloaderNotification;
}
public void setPreloaderNotification(PreloaderNotification preloaderNotification) {
this.preloaderNotification = preloaderNotification;
}
Here is the call to dispatchEvent
SquirrelActionEvent event = new SquirrelActionEvent(0.1d);
mainScene.getEventDispatcher().dispatchEvent(event, null);
Events are simply send through Event.fireEvent() which is a static method.