Contents
This topic discusses the options for preserving the layout information of components on the EventFlow Editor canvas.
The EventFlow XML grammar contains two distinct types of elements:
- EventFlow Semantic elements
-
Describes the functionality of module components. This information changes when you add or remove components and change their properties.
- Graphical Layout elements
-
Describes the last-saved graphical positions and dimensions of components on the EventFlow canvas. This information changes when you move or resize a component on the canvas. Changes in layout elements have no effect on your module's functionality.
By default, StreamBase stores semantic and layout elements in separate files:
-
Semantic elements are stored in the primary module file with
.sbappextension. -
Layout elements are stored in an associated layout-only file with
.sblayoutextension.
When a separate layout file exists for a module, it shares the same base name, which always matches exactly in spelling and
case. For example, StreamBase Studio treats the following files as a related pair that together define the module BlendDepthOfBook:
BlendDepthOfBook.sbapp |
BlendDepthOfBook.sblayout |
StreamBase Studio respects and preserves the layout status it detects for each individual EventFlow module. That is:
-
If Studio detects an
.sbappfile with no matching.sblayoutfile, it organizes icons on the canvas based on the layout information in the.sbappfile. If the.sbappfile does not contain any layout information (perhaps because a former.sblayoutfile was deleted), then Studio applies a default layout.On save, Studio stores any changed or added layout information back to the
.sbappfile. -
If Studio detects an
.sbappfile with matching.sblayoutfile (with the same base name), then it uses the layout information in the.sblayoutfile to organize the canvas.On save, Studio stores any changed layout information back to the
.sblayoutfile.
Your project folders might contain several EventFlow modules with a mix of layout states: some modules with only an .sbapp file, and other modules with both .sbapp and .sblayout files.
Separate layout files are copied and deleted automatically when you copy or delete the corresponding EventFlow file. If you
rename the EventFlow file with refactoring, its corresponding .sblayout file is automatically renamed. But the reverse is not true: you can copy, delete, and rename .sblayout files without affecting the corresponding EventFlow file.
StreamBase Studio's default state for newly created EventFlow modules is to keep semantic and layout information in separate files. The advantages are:
-
Better match for many version control systems. With meaningful changes isolated to the
.sbappfile, difference comparisons and merging are easier for version control systems to handle. -
Easier to share application modules in a team development environment, where more than one developer might open the same file and rearrange components.
The advantage of using combined layout in the .sbapp file is simplicity of file management and in sharing of application module files with other users.
There are both manual and automatic ways to create an .sblayout file for any .sbapp file.
- Manual Creation of Layout Files
-
Create separate layout files for individual EventFlow modules with the following steps:
-
Select one or more
.sbappfile names in the Package Explorer. (Hold the Ctrl key on Windows or Command key on Mac OS X while clicking to select more than one file name.) You can select files in the same project or different projects. -
Right-click; from the context menu select → → .
-
- Automatic Creation of Layout Files
-
Configure Studio to automatically create separate layout files when new EventFlow module files are created:
-
Open Studio Preferences with → .
-
In the contents pane on the left, open → .
-
Select Separate layout (.sblayout) file (the default setting).
This setting controls only whether
.sblayoutfiles are created automatically when you create EventFlow module files going forward. It does not affect existing.sbappfiles in your workspace. -
You can keep separate layout files in your project folders — whether manually or automatically generated — and still suppress them from view, if you find you prefer an uncluttered project view.
To do this:
-
Select the down-pointing arrow from the Package Explorer view's toolbar.
-
Select Filters from the resulting menu.
-
In the Java Element Filters dialog, select the check box for the StreamBase EventFlow Layout Files entry.
-
Click .
These steps both suppress showing .sblayout files in your project folders, and place a StreamBase EventFlow Layout Files menu item in the down-arrow menu.
To show suppressed .sblayout files again, you can either go through the same steps, this time clearing the check box, or you can use the down-arrow menu's
StreamBase EventFlow Layout Files entry to toggle the view of layout files off and back on.
When a module has separate .sbapp and .sblayout files, you can recombine the two by removing the .sblayout file in the Package Explorer. In this case, Studio behaves as follows:
-
If the
.sbappfile is open in Studio when you remove the.sblayoutfile, Studio detects a file system change and prompts for permission to reload the file. Let the file reload, then move one component slightly, which allows you to save the.sbappfile. When you next save the module, the current layout information is saved to the.sbappfile. -
If the
.sbappfile is not open when you remove the.sblayoutfile, then the next time the.sbappfile is opened, Studio applies a default layout. Rearrange the components as you prefer, then save the file.
