Nevron Open Vision Documentation
Diagram / Diagram DOM / Drawings / Shapes / Shape Elements / Controls
In This Topic
    Controls
    In This Topic
     About Controls

    The control points (abbreviated as controls) of a shape are represented by the NControl class. The controls of a shape are contained in an instance of the NControlCollection class, which can be obtained from the Controls property of the shape.

    When the shape is selected, the NOV diagram will display control handles that the user can drag to modify the control point location. That is why controls are usually used with expressions to specify the location of some important for the geometry point that the user can edit.

     Location and Behavior

    The location of the control is specified by the X and Y properties of each NControl object. The location of the control point is in shape local coordinates. When the user moves the control handle, NOV diagram refactors the values and/or the expressions associated with the X and Y properties according to the XBehavior and YBehavior properties, which can take one of the following values:

    • Proportional - The coordinate is defined proportionally to the respective dimension. When the control handle is moved, NOV diagram will express the X or Y property is a factor of the shape Width or Height.
    • Locked - The coordinate is locked to its original value. Nevron does not update this coordinate.
    • OffsetFromMin - The coordinate is defined with a constant distance from the near side (Left or Top).
    • OffsetFromMid - The coordinate is defined with a constant distance from the center (CenterX or CenterY).
    • OffsetFromMax - The coordinate is defined with a constant distance from the far side (Right or Bottom).

    The GetLocation() and SetLocation() methods help you work with the control point. The SetLocation() method honors the XBehavior and YBehavior of the control.

     Tooltip
    Each control point can have a tooltip string that NOV diagram displays when the user hovers the mouse over the control point. The tooltip of the control is controlled by the Tooltip property.
     Glue
    In NOV Diagram control points can be glued to other shapes geometry, box, line etc. The following table discusses the methods that help you glue a control point to another object aspect:
    Method Name Method Description

    void GlueToGeometryContour(NShape shape, double locationFactor)

    Glues (connects) the control point to a factor location on the specified shape geometry contour.
    0 is the begin of the contour, 1 is the end of the contour.

    void GlueToGeometryVertex(NGeometryCommand command, int vertexIndex)

    Glues the control point to a vertex of the specified geometry command.

    void GlueToPort(NPort port)

    Glues the control point to the specified port.

    void GlueToShapeBox(NShape shape, double widthFactor, double heightFactor)

    Glues the control point to a point defined by factors in the specified shape box.

    void GlueToShapeLine(NShape shape, double locationFactor)

    Glues the control point to a factor location along the shape line. 0 is the begin of the line, 1 is the end of the line.

    You can prevent a control point from being visually glued by setting the CanGlue property to false. You can also unglue a control point by calling the Unglue() method.