A gradient can be defined as a background color for a node. For this purpose the figure configuration of the node is extended by the <configuration> tag, which encloses the <bGradient> tag.
A complete configuration contains information on the direction of the gradient, start and end color for the unselected nodes and start and end color for the selected node.
The information for the gradient is provided in the form of the cardinal point-cardinal point. The cardinal points are abbreviated as indicated, combinations are possible:
Attribute name | Usage | Attribute values | Default value | Description |
---|---|---|---|---|
direction | required | E->W N->S NE->SW NW->SE S->N SE->NW SW->NE W->E |
Direction of the gradient from startColor to background color of the node, resp. from selectedStartColor to background color of the selected node. E->W = East to West N->S = North to South NE->SW = North-East to South-West NW->SE = North-West to South-East S->N = South to North SE->NW = South-East to North-West SW->NE = South-West to North-East W->E = West to East |
|
startColor | optional | 0,0,0 to 255,255,255 | Start color of the gradient for the not-selected node as RGB value. | |
selectedStartColor | optional | 0,0,0 to 255,255,255 | Start color of the gradient for the selected node as RGB value. |
Allowed sub-elements | Quantity |
---|---|
none |
Note:
Follow the sequence:
If an <editRequestHandler> is also configured with <configuration>, this is then followed first by <editRequestHandlerInfo> and then <bGradient>.
Example code of a diagonal gradient from upper left in green to lower right in white for the unselected node and from upper left in red to lower right in blue (default color) for the selected node (SafetyCircuit in the Planning_Diagram of the BodyshellWork model):
<node id="SafetyCircuit" super="Component" valid="=isInstanceEO() and isInstanceOf('BodyShellWork_Architecture.LevelComponents .SafetyCircuit')" acceptedChildren="Funktion LabelAsSlave">
<figurePolygon figure="com.mind8.graph2d.figure.container.Polygon">
<configuration>
<bGradient direction="NW->SE" startColor="0,200,0" selectedStartColor="200,0,0"/>
</configuration>
<properties>
<property id="bColor">
<read value="255,255,255"/>
</property>
<property id="selectedBColor">
<read value="0,0,255"/>
</property>
...
</properties>
</figurePolygon>
<property id="text">
<read value="=$Designation"/>
<write key="value" receiver="=getParameter('Designation')"/>
</property>
</node>
Result:
The following figures show the same node with gradient, once selected and once not selected: