Class LassoSelectingTool

GoJS® Diagramming Components
version 3.1.0
by Northwoods Software®

This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. See the Extensions intro page for more information.

Hierarchy (view full)

  • Tool
    • LassoSelectingTool

This replacement for the DragSelectingTool operates similarly but instead of drawing a rectangular area where Parts may be selected, follows the mouse to draw a polygon.

Instead of the DragSelectingTool.box this tool has the LassoSelectingTool.shape whose Shape.fill and Shape.stroke may be styled.

Install by replacing the CommandHandler.dragSelectingTool. For example:

new go.Diagram("myDiagramDiv", {
dragSelectingTool: new LassoSelectingTool(),
. . .
})
Index

Constructors

Accessors

  • Gets or sets the time in milliseconds for which the mouse must be stationary before this tool can be started. The default value is 175 milliseconds. Setting this property does not raise any events.

  • Gets or sets the Shape that is used to hold the line as it is being drawn.

    The default value is a simple Shape drawing a translucent polygon. The shape may not be null.

Methods

  • This adds a Point to the shape's geometry.

    If the Shape is not yet in the Diagram, its geometry is initialized and its parent Part is added to the Diagram.

    If the point is less than half a pixel away from the previous point, it is ignored.

    Parameters

    Returns void

  • Returns boolean

  • Capture the mouse and use a "crosshair" cursor.

    Returns void

  • Release the mouse and reset the cursor.

    Returns void

  • Start drawing the line by starting to accumulate points in the shape's geometry.

    Returns void

  • Keep accumulating points in the shape's geometry.

    Returns void

  • Finish drawing the line by selecting Parts whose Part.selectionObject is within the drawn polygon.

    Returns void

  • Modify the diagram's selection according to whether a Part is within the given Shape. This is called from doMouseUp.

    This method may be overridden.

    Parameters

    Returns void