This article explains NautDrafters screen hierarchy and how screen switching occurs.
Our Screen interface:
In NautDrafter the interface SubScreen is all a class has to implement to be used as a screen.
Defined in this class are the methods that are used by the Base class to get what elements to show. Read the Java documentation of the project for further explanation.
Base class:
This class is the root node of our application. All screens are shown within using the SubScreen interface. Base looks like this:
The area label "Main Screen" is where the elements in the SubScreen are shown.the TitleBar is where we show the user details (right) , application logo (center) and the Screen title + menu (left). there is an optional panel that is currently not used but could be potentially used for displaying advertisements (for tournaments, etc). Refer to the Javadocs for more information.
The screen flow diagram:
In NautDrafter we are using a Screen stack to hold the current screens in the application. In the above diagram, stack levels are shown by what row the screens are on. For example the Login Screen is the first screen on the stack and when the user logs in, the server browser screen is added onto the stack. For the main three drafting screens, the new screen is not put on the stack but switched with the old screen.
To add a screen onto the screen stack call the static method NautDrafter.setScreen( "new screen", true), and to switch out the screen currently showing call NautDrafter.setScreen( "new screen", false).
Related articles