DroidDiagram Programmer's Guide
DiagramLink Class
Remarks See Also
 






Links between nodes in DroidDiagram diagrams are represented by instances of the DiagramLink class.

Namespace: com.mindfusion.diagramming
Package: com.mindfusion.diagramming

 Syntax

Java  Copy Code

public class DiagramLink extends DiagramItem implements InplaceEditable, Routable

 Remarks

Links connect at most two nodes, which can be accessed by the getOrigin and getDestination methods. If linked to node anchor points, the point indices can be accessed using the getOriginAnchor and getDestinationAnchor methods. To control whether users are allowed to move link end points, call one or both of the setAllowMoveStart and setAllowMoveEnd.

Links are built of smaller parts, called segments, which can be straight lines, cascading orthogonal lines or Bezier curves. The type of segments can be set through the setStyle method. The number of links segments is specified by the setSegmentCount method. Access to the control point locations is provided by the getControlPoints method.

Usually only the start and end segments of a link are updated if the nodes it connects are moved around. Number, orientation and/or position of link segments can change dynamically in various ways depending on the values set through setAutoRoute, setDynamic and setRetainForm. The setCascadeOrientation method lets you specify the orientation of the first segment of a link of style Cascading.

If AutoSnapToNode is enabled, a link automatically aligns its end points to the border of the origin or destination nodes when a user moves the first or last control points. This has a higher priority than aligning to the grid, but a lower priority than aligning to an anchor point.

Links can display distinct arrowhead shapes at their ends. These shapes can be set by the setHeadShape and setBaseShape methods. The size of the arrowhead and base shapes can be specified respectively via the setHeadShapeSize and setBaseShapeSize methods. Arrowhead shapes can be displayed in the middle of each segment to facilitate users by distinguishing different links. The type and size of these shapes is set by the setIntermediateShape and setIntermediateShapeSize methods. The outlines of arrowhead shapes are painted with the pen specified by setHeadPen.

Links can have some text associated with them, displayed as specified in the setText, setTextBrush and setTextStyle methods. It is also possible to display multiple labels, added via the addLabel method. They are rendered using the font and text color associated with the link by default, but can be customized with distinct fonts, colors and text alignments through the methods of LinkLabel.

 Inheritance Hierarchy

java.lang.Object
    com.mindfusion.diagramming.DiagramItem
        com.mindfusion.diagramming.DiagramLink

 See Also

DiagramLink Members
com.mindfusion.diagramming Namespace