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"));