mxHandle

Implements a single custom handle for vertices.

Summary
mxHandleImplements a single custom handle for vertices.
Functions
mxHandleConstructs a new handle for the given state.
Variables
cursorSpecifies the cursor to be used for this handle.
imageSpecifies the mxImage to be used to render the handle.
ignoreGridDefault is false.
Functions
getPositionHook for subclassers to return the current position of the handle.
setPositionHooks for subclassers to update the style in the <state>.
executeHook for subclassers to execute the handle.
copyStyleSets the cell style with the given name to the corresponding value in <state>.
processEventProcesses the given mxMouseEvent and invokes setPosition.
positionChangedShould be called after setPosition in processEvent.
getRotationReturns the rotation defined in the style of the cell.
getTotalRotationReturns the rotation from the style and the rotation from the direction of the cell.
initCreates and initializes the shapes required for this handle.
createShapeCreates and returns the shape for this handle.
initShapeInitializes <shape> and sets its cursor.
redrawRenders the shape for this handle.
isHtmlRequiredReturns true if this handle should be rendered in HTML.
rotatePointRotates the point by the given angle.
flipPointFlips the given point vertically and/or horizontally.
snapPointSnaps the given point to the grid if ignore is false.
setVisibleShows or hides this handle.
resetResets the state of this handle by setting its visibility to true.
destroyDestroys this handle.

Functions

mxHandle

function mxHandle(state,
cursor,
image,
shape)

Constructs a new handle for the given state.

Parameters

statemxCellState of the cell to be handled.

Variables

cursor

mxHandle.prototype.cursor

Specifies the cursor to be used for this handle.  Default is ‘default’.

image

mxHandle.prototype.image

Specifies the mxImage to be used to render the handle.  Default is null.

ignoreGrid

mxHandle.prototype.ignoreGrid

Default is false.

Functions

getPosition

mxHandle.prototype.getPosition = function(bounds)

Hook for subclassers to return the current position of the handle.

setPosition

mxHandle.prototype.setPosition = function(bounds,
pt,
me)

Hooks for subclassers to update the style in the <state>.

execute

mxHandle.prototype.execute = function(me)

Hook for subclassers to execute the handle.

copyStyle

mxHandle.prototype.copyStyle = function(key)

Sets the cell style with the given name to the corresponding value in <state>.

processEvent

mxHandle.prototype.processEvent = function(me)

Processes the given mxMouseEvent and invokes setPosition.

positionChanged

mxHandle.prototype.positionChanged = function()

Should be called after setPosition in processEvent.  This repaints the state using mxCellRenderer.

getRotation

mxHandle.prototype.getRotation = function()

Returns the rotation defined in the style of the cell.

getTotalRotation

mxHandle.prototype.getTotalRotation = function()

Returns the rotation from the style and the rotation from the direction of the cell.

init

mxHandle.prototype.init = function()

Creates and initializes the shapes required for this handle.

createShape

mxHandle.prototype.createShape = function(html)

Creates and returns the shape for this handle.

initShape

mxHandle.prototype.initShape = function(html)

Initializes <shape> and sets its cursor.

redraw

mxHandle.prototype.redraw = function()

Renders the shape for this handle.

isHtmlRequired

mxHandle.prototype.isHtmlRequired = function()

Returns true if this handle should be rendered in HTML.  This returns true if the text node is in the graph container.

rotatePoint

mxHandle.prototype.rotatePoint = function(pt,
alpha)

Rotates the point by the given angle.

flipPoint

mxHandle.prototype.flipPoint = function(pt)

Flips the given point vertically and/or horizontally.

snapPoint

mxHandle.prototype.snapPoint = function(pt,
ignore)

Snaps the given point to the grid if ignore is false.  This modifies the given point in-place and also returns it.

setVisible

mxHandle.prototype.setVisible = function(visible)

Shows or hides this handle.

reset

mxHandle.prototype.reset = function()

Resets the state of this handle by setting its visibility to true.

destroy

mxHandle.prototype.destroy = function()

Destroys this handle.

function mxHandle(state,
cursor,
image,
shape)
Constructs a new handle for the given state.
mxHandle.prototype.cursor
Specifies the cursor to be used for this handle.
mxHandle.prototype.image
Specifies the mxImage to be used to render the handle.
Encapsulates the URL, width and height of an image.
mxHandle.prototype.ignoreGrid
Default is false.
mxHandle.prototype.getPosition = function(bounds)
Hook for subclassers to return the current position of the handle.
mxHandle.prototype.setPosition = function(bounds,
pt,
me)
Hooks for subclassers to update the style in the state.
mxHandle.prototype.execute = function(me)
Hook for subclassers to execute the handle.
mxHandle.prototype.copyStyle = function(key)
Sets the cell style with the given name to the corresponding value in state.
mxHandle.prototype.processEvent = function(me)
Processes the given mxMouseEvent and invokes setPosition.
Base class for all mouse events in mxGraph.
mxHandle.prototype.positionChanged = function()
Should be called after setPosition in processEvent.
mxHandle.prototype.getRotation = function()
Returns the rotation defined in the style of the cell.
mxHandle.prototype.getTotalRotation = function()
Returns the rotation from the style and the rotation from the direction of the cell.
mxHandle.prototype.init = function()
Creates and initializes the shapes required for this handle.
mxHandle.prototype.createShape = function(html)
Creates and returns the shape for this handle.
mxHandle.prototype.initShape = function(html)
Initializes shape and sets its cursor.
mxHandle.prototype.redraw = function()
Renders the shape for this handle.
mxHandle.prototype.isHtmlRequired = function()
Returns true if this handle should be rendered in HTML.
mxHandle.prototype.rotatePoint = function(pt,
alpha)
Rotates the point by the given angle.
mxHandle.prototype.flipPoint = function(pt)
Flips the given point vertically and/or horizontally.
mxHandle.prototype.snapPoint = function(pt,
ignore)
Snaps the given point to the grid if ignore is false.
mxHandle.prototype.setVisible = function(visible)
Shows or hides this handle.
mxHandle.prototype.reset = function()
Resets the state of this handle by setting its visibility to true.
mxHandle.prototype.destroy = function()
Destroys this handle.
Represents the current state of a cell in a given mxGraphView.
Renders cells into a document object model.
Close