Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ColumnResizingTool Extension

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. Extensions can be found in the GoJS kit under the extensions (for loading via script tags),extensionsTS (UMD modules), or extensionsJSM (ES6 modules) folders. See the Extensions intro page for more information.

Hierarchy

  • Tool
    • ColumnResizingTool

The ColumnResizingTool class lets the user resize each column of a named Table Panel in a selected Part.

If you want to experiment with this extension, try the Column Resizing sample.

Index

Inherited Members

Constructors

  • Constructs a ColumnResizingTool and sets the handle and name of the tool.

    Returns ColumnResizingTool

Properties

  • This read-only property returns the Panel of type Panel.Table whose columns are being resized. This must be contained within the selected Part.

  • Gets or sets small GraphObject that is copied as a resize handle for each column. This tool expects that this object's GraphObject.desiredSize (a.k.a width and height) has been set to real numbers.

    The default value is a Shape that is a narrow rectangle.

  • Gets or sets the name of the Table Panel to be resized.

    The default value is the name "TABLE".

Methods

  • canStart(): boolean
  • This tool may run when there is a mouse-down event on a "ColumnResizing" handle, the diagram is not read-only, the left mouse button is being used, and this tool's adornment's resize handle is at the current mouse point.

    Returns boolean

  • This can be overridden in order to customize the resizing process.

    Parameters

    • p: Point

      the point where the handle is being dragged

    Returns Point

  • doActivate(): void
  • Find the handle, ensure type Panel.Table, capture the mouse, and start a transaction.

    If the call to Tool.findToolHandleAt finds no "ColumnResizing" tool handle, this method returns without activating this tool.

    Returns void

  • doDeactivate(): void
  • Stop the current transaction and release the mouse.

    Returns void

  • doKeyDown(): void
  • Pressing the Delete key removes any column width setting and stops this tool.

    Returns void

  • doMouseMove(): void
  • Call resize with a new size determined by the current mouse point. This determines the new bounds by calling computeResize.

    Returns void

  • doMouseUp(): void
  • Call resize with the final bounds based on the most recent mouse point, and commit the transaction. This determines the new bounds by calling computeResize.

    Returns void

  • resize(newPoint: Point): void
  • updateAdornments(part: Part): void