DiagramObjectStyles - Helmut-Ortmann/EnterpriseArchitect_hoTools GitHub Wiki

Diagram Object Style (bulk change)

Sounds familiar?

  • You have some standardized Diagrams
  • You want to ensure same look and feel of your different Diagram types
  • You want to highlight something by Color, Font, LineWidth,
  • Mark nodes with missing links
  • Visualize Hidden Links in e.g. red and let the Links disappear after scrutinizing them
  • Setting Style based on conditions like Type, Stereotype,

Ensure your Look and Feel by just a few clicks.

General

Change Diagram Object Styles with one Click from your library of Styles - for selected .. or for a whole package.

Your library of Styles is stored in Settings.Json and hoTools ships with a reasonable default Style library you can easily access and adapt via the File Menu.

Edit EA Layouts for Nodes and Links with EA and apply them to a bunch of Diagram Nodes/Objects.

You can change:

by

  • Do Menu, Bulk Change..
  • Button on Toolbar (configurable)
  • Key (configurable)

It's like EA Features and Compartment Visibility of one or more Diagram Objects or the EA Short Cut 'CTRL+SHFT+Y'.

The features are:

  • Diagram or Diagram Object(s)
    • Menu, Do, Bulk change Diagram Objects
    • 5 General Diagram Object Styles to use with Toolbar(Buttons)
    • 5 General Diagram Object Styles to use with Keys
  • Define arbitrary amount of Diagram Object Styles
  • Define Diagram Object Styles in Settings.json (Chapter 'DiagramObjectStyle':)

Principles

First define the Diagram Style. Then define Diagram Object Styles to modify the general Style by defining what:

  • to additional visualize (e.g.: 'Tag=1;Notes=1000;PType=1;')
  • not to visualie (e.g. 'AttPri=0;AttPro=0;AttPub=0;OpPri=0;OpPro=0;OpPub=0;')

A good idea is to:

  • Change the wanted type be EA Dialog
  • Run SQL to see the values for 'objectStyle'
  • see Style

Diagram Style/Theme via Menu

Diagram Object Style via Button

You may assign the services

  • Bulk change Diagram to 'Style 1', e.g. Show Notes, Tagged Values
  • Bulk change Diagram to 'Style 2'. e.g. don't show Notes Tagged Values

by

to a button to quickly apply the changes.

Diagram Style/Theme via Key

You may assign the two services

  • Bulk change Diagram to 'Style 1'
  • Bulk change Diagram to 'Style 2'

by

to a Key to quickly apply the changes.

Configure

Example

{
  "Name":        "Default1, no Notes",
  "Description": "No Notes\r\nNo Attributres",
  "Type":        "Types=Component, aaa, Class;Stereotypes=a,b",
  "Style":       "",
  "Property":    "ShowNotes=false;ShowPackageAttributes=False, ShowPrivateAttributes=false, ShowProtectedAttributes=false, ShowPublicAttributes=false" 
},
{
  "Name":        "Default2, Notes",
  "Description": "Notes\r\nNo Attributes",
  "Type":        "Types=Component, aaaa, Class;Stereotypes=a,b",
  "Style":       "Notes=1000,Formatted=1",
  "Property":    "ShowPackageAttributes=True; ShowPrivateAttributes=false, ShowProtectedAttributes=false, ShowPublicAttributes=false" 
},
{
  "Name":        "Notes, Public Operations, Class",
  "Description": "Notes\r\nNo Protected,Private Operations\r\nTags",
  "Type":        "",
  "Style":       "Notes=1000;OpPro=0;OpPri=0;OpPkg=0;",
  "Property":     ""
},
{
  "Name":        "Tags",
  "Description": "No Notes\r\nNo Operations\r\nNo Attributes\r\nTags",
  "Type":        "", 
  "Style":       "HideIcon=0;AttPri=0;AttPkg=0;AttPro=0;AttPub=0;AttCustom=0;OpCustom=0;OpPro=0;OpPri=0;OpPkg=0;PType=0;RzO=1;",
  "Property":    ""
},
{
  "Name":        "Wrap Features",
  "Description": "Wrap Features",
  "Type":         "", 
  "Style":        "HideIcon=0;RzO=2;",
  "Property":     ""
},
{

  "Name":         "Resize Features",
  "Description":  "Resize Features",
  "Type":         "", 
  "Style":        "HideIcon=0;RzO=1;",
  "Property":     ""
},
{

  "Name":        "ObjStyle1",
  "Description": "According to EA ObjStyle1",
  "Type":        "", 
  "Style":       "",
  "Property":    "EaLayoutStyle=ObjStyle1;"
},
{

  "Name":        "ObjStyle2",
  "Description": "According to EA ObjStyle2",
  "Type":        "", 
  "Style":       "",
  "Property":    "EaLayoutStyle=ObjStyle2;"
}

Location

EA Layout Styles

EA supports Layout Styles (Layout, Style) with:

  • Font
  • Colors (Line, Font, Background)
  • Bold, Underline, Italic
  • You can store them assign them to Diagram Objects/Nodes or Links/Connector.

General

You can use comma/semicolon separated lists in Settings.Json to define Styles:

  • Name Name of the Style
  • Description Description/ Tooltip
  • Type Type of Diagram, Node, Link
  • Style Styles to be applied
  • Properties EA Property (somehow redundant to PDATA/StyleEx)

My preffered way to find the right solution (if not obvious):

  • Make a new project
  • Change style with EA Diagram properties
  • SQL: select pdata, styleEx from t_diagram
  • Compare
  • Before Change in EA
  • After Change in EA

General

You can use semicolon separated lists for:

  • Type Currently not used
  • Style Column objectStyle in table t_diagramObjects
  • Properties EA Diagram Object Properties, somehow redundant to Style

Sometimes you can achieve the same effect with Style or Properties.

hoTools apply Diagram Object styles in the following sequence:

  1. Style
  2. Properties (they may change Style)

My preffered way to find the right solution (if no obvious):

  • Make a new project
  • Change style with EA Diagram properties
  • SQL: select objectStyle from t_diagramObjects
  • Compare
  • Before Change in EA
  • After Change in EA

The EA Dialog to understand the Diagram Object Styles:

EA Object Styles

Name

hoTools shows the Name in dialogs to set the Diagram Object Style

Description

hoTools shows the Description as Tooltip. It's also a good idea to have a bit of documentation.

Use '\r\n' if you want LineFeeds.

Type

With Type you can conditionally apply your Style:

  • Object Type
  • Stereotype

Style

Have a look in the table t_diagramobjects column 'objectStyle' for possible values. Also look into the above picture to see the EA dialog which maintains the Object Styles.

SQL: 'select name, objectStyle from t_diagramobjects d inner join t_object o on d.object_id = o.object_id'

Hide

AttPro=0;AttPri=0;AttPub=0;AttPkg=0;OpPro=0;OpPri=0;OpPub=0;OpPkg=0;

Show

Tag=1;Constraint=1;PType=1;Notes=1000;Formatted=1;RzO=1;Runstate=1;Responsibility;FQTag=1;OpInh=1;AttInh=1;RzO=n;

Abbreviations

Notes=nnnn;       Count of characters to show in notes
Pro=0:            Hide Protected (Attribute/Operation)
Pri=0:            Hide Private (Attribute/Operation)
Pub=0:            Hide Public (Attribute/Operation)
Pkg=0:            Hide Package (Attribute/Operation)
PType=1:          Show Property Type 
FQTag=1;          Show Full Qualified Tag
TagInh=1;         Show Inherited Tagged Values
SC=1;             Structured Compartment
Responsibility=1; Internal Requirement of a Requirement
Inh=1,            Inherited Operation, Attribute, Constraint
RzO=n;            Resize Object: 1= Resize to longest Feature;2=Wrap Features;3=Truncate Features;

Properties

See the EA Diagram Object Referenz.

Propertis change the DiagramObject Properties:

  • BackgroundColor=long (standard colors like 'green', 'red', 'blue', 'gold', 'purple', 'yellow', etc., Color)
  • BorderColor=long (standard colors like 'green', 'red', 'blue', 'gold', 'purple', 'yellow', etc., Color)
  • BorderLineWidth=long
  • Bottom=long
  • ElementDisplayMode=long (1=Resize to longest feature, 2=Wrap feature, 3=Truncate feature)
  • FeatureStereotypesToHide=string
  • FontBold=true
  • FontItalic=true
  • FontName=string
  • FontSize=string
  • FontUnderline=true
  • IsSelectable=true
  • Left=long
  • Right=long
  • Sequence=long
  • ShowConstraints=true
  • ShowFormattedNotes=true
  • ShowFullyQualifiedTags=true
  • ShowInheritedAttributes=true
  • ShowInheritedConstraints=true
  • ShowInheritedOperations=true
  • ShowInheritedResponsibilities=true
  • ShowInheritedTags=true
  • ShowPortType=true
  • ShowPrivateAttributes=true
  • ShowProtectedAttributes=true
  • ShowPublicAttributes=true
  • ShowPackageAttributes=true
  • ShowPrivateOperations=true
  • ShowProtectedOperations=true
  • ShowPublicOperations=true
  • ShowPackageOperations=true
  • ShowResponsibilities=true
  • ShowStructuredCompartments=true
  • ShowTags=true
  • TextAlign=long (1=left aligned, 2=center aligned, 3=Right aligned)
  • Top=long

Color

You can express colors by:

  • Integer (Blue256256) + (Green*256) + Red, RGM scheme
  • Heaxadical #BBGGRR (B=blue, G=green, R= red), RGB scheme
  • Color names (red, crimson,..) see

Often it's easier to use the EA Layout Styles with the Property:

  • "Property": "EaLayoutStyle=ObjStyle2;"

References