org.bushe.swing.event.annotation.package.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nifty Show documentation
Show all versions of nifty Show documentation
Nifty GUI is a Java Library that supports the building of interactive user interfaces for games or similar applications. It utilizes OpenGL for rendering and it can be easily integrated into many rendering systems. The configuration of the GUI is stored in xml files with little supporting Java code. In short Nifty helps you to layout stuff, display it in a cool way and interact with it :)
The newest version!
EventBus annotations to make it much simpler to publish and subscribe to events.
Subscription annotations remove the boilerplate inner classes that often used for subscribers, especially when
one class subscribes to multiple events.
When using annotations, the AnnotationProcessor must be used to create proxy subscribers.
An annotation example:
class MySubscriber {
@EventSubscriber(eventClass=HelloEvent.class)
public void printOutHelloWorld(HelloEvent event) {
System.out.println("Hello"+helloEvent.getWorld());
}
@EventTopicSubscriber(topic="Hello");
public void printOutHelloWorld(String topic, Object event) {
System.out.println(topic+" "+event);
}
}
class HelloEventBus {
public static void main(String args[]) {
MySubscriber subscriber = new MySubscriber();
AnnotationProcessor.process(subscriber);//makes a proxy subscribers
EventBus.publish(new HelloEvent());
EventBus.publish("Hello", "World");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy