Gtkada.Canvas_View.Links

Entities

Subprograms

Description

Various support utilities for the drawing of links in GtkAda.Canvas

Circle_From_Bezier

function Circle_From_Bezier
  (Center   : Item_Point;
   Radius   : Glib.Gdouble) return Item_Point_Array

Return the waypoints needed to draw a circle via a bezier curve in Draw_Polycurve.

Parameters
Center
Radius
Return Value

Compute_Bounding_Box

function Compute_Bounding_Box
  (Points   : Item_Point_Array;
   Relative : Boolean := False) return Item_Rectangle

Compute the minimum rectangle that encloses all points

Parameters
Points
Relative
Return Value

Compute_Layout_For_Arc_Link

procedure Compute_Layout_For_Arc_Link
  (Link    : not null access Canvas_Link_Record'Class;
   Context : Draw_Context;
   Offset  : Gdouble := 10.0)

Compute the layout for the link, with a curve link. The offset can be used to make the link more or less curved, in particular when there are multiple links between the same two objects, so that they do not override.

Parameters
Link
Context
Offset

Compute_Layout_For_Curve_Link

procedure Compute_Layout_For_Curve_Link
  (Link    : not null access Canvas_Link_Record'Class;
   Context : Draw_Context)

Compute the layout for the link

Parameters
Link
Context

Compute_Layout_For_Orthogonal_Link

procedure Compute_Layout_For_Orthogonal_Link
  (Link    : not null access Canvas_Link_Record'Class;
   Context : Draw_Context)

Compute the layout for the link, when it is restricted to vertical and horizontal lines only.

Parameters
Link
Context

Compute_Layout_For_Straight_Link

procedure Compute_Layout_For_Straight_Link
  (Link    : not null access Canvas_Link_Record'Class;
   Context : Draw_Context)

Compute the layout for the link, with a straight line (although additional waypoints could be added). The layout is cached in the link itself, and will be used when drawing.

Parameters
Link
Context

Draw_Link

procedure Draw_Link
  (Link     : not null access Canvas_Link_Record'Class;
   Context  : Draw_Context;
   Selected : Boolean)

Draw the link, using the layout computed earlier via one of the procedures above. This is a help method for the Draw primitive operation on the link, which should be used preferrably.

Parameters
Link
Context
Selected

Prepare_Path

function Prepare_Path
  (Link    : not null access Canvas_Link_Record'Class;
   Context : Draw_Context) return Boolean

Prepare a cairo path for the link. The path is not displayed, so this can be used for various purposes like computing intersections. The path does not include any of the labels. Return True if the path could be prepared successfully

Parameters
Link
Context
Return Value