4.2.5. Connecting Objects With Lines

Dia

4.2.5. Connecting Objects With Lines

In many diagrams, shapes are connected to each other using one of the basic line objects. When a shape is not selected, a number of connection points are displayed on its borders as small "x" figures. There is also a connection point in the middle of each shape. Lines also have connection points where other lines can connect.

Lines have handles on each end that are used to connect them to other objects. These handles are green if the line is not connected and red if it is connected. Lines also have orange handles that are used to shape the line. The figure below shows several lines with green handles on the unconnected end and red handles on the connected end.

Line Handles

Figure 4.13. Line Handles


To connect two shapes with a line:

  1. Select the desired line (Line, Zigzagline, etc.) by clicking on the Toolbox icon.

  2. You can either click on the canvas to place the line on the diagram and then drag the "from" end of the line to the desired connection point of the first object.

    Or you can save a step by clicking directly on the desired connection point of the first object. In this case, the line will display with the "from" end of the line already connected to the first object.

    In either case, when the "from" end of the line is connected, it's "from" handle will be red.

  3. Click on green handle at the "to" end of the line and drag it to the desired connection point on the second object. When the line is connected, the outline of the object being connected will turn red, as shown in the figure below.

    Line Connected

    Figure 4.14. Line Connected


    At this point, the two objects are connected. If you move either object, the line will stretch to keep them connected. If you move the line, it will disconnect from both objects. If you do this by mistake, you can undo using Ctrl+Z or Edit->Undo.

At any time, you can disconnect or connect to a new point by clicking on the "from" or "to" handle and dragging it to a new location on the diagram.

[Tip] Tip

If you connect a line to a fixed point on a shape's perimeter, it will stay connected to this point when the object is moved.

Fixed Connection Point

Figure 4.15. Fixed Connection Point


If you connect a line to the middle of an object, when you move the object the displayed connection point moves automatically, so you don't need to change the connection point.

Middle Connection Point

Figure 4.16. Middle Connection Point


Note that, when a line is connected to the middle of an object, the line's connection handle is still positioned on the perimeter of the object. So to move the line's connection point, drag on the line's handle (as opposed to the middle of the object).

[Tip] Tip

If you connect a Line or Polyline object to the middle of a shape when you first place the line on the canvas, you need to be careful when connecting the "to" end of the line. Be sure to click on the line's handle and not on the surrounding area within the shape. If you click on the surrounding area inside the shape, you will select the shape and not the line's handle. If this happens, click outside the shape to deselect it and then carefully click on the "x" in the middle of the object (not on the line's arrow). The handle will display, and you can drag it to the desired location. Note that the handle will display as red, because it is connected to the middle. Also note that you need to drag it outside the shape before you can see the line.

See Basic Objects / Line for more information on the different lines available.