skip to main content
Programmer's documentation > Programming with JViews Maps > Integration > Integrating with JViews Diagrammer
 
Integrating with JViews Diagrammer
Describes the tools available for integrating maps and symbols into applications that use both JViews Maps and JViews Diagrammer.
*Overview
*Presents the tools (GUIs) available for integrating maps and symbols into applications.
*Using symbols and maps in the Designer for JViews Diagrammer
*Describes how to use the Designer for JViews Diagrammer for map integration.
*Integrating a JViews Diagrammer project into an application
*Describes a project file and how to create one and use it for loading diagrams.
Overview
To get the best from the JViews Maps and JViews Diagrammer technologies, you can use two tools:
*The Map Builder, to create dynamic maps (see Using the Map Builder)
*The Designer for JViews Diagrammer, to connect with data and style symbols (see Using the Designer).
You can use either of these tools to display maps and symbols, but you can only design Maps with the Map Builder, and Symbols with the Designer for JViews Diagrammer.
Using symbols and maps in the Designer for JViews Diagrammer
The Designer for JViews Diagrammer provides features to style, import, and export the symbol data model and the rendering mechanism. It also includes an option that gives access to the same kind of graphic objects as the default Basic Symbols in the Map Builder. See ““Predefined Renderers”” in Developing with the JViews Diagrammer SDK.
The Designer for JViews Diagrammer includes an option that can import any IVL file saved by the Map Builder and use it as a background image of the current diagram, (see The Map Renderer in Developing with the JViews Diagrammer SDK ). You can activate this option at any time and provide it with the name of the IVL file.
The Designer for JViews Diagrammer Wizard is a powerful tool that allows you to use maps by selecting a Georeferenced Diagram option when you create a new diagram application.
Integrating a JViews Diagrammer project into an application
A project is an association of a style sheet and a data source which supplies data. It groups the inputs for a diagram. A project is saved as an XML file with the extension .idpr (JViews Diagrammer Project File).
Loading a project file is the recommended way to load a diagram in Java™ because it is the quickest way. The following code sample shows how to load a project into a diagram component using the method setProject.
 
IlvDiagrammer diagrammer = new IlvDiagrammer();
diagrammer.setProject(new IlvDiagrammerProject(
  new URL("file:myproject.idpr"));
//Display the diagram.
The project is represented by the IlvDiagrammerProject class, which is in the Rogue Wave® JViews Diagrammer package ilog.views.diagrammer.project. When a new project is created, the style sheet and data source are both null.
The following example shows how to create a new project file, set the style sheet and data source, and save the file.
 
IlvDiagrammerProject project = new IlvDiagrammerProject();
project.setStyleSheet(new URL("file:example.css"));
IlvXMLDataSource dataSource = new IlvXMLDataSource();
dataSource.setDataURL(new URL("file:example.xml"));
project.setDataSource(dataSource);
project.write(new URL("file:example.idpr"));

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