Developing a graphical user interface with
JViews Diagrammer requires to be aware of the following key
aspects:
- Symbols
- Model-driven diagrams
- Dashboards and Monitoring Panels
Symbols
Symbols are the starting point of a
display (diagram or dashboard). A symbol is a self-contained
graphic object that represents a physical or conceptual element
in the underlying application. For example, symbols can represent
trucks, factories, network elements, dials or gauges. They have
built in behavior which means that they react dynamically to data
changes or user interaction.
A symbol and its behavior are not defined by code but in a CSS
(Cascading Style Sheet) file that contains a description of the JavaBeans™ to use, their settings and
logic. At run time, a generic engine instantiates the right class
and configures the created instances as specified in the CSS
file. For better performance, or if such symbols can be frozen
for a given application, it is also possible to generate Java™ source code corresponding to
these symbols.
Model-driven diagrams
Applications that must automatically
create a diagram from a data source (like workflows, business
processes, entity relationships, or network topologies) use a
model-driven approach. The design tool used to create this type
of display is the Designer for JViews Diagrammer. The Designer
creates a display by binding the data source elements to symbols
created with the Symbol Editor. For example, you can specify that
a given type of data instance be represented by a given symbol,
and that a particular value of a field be bound to some symbol
parameters to alter the aspect of the symbol. The specification
of how the visual aspect of the symbol is controlled by the data
model is performed at a high level as the symbols already contain
their particular visual logic. Other aspects of the display, such
as automatic graph layout options, links, background images,
subgraphs, zooming can also be tuned through the Designer tool.
The mapping between the data model and the visual entities
(symbols) is described in a CSS format. The output is a project
file combining the CSS part and the XML part (data source) and
can be loaded into the application at run time. The project’s
individual elements can be accessed through dedicated Java
classes for further customization of the look or behavior of the
display.
Dashboards and monitoring panels
To build displays for monitoring or
supervision purposes (like industrial schematics, business
dashboards, and other generic human-machine interfaces), the
approach is quite the opposite from the model-driven approach, in
the sense that you start by manually placing symbols created with
the Symbol Editor on top of a static background. This is done
with another design tool called the Dashboard Editor. Symbol
parameters can be associated with application data at design
time, but this mapping will be resolved only at run time when
connecting the actual data source. The resulting dashboard or
schematic is an XML file associated with palettes of symbols that
can be loaded into an application window and fed with real-time
data.