mxGuide

Implements the alignment of selection cells to other cells in the graph.

Summary
mxGuideImplements the alignment of selection cells to other cells in the graph.
Functions
mxGuideConstructs a new guide object.
Variables
graphReference to the enclosing mxGraph instance.
statesContains the mxCellStates that are used for alignment.
horizontalSpecifies if horizontal guides are enabled.
verticalSpecifies if vertical guides are enabled.
guideXHolds the mxShape for the horizontal guide.
guideYHolds the mxShape for the vertical guide.
roundedSpecifies if rounded coordinates should be used.
toleranceDefault tolerance in px if grid is disabled.
Functions
setStatesSets the mxCellStates that should be used for alignment.
isEnabledForEventReturns true if the guide should be enabled for the given native event.
getGuideToleranceReturns the tolerance for the guides.
createGuideShapeReturns the mxShape to be used for painting the respective guide.
isStateIgnoredReturns true if the given state should be ignored.
moveMoves the <bounds> by the given mxPoint and returnt the snapped point.
getDeltaRounds to pixels for virtual states (eg.
getGuideColorReturns the color for the given state.
hideHides all current guides.
setVisibleShows or hides the current guides.
destroyDestroys all resources that this object uses.

Functions

mxGuide

function mxGuide(graph,
states)

Constructs a new guide object.

Variables

graph

mxGuide.prototype.graph

Reference to the enclosing mxGraph instance.

states

mxGuide.prototype.states

Contains the mxCellStates that are used for alignment.

horizontal

mxGuide.prototype.horizontal

Specifies if horizontal guides are enabled.  Default is true.

vertical

mxGuide.prototype.vertical

Specifies if vertical guides are enabled.  Default is true.

guideX

mxGuide.prototype.guideX

Holds the mxShape for the horizontal guide.

guideY

mxGuide.prototype.guideY

Holds the mxShape for the vertical guide.

rounded

mxGuide.prototype.rounded

Specifies if rounded coordinates should be used.  Default is false.

tolerance

mxGuide.prototype.tolerance

Default tolerance in px if grid is disabled.  Default is 2.

Functions

setStates

mxGuide.prototype.setStates = function(states)

Sets the mxCellStates that should be used for alignment.

isEnabledForEvent

mxGuide.prototype.isEnabledForEvent = function(evt)

Returns true if the guide should be enabled for the given native event.  This implementation always returns true.

getGuideTolerance

mxGuide.prototype.getGuideTolerance = function(gridEnabled)

Returns the tolerance for the guides.  Default value is gridSize / 2.

createGuideShape

mxGuide.prototype.createGuideShape = function(horizontal)

Returns the mxShape to be used for painting the respective guide.  This implementation returns a new, dashed and crisp mxPolyline using mxConstants.GUIDE_COLOR and mxConstants.GUIDE_STROKEWIDTH as the format.

Parameters

horizontalBoolean that specifies which guide should be created.

isStateIgnored

mxGuide.prototype.isStateIgnored = function(state)

Returns true if the given state should be ignored.

move

mxGuide.prototype.move = function(bounds,
delta,
gridEnabled,
clone)

Moves the <bounds> by the given mxPoint and returnt the snapped point.

getDelta

mxGuide.prototype.getDelta = function(bounds,
stateX,
dx,
stateY,
dy)

Rounds to pixels for virtual states (eg. page guides)

getGuideColor

mxGuide.prototype.getGuideColor = function(state,
horizontal)

Returns the color for the given state.

hide

mxGuide.prototype.hide = function()

Hides all current guides.

setVisible

mxGuide.prototype.setVisible = function(visible)

Shows or hides the current guides.

destroy

mxGuide.prototype.destroy = function()

Destroys all resources that this object uses.

function mxGuide(graph,
states)
Constructs a new guide object.
mxGuide.prototype.graph
Reference to the enclosing mxGraph instance.
Extends mxEventSource to implement a graph component for the browser.
mxGuide.prototype.states
Contains the mxCellStates that are used for alignment.
Represents the current state of a cell in a given mxGraphView.
mxGuide.prototype.horizontal
Specifies if horizontal guides are enabled.
mxGuide.prototype.vertical
Specifies if vertical guides are enabled.
mxGuide.prototype.guideX
Holds the mxShape for the horizontal guide.
Base class for all shapes.
mxGuide.prototype.guideY
Holds the mxShape for the vertical guide.
mxGuide.prototype.rounded
Specifies if rounded coordinates should be used.
mxGuide.prototype.tolerance
Default tolerance in px if grid is disabled.
mxGuide.prototype.setStates = function(states)
Sets the mxCellStates that should be used for alignment.
mxGuide.prototype.isEnabledForEvent = function(evt)
Returns true if the guide should be enabled for the given native event.
mxGuide.prototype.getGuideTolerance = function(gridEnabled)
Returns the tolerance for the guides.
mxGuide.prototype.createGuideShape = function(horizontal)
Returns the mxShape to be used for painting the respective guide.
mxGuide.prototype.isStateIgnored = function(state)
Returns true if the given state should be ignored.
mxGuide.prototype.move = function(bounds,
delta,
gridEnabled,
clone)
Moves the bounds by the given mxPoint and returnt the snapped point.
Implements a 2-dimensional vector with double precision coordinates.
mxGuide.prototype.getDelta = function(bounds,
stateX,
dx,
stateY,
dy)
Rounds to pixels for virtual states (eg.
mxGuide.prototype.getGuideColor = function(state,
horizontal)
Returns the color for the given state.
mxGuide.prototype.hide = function()
Hides all current guides.
mxGuide.prototype.setVisible = function(visible)
Shows or hides the current guides.
mxGuide.prototype.destroy = function()
Destroys all resources that this object uses.
Extends mxShape to implement a polyline (a line with multiple points).
GUIDE_COLOR: '#FF0000'
Defines the color to be used for the guidelines in mxGraphHandler.
GUIDE_STROKEWIDTH: 1
Defines the strokewidth to be used for the guidelines in mxGraphHandler.
Close