Using the Designer > Next Steps After the Designer > Specifying a Different Data Source

Once the project is loaded into the application, you can specify a data source other than the one contained by default in the project. This is an important feature, since the Designer is often used with sample data that contains only enough information to specify the drawing style. Code Sample 6.2 shows how to include a different data source.

//Retrieve the project
IlvDiagrammer project = diagrammer.getProject();

//Create a new data source based on XML format
IlvXMLDataSource dataSource = new IlvXMLDataSource();
dataSource.setDataURL(new URL("file:example.xml"));

//Associate new data source with current project
project.setDataSource(datasource);

//Update the diagrammer object with the newly created
//project
diagrammer.setProject(project);

Code Sample 6.2 Specifying a Different Data Source