DiagramStyleDiagramStyles are at the top of the configuration food chain. They reference other configuration parts, binding them together so the diagram selects which Java elements to display and how to display them. Basic controls
The basic controls are:
These clauses are optional but have to be specified in the above order and before other clauses. Note that content assist enforces this. Displays / Hides (Bindings)Below the basic controls is a list of displays / hides clauses. Each Java element is assigned a display style on a first match basis.
So above we have two TypeSelectors and a DiagramStyle. The DiagramStyle binds proxies to greenTypeDisplayStyle. In other words, any class which implements the IProxy interface will be displayed in green (greenTypeDisplayStyle is defined elsewhere). Note that type which are not selected by proxies ie any class which does not implement IProxy or any interface which does not extend IProxy will fail over to the next clause. There are equivalent clauses for binding fields and methods.
Above, publicFields is a FieldSelector specified elsewhere, largerFIeldOrMethod is a FieldOrMethodDisplayStyle specified elsewhere and privateMethods is a MethodSelector specified elsewhere. So each type, field or method is displayed (if at all) according to the first selector which it matches using the display style it is bound to. Line BindingsLine bindings control how lines are displayed between Java elements. The line bindings must be specified after the type, method and field bindings. ExampleSupposing we had a diagram with many types selectable by TypeSelector called managedObjects. If almost every managedObject had a dependency on every other managed object, it would make it difficult to see other significant dependencies between types. Therefore we may wish to play down the dependencies between managedObjects and we could do this as follows:
Switchesdisplays and hides clauses can be qualified by switches. This saves having to make large numbers of DiagramStyles to handle all of the combinations of display options you may need. ExampleHighlights (displays in orange) clientExceptions if the switch is set to client or highlights serverExceptions if the switch is set to server. clientExceptions and serverExceptions are TypeSelectors specified elsewhere.
InheritanceAny DiagramStyle can be declared using basic control statements followed by an ordered list of bindings. However, there is normally common ground between the DiagramStyles you require and the inheritance of DiagramStyles avoids having to repeat boiler-plate clauses.
|