Nifty meets flow - New feature for nifty-gui to allow sequences of screens

As usual, I didn’t know where to make this offering/announcement.

I managed to separate my nifty-flow from cabotrafalgar, and it’s started to be ready to open to other users.

What’s nifty-flow?

  • A library that helps you to create series of screens to be played in order.
  • A library that helps you to share screens, as they won’t need to know where to point next, screens are no longer pointing to other screens.
  • A library that helps you to reuse the same screen, accesible from different screens, allowing decoupling content and routing.
  • A library that (will) help you to apply template technologies to save time creating dynamic screens avoiding java builders.
  • If you’re using spring or guice for wiring your instances, we won’t complain, it’s generic enough to accept instances from any system (as long as you build the bridge ;))

It’s build on the top of nifty 1.3.3, and fully compatible with jme3 AFAIK.

Code and example here: GitHub - albertonavarro/nifty-flow: Nifty meets flow feature.
Feedback is welcome, the project works for me though :slight_smile:

8 Likes

This is from the example, a sample of how it ends:

screenFlowManager.addScreenDefinition(new ScreenDefinition("root", "live:root", "live:root"));
screenFlowManager.addScreenDefinition(new ScreenDefinition("screen1", "live:controller1", "static:/screen.xml"));
screenFlowManager.addScreenDefinition(new ScreenDefinition("screen2", "live:controller2", "live:generator2"));
screenFlowManager.addScreenDefinition(new ScreenDefinition("screen3", "live:controller1", "static:/screen.xml"));
screenFlowManager.addScreenDefinition(new ScreenDefinition("screen4", "live:controller4", "live:generator4"));
screenFlowManager.addFlowDefinition("root", Optional.<String>absent(), newArrayList("root")); //parent is absent, this is root.
screenFlowManager.addFlowDefinition("screenFlow1", of("root:root"), newArrayList("screen1", "screen2", "screen3", "screen4"));
screenFlowManager.addFlowDefinition("screenFlow2", of("root:root"), newArrayList("screen1", "screen4"));

This would generate an initial single screen flow “root”, from where it starts another two sequences of screens.
None of the screens have the minimum clue what’s the next screen to jump to, they only provide hints like NEXT and PREV, it’s the redirector who controls it.
As you can see, screen1->NEXT jumps to different screens depending on the flow you are.

Also notice the way of referencing the controllers and screen generators is customizable, I provide none for controllers (just the one in the example) but for generators, if your screen is defined in an XML, it can be picked up directly, as long as your controller is well defined inside and the screenId is ${screenUniqueId}, as it’ll be replaced with the right name.

In the near future, I’d very like to introduce more templating so I can avoid using Java for building dynamic screens.

1 Like

Dunno if @void256 or @relucri ever noticed this. Bumping this just in case, since it seems like a really nice addition.

Thanks for your interest, @void256 was fully aware of this addition: http://void256.github.io/nifty-gui/blog/update/nifty-flow/ :smile:

1 Like