Where to Find Up-to-date yFiles Information

This page is from the outdated yFiles for Java 2.13 documentation. You can find the most up-to-date documentation for all yFiles products on the yFiles documentation overview page.

Please see the following links for more information about the yFiles product family of diagramming programming libraries and corresponding yFiles products for modern web apps, for cross-platform Java(FX) applications, and for applications for the Microsoft .NET environment.

More about the yFiles product family Close X

Chapter 10. Settings Dialogs and Components

Table of Contents

Overview
Model-Delegate Pattern
Basic Functionality
Creating Model and View
Synchronizing Editors and Option Items
Defining Dependencies Between Option Items
Undefined Values in Option Items
Internationalization and Localization
Serialization of Settings
Tutorial Demo Code
Advanced Topics
Synchronizing Multiple Editors
Tutorial Demo Code

This chapter discusses GUI utility functionality that provides means to quickly create property editors for items of diverse types.

Overview

The classes from package y.option constitute a framework to conveniently handle property management and manipulation. It offers support for internationalization and localization of dialogs (i18n/l10n for short), as well as (de)serialization of settings. The framework separates responsibilities applying a Model-Delegate pattern, which facilitates, for example, different styles of settings presentations and manipulation. Figure 10.1, “Dialog-based and table-based settings presentation” shows the alternative presentation styles.

Figure 10.1. Dialog-based and table-based settings presentation

Dialog-based settings.
Table-based settings.
Dialog-based and... table-based settings presentation.

The separation also permits the use of multiple dialogs (in other words, multiple views) to present and modify settings that are managed by a common model. Synchronization of model and view(s) is covered by different policies, following "push" and "pull" semantics.

Model-Delegate Pattern

The classes from package y.option reflect a modification of the Model-View-Controller (MVC) paradigm, dubbed Model-Delegate pattern. Two of the three responsibilities from MVC, namely the view and controller part, are brought together in a so-called User Interface (UI) Delegate. Hence classes with the following roles can be distinguished:

  • Model classes: hold data specific to the application
  • View/Controller classes: present information to and interact with the user

In terms of MVC then, class OptionHandler together with classes OptionItem and OptionSection make up the model which holds the data. The view/controller part is in the implementations of interface Editor.

Figure 10.2, “Settings framework core classes” shows the essential classes of the settings framework.

Figure 10.2. Settings framework core classes

Settings framework core classes.