Variable: constrainGroupByChildren
Specifies if the size of groups should be constrained by the children. Default is false.
Variable: graph
Reference to the enclosing
Variable: handleImage
Optional
Variable: horizontalOffset
The horizontal offset for the handles. This is updated in
Variable: index
Holds the index of the current handle.
Variable: livePreview
Specifies if resize should change the cell in-place. This is an experimental feature for non-touch devices. Default is false.
Variable: manageSizers
Specifies if sizers should be hidden and spaced if the vertex is small. Default is false.
Variable: parentHighlightEnabled
Specifies if the parent should be highlighted if a child cell is selected. Default is false.
Variable: rotationCursor
Specifies the cursor for the rotation handle. Default is 'crosshair'.
Variable: rotationEnabled
Specifies if a rotation handle should be visible. Default is false.
Variable: rotationHandleVSpacing
Vertical spacing for rotation icon. Default is -16.
Variable: rotationRaster
Specifies if rotation steps should be "rasterized" depening on the distance to the handle. Default is true.
Variable: singleSizer
Specifies if only one sizer handle at the bottom, right corner should be used. Default is false.
Variable: state
Reference to the
Variable: tolerance
Optional tolerance for hit-detection in
Variable: verticalOffset
The horizontal offset for the handles. This is updated in
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.
Function: createCustomHandles
Returns an array of custom handles. This implementation returns null.
Function: createParentHighlightShape
Creates the shape used to draw the selection border.
Function: createSelectionShape
Creates the shape used to draw the selection border.
Function: createSizer
Creates a sizer handle for the specified cursor and index and returns
the new
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.
Function: destroy
Destroys the handler and all its resources and DOM nodes.
Function: drawPreview
Redraws the preview.
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>.
Returns the padding to be used for drawing handles for the current
Function: getRotationHandlePosition
Returns an
Function: getSelectionBounds
Returns the mxRectangle that defines the bounds of the selection border.
Function: getSelectionColor
Returns <mxConstants.VERTEX_SELECTION_COLOR>.
Function: getSelectionStrokeWidth
Returns <mxConstants.VERTEX_SELECTION_STROKEWIDTH>.
Function: hideSizers
Hides all sizers except.
Starts the handling of the mouse gesture.
Function: init
Initializes the shapes required for this vertex handler.
Function: isCenteredEvent
Returns true if the center of the vertex should be maintained during the resize.
Function: isConstrainedEvent
Returns true if the aspect ratio if the cell should be maintained.
Function: isCustomHandleEvent
Returns true if the given event allows custom handles to be changed. This implementation returns true.
Function: isLivePreviewBorder
Called if
Function: rotateCell
Rotates the given cell to the given rotation.
Function: isRotationHandleVisible
Returns true if the rotation handle should be showing.
Function: isSelectionDashed
Returns <mxConstants.VERTEX_SELECTION_DASHED>.
Function: isSizerVisible
Returns true if the sizer for the given index is visible. This returns true for all given indices.
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.
Function: mouseMove
Handles the event by updating the preview.
Function: mouseUp
Handles the event by applying the changes to the geometry.
Function: moveChildren
Moves the children of the given cell by the given vector.
Function: rotateVertex
Rotates the vertex.
Function: createBounds
Helper method to create an
Function: redraw
Redraws the handles and the preview.
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)
Function: removeHint
Hooks for subclassers to hide details when the handler gets inactive.
Function: reset
Resets the state of this handler.
Function: resizeCell
Uses the given vector to change the bounds of the given cell in the graph using <mxGraph.resizeCell>.
Function: rotateVertex
Rotates the vertex.
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.
Function: rotateVertex
Rotates the vertex.
Function: roundAngle
Hook for rounding the angle. This uses Math.round.
Function: roundLength
Hook for rounding the unscaled width or height. This uses Math.round.
Function: hideHandles
Shortcut to
Function: start
Starts the handling of the mouse gesture.
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)
Function: updateHint
Hook for subclassers do show details while the handler is active.
Function: updateLivePreview
Repaints the live preview.
Function: updateMinBounds
Initializes the shapes required for this vertex handler.
Function: updateParentHighlight
Updates the highlight of the parent if
Generated using TypeDoc
Variable: allowHandleBoundsCheck
Specifies if the bounds of handles should be used for hit-detection in IE or if > 0. Default is true.