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.
verticalHolds the mxShape for the horizontal guide.
verticalHolds the mxShape for the vertical guide.
roundedSpecifies if rounded coordinates should be used.
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.
hideHides all current guides.
hideHides all current guides.
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.

vertical

Holds the mxShape for the horizontal guide.

vertical

Holds the mxShape for the vertical guide.

rounded

mxGuide.prototype.rounded

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

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()

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.

hide

Hides all current guides.

hide

Hides all current guides.

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.
Base class for all shapes.
mxGuide.prototype.rounded
Specifies if rounded coordinates should be used.
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()
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.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