<< Click to Display Table of Contents >> NShape Concepts
|
Styles encapsulate certain graphical aspects like filling, arrows, fonts etc. You might think of them in a similar way as styles in word processors, where you have styles for headings, normal text, bulleted text etc. Each project contains a list of styles for the different purposes, which is called the design. Why does NShape offer styles and designs? There are two reasons:
• | There are so many possible colors, line styles, arrow caps, fonts etc. that you certainly not want to use all of them in your diagrams. Instead, you want to define a subset of well fitting styles and apply them over and over. NShape makes that very easy by offering only that subset in the property editors and making the whole palette of opportunities only available in the design editor. This makes your diagrams more consistent and the diagram design quicker. Yet, you do not loose any flexibility in your diagram, because shapes may but need not fully follow their templates. |
• | Styles make it very easy to modify all graphical aspects of a certain kind in one step. Say you decide to use filled arrow heads now instead of open ones. Open the design editor, select the appropriate style, change its appearance and all shapes that use the style will immediately adjust themselves. Another example is color. It may want to use that other shade of blue that looks much cooler and fits better to the strawberry red your diagrams are using. Select the color style for blue in the design editor, modify and that was it. You can even assign a completely new design to a project and thereby completely modify the look of the diagrams. |
You might ask yourself whether it is really necessary to offer templates on hand and styles on the other, if they are both used to modify whole classes of shapes in one action. Well, it is necessary because templates and styles are made for two completely different things.
The main purpose of templates is to assign shape types to model object types and thereby define the model presentation. In a template, the focus is on the mapping of the model object type to the shape type, the mapping from connection points to terminals and the mapping from dynamic model properties to dynamic view properties. The graphical aspects of templates is about how a given meaning is represented in the diagram. A typical question regarding this aspect are "How do I want to present a class in an UML diagram?".
Styles on the other hand are presentation and only presentation. A style defines what blue means exactly and how an arrow actually looks like. Styles are completely independent of templates and a modified style will be reflected in all shapes using it, independent from their templates and even of the fact, whether they have a template anyway. The typical question here "What do I want my lines look like?". As already mentioned, a design can be replaced to completely exchange the appearance of the diagrams. This is not possible with templates, because they are very specific to a given structure of the model.