In this Lesson
You will learn what a scene transition is and how to use it.
Scenes are the navigable unit in Soiree. So, what is a navigable unit? A navigable unit is
- A place you can ‘go to’ in the Solution.
You can make requests to ‘go to’ a scene. You cannot make a request to ‘go to’ a layer.
- An item you can place on a menu.
Menus are designed to take you places within the solution. So, menus may contain scenes because they are a navigable unit but menus may not contain layers because they are not a navigable unit. [ you will create menus in a later lesson ]
- Navigable units are secured.
You cannot get to a scene unless you are granted access to it. You can configure the security system to grant access to everyone or to restrict a scene to certain set of people. [ you will play with the security system in a later lesson ]
There are three ways to navigate to a scene
- Declarations in the Solution
For example, the Solution defines the Initial Scene that should be displayed when the solution starts. [ there are other ‘scene starting’ declarations in the Solution and those are beyond the scope of this lesson ]
- Scene Request
This is the ability of an Agent (program) to request a scene to be opened. [ this is covered in a future lesson ]
- Scene Transitions
This is the ability of one Scene to request a transfer, or transition, to another scene.
This lesson focuses on scene transitions.
A scene transition is a transfer of control from one scene to another. To be more precise, it is a declaration within a scene to transition to another scene often in response to an event such as a person clicking on a button.
When Scene-A requests a transition to Scene-B it causes Scene-A to be closed and Scene-B to be opened.
Create a scene transition
You will need to have two scenes to perform a scene transition – so let’s begin this lesson by creating your second scene.
In the new scene you will be using the party fish image from the Creating a Scene lesson. You probably still have that image available on your computer’s file system from the download you performed in that lesson, however, instead of taking the easy path and using that image we want to show you how to obtain an image from another scene.
You will now get the image you need from the first scene you created.
- Open the PartyDefinition scene.
- Expand the scene’s image library
- Click the party fish image to select it
- Click the Export selected images button, select your desktop folder, and press Save
- The image will be exported to your desktop with a random name as shown here.
- Close the PartyDefinition scene.
You will now create a second scene using that exported image.
- Select the com.example.party.scene package by left clicking on it.
- Create a new desktop scene by pressing CTRL+N (Windows) or Command+N (OS X) to open the Wizard selection window. Expand the Soiree section and select Scene.
- Enter a scene name of PartySplash and other information as shown here
- Drag the exported fish image file into the scene’s image catalog
TipYou do NOT need to open the image catalog before dragging. As you are dragging the image you can pause momentarily over the Images tab and the catalog will open. [ it’s like a garage door opener with eyes ]
- Drag the party fish from the image catalog onto the design canvas.
Ensure the Image Button option is selected before you drop the image.
Element OptionsAs you are dragging an image onto the canvas you may select the type of Element to create when the image is dropped by pressing the ALT key while you are dragging.
- Click on the Images tab to close the image catalog.
- Add a label as shown here
- Right click the image button and configure the scene transition as shown here
- Save close the scene.
Modify the Solution to start with the splash screen
- Open the PartyPool solution.
- Change the Initial Scene to be the splash scene.
- Save and close the solution.
Test the Scene Transition
- Start the Derby database if it is not already running.
- Start the server
- Start the solution
- Test the scene transition by clicking on the splash scene’s image button
- The scene transition test should fail
If your test failed you have succeeded! Congratulations on such a superb failure.
Your final grade is an A+Don’t you wish all your professors would give you such a good mark for failing their tests?
You will resolve this security issue in the next lesson.
That’s it for this lesson.