Developing with the SDK > Introducing the SDK > Styling and Data Mapping (SDM) > The SDM Engine

The SDM engine controls the data-to-graphics mapping. There are four key elements in the data-to-graphics mapping process:

images/diaext_dtogmapping.png

Figure 1.4 SDM Data-to-Graphics Mapping

As shown in Figure 1.4, the mapping between the data model and the graphical representation is bidirectional:

  1. Data model to graphics: the rendering process is controlled by the style sheet, which lets you tell the SDM engine how you want each particular kind of data object to be displayed in the grapher. The rendering process is performed by specialized renderers.
  2. Graphics to data model: the editing process relies on built-in editing facilities that act directly on the underlying data model. The actions in an editing application are implemented by interactors. For example:

To access the SDM engine associated with a diagram component, use the getEngine method. Similarly, to access the SDM view associated with a diagram component, use the getView method. Code Sample 1.7 shows the use of these methods.

IlvSDMEngine engine = diagrammer.getEngine();
IlvSDMView view = diagrammer.getView();

Code Sample 1.7 Getting the SDM Engine and the SDM View

You can also choose not to use the IlvDiagrammer class at all. Instead, you can create an SDM engine (IlvSDMEngine instance) and an SDM view (IlvSDMView instance) yourself.