This functionality is only available for certain module packages.

You are here: Tutorial > GRAPH2D discipline > Configuring slave-nodes as labels

Configuring slave-nodes as labels

With the configuration so far, the nodes stood for themselves. In this section, the existing nodes are to be viewed as Master nodes, to which slave nodes can be assigned as labels.

The slave nodes as labels in this diagram fulfill two tasks:

  1. Displaying a label with the name of the Master node on the upper edge of the Master node.
  2. Displaying a label with the name of the slave node, which represents the LAN_Jack of a room component. The room components can later be connected with one another via this slave node.

First, a slave node is configured.

  1. Add the following lines below the node with id=”Component".
<!-- Slave -->
<node id="LAN_Jack" valid="=isInstanceOf('IT_ModularSystem.Basic.LAN_Jack')">
	<figureLabel figure="com.mind8.graph2d.figure.Label">
		<properties>
			<property id="text">
				<read value="=$Name" />
			</property>
			<property id="showIcon">
				<read value="false" />
			</property>
		</properties>
	</figureLabel>
</node>

Now, it is defined how the component LAN_Jack is to be displayed as a slave node on the outside edges of the Master. At the same time, the label that is to display the name of the master component is configured.

  1. Add the following lines below the node with id=”Component".
<!-- Relation of Master (PC/Printer/Telephone/5waySwitch/2wayLANJack) to Slave (LAN_Jack) and Label -->
<node id="abstract_Roomcomponent" super="Component" slaveNodes="=rmos('IT_ModularSystem.Basic.LAN_Jack').append(this)">
	< slaveNode id="SN_LAN_Jack" node="LAN_Jack" layout="outsideEdged" direction="=$Direction" parent="=mc">
		 <movement direction="WEST SOUTH EAST NORTH" rotate="NO" />
	</slaveNode>
	< slaveNode id="SNLabel" valid="=isInstanceEO() and isInstanceOf('IT_Architecture.Levelcomponents.RoomComponent')" layout="outsideEdged" direction="NORTH" parent="=this">
		< figureLabel figure="com.mind8.graph2d.figure.Label">
			<properties>
				< property id="text">
					< read value="=$Tooltip" />
				</property>
				<property id="prefWidth">
					<read value="100" />
				</property>
				<property id="prefHeight">
					<read value="30" />
				</property>
				<property id="showIcon">
					<read value="false" />
				</property>
			</properties>
		</figureLabel>
		< property id="showLabel">
			< read value="true" />
		</property>
		 <movement rotateWithMaster="NO" rotate="NO" />
	</slaveNode>
</node>
  1. In the tag <node id="Room">, change the attribute acceptedChildren="Master" to acceptedChildren="abstract_Roomcomponent".
  2. In the tag <node id="Master">, change the attribute super="Component" to super="abstract_Roomcomponent".
  3. Save the diagram configuration ([Ctrl] + [S]).