skip to main content
Diagrammer > Getting started > Introducing JViews Diagrammer > Basic concepts > Data
 
Data
JViews Diagrammer offers you the opportunity to stay away from the low-level graphics API, and to worry only about your business data and the way you want to display it. The section on Creating diagramming applications explains how this works in more detail; at this point it is sufficient to explore the basic concept of a data model.
JViews Diagrammer is based on a model-view architecture that cleanly separates the data, the display, and the interaction facets of the component, see figure The model-view architecture of JViews Diagrammer. It follows the Swing architecture where the developer takes care of populating the data model and the component takes care of displaying the data and enabling interactions like selection and editing.
The model-view architecture of JViews Diagrammer
In JViews Diagrammer, the data model is an interface that manages nodes and links. Nodes have a set of generic properties like x and y coordinates, and user-defined properties can be added to store application-dependent information. Similarly, links have generic properties like to and from for the source and destination nodes, and can have further, user-defined properties. Based on this data model, JViews Diagrammer knows how to display the diagram, and how to manage end-user interactions.
The data model needs to be populated with application data. To do this, you have the choice between using a prebuilt implementation such as the in-memory data model, or connecting the diagram directly to your data by implementing the data model interface. The latter solution avoids data duplication and enables finer synchronization between the diagram and the data.
JViews Diagrammer provides data sources to populate your diagram from XML files, JDBC connections, or flat files in formats like CSV (comma-separated values).

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.