Modeling T-Connections Using Edge Labels |
| Applies to: yFiles 2.5 |
Type: Tips & Tricks
Categories this article belongs to:
| yFiles for Java | > yFiles Viewer | > Displaying and Editing Graphs | > Realizer-Related Features |
T-style connections like they are described in modeling notations such as UML can be easily realized using edge labels.
T-style connections as shown in the below figure can be modeled using an edge label having an additional line that visually links the label box to its edge.
Tutorial demo application YLabelConfigurationDemo.java presents the setup for a label configuration that uses a customized implementation for the YLabel.Painter
interface which draws a light gray line between the edge and the label.
A special helper class ensures that the line is drawn perpendicular to the edge's path.
Tutorial demo application YLabelConfigurationDemo.java presents the setup for a label configuration that uses a customized implementation for the YLabel.Painter
When used in conjuction with a layout algorithm that provides support for integrated edge labeling, like, e.g., orthogonal layout, the edge label is placed near its edge and the T-style connection can be nicely observed.
Please note that the scheme presented in YLabelConfigurationDemo only suits for modeling annotations that belong to a single edge. Tutorial demo application EdgeConnectorDemo.java shows a solution that allows to model annotations belonging to multiple edges.
| Keywords: | T-connector - T-connection - edge - label - EdgeLabel - BPMN - UML - link - notation - modeling - configuration - painter - integrated - labeling |


