Represents a label displayed by a DiagramLink. New labels can be added to a link by calling the DiagramLink.addLabel method.
Namespace: com.mindfusion.diagramming
Package: com.mindfusion.diagramming
Java
![]() |
---|
public class LinkLabel |
Each label can be associated with a specific segment or control point of the link, or it can be placed at a specific position along the link's length. To set a label's position, call one of the setSegmentPosition, setControlPointPosition or setLinkLengthPosition methods.
The alignment of text can be set via setHorizontalAlign and setVerticalAlign. Text can automatically wrap to new line if it exceeds a specified width. To enable that, call setEnableWrap and setMaxWidth.
By default, labels are rendered using the link's text color and font. Call setTextColor and setFont to specify distinct color and font for the label's text.
A label can also display a java.awt.Image bitmap assigned to the Image property. This lets you draw icons along a link's geometry. If a label contains both image and text, their relative position can be set using the ImageAlign property.
java.lang.Object
com.mindfusion.diagramming.ItemLabel
com.mindfusion.diagramming.LinkLabel