EventFlow Layout Options

This topic discusses the options for preserving the layout information of components on the EventFlow Editor canvas.

Semantic and Graphical Layout Elements

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 Editor 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 .sbapp extension.

  • Layout elements are stored in an associated layout-only file with .sblayout extension.

When a separate layout file exists for a module, it shares base name, which always matches exactly in spelling and case. For example, StreamBase Studio treats the following files as a related pair that together defines the module BlendDepthOfBook:

BlendDepthOfBook.sbapp
BlendDepthOfBook.sblayout

Studio suppresses the view of .sblayout files in the Project Explorer view by default. If you are managing your Studio workspaces in a version control system, remember that these files must be committed and managed along with other files.

To changes Studio's default and make .sblayout files visible, see Restoring Layout File Visibility.

How Studio Handles Layout Information

StreamBase Studio respects and preserves the layout status it detects for each individual EventFlow module. That is:

  • If Studio detects an .sbapp file with no matching .sblayout file, it organizes icons on the canvas based on the layout information in the .sbapp file. If the .sbapp file does not contain any layout information (perhaps because a former .sblayout file was deleted), then Studio applies a default layout.

    On save, Studio stores any changed or added layout information back to the .sbapp file.

  • If Studio detects an .sbapp file with matching .sblayout file (with the same base name), then it uses the layout information in the .sblayout file to organize the canvas.

    On save, Studio stores any changed layout information back to the .sblayout file.

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.

Advantages of Combined and Separate Layout

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 .sbapp file, 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 the sharing of application module files with other users.

Creating Separate Layout Files

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:

  1. Select one or more .sbapp file names in the Project Explorer. (Hold the Ctrl key on Windows or command key on macOS while clicking to select more than one file name.) You can select files in the same project or different projects.

  2. Right-click, and from the context menu, select StreamBase>EventFlow Layout>Extract to Layout File.

Automatic Creation of Layout Files

Configure Studio to automatically create separate layout files when new EventFlow module files are created:

  1. Open Studio Preferences with Window>Preferences.

  2. In the contents pane on the left, open StreamBase Studio>Authoring.

  3. Select Separate layout (.sblayout) file (the default setting).

This setting controls only whether .sblayout files are created automatically going forward when you create EventFlow module files. It does not affect existing .sbapp files in your workspace.

Remember that .sblayout files are hidden in the Project Explorer view by default. To restore their visibility, see the next section.

Restoring Layout File Visibility

By default, Studio suppresses the view of separate layout files in the Project Explorer view, whether they are manually or automatically generated.

If you prefer to see .sblayout files in your project folders, follow these steps:

  1. Select the down-pointing triangle from the Project Explorer view's toolbar.

  2. Select Filters from the resulting menu.

  3. Clear the checkbox for the StreamBase EventFlow Layout Files entry.

  4. Click OK.

This change affects the entire Studio workspace, and must be made again when you switch to a new workspace. To hide suppressed .sblayout files again, go through the same steps, this time selecting the checkbox.

Recombining Layout Information

When a module has separate .sbapp and .sblayout files, you can recombine the two by restoring the view of layout files as described in the previous section, then removing the .sblayout file of interest in the Project Explorer view. In this case, Studio behaves as follows:

  • If the .sbapp file is open in Studio when you remove the .sblayout file, 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 .sbapp file. When you next save the module, the current layout information is saved to the .sbapp file.

  • If the .sbapp file is not open when you remove the .sblayout file, then the next time the .sbapp file is opened, Studio applies a default layout. Rearrange the components as you prefer, then save the file.

Back to Top ^