By default, a port is displayed as a white square with a black border in configurable graphs in SystemWeaver. However, there is an option to customize the style and symbol of ports (InPort, OutPort, and InOutPort). This article describes how to define and apply a port style.  


Prerequisites


Defining a Style

The port style is defined using the <PortStyle> element. A style can include one or more of the following attributes: 

  • name (mandatory) identifies the PortStyle when it is referred to for the ports.
  • fillColor (optional) defines the fill color* of the ports according to the style. Default value is "white".
  • borderThickness (optional) defines the thickness of the border lines of the ports. Default value is "1".
  • borderColor (optional) defines the color of the border lines of the nodes. Default value is "black".
  • borderType (optional) defines the line style of the border. Supported values are: "dash", "dashdot", "dashdotdot", "dot", and "solid". Default value is "solid".
  • portSymbol (optional) defines the symbol to display in the port. It is possible to use Alt-codes here to insert symbols in the port. 
  • legendLabel (optional) defines the label text that will be added to the legend. This attribute is used together with Legend option.


...
<PortStyles>
  <PortStyle name="p1" fillColor="Red" borderColor="Blue" borderType="dash" portSymbol="⯇"/>
  </PortStyle>
</PortStyles>
...



Fill and Border Colors

See Defining Color in Configurations for valid values for color-related attributes.


Using Hard-coded AUTOSAR Symbols

An optional Shape sub-element can be used to apply one of the following hard-coded Autosar symbols to a PortStyle:


<ClientServerRPort/>
<ClientServerPPort/>
<ClientServerPPort/>


<PortStyles>

   <PortStyle name="p1" fillColor="Red" portSymbol="⯇"/>

   <PortStyle name="p2" fillColor="Green" borderThickness="3" borderColor="Yellow">
      <Shape>
	  <ClientServerPPort/>
      </Shape>
   </PortStyle>

</PortStyles>


Applying a Style

Once you have defined a port style, you can then apply it to any InPort, OutPort, or InOutPorts elements in the graph configuration using the style attribute as shown below:


<InPort connection="DefObj" style="p1">
  <RemovePart part="." caption="Remove (->) #{Name}"/>
</InPort>