NShape Programmer Tasks
Connecting Shapes

<< Click to Display Table of Contents >>

Navigation:  Programmer Tasks >

NShape Programmer Tasks
Connecting Shapes

Previous pageReturn to chapter overviewNext page

This topic deals with linking the various NShape components together.

Basic Components

1.Add a Project component to your application.

2.Add a DiagramSetController to your application.

3.Add a Display component to your application.

4.Select the DiagramSetController and set the DiagramSetController.Project property to the previously created Project component.

5.Select the Display component and set the Display.DiagramSetController property to the previously created DiagramSetController.

Repository and Store

These steps are not necessary if you do not want to load or save diagrams.

1.Add a CachedRepository component to your application.

2.Add a Store component to your application, e.g an XMLStore or an SQLStore.

3.Select your Project component and set the Project.Repository property to the previously created CachedRepository.

4.Select the CachedRepository and set the CachedRepository.Store property to the previously created XMLStore / SQLStore component.

ToolBox

1.Add a ToolSetController component to your application.

2.Add a ToolSetPresenter component to your application, e.g. a ToolSetListViewPresenter or a ToolSetToolStripPresenter.

3.Add a component for the ToolSetPresenter's user interface to your application, e.g. a ListView for the ToolSetListViewPresenter and a ToolStrip for the ToolSetToolStripPresenter.

4.Select the ToolSetController.

Set its Project property to your application's Project component

Set its DiagramSetController property to the DiagramSetController component.

5.Select the ToolSetPresenter.

Set the ToolSetPresenter.ToolSetController property to the previously created ToolSetController.

Set the ToolSetListViewPresenter.ListView property / the ToolSetToolStripPresenter.ToolStrip property to the previously created ListView / ToolStrip.

Property Editor

1.Add a PropertyController component to your application.

2.Add a PropertyPresenter component to your application.

3.Add at least one System.Windows.Forms.PropertyGrid (3rd Party WPF PropertyGrid is not supported) to your application.

4.Select the PropertyController component and set its Project property to your application's Project.

5.Select the PropertyPresenter component.

Set the PropertyPresenter.PropertyController component to the previously created PropertyController.

Set the PropertyPresenter.PrimaryPropertyGrid to the PropertyGrid that should display properties of shapes and diagrams.

If you have created a second PropertyGrid, set the PropertyPresenter.SecondaryPropertyGrid to the PropertyGrid that should display properties of model objects.

6.Select the Display component and set the Display.PropertyController property to the previously created PropertyController.
If you use more than one display, you can choose whether to use one property controller for all displays or create one property controller, property presenter and property grid per display.

Layer Editor

You can choose between using the predefined LayerEditor component or creating and linking a LayerController, a LayerPresenter and a LayerListView component separately.

If you decided to use the LayerEditor, perform the following steps:

1.Add a LayerEditor component to your application.

2.Select the created LayerEditor component.

Set the LayerEditor.DiagramSetController property to the previously created DiagramSetController component.

Set the LayerEditor.DisplayPresenter property to the previously created Display component

If you decided to use the separate components, perform the following steps:

1.Add a LayerController component to your application.

2.Add a LayerPresenter component to your application.

3.Add a LayerListView component to your application.

4.Select the LayerController component and set the LayerController.DiagramSetController property to the DiagramSetController component of your application.

5.Select the LayerPresenter component.

Set the LayerPresenter.LayerController property to the previously created LayerController component.

Set the LayerPresenter.LayerView property to the previously created LayerListView component.

Set the LayerPresenter.DiagramPresenter property to your application's Display component.