Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • mxVertexHandler

Index

Constructors

constructor

Properties

allowHandleBoundsCheck

allowHandleBoundsCheck: boolean

Variable: allowHandleBoundsCheck

Specifies if the bounds of handles should be used for hit-detection in IE or if > 0. Default is true.

bounds

bounds: mxRectangle

constrainGroupByChildren

constrainGroupByChildren: boolean

Variable: constrainGroupByChildren

Specifies if the size of groups should be constrained by the children. Default is false.

graph

graph: mxGraph

Variable: graph

Reference to the enclosing .

handleImage

handleImage: mxImage

Variable: handleImage

Optional to be used as handles. Default is null.

horizontalOffset

horizontalOffset: number

Variable: horizontalOffset

The horizontal offset for the handles. This is updated in if is true and the sizers are offset horizontally.

index

index: number

Variable: index

Holds the index of the current handle.

livePreview

livePreview: boolean

Variable: livePreview

Specifies if resize should change the cell in-place. This is an experimental feature for non-touch devices. Default is false.

manageSizers

manageSizers: boolean

Variable: manageSizers

Specifies if sizers should be hidden and spaced if the vertex is small. Default is false.

parentHighlightEnabled

parentHighlightEnabled: boolean

Variable: parentHighlightEnabled

Specifies if the parent should be highlighted if a child cell is selected. Default is false.

rotationCursor

rotationCursor: string

Variable: rotationCursor

Specifies the cursor for the rotation handle. Default is 'crosshair'.

rotationEnabled

rotationEnabled: boolean

Variable: rotationEnabled

Specifies if a rotation handle should be visible. Default is false.

rotationHandleVSpacing

rotationHandleVSpacing: number

Variable: rotationHandleVSpacing

Vertical spacing for rotation icon. Default is -16.

rotationRaster

rotationRaster: boolean

Variable: rotationRaster

Specifies if rotation steps should be "rasterized" depening on the distance to the handle. Default is true.

singleSizer

singleSizer: boolean

Variable: singleSizer

Specifies if only one sizer handle at the bottom, right corner should be used. Default is false.

state

Variable: state

Reference to the being modified.

tolerance

tolerance: number

Variable: tolerance

Optional tolerance for hit-detection in . Default is 0.

verticalOffset

verticalOffset: number

Variable: verticalOffset

The horizontal offset for the handles. This is updated in if is true and the sizers are offset vertically.

Methods

checkTolerance

  • Function: checkTolerance

    Checks if the coordinates for the given event are within the <mxGraph.tolerance>. If the event is a mouse event then the tolerance is ignored.

    Parameters

    Returns void

createCustomHandles

  • createCustomHandles(): any[]

createParentHighlightShape

createSelectionShape

createSizer

  • createSizer(cursor: string, index: number, size: number, fillColor: string): mxRectangleShape
  • Function: createSizer

    Creates a sizer handle for the specified cursor and index and returns the new that represents the handle.

    Parameters

    • cursor: string
    • index: number
    • size: number
    • fillColor: string

    Returns mxRectangleShape

createSizerShape

  • Function: createSizerShape

    Creates the shape used for the sizer handle for the specified bounds an index. Only images and rectangles should be returned if support for HTML labels with not foreign objects is required.

    Parameters

    Returns mxShape

destroy

  • destroy(): void

drawPreview

  • drawPreview(): void

getHandleForEvent

  • Function: getHandleForEvent

    Returns the index of the handle for the given event. This returns the index of the sizer from where the event originated or <mxEvent.LABEL_INDEX>.

    Parameters

    Returns number

getHandlePadding

getRotationHandlePosition

  • getRotationHandlePosition(): mxPoint

getSelectionBounds

getSelectionColor

  • getSelectionColor(): string

getSelectionStrokeWidth

  • getSelectionStrokeWidth(): number

hideSizers

  • hideSizers(): void

init

  • init(): void

isCenteredEvent

isConstrainedEvent

isCustomHandleEvent

  • Function: isCustomHandleEvent

    Returns true if the given event allows custom handles to be changed. This implementation returns true.

    Parameters

    Returns boolean

isLivePreviewBorder

  • isLivePreviewBorder(): boolean
  • Function: isLivePreviewBorder

    Called if is enabled to check if a border should be painted. This implementation returns true if the shape is transparent.

    Returns boolean

isRecursiveResize

isRotationHandleVisible

  • isRotationHandleVisible(): boolean

isSelectionDashed

  • isSelectionDashed(): boolean

isSizerVisible

  • isSizerVisible(index: number): boolean
  • Function: isSizerVisible

    Returns true if the sizer for the given index is visible. This returns true for all given indices.

    Parameters

    • index: number

    Returns boolean

mouseDown

  • Function: mouseDown

    Handles the event if a handle has been clicked. By consuming the event all subsequent events of the gesture are redirected to this handler.

    Parameters

    Returns void

mouseMove

mouseUp

moveChildren

  • moveChildren(cell: mxCell, dx: number, dy: number): void

moveLabel

moveSizerTo

  • Function: createBounds

    Helper method to create an around the given centerpoint with a width and height of 2*s or 6, if no s is given.

    Parameters

    Returns void

redraw

  • redraw(): void

redrawHandles

  • redrawHandles(): void
  • Function: redrawHandles

    Redraws the handles. To hide certain handles the following code can be used.

    (code) redrawHandles() { mxVertexHandlerRedrawHandles.apply(this, arguments);

    if (this.sizers != null && this.sizers.length > 7) { this.sizers[1].node.style.display = 'none'; this.sizers[6].node.style.display = 'none'; } }; (end)

    Returns void

removeHint

  • removeHint(): void

reset

  • reset(): void

resizeCell

  • resizeCell(cell: mxCell, dx: number, dy: number, index: number, gridEnabled: boolean, constrained: boolean, recurse: boolean): void
  • Function: resizeCell

    Uses the given vector to change the bounds of the given cell in the graph using <mxGraph.resizeCell>.

    Parameters

    • cell: mxCell
    • dx: number
    • dy: number
    • index: number
    • gridEnabled: boolean
    • constrained: boolean
    • recurse: boolean

    Returns void

resizeVertex

rotateCell

  • rotateCell(cell: mxCell, angle: number, parent: mxCell): void
  • Function: rotateCell

    Rotates the given cell and its children by the given angle in degrees.

    Parameters:

    cell - to be rotated. angle - Angle in degrees.

    Parameters

    Returns void

rotateClick

  • rotateClick(): void
  • Function: rotateClick

    Hook for subclassers to implement a single click on the rotation handle. This code is executed as part of the model transaction. This implementation is empty.

    Returns void

rotateVertex

roundAngle

  • roundAngle(angle: number): number

roundLength

  • roundLength(length: number): number
  • Function: roundLength

    Hook for rounding the unscaled width or height. This uses Math.round.

    Parameters

    • length: number

    Returns number

setHandlesVisible

  • setHandlesVisible(visible: boolean): void

start

  • start(x: number, y: number, index: number): void
  • Function: start

    Starts the handling of the mouse gesture.

    Parameters

    • x: number
    • y: number
    • index: number

    Returns void

union

  • union(bounds: mxRectangle, dx: number, dy: number, index: number, gridEnabled: boolean, scale: number, tr: Element, constrained: boolean, centered: boolean): void
  • Function: union

    Returns the union of the given bounds and location for the specified handle index.

    To override this to limit the size of vertex via a minWidth/-Height style, the following code can be used.

    (code) var vertexHandlerUnion = union; union(bounds, dx, dy, index, gridEnabled, scale, tr, constrained) { var result = vertexHandlerUnion.apply(this, arguments);

    result.width = Math.max(result.width, mxUtils.getNumber(this.state.style, 'minWidth', 0)); result.height = Math.max(result.height, mxUtils.getNumber(this.state.style, 'minHeight', 0));

    return result; }; (end)

    The minWidth/-Height style can then be used as follows:

    (code) graph.insertVertex(parent, null, 'Hello,', 20, 20, 80, 30, 'minWidth=100;minHeight=100;'); (end)

    To override this to update the height for a wrapped text if the width of a vertex is changed, the following can be used.

    (code) var mxVertexHandlerUnion = union; union(bounds, dx, dy, index, gridEnabled, scale, tr, constrained) { var result = mxVertexHandlerUnion.apply(this, arguments); var s = this.state;

    if (this.graph.isHtmlLabel(s.cell) && (index == 3 || index == 4) && s.text != null && s.style[mxConstants.STYLE_WHITE_SPACE] == 'wrap') { var label = this.graph.getLabel(s.cell); var fontSize = mxUtils.getNumber(s.style, mxConstants.STYLE_FONTSIZE, mxConstants.DEFAULT_FONTSIZE); var ww = result.width / s.view.scale - s.text.spacingRight - s.text.spacingLeft

    result.height = mxUtils.getSizeForString(label, fontSize, s.style[mxConstants.STYLE_FONTFAMILY], ww).height;
    

    }

    return result; }; (end)

    Parameters

    • bounds: mxRectangle
    • dx: number
    • dy: number
    • index: number
    • gridEnabled: boolean
    • scale: number
    • tr: Element
    • constrained: boolean
    • centered: boolean

    Returns void

updateHint

updateLivePreview

updateMinBounds

  • updateMinBounds(): void

updateParentHighlight

  • updateParentHighlight(): void

Generated using TypeDoc