diff --git a/ChangeLog b/ChangeLog
index 57c49c216..ffc8390cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+20-JUL-2019: 4.0.4
+
+- Moved PHP code to own repo
+- Adds DPI support in advanced dialog
+
26-JUL-2019: 4.0.3
- Reverts forcing quotes around font names in CSS and SVG
diff --git a/docs/js-api/files/index-txt.html b/docs/js-api/files/index-txt.html
index 75c789d03..52ecba419 100644
--- a/docs/js-api/files/index-txt.html
+++ b/docs/js-api/files/index-txt.html
@@ -55,7 +55,7 @@ HideAllBut([1], 13);// -->
-
Bootstrapping mechanism for the mxGraph thin client.
VERSION: '4.0.3'
Contains the current version of the mxGraph library.
Extends mxEventSource to implement a application wrapper for a graph that adds actions, I/O using mxCodec, auto-layout using mxLayoutManager, command history using undoManager, and standard dialogs and widgets, eg.
Extends mxEventSource to implement a graph component for the browser.
Extends mxEventSource to implement a graph model.
Cells are the elements of the graph model.
Extends mxEventSource to implement a view for a graph.
Renders cells into a document object model.
Defines the appearance of the cells in a graph.
Implements a command history.
Extends mxEventSource to implement a graph overlay, represented by an icon and a tooltip.
Defines invalid connections along with the error messages that they produce.
Event handler that selects rectangular regions.
Graph event handler that displays tooltips.
Graph event handler that handles selection.
Extends mxGraphLayout to implement a compact tree (Moen) algorithm.
Base class for all shapes.
Singleton that implements a clipboard for graph cells.
Defines various global constants.
Cross-browser DOM event support.
A singleton class that provides cross-browser helper methods.
Implements internationalization.
A singleton class that implements a simple console.
Generic codec for JavaScript objects that implements a mapping between JavaScript objects and XML nodes that maps each field or element to an attribute or child node, and vice versa.
XML codec for JavaScript object graphs.
Singleton class that acts as a global registry for codecs.
The mxEventObject is a wrapper for all properties of a single event.
Base class for objects that dispatch named events.
Base class for all mouse events in mxGraph.
mxEventSource.prototype.fireEvent = function(
evt,
sender
)
Dispatches the given event to the listeners which are registered for the event.
mxEventSource.prototype.addListener = function(
name,
funct
)
Binds the specified function to the given event name.
Removes all occurrences of the given listener from eventListeners.
mxGraph.prototype.fireMouseEvent = function(
evtName,
me,
sender
)
Dispatches the given event in the graph event dispatch loop.
mxGraph.prototype.addMouseListener = function(
listener
)
Adds a listener to the graph event dispatch loop.
mxGraph.prototype.removeMouseListener = function(
listener
)
Removes the specified graph listener.
Basepath for all URLs in the core without trailing slash.
Basepath for all images URLs in the core without trailing slash.
Defines the language of the client, eg.
Defines the default language which is used in the common resource files.
include: function(
src
)
Dynamically adds a script node to the document header.
eval: function(
expr
)
Evaluates the given expression using eval and returns the JavaScript object that represents the expression result.
mxGraph.prototype.setCellWarning = function(
cell,
warning,
img,
isSelect
)
Creates an overlay for the given cell using the warning and image or warningImage and returns the new mxCellOverlay.
mxGraph.prototype.warningImage
Specifies the mxImage for the image to be used to display a warning overlay.
+
Bootstrapping mechanism for the mxGraph thin client.
VERSION: '4.0.4'
Contains the current version of the mxGraph library.
Extends mxEventSource to implement a application wrapper for a graph that adds actions, I/O using mxCodec, auto-layout using mxLayoutManager, command history using undoManager, and standard dialogs and widgets, eg.
Extends mxEventSource to implement a graph component for the browser.
Extends mxEventSource to implement a graph model.
Cells are the elements of the graph model.
Extends mxEventSource to implement a view for a graph.
Renders cells into a document object model.
Defines the appearance of the cells in a graph.
Implements a command history.
Extends mxEventSource to implement a graph overlay, represented by an icon and a tooltip.
Defines invalid connections along with the error messages that they produce.
Event handler that selects rectangular regions.
Graph event handler that displays tooltips.
Graph event handler that handles selection.
Extends mxGraphLayout to implement a compact tree (Moen) algorithm.
Base class for all shapes.
Singleton that implements a clipboard for graph cells.
Defines various global constants.
Cross-browser DOM event support.
A singleton class that provides cross-browser helper methods.
Implements internationalization.
A singleton class that implements a simple console.
Generic codec for JavaScript objects that implements a mapping between JavaScript objects and XML nodes that maps each field or element to an attribute or child node, and vice versa.
XML codec for JavaScript object graphs.
Singleton class that acts as a global registry for codecs.
The mxEventObject is a wrapper for all properties of a single event.
Base class for objects that dispatch named events.
Base class for all mouse events in mxGraph.
mxEventSource.prototype.fireEvent = function(
evt,
sender
)
Dispatches the given event to the listeners which are registered for the event.
mxEventSource.prototype.addListener = function(
name,
funct
)
Binds the specified function to the given event name.
IS_TOUCH: 'ontouchstart' in document.documentElement
True if this device supports touchstart/-move/-end events (Apple iOS, Android, Chromebook and Chrome Browser on touch-enabled devices).
IS_POINTER: window.PointerEvent !
True if this device supports Microsoft pointer events (always false on Macs).
defaultBundles: []
Contains the base names of the default bundles if mxLoadResources is false.
isBrowserSupported: function()
Returns true if the current browser is supported, that is, if mxClient.IS_VML or mxClient.IS_SVG is true.
link: function(
rel,
href,
doc,
id
)
Adds a link node to the head of the document.
loadResources: function(
fn,
lan
)
Helper method to load the default bundles if mxLoadResources is false.
include: function(
src
)
Dynamically adds a script node to the document header.
Extends mxEventSource to implement a graph component for the browser.
Extends mxEventSource to implement a application wrapper for a graph that adds actions, I/O using mxCodec, auto-layout using mxLayoutManager, command history using undoManager, and standard dialogs and widgets, eg.
add: function(
basename,
lan,
callback
)
Adds the default and current language properties file for the specified basename.
Basepath for all URLs in the core without trailing slash.
getSpecialBundle: function(
basename,
lan
)
Hook for subclassers to return the URL for the special bundle.
mxEditor.prototype.askZoomResource
Specifies the resource key for the zoom dialog.
mxEditor.prototype.lastSavedResource
Specifies the resource key for the last saved info.
mxEditor.prototype.currentFileResource
Specifies the resource key for the current file info.
mxEditor.prototype.propertiesResource
Specifies the resource key for the properties window title.
mxEditor.prototype.tasksResource
Specifies the resource key for the tasks window title.
mxEditor.prototype.helpResource
Specifies the resource key for the help window title.
mxEditor.prototype.outlineResource
Specifies the resource key for the outline window title.
IS_TOUCH: 'ontouchstart' in document.documentElement
True if this device supports touchstart/-move/-end events (Apple iOS, Android, Chromebook and Chrome Browser on touch-enabled devices).
IS_POINTER: window.PointerEvent !
True if this device supports Microsoft pointer events (always false on Macs).
defaultBundles: []
Contains the base names of the default bundles if mxLoadResources is false.
isBrowserSupported: function()
Returns true if the current browser is supported, that is, if mxClient.IS_VML or mxClient.IS_SVG is true.
link: function(
rel,
href,
doc,
id
)
Adds a link node to the head of the document.
loadResources: function(
fn,
lan
)
Helper method to load the default bundles if mxLoadResources is false.
include: function(
src
)
Dynamically adds a script node to the document header.
Extends mxEventSource to implement a graph component for the browser.
Extends mxEventSource to implement a application wrapper for a graph that adds actions, I/O using mxCodec, auto-layout using mxLayoutManager, command history using undoManager, and standard dialogs and widgets, eg.
add: function(
basename,
lan,
callback
)
Adds the default and current language properties file for the specified basename.
Basepath for all URLs in the core without trailing slash.
getSpecialBundle: function(
basename,
lan
)
Hook for subclassers to return the URL for the special bundle.
mxEditor.prototype.askZoomResource
Specifies the resource key for the zoom dialog.
mxEditor.prototype.lastSavedResource
Specifies the resource key for the last saved info.
mxEditor.prototype.currentFileResource
Specifies the resource key for the current file info.
mxEditor.prototype.propertiesResource
Specifies the resource key for the properties window title.
mxEditor.prototype.tasksResource
Specifies the resource key for the tasks window title.
mxEditor.prototype.helpResource
Specifies the resource key for the help window title.
mxEditor.prototype.outlineResource
Specifies the resource key for the outline window title.
Inner callback to update the user object of the given mxCell using mxCell.valueChanged and return the previous value, that is, the return value of mxCell.valueChanged.
values: []
Maps from strings to objects.
VERSION: '4.0.3'
Contains the current version of the mxGraph library.
mxCell.prototype.vertex
Specifies whether the cell is a vertex.
VERTEX_SELECTION_COLOR: '#00FF00'
Defines the color to be used for the selection border of vertices.
VERTEX_SELECTION_STROKEWIDTH: 1
Defines the strokewidth to be used for vertex selections.
mxFastOrganicLayout.prototype.vertexArray
An array of all vertices to be laid out.
mxGraph.prototype.vertexLabelsMovable
Specifies the return value for vertices in isLabelMovable.
Inner callback to update the visible state of the given mxCell using mxCell.setCollapsed and return the previous visible state.
mxCellState.prototype.visibleTargetState
Caches the visible target terminal state.
mxDictionary.prototype.visit = function(
visitor
)
Visits all entries in the dictionary using the given function with the following signature: function(key, value) where key is a string and value is an object.
mxGraphHierarchyModel.prototype.visit = function(
visitor,
dfsRoots,
trackAncestors,
seenNodes
)
A depth first search through the internal heirarchy model.
mxSwimlaneModel.prototype.visit = function(
visitor,
dfsRoots,
trackAncestors,
seenNodes
)
A depth first search through the internal heirarchy model.
mxCompactTreeLayout.prototype.visited
Specifies if the tree should be moved to the top, left corner if it is inside a top-level layer.
WeightedCellSorter.prototype.visited
Whether or not this cell has been visited in the current assignment.
VML_PREFIX: 'v'
Prefix for VML namespace in node names.
VML_SHADOWCOLOR: 'gray'
Used for shadow color in filters where transparency is not supported (Microsoft Internet Explorer).
mxDoubleEllipse.prototype.vmlScale
Scale for improving the precision of VML rendering.
mxShape.prototype.vmlScale
Scale for improving the precision of VML rendering.
mxVmlCanvas2D.prototype.vmlScale
Specifies the scale used to draw VML shapes.
+
VALID_COLOR: '#00FF00'
Defines the color to be used for the coloring valid connection previews.
mxGraphView.prototype.validate = function(
cell
)
Calls validateCell and validateCellState and updates the graphBounds using getBoundingBox.
Inner callback to update the user object of the given mxCell using mxCell.valueChanged and return the previous value, that is, the return value of mxCell.valueChanged.
values: []
Maps from strings to objects.
VERSION: '4.0.4'
Contains the current version of the mxGraph library.
mxCell.prototype.vertex
Specifies whether the cell is a vertex.
VERTEX_SELECTION_COLOR: '#00FF00'
Defines the color to be used for the selection border of vertices.
VERTEX_SELECTION_STROKEWIDTH: 1
Defines the strokewidth to be used for vertex selections.
mxFastOrganicLayout.prototype.vertexArray
An array of all vertices to be laid out.
mxGraph.prototype.vertexLabelsMovable
Specifies the return value for vertices in isLabelMovable.
Inner callback to update the visible state of the given mxCell using mxCell.setCollapsed and return the previous visible state.
mxCellState.prototype.visibleTargetState
Caches the visible target terminal state.
mxDictionary.prototype.visit = function(
visitor
)
Visits all entries in the dictionary using the given function with the following signature: function(key, value) where key is a string and value is an object.
mxGraphHierarchyModel.prototype.visit = function(
visitor,
dfsRoots,
trackAncestors,
seenNodes
)
A depth first search through the internal heirarchy model.
mxSwimlaneModel.prototype.visit = function(
visitor,
dfsRoots,
trackAncestors,
seenNodes
)
A depth first search through the internal heirarchy model.
mxCompactTreeLayout.prototype.visited
Specifies if the tree should be moved to the top, left corner if it is inside a top-level layer.
WeightedCellSorter.prototype.visited
Whether or not this cell has been visited in the current assignment.
VML_PREFIX: 'v'
Prefix for VML namespace in node names.
VML_SHADOWCOLOR: 'gray'
Used for shadow color in filters where transparency is not supported (Microsoft Internet Explorer).
mxDoubleEllipse.prototype.vmlScale
Scale for improving the precision of VML rendering.
mxShape.prototype.vmlScale
Scale for improving the precision of VML rendering.
mxVmlCanvas2D.prototype.vmlScale
Specifies the scale used to draw VML shapes.
diff --git a/docs/js-api/index/Variables16.html b/docs/js-api/index/Variables16.html
index da1285cd0..2ebd5ce11 100644
--- a/docs/js-api/index/Variables16.html
+++ b/docs/js-api/index/Variables16.html
@@ -17,7 +17,7 @@ if (browserType) {document.write("
");if (browserV
-
VALID_COLOR: '#00FF00'
Defines the color to be used for the coloring valid connection previews.
mxEditor.prototype.validating
Specifies if mxGraph.validateGraph should automatically be invoked after each change.
mxCellMarker.prototype.validColor
Holds the valid marker color.
mxMultiplicity.prototype.validNeighbors
Holds an array of strings that specify the type of neighbor for which this rule applies.
mxMultiplicity.prototype.validNeighborsAllowed
Boolean indicating if the list of validNeighbors are those that are allowed for this rule or those that are not allowed for this rule.
mxCellMarker.prototype.validState
Holds the marked mxCellState if it is valid.
mxCell.prototype.value
Holds the user object.
mxMultiplicity.prototype.value
Optional string that specifies the value of the attribute to be passed to mxUtils.isNode to check if the rule applies to a cell.
values: []
Maps from strings to objects.
VERSION: '4.0.3'
Contains the current version of the mxGraph library.
mxCell.prototype.vertex
Specifies whether the cell is a vertex.
VERTEX_SELECTION_COLOR: '#00FF00'
Defines the color to be used for the selection border of vertices.
VERTEX_SELECTION_STROKEWIDTH: 1
Defines the strokewidth to be used for vertex selections.
mxFastOrganicLayout.prototype.vertexArray
An array of all vertices to be laid out.
mxGraph.prototype.vertexLabelsMovable
Specifies the return value for vertices in isLabelMovable.
mxGraphHierarchyModel.prototype.vertexMapper
Map from graph vertices to internal model nodes.
mxSwimlaneModel.prototype.vertexMapper
Map from graph vertices to internal model nodes.
mxGuide.prototype.vertical
Specifies if vertical guides are enabled.
mxCellOverlay.prototype.verticalAlign
Holds the vertical alignment for the overlay.
mxVertexHandler.prototype.verticalOffset
The horizontal offset for the handles.
mxText.prototype.verticalTextRotation
Rotation for vertical text.
mxCellState.prototype.view
Reference to the enclosing mxGraphView.
mxGraph.prototype.view
Holds the mxGraphView that caches the mxCellStates for the cells.
mxTemporaryCellStates.prototype.view
Holds the width of the rectangle.
VIRTUAL_HANDLE: -100000
Start index for the virtual handles in an mxMouseEvent.
mxEdgeHandler.prototype.virtualBendOpacity
Opacity to be used for virtual bends (see virtualBendsEnabled).
mxEdgeHandler.prototype.virtualBendsEnabled
Specifies if virtual bends should be added in the center of each segments.
mxCell.prototype.visible
Specifies whether the cell is visible.
mxShape.prototype.visible
Specifies if the shape is visible.
mxWindow.prototype.visible
Boolean flag that represents the visible state of the window.
mxCellState.prototype.visibleSourceState
Caches the visible source terminal state.
mxCellState.prototype.visibleTargetState
Caches the visible target terminal state.
mxCompactTreeLayout.prototype.visited
Specifies if the tree should be moved to the top, left corner if it is inside a top-level layer.
WeightedCellSorter.prototype.visited
Whether or not this cell has been visited in the current assignment.
VML_PREFIX: 'v'
Prefix for VML namespace in node names.
VML_SHADOWCOLOR: 'gray'
Used for shadow color in filters where transparency is not supported (Microsoft Internet Explorer).
mxDoubleEllipse.prototype.vmlScale
Scale for improving the precision of VML rendering.
mxShape.prototype.vmlScale
Scale for improving the precision of VML rendering.
mxVmlCanvas2D.prototype.vmlScale
Specifies the scale used to draw VML shapes.
+
VALID_COLOR: '#00FF00'
Defines the color to be used for the coloring valid connection previews.
mxEditor.prototype.validating
Specifies if mxGraph.validateGraph should automatically be invoked after each change.
mxCellMarker.prototype.validColor
Holds the valid marker color.
mxMultiplicity.prototype.validNeighbors
Holds an array of strings that specify the type of neighbor for which this rule applies.
mxMultiplicity.prototype.validNeighborsAllowed
Boolean indicating if the list of validNeighbors are those that are allowed for this rule or those that are not allowed for this rule.
mxCellMarker.prototype.validState
Holds the marked mxCellState if it is valid.
mxCell.prototype.value
Holds the user object.
mxMultiplicity.prototype.value
Optional string that specifies the value of the attribute to be passed to mxUtils.isNode to check if the rule applies to a cell.
values: []
Maps from strings to objects.
VERSION: '4.0.4'
Contains the current version of the mxGraph library.
mxCell.prototype.vertex
Specifies whether the cell is a vertex.
VERTEX_SELECTION_COLOR: '#00FF00'
Defines the color to be used for the selection border of vertices.
VERTEX_SELECTION_STROKEWIDTH: 1
Defines the strokewidth to be used for vertex selections.
mxFastOrganicLayout.prototype.vertexArray
An array of all vertices to be laid out.
mxGraph.prototype.vertexLabelsMovable
Specifies the return value for vertices in isLabelMovable.
mxGraphHierarchyModel.prototype.vertexMapper
Map from graph vertices to internal model nodes.
mxSwimlaneModel.prototype.vertexMapper
Map from graph vertices to internal model nodes.
mxGuide.prototype.vertical
Specifies if vertical guides are enabled.
mxCellOverlay.prototype.verticalAlign
Holds the vertical alignment for the overlay.
mxVertexHandler.prototype.verticalOffset
The horizontal offset for the handles.
mxText.prototype.verticalTextRotation
Rotation for vertical text.
mxCellState.prototype.view
Reference to the enclosing mxGraphView.
mxGraph.prototype.view
Holds the mxGraphView that caches the mxCellStates for the cells.
mxTemporaryCellStates.prototype.view
Holds the width of the rectangle.
VIRTUAL_HANDLE: -100000
Start index for the virtual handles in an mxMouseEvent.
mxEdgeHandler.prototype.virtualBendOpacity
Opacity to be used for virtual bends (see virtualBendsEnabled).
mxEdgeHandler.prototype.virtualBendsEnabled
Specifies if virtual bends should be added in the center of each segments.
mxCell.prototype.visible
Specifies whether the cell is visible.
mxShape.prototype.visible
Specifies if the shape is visible.
mxWindow.prototype.visible
Boolean flag that represents the visible state of the window.
mxCellState.prototype.visibleSourceState
Caches the visible source terminal state.
mxCellState.prototype.visibleTargetState
Caches the visible target terminal state.
mxCompactTreeLayout.prototype.visited
Specifies if the tree should be moved to the top, left corner if it is inside a top-level layer.
WeightedCellSorter.prototype.visited
Whether or not this cell has been visited in the current assignment.
VML_PREFIX: 'v'
Prefix for VML namespace in node names.
VML_SHADOWCOLOR: 'gray'
Used for shadow color in filters where transparency is not supported (Microsoft Internet Explorer).
mxDoubleEllipse.prototype.vmlScale
Scale for improving the precision of VML rendering.
mxShape.prototype.vmlScale
Scale for improving the precision of VML rendering.
All rights reserved. No part of this publication may be
diff --git a/docs/manual_javavis.html b/docs/manual_javavis.html
index 007114f4c..bbc9df10d 100644
--- a/docs/manual_javavis.html
+++ b/docs/manual_javavis.html
@@ -9,7 +9,7 @@
JGraphX (JGraph 6) User Manual
-
JGraphX Version 4.0.3 – 26. July 2019
+
JGraphX Version 4.0.4 – 20. August 2019
Copyright (c) JGraph Ltd 2006-2017
All rights reserved. No part of this publication may be
diff --git a/docs/php-api/files/canvas/mxGdCanvas-php.html b/docs/php-api/files/canvas/mxGdCanvas-php.html
deleted file mode 100644
index 2e72975c6..000000000
--- a/docs/php-api/files/canvas/mxGdCanvas-php.html
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
Specifies if image aspect should be preserved in drawImage. Default is true.
-
-
mxGdCanvas
Canvas for drawing graphs using the GD library. This class requires GD support (GDLib). Note that rounded corners, gradients and word wrapping are not supported by GD.
Constructs a new GD canvas. Use a HTML color definition for the optional background parameter, eg. white or #FFFFFF. The buffered image is only created if the given width and height are greater than 0.
-
-
loadImage
function loadImage(
$image
)
Returns an image instance for the given URL. If the URL has been loaded before than an instance of the same instance is returned as in the previous call.
-
-
drawCell
function drawCell(
$state
)
Draws the given cell state.
-
-
drawLabel
function drawLabel(
$text,
$state,
$html
=
false
)
Draws the given label.
-
-
drawMarker
function drawMarker(
$type,
$p0,
$pe,
$size,
$stroke
)
Draws the specified marker.
-
-
getImage
function getImage()
Returns an image that represents this canvas.
-
-
setImage
function setImage(
$img
)
Sets the image that represents the canvas.
-
-
getImageForStyle
function getImageForStyle(
$style
)
Returns an image that represents this canvas.
-
-
drawLine
function drawLine(
$x0,
$y0,
$x1,
$y1,
$stroke
=
null,
$dashed
=
false
)
Draws the given line.
-
-
drawShape
function drawShape(
$x,
$y,
$w,
$h,
$style
)
Draws the given shape.
-
-
drawPolygon
function drawPolygon(
$points,
$fill
=
null,
$stroke
=
null,
$shadow
=
false
)
Draws the given polygon.
-
-
drawRect
function drawRect(
$x,
$y,
$w,
$h,
$fill
=
null,
$stroke
=
null,
$shadow
=
false,
$rounded
=
false,
$dashed
=
false
)
Draws then given rectangle. Rounded is currently ignored.
-
-
drawOval
function drawOval(
$x,
$y,
$w,
$h,
$fill
=
null,
$stroke
=
null,
$shadow
=
false
)
Draws then given ellipse.
-
-
drawRhombus
function drawRhombus(
$x,
$y,
$w,
$h,
$fill
=
null,
$stroke
=
null,
$shadow
=
false
)
Draws then given rhombus.
-
-
drawTriangle
function drawTriangle(
$x,
$y,
$w,
$h,
$fill
=
null,
$stroke
=
null,
$shadow
=
false,
$direction
=
null
)
Draws then given triangle.
-
-
drawHexagon
function drawHexagon(
$x,
$y,
$w,
$h,
$fill
=
null,
$stroke
=
null,
$shadow
=
false,
$direction
=
null
)
Draws then given haxagon.
-
-
drawCylinder
function drawCylinder(
$x,
$y,
$w,
$h,
$fill
=
null,
$stroke
=
null,
$shadow
=
false
)
Draws then given cylinder.
-
-
drawCloud
function drawCloud(
$x,
$y,
$w,
$h,
$fill
=
null,
$stroke
=
null,
$shadow
=
false
)
Draws then given cloud.
-
-
drawActor
function drawActor(
$x,
$y,
$w,
$h,
$fill
=
null,
$stroke
=
null,
$shadow
=
false
)
Draws then given cloud.
-
-
drawImage
function drawImage(
$x,
$y,
$w,
$h,
$image,
$aspect
=
true,
$flipH
=
false,
$flipV
=
false
)
Draws a given image.
-
-
drawText
function drawText(
$string,
$x,
$y,
$w,
$h,
$style
)
-
-
getTrueTypeFont
function getTrueTypeFont(
$style
)
Returns the truetype font to be used to draw the text with the given style.
-
-
getTrueTypeFontSize
function getTrueTypeFontSize(
$style
)
Returns the truetype font size to be used to draw the text with the given style. This returns the fontSize in the style of the default fontsize multiplied with <ttfSizeFactor>.
-
-
drawTtfText
function drawTtfText(
$string,
$x,
$y,
$w,
$h,
$style
)
-
-
drawTtxTextLine
Draws a single line of the given true type font text. The w and h are the width and height of the complete text box that contains this line.
-
-
getFixedFontSize
function getFixedFontSize(
$fontSize,
$fontFamily,
$fontStyle
=
null
)
Returns the fixed font size for GD (1 t0 5) for the given font properties
-
-
drawString
-
-
drawFixedTextLine
function drawFixedTextLine(
$text,
$font,
$left,
$top,
$color,
$horizontal
=
true
)
Draws the given fixed text line.
-
-
getColor
function getColor(
$hex,
$default
=
null
)
Allocates the given color and returns a reference to it. Supported color names are black, red, green, blue, orange, yellow, pink, turqoise, white, gray and any hex codes between 000000 and FFFFFF.
-
-
offset
function offset(
$points,
$dx
=
null,
$dy
=
null
)
Creates a new array of x, y sequences where the each coordinate is translated by dx and dy, respectively.
-
-
-
\ No newline at end of file
diff --git a/docs/php-api/files/index-txt.html b/docs/php-api/files/index-txt.html
deleted file mode 100644
index 390bae5cd..000000000
--- a/docs/php-api/files/index-txt.html
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-API Specification
-
-
-
-
-
-
-
-
-
-
API Specification
Overview
This PHP library is divided into 4 packages. The top-level <mxServer> class dynamically includes everything else.
The view and model packages implement the graph component, represented by mxGraph. It refers to a mxGraphModel which contains mxCells and caches the state of the cells in a mxGraphView. The cells are painted using a <mxCanvas> based on the appearance defined in mxStylesheet.
The io package implements a generic mxObjectCodec for turning PHP objects into XML. The main class is mxCodec. mxCodecRegistry is the global registry for custom codecs.
Requirements
The I/O module requires libxml support. The mxGdCanvas requires GD support.
Constructs a new codec for the specified template object.
-
-
Functions
-
-
mxObjectCodec
Constructs a new codec for the specified template object. The variables in the optional exclude array are ignored by the codec. Variables in the optional idrefs array are turned into references in the XML. The optional mapping may be used to map from variable names to XML attributes.
Parameters
template
Prototypical instance of the object to be encoded/decoded.
exclude
Optional array of fieldnames to be ignored.
idrefs
Optional array of fieldnames to be converted to/from references.
-
-
-
\ No newline at end of file
diff --git a/docs/php-api/files/io/mxCodec-php.html b/docs/php-api/files/io/mxCodec-php.html
deleted file mode 100644
index 6403b358d..000000000
--- a/docs/php-api/files/io/mxCodec-php.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-mxCodec
-
-
-
-
-
-
-
-
-
-
mxCodec
XML codec for PHP object graphs. In order to resolve forward references when reading files the XML document that contains the data must be passed to the constructor.
Encoding of cell hierarchies is built-into the core, but is a higher-level function that needs to be explicitely used by the respective object encoders (eg.
Sets the attribute on the specified node to value.
-
-
Variables
-
-
document
var $document
The owner document of the codec.
-
-
objects
var $objects
Maps from IDs to objects.
-
-
elements
var $elements
Maps from IDs to elements.
-
-
encodeDefaults
var $encodeDefaults
Specifies if default values should be encoded. Default is false.
-
-
Functions
-
-
mxGraphViewHtmlReader
Constructs a new HTML graph view reader.
-
-
putObject
function putObject(
$id,
$object
)
Assoiates the given object with the given ID.
Parameters
id
ID for the object to be associated with.
obj
Object to be associated with the ID.
-
-
getObject
function getObject(
$id
)
Returns the decoded object for the element with the specified ID in document. If the object is not known then lookup is used to find an object. If no object is found, then the element with the respective ID from the document is parsed using decode.
-
-
lookup
function lookup(
$id
)
Hook for subclassers to implement a custom lookup mechanism for cell IDs. This implementation always returns null.
Parameters
id
ID of the object to be returned.
-
-
getElementById
function getElementById(
$id
)
Returns the element with the given ID from document.
Parameters
id
String that contains the ID.
-
-
addElement
function addElement(
$node
)
Adds the given element to elements if it has an ID.
-
-
getId
function getId(
$obj
)
Returns the ID of the specified object. This implementation calls reference first and if that returns null handles the object as an mxCell by returning their IDs using mxCell.getId. If no ID exists for the given cell, then an on-the-fly ID is generated using mxCellPath.create.
Parameters
obj
Object to return the ID for.
-
-
reference
function reference(
$obj
)
Hook for subclassers to implement a custom method for retrieving IDs from objects. This implementation always returns null.
Parameters
obj
Object whose ID should be returned.
-
-
encode
function encode(
$obj
)
Encodes the specified object and returns the resulting XML node.
Parameters
obj
Object to be encoded.
-
-
decode
function decode(
$node,
$into
=
null
)
Decodes the given XML node. The optional “into” argument specifies an existing object to be used. If no object is given, then a new instance is created using the constructor from the codec.
The function returns the passed in object or the new instance if no object was given.
Parameters
node
XML node to be decoded.
into
Optional object to be decodec into.
-
-
encodeCell
function encodeCell(
$cell,
$node,
$includeChildren
=
true
)
Encoding of cell hierarchies is built-into the core, but is a higher-level function that needs to be explicitely used by the respective object encoders (eg. mxModelCodec, <mxChildChangeCodec> and <mxRootChangeCodec>). This implementation writes the given cell and its children as a (flat) sequence into the given node. The children are not encoded if the optional includeChildren is false. The function is in charge of adding the result into the given node and has no return value.
Optional boolean indicating if the function should include all descendents. Default is true.
-
-
decodeCell
function decodeCell(
$node,
$restoreStructures
=
true
)
Decodes cells that have been encoded using inversion, ie. where the user object is the enclosing node in the XML, and restores the group and graph structure in the cells. Returns a new mxCell instance that represents the given node.
Parameters
node
XML node that contains the cell data.
restoreStructures
Optional boolean indicating whether the graph structure should be restored by calling insert and insertEdge on the parent and terminals, respectively. Default is true.
-
-
insertIntoGraph
function insertIntoGraph(
$cell
)
Inserts the given cell into its parent and terminal cells.
-
-
setAttribute
function setAttribute(
$node,
$attribute,
$value
)
Sets the attribute on the specified node to value. This is a helper method that makes sure the attribute and value arguments are not null.
Returns the decoded object for the element with the specified ID in document.
function lookup(
$id
)
Hook for subclassers to implement a custom lookup mechanism for cell IDs.
function getElementById(
$id
)
Returns the element with the given ID from document.
function addElement(
$node
)
Adds the given element to elements if it has an ID.
function getId(
$obj
)
Returns the ID of the specified object.
function reference(
$obj
)
Hook for subclassers to implement a custom method for retrieving IDs from objects.
function encode(
$obj
)
Encodes the specified object and returns the resulting XML node.
function decode(
$node,
$into
=
null
)
Decodes the given XML node.
function encodeCell(
$cell,
$node,
$includeChildren
=
true
)
Encoding of cell hierarchies is built-into the core, but is a higher-level function that needs to be explicitely used by the respective object encoders (eg.
function decodeCell(
$node,
$restoreStructures
=
true
)
Decodes cells that have been encoded using inversion, ie.
function insertIntoGraph(
$cell
)
Inserts the given cell into its parent and terminal cells.
function setAttribute(
$node,
$attribute,
$value
)
Sets the attribute on the specified node to value.
Returns the codec name for the given object instance.
-
-
Variables
-
-
codecs
public static $codecs
Maps from constructor names to codecs.
-
-
aliases
public static $aliases
Maps from classnames to codecnames.
-
-
Functions
-
-
register
static function register(
$codec
)
Registers a new codec and associates the name of the template constructor in the codec with the codec object. Automatically creates an alias if the codename and the classname are not equal.
Constructs a new codec for the specified template object.
-
-
Functions
-
-
mxObjectCodec
Constructs a new codec for the specified template object. The variables in the optional exclude array are ignored by the codec. Variables in the optional idrefs array are turned into references in the XML. The optional mapping may be used to map from variable names to XML attributes.
Parameters
template
Prototypical instance of the object to be encoded/decoded.
exclude
Optional array of fieldnames to be ignored.
idrefs
Optional array of fieldnames to be converted to/from references.
Hook for subclassers to post-process the object after decoding.
-
-
Variables
-
-
template
var $template
Holds the template object associated with this codec.
-
-
exclude
var $exclude
Array containing the variable names that should be ignored by the codec.
-
-
idrefs
var $idrefs
Array containing the variable names that should be turned into or converted from references. See mxCodec.getId and mxCodec.getObject.
-
-
mapping
var $mapping
Maps from from fieldnames to XML attribute names.
-
-
reverse
var $reverse
Maps from from XML attribute names to fieldnames.
-
-
Functions
-
-
mxObjectCodec
function mxObjectCodec(
$template,
$exclude
=
array(),
$idrefs
=
array(),
$mapping
=
array()
)
Constructs a new codec for the specified template object. The variables in the optional exclude array are ignored by the codec. Variables in the optional idrefs array are turned into references in the XML. The optional mapping may be used to map from variable names to XML attributes.
Parameters
template
Prototypical instance of the object to be encoded/decoded.
exclude
Optional array of fieldnames to be ignored.
idrefs
Optional array of fieldnames to be converted to/from references.
mapping
Optional mapping from field- to attributenames.
-
-
getName
function getName()
Creates a new instance of the template for this codec.
-
-
cloneTemplate
function cloneTemplate()
Creates a new instance of the template for this codec.
-
-
getFieldName
function getFieldName(
$attributename
)
Returns the fieldname for the given attributename. Looks up the value in the reverse mapping or returns the input if there is no reverse mapping for the given name.
-
-
getAttributeName
function getAttributeName(
$fieldname
)
Returns the attributename for the given fieldname. Looks up the value in the mapping or returns the input if there is no mapping for the given name.
-
-
isExcluded
function isExcluded(
$obj,
$attr,
$value,
$write
)
Returns true if the given attribute is to be ignored by the codec. This implementation returns true if the given fieldname is in exclude or if the fieldname equals <mxObjectIdentity.FIELD_NAME>.
Parameters
obj
Object instance that contains the field.
attr
Fieldname of the field.
value
Value of the field.
write
Boolean indicating if the field is being encoded or decoded. Write is true if the field is being encoded, else it is being decoded.
-
-
isReference
function isReference(
$obj,
$attr,
$value,
$write
)
Returns true if the given fieldname is to be treated as a textual reference (ID). This implementation returns true if the given fieldname is in idrefs.
Parameters
obj
Object instance that contains the field.
attr
Fieldname of the field.
value
Value of the field.
write
Boolean indicating if the field is being encoded or decoded. Write is true if the field is being encoded, else it is being decoded.
-
-
encode
function encode(
$enc,
$obj
)
Encodes the specified object and returns a node representing then given object. Calls beforeEncode after creating the node and afterEncode with the resulting node after processing.
Enc is a reference to the calling encoder. It is used to encode complex objects and create references.
This implementation encodes all variables of an object according to the following rules:
If the variable name is in exclude then it is ignored.
If the variable name is in idrefs then mxCodec.getId is used to replace the object with its ID.
Writes the given value as an attribute of the given node.
-
-
writeComplexAttribute
function writeComplexAttribute(
$enc,
$obj,
$attr,
$value,
$node
)
Writes the given value as a child node of the given node.
-
-
convertValueToXml
function convertValueToXml(
$value
)
Returns the given value without applying a conversion.
-
-
convertValueFromXml
function convertValueFromXml(
$value
)
Returns the given value. In PHP there is no need to convert the boolean strings “0” and “1” to their numeric / boolean values.
-
-
beforeEncode
function beforeEncode(
$enc,
$obj,
$node
)
Hook for subclassers to pre-process the object before encoding. This returns the input object. The return value of this function is used in encode to perform the default encoding into the given node.
Hook for subclassers to post-process the node for the given object after encoding and return the post-processed node. This implementation returns the input node. The return value of this method is returned to the encoder from encode.
Parses the given node into the object or returns a new object representing the given node.
Dec is a reference to the calling decoder. It is used to decode complex objects and resolve references.
If a node has an id attribute then the object cache is checked for the object. If the object is not yet in the cache then it is constructed using the constructor of template and cached in mxCodec.objects.
This implementation decodes all attributes and childs of a node according to the following rules:
If the variable name is in exclude or if the attribute name is “id” or “as” then it is ignored.
If the variable name is in idrefs then mxCodec.getObject is used to replace the reference with an object.
The variable name is mapped using a reverse mapping.
If the value has a child node, then the codec is used to create a child object with the variable name taken from the “as” attribute.
If the object is an array and the variable name is empty then the value or child object is appended to the array.
If an add child has no value or the object is not an array then the child text content is evaluated using <mxUtils.eval>.
For add nodes where the object is not an array and the variable name is defined, the default mechanism is used, allowing to override/add methods as follows:
Decodes all attributes of the given node using decodeAttribute.
-
-
decodeAttribute
function decodeAttribute(
$dec,
$attr,
&
$obj
)
Reads the given attribute into the specified object.
-
-
decodeChildren
function decodeChildren(
$dec,
$node,
&
$obj
)
Decodec all children of the given node using decodeChild.
-
-
decodeChild
function decodeChild(
$dec,
$child,
&
$obj
)
Reads the specified child into the given object.
-
-
getFieldTemplate
function getFieldTemplate(
&
$obj,
$fieldname,
$child
)
Returns the template instance for the given field. This returns the value of the field, null if the value is an array or an empty collection if the value is a collection. The value is then used to populate the field for a new instance. For strongly typed languages it may be required to override this to return the correct collection instance based on the encoded child.
-
-
addObjectValue
function addObjectValue(
&
$obj,
$fieldname,
$value,
$template
)
Sets the decoded child node as a value of the given object. If the object is a map, then the value is added with the given fieldname as a key. If the fieldname is not empty, then setFieldValue is called or else, if the object is a collection, the value is added to the collection. For strongly typed languages it may be required to override this with the correct code to add an entry to an object.
-
-
processInclude
function processInclude(
$dec,
$node,
$into
)
Returns true if the given node is an include directive and executes the include by decoding the XML document. Returns false if the given node is not an include directive.
Parameters
dec
mxCodec that controls the encoding/decoding process.
node
XML node to be checked.
into
Optional object to pass-thru to the codec.
-
-
beforeDecode
function beforeDecode(
$dec,
$node,
&
$obj
)
Hook for subclassers to pre-process the node for the specified object and return the node to be used for further processing by decode. The object is created based on the template in the calling method and is never null. This implementation returns the input node. The return value of this function is used in decode to perform the default decoding into the given object.
Hook for subclassers to post-process the object after decoding. This implementation returns the given object without any changes. The return value of this method is returned to the decoder from decode.
Constructs a new codec for the specified template object.
-
-
Functions
-
-
mxObjectCodec
Constructs a new codec for the specified template object. The variables in the optional exclude array are ignored by the codec. Variables in the optional idrefs array are turned into references in the XML. The optional mapping may be used to map from variable names to XML attributes.
Parameters
template
Prototypical instance of the object to be encoded/decoded.
exclude
Optional array of fieldnames to be ignored.
idrefs
Optional array of fieldnames to be converted to/from references.
Boolean that specifies if the source terminal should be returned.
-
-
setTerminal
function setTerminal(
$terminal,
$source
)
Sets the source or target terminal and returns the new terminal.
Parameters
terminal
mxCell that represents the new source or target terminal.
source
Boolean that specifies if the source or target terminal should be set.
-
-
getChildCount
function getChildCount()
Returns the number of child cells.
-
-
getIndex
function getIndex(
$child
)
Returns the index of the specified child in the child array.
Parameters
child
Child whose index should be returned.
-
-
getChildAt
function getChildAt(
$index
)
Returns the child at the specified index.
Parameters
index
Integer that specifies the child to be returned.
-
-
insert
function insert(
$child,
$index
=
null
)
Inserts the specified child into the child array at the specified index and updates the parent reference of the child. If not childIndex is specified then the child is appended to the child array. Returns the inserted child.
Parameters
child
mxCell to be inserted or appended to the child array.
index
Optional integer that specifies the index at which the child should be inserted into the child array.
-
-
remove
function remove(
$index
)
Removes the child at the specified index from the child array and returns the child that was removed. Will remove the parent reference of the child.
Parameters
index
Integer that specifies the index of the child to be removed.
Returns the cell for the specified cell path using the given root as the root of the path.
-
-
Variables
-
-
codecs
Maps from constructor names to codecs.
-
-
Functions
-
-
create
static function create(
$cell
)
Creates the cell path for the given cell. The cell path is a concatenation of the indices of all ancestors on the (finite) path to the root, eg. “0.0.0.1”.
Parameters
cell
Cell whose path should be returned.
-
-
getParentPath
static function getParentPath(
$path
)
Returns the cell for the specified cell path using the given root as the root of the path.
Parameters
path
Path whose parent path should be returned.
-
-
resolve
static function resolve(
$root,
$path
)
Returns the cell for the specified cell path using the given root as the root of the path.
-
-
-
\ No newline at end of file
diff --git a/docs/php-api/files/model/mxGeometry-php.html b/docs/php-api/files/model/mxGeometry-php.html
deleted file mode 100644
index 49893cd72..000000000
--- a/docs/php-api/files/model/mxGeometry-php.html
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-mxGeometry
-
-
-
-
-
-
-
-
-
-
mxGeometry
Represents the geometry of a cell. For vertices, the geometry consists of the x- and y-location, as well as the width and height. For edges, the edge either defines the source- and target-terminal, or the geometry defines the respective terminal points.
Global switch to translate the points in translate. Default is true.
-
-
alternateBounds
var $alternateBounds
Stores alternate values for x, y, width and height in a rectangle. Default is null.
-
-
sourcePoint
var $sourcePoint
Defines the source point of the edge. This is used if the corresponding edge does not have a source vertex. Otherwise it is ignored. Default is null.
-
-
targetPoint
var $targetPoint
Defines the target point of the edge. This is used if the corresponding edge does not have a target vertex. Otherwise it is ignored. Default is null.
-
-
points
var $points
Array of mxPoints which specifies the control points along the edge. These points are the intermediate points on the edge, for the endpoints use targetPoint and sourcePoint or set the terminals of the edge to a non-null value. Default is null.
-
-
offset
var $offset
Holds the offset of the label for edges. This is the absolute vector between the center of the edge and the top, left point of the label. Default is null.
-
-
relative
var $relative
Specifies if the coordinates in the geometry are to be interpreted as relative coordinates. Default is false. This is used to mark a geometry with an x- and y-coordinate that is used to describe an edge label position.
-
-
Functions
-
-
mxGeometry
function mxGeometry(
$x
=
0,
$y
=
0,
$width
=
0,
$height
=
0
)
Constructs a new object to describe the size and location of a vertex or the control points of an edge.
-
-
getTerminalPoint
function getTerminalPoint(
$isSource
)
Returns the mxPoint representing the source or target point of this edge. This is only used if the edge has no source or target vertex.
Parameters
isSource
Boolean that specifies if the source or target point should be returned.
Point to be used as the new source or target point.
isSource
Boolean that specifies if the source or target point should be set.
-
-
translate
function translate(
$dx,
$dy
)
Translates the geometry by the specified amount. That is, <x> and <y> of the geometry, the sourcePoint, targetPoint and all elements of points are translated by the given amount. <x> and <y> are only translated if relative is false. If TRANSLATE_CONTROL_POINTS is false, then points are not modified by this function.
Parameters
dx
Integer that specifies the x-coordinate of the translation.
dy
Integer that specifies the y-coordinate of the translation.
Clones the children of the source cell into the given target cell in this model and adds an entry to the mapping that maps from the source cell to the target cell with the same id or the clone of the source cell that was inserted into this model.
Returns the number of incoming or outgoing edges, ignoring the given edge.
-
-
Variables
-
-
root
var $root
Holds the root cell, which in turn contains the cells that represent the layers of the diagram as child cells. That is, the actual elements of the diagram are supposed to live in the third generation of cells and below.
-
-
cells
var $cells
Maps from Ids to cells.
-
-
maintainEdgeParent
var $maintainEdgeParent
Specifies if edges should automatically be moved into the nearest common ancestor of their terminals. Default is true.
-
-
createIds
var $createIds
Specifies if the model should automatically create Ids for new cells. Default is true.
-
-
nextId
var $nextId
Specifies the next Id to be created. Default is 0.
-
-
updateLevel
var $updateLevel
Counter for the depth of nested transactions. Each call to beginUpdate will increment this number and each call to endUpdate will decrement it. When the counter reaches 0, the transaction is closed and the respective events are fired. Initial value is 0.
-
-
Functions
-
-
mxGraphModel
function mxGraphModel(
$root
=
null
)
Constructs a new graph model using the specified root cell.
Creates a new root cell with a default layer (child 0).
-
-
getCells
function getCells()
Returns the internal lookup table that is used to map from Ids to cells.
-
-
setRoot
-
-
getRoot
function getRoot()
Returns the root of the model.
-
-
setRoot
function setRoot(
$root
)
Sets the root of the model using <mxRootChange> and adds the change to the current transaction. This resets all datastructures in the model and is the preferred way of clearing an existing model. Returns the new root.
Returns an array of clones for the given array of mxCells. Depending on the value of includeChildren, a deep clone is created for each cell. Connections are restored based if the corresponding cell is contained in the passed in array.
Adds the specified child to the parent at the given index using <mxChildChange> and adds the change to the current transaction. If no index is specified then the child is appended to the parent’s array of children. Returns the inserted child.
Parameters
parent
mxCell that specifies the parent to contain the child.
mxCell that specifies the second cell in the tree.
-
-
remove
function remove(
$cell
)
Removes the specified cell from the model using <mxChildChange> and adds the change to the current transaction. This operation will remove the cell and all of its children from the model. Returns the removed cell.
Boolean indicating which end of the edge should be returned.
-
-
setTerminal
function setTerminal(
$edge,
$terminal,
$source
)
Sets the source or target terminal of the given mxCell using <mxTerminalChange> and adds the change to the current transaction. This implementation updates the parent of the edge using updateEdgeParent if required.
Returns true if the given mxCell is connectable. If <edgesConnectable> is false, then this function returns false for all edges else it returns the return value of mxCell.isConnectable.
Parameters
cell
mxCell whose connectable state should be returned.
Sets the mxGeometry of the given mxCell. The actual update of the cell is carried out in <geometryForCellChanged>. The <mxGeometryChange> action is used to encapsulate the change.
Merges the children of the given cell into the given target cell inside this model. All cells are cloned unless there is a corresponding cell in the model with the same id, in which case the source cell is ignored and all edges are connected to the corresponding cell in this model. Edges are considered to have no identity and are always cloned unless the cloneAllEdges flag is set to false, in which case edges with the same id in the target model are reconnected to reflect the terminals of the source edges.
-
-
mergeChildrenImpl
function mergeChildrenImpl(
$from,
$to,
$cloneAllEdges,
$mapping
)
Clones the children of the source cell into the given target cell in this model and adds an entry to the mapping that maps from the source cell to the target cell with the same id or the clone of the source cell that was inserted into this model.
Holds the root cell, which in turn contains the cells that represent the layers of the diagram as child cells.
var $cells
Maps from Ids to cells.
var $maintainEdgeParent
Specifies if edges should automatically be moved into the nearest common ancestor of their terminals.
var $createIds
Specifies if the model should automatically create Ids for new cells.
var $nextId
Specifies the next Id to be created.
var $updateLevel
Counter for the depth of nested transactions.
function mxGraphModel(
$root
=
null
)
Constructs a new graph model using the specified root cell.
function clear()
Sets a new root using createRoot.
function createRoot()
Creates a new root cell with a default layer (child 0).
function getCells()
Returns the internal lookup table that is used to map from Ids to cells.
function getRoot()
Returns the root of the model.
function setRoot(
$root
)
Sets the root of the model using mxRootChange and adds the change to the current transaction.
function cloneCell(
$cell
)
Returns a deep clone of the given mxCell (including the children) which is created using cloneCells.
Cells are the elements of the graph model.
function cloneCells(
$cells,
$includeChildren
=
true
)
Returns an array of clones for the given array of mxCells.
function cloneCellImpl(
$cell,
$mapping,
$includeChildren
)
Inner helper method for cloning cells recursively.
function cellCloned(
$cell
)
Hook for cloning the cell.
function restoreClone(
$clne,
$cell,
$mapping
)
Inner helper method for restoring the connections in a network of cloned cells.
function isAncestor(
$parent,
$child
)
Returns true if the given parent is an ancestor of the given child.
function contains(
$cell
)
Returns true if the model contains the given mxCell.
function getParent(
$cell
)
Returns the parent of the given cell.
function add(
$parent,
$child,
$index
=
null
)
Adds the specified child to the parent at the given index using mxChildChange and adds the change to the current transaction.
function cellAdded(
$cell
)
Inner callback to update cells when a cell has been added.
function createId(
$cell
)
Hook method to create an Id for the specified cell.
function updateEdgeParents(
$cell,
$root
=
null
)
Updates the parent for all edges that are connected to cell or one of its descendants using updateEdgeParent.
function updateEdgeParent(
$edge,
$root
)
Inner callback to update the parent of the specified mxCell to the nearest-common-ancestor of its two terminals.
function getOrigin(
$cell
)
Returns the absolute, cummulated origin for the children inside the given parent as an mxPoint.
Implements a 2-dimensional point with double precision coordinates.
function getNearestCommonAncestor(
$cell1,
$cell2
)
Returns the nearest common ancestor for the specified cells.
function remove(
$cell
)
Removes the specified cell from the model using mxChildChange and adds the change to the current transaction.
function cellRemoved(
$cell
)
Inner callback to update cells when a cell has been removed.
function getChildCount(
$cell
)
Returns the number of children in the given cell.
function getChildAt(
$cell,
$index
)
Returns the child of the given mxCell at the given index.
function getTerminal(
$edge,
$cource
)
Returns the source or target mxCell of the given edge depending on the value of the boolean parameter.
function setTerminal(
$edge,
$terminal,
$source
)
Sets the source or target terminal of the given mxCell using mxTerminalChange and adds the change to the current transaction.
function setTerminals(
$edge,
$source,
$target
)
Sets the source and target mxCell of the given mxCell in a single transaction using setTerminal for each end of the edge.
function getEdgeCount(
$cell
)
Returns the number of distinct edges connected to the given cell.
function getEdgeAt(
$cell,
$index
)
Returns the edge of cell at the given index.
function getEdges(
$cell
)
Returns all distinct edges connected to this cell as an array of mxCells.
function isVertex(
$cell
)
Returns true if the given cell is a vertex.
function isEdge(
$cell
)
Returns true if the given cell is an edge.
function isConnectable(
$cell
)
Returns true if the given mxCell is connectable.
function getValue(
$cell
)
Returns the user object of the given mxCell using mxCell.getValue.
function getValue()
Returns the user object of the cell.
function setValue(
$cell,
$value
)
Sets the user object of then given mxCell using mxValueChange and adds the change to the current transaction.
function getGeometry(
$cell
)
Returns the mxGeometry of the given mxCell.
Represents the geometry of a cell.
function setGeometry(
$cell,
$geometry
)
Sets the mxGeometry of the given mxCell.
function getStyle(
$cell
)
Returns the style of the given mxCell.
function setStyle(
$cell,
$style
)
Sets the style of the given mxCell using mxStyleChange and adds the change to the current transaction.
function isCollapsed(
$cell
)
Returns true if the given mxCell is collapsed.
function setCollapsed(
$cell,
$isCollapsed
)
Sets the collapsed state of the given mxCell using mxCollapseChange and adds the change to the current transaction.
function isVisible(
$cell
)
Returns true if the given mxCell is visible.
function setVisible(
$cell,
$visible
)
Sets the visible state of the given mxCell using mxVisibleChange and adds the change to the current transaction.
function mergeChildren(
$from,
$to,
$cloneAllEdges
=
true
)
Merges the children of the given cell into the given target cell inside this model.
function mergeChildrenImpl(
$from,
$to,
$cloneAllEdges,
$mapping
)
Clones the children of the source cell into the given target cell in this model and adds an entry to the mapping that maps from the source cell to the target cell with the same id or the clone of the source cell that was inserted into this model.
function beginUpdate()
Increments the updateLevel by one.
function endUpdate()
Decrements the updateLevel by one and fires a notification event if the updateLevel reaches 0.
function getDirectedEdgeCount(
$cell,
$outgoing,
$ignoredEdge
=
null
)
Returns the number of incoming or outgoing edges, ignoring the given edge.
-
-
-
\ No newline at end of file
diff --git a/docs/php-api/files/reader/mxGraphViewHtmlReader-php.html b/docs/php-api/files/reader/mxGraphViewHtmlReader-php.html
deleted file mode 100644
index 806bda934..000000000
--- a/docs/php-api/files/reader/mxGraphViewHtmlReader-php.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-mxGraphViewHtmlReader
-
-
-
-
-
-
-
-
-
-
mxGraphViewHtmlReader
A display XML to HTML converter. This allows to create an image of a graph without having to parse and create the graph model using the XML file created for the mxGraphView object in the thin client.
-
-
-
\ No newline at end of file
diff --git a/docs/php-api/files/reader/mxGraphViewImageReader-php.html b/docs/php-api/files/reader/mxGraphViewImageReader-php.html
deleted file mode 100644
index a48f1db80..000000000
--- a/docs/php-api/files/reader/mxGraphViewImageReader-php.html
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-mxGraphViewImageReader
-
-
-
-
-
-
-
-
-
-
mxGraphViewImageReader
A display XML to image converter. This allows to create an image of a graph without having to parse and create the graph model using the XML file created for the mxGraphView object in the thin client.
To create the XML for the mxGraphView on the client
var enc = new mxCodec(mxUtils.createXMLDocument());
-var node = enc.encode(editor.graph.view);
-var xml = mxUtils.getXML(node);
Defines if the connection points on either end of the edge should be computed so that the edge is vertical or horizontal if possible and if the point is not at a fixed location.
Defines the key for the spacingBottom style The value represents the spacing, in pixels, added to the bottom side of a label in a vertex (style applies to vertices only).
Defines the key for the spacingRight style The value represents the spacing, in pixels, added to the right side of a label in a vertex (style applies to vertices only).
Defines the portion of the cell which is to be used as a connectable region.
-
-
MIN_ACTIVE_REGION
public static $MIN_ACTIVE_REGION
Defines the minimum size in pixels of the portion of the cell cell which is to be used as a connectable region.
-
-
NS_SVG
public static $NS_SVG
Defines the SVG namespace.
-
-
NS_XHTML
public static $NS_XHTML
Defines the XHTML namespace.
-
-
NS_XLINK
public static $NS_XLINK
Defined the XLink namespace.
-
-
W3C_SHADOWCOLOR
public static $W3C_SHADOWCOLOR
Defines the color to be used to draw shadows in DOM documents.
-
-
SHADOW_OFFSETX
public static $SHADOW_OFFSETX
Defines the x-offset to be used for shadows. Default is 2.
-
-
SHADOW_OFFSETY
public static $SHADOW_OFFSETY
Defines the y-offset to be used for shadows. Default is 3.
-
-
W3C_DEFAULT_FONTFAMILY
public static $W3C_DEFAULT_FONTFAMILY
Defines the default family for HTML markup. Default is times, serif.
-
-
TTF_ENABLED
public static $TTF_ENABLED
Whether TrueType fonts should be enabled in the mxGdCanvas by default. Default is true.
-
-
TTF_SIZEFACTOR
public static $TTF_SIZEFACTOR
Defines the factor which wich the font sizes are to be multiplied when used in truetype fonts. Default is 0.66.
-
-
DEFAULT_FONTFAMILY
public static $DEFAULT_FONTFAMILY
Defines the default family for all truetype fonts. Default is vera.
-
-
DEFAULT_FONTSIZE
public static $DEFAULT_FONTSIZE
Defines the default size (in px). Default is 11.
-
-
DEFAULT_STARTSIZE
public static $DEFAULT_STARTSIZE
Defines the default start size for swimlanes. Default is 40.
-
-
DEFAULT_LINESPACING
public static $DEFAULT_LINESPACING
Defines the default linespacing. Default is 7.
-
-
LABEL_INSET
public static $LABEL_INSET
Defines the inset in absolute pixels between the label bounding box and the label text. Default is 3.
-
-
DEFAULT_MARKERSIZE
public static $DEFAULT_MARKERSIZE
Defines the default size for all markers. Default is 6.
-
-
DEFAULT_IMAGESIZE
public static $DEFAULT_IMAGESIZE
Defines the default width and height for images used in the label shape. Default is 24.
-
-
ENTITY_SEGMENT
public static $ENTITY_SEGMENT
Defines the length of the horizontal segment of an Entity Relation. This can be overridden using mxConstants.STYLE_SEGMENT style. Default is 30.
-
-
ARROW_SPACING
public static $ARROW_SPACING
Defines the spacing between the arrow shape and its terminals. Default is 10.
-
-
ARROW_WIDTH
public static $ARROW_WIDTH
Defines the width of the arrow shape. Default is 30.
-
-
ARROW_SIZE
public static $ARROW_SIZE
Defines the size of the arrowhead in the arrow shape. Default is 30.
-
-
NONE
public static $NONE
Defines the value for none. Default is “none”.
-
-
STYLE_PERIMETER
public static $STYLE_PERIMETER
Defines the key for the perimeter style. This is a function that defines the perimeter around a particular shape. Possible values are the functions defined in mxPerimeter. Alternatively, the constants in this class that start with <code>PERIMETER_</code> may be used to access perimeter styles in mxStyleRegistry.
-
-
STYLE_OPACITY
public static $STYLE_OPACITY
Defines the key for the opacity style. The type of the value is numeric and the possible range is 0-100.
-
-
STYLE_TEXT_OPACITY
public static $STYLE_TEXT_OPACITY
Defines the key for the text opacity style. The type of the value is numeric and the possible range is 0-100.
-
-
STYLE_OVERFLOW
public static $STYLE_OVERFLOW
Defines the key for the overflow style. Possible values are “visible”, “hidden” and “fill”. The default value is “visible”. This value specifies how overlapping vertex labels are handles. A value of “visible” will show the complete label. A value of “hidden” will clip the label so that it does not overlap the vertex bounds. A value of “fill” will use the vertex bounds for the label.
This style is ignored in PHP.
-
-
STYLE_ORTHOGONAL
public static $STYLE_ORTHOGONAL
Defines if the connection points on either end of the edge should be computed so that the edge is vertical or horizontal if possible and if the point is not at a fixed location. Default is false. This is used in mxGraph.isOrthogonal, which also returns true if the edgeStyle of the edge is an elbow or entity.
-
-
STYLE_EXIT_X
public static $STYLE_EXIT_X
Defines the key for the horizontal relative coordinate connection point of an edge with its source terminal.
-
-
STYLE_EXIT_Y
public static $STYLE_EXIT_Y
Defines the key for the vertical relative coordinate connection point of an edge with its source terminal.
-
-
STYLE_EXIT_PERIMETER
public static $STYLE_EXIT_PERIMETER
Defines if the perimeter should be used to find the exact entry point along the perimeter of the source. Possible values are 0 (false) and 1 (true). Default is 1 (true).
-
-
STYLE_ENTRY_X
public static $STYLE_ENTRY_X
Defines the key for the horizontal relative coordinate connection point of an edge with its target terminal.
-
-
STYLE_ENTRY_Y
public static $STYLE_ENTRY_Y
Defines the key for the vertical relative coordinate connection point of an edge with its target terminal.
-
-
sSTYLE_ENTRY_PERIMETER
Defines if the perimeter should be used to find the exact entry point along the perimeter of the target. Possible values are 0 (false) and 1 (true). Default is 1 (true).
-
-
STYLE_WHITE_SPACE
public static $STYLE_WHITE_SPACE
Defines the key for the white-space style. Possible values are “nowrap” and “wrap”. The default value is “nowrap”. This value specifies how white-space inside a HTML vertex label should be handled. A value of “nowrap” means the text will never wrap to the next line until a linefeed is encountered. A value of “wrap” means text will wrap when necessary. This style is only used for HTML labels.
This style is ignored in PHP.
-
-
STYLE_ROTATION
public static $STYLE_ROTATION
Defines the key for the rotation style. The type of the value is numeric and the possible range is 0-360.
-
-
STYLE_FILLCOLOR
public static $STYLE_FILLCOLOR
Defines the key for the fill color. Possible values are all HTML color names or HEX codes, as well as special keywords such as ‘swimlane, ‘inherit’ or ‘indicated’ to use the color code of a related cell or the indicator shape.
-
-
STYLE_SWIMLANE_FILLCOLOR
public static $STYLE_SWIMLANE_FILLCOLOR
Defines the key for the fill color of the swimlane background. Possible values are all HTML color names or HEX codes. Default is no background. Value is “swimlaneFillColor”.
-
-
STYLE_GRADIENTCOLOR
public static $STYLE_GRADIENTCOLOR
Defines the key for the gradient color. Possible values are all HTML color names or HEX codes, as well as special keywords such as ‘swimlane, ‘inherit’ or ‘indicated’ to use the color code of a related cell or the indicator shape. This is ignored if no fill color is defined.
Defines the key for the strokeColor style. Possible values are all HTML color names or HEX codes, as well as special keywords such as ‘swimlane, ‘inherit’ or ‘indicated’ to use the color code of a related cell or the indicator shape.
-
-
STYLE_SEPARATORCOLOR
public static $STYLE_SEPARATORCOLOR
Defines the key for the separatorColor style. Possible values are all HTML color names or HEX codes. This style is only used for SHAPE_SWIMLANE shapes.
-
-
STYLE_STROKEWIDTH
public static $STYLE_STROKEWIDTH
Defines the key for the strokeWidth style. The type of the value is numeric and the possible range is any non-negative value. The value the stroke width in pixels.
-
-
STYLE_ALIGN
public static $STYLE_ALIGN
Defines the key for the align style. Possible values are ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT. This value defines how the lines of the label are horizontally aligned. ALIGN_LEFT mean label text lines are aligned to left of the label bounds, ALIGN_RIGHT to the right of the label bounds and ALIGN_CENTER means the center of the text lines are aligned in the center of the label bounds. Note this value doesn’t affect the positioning of the overall label bounds relative to the vertex, to move the label bounds horizontally, use STYLE_LABEL_POSITION.
-
-
STYLE_VERTICAL_ALIGN
public static $STYLE_VERTICAL_ALIGN
Defines the key for the verticalAlign style. Possible values are ALIGN_TOP, ALIGN_MIDDLE and ALIGN_BOTTOM. This value defines how the lines of the label are vertically aligned. ALIGN_TOP means the topmost label text line is aligned against the top of the label bounds, ALIGN_BOTTOM means the bottom-most label text line is aligned against the bottom of the label bounds and ALIGN_MIDDLE means there is equal spacing between the topmost text label line and the top of the label bounds and the bottom-most text label line and the bottom of the label bounds. Note this value doesn’t affect the positioning of the overall label bounds relative to the vertex, to move the label bounds vertically, use STYLE_VERTICAL_LABEL_POSITION.
-
-
STYLE_LABEL_POSITION
public static $STYLE_LABEL_POSITION
Defines the key for the horizontal label position of vertices. Possible values are ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT. Default is ALIGN_CENTER. The label align defines the position of the label relative to the cell. ALIGN_LEFT means the entire label bounds is placed completely just to the left of the vertex, ALIGN_RIGHT means adjust to the right and ALIGN_CENTER means the label bounds are vertically aligned with the bounds of the vertex. Note this value doesn’t affect the positioning of label within the label bounds, to move the label horizontally within the label bounds, use STYLE_ALIGN.
-
-
STYLE_VERTICAL_LABEL_POSITION
public static $STYLE_VERTICAL_LABEL_POSITION
Defines the key for the vertical label position of vertices. Possible values are ALIGN_TOP, ALIGN_BOTTOM and ALIGN_MIDDLE. Default is ALIGN_MIDDLE. The label align defines the position of the label relative to the cell. ALIGN_TOP means the entire label bounds is placed completely just on the top of the vertex, ALIGN_BOTTOM means adjust on the bottom and ALIGN_MIDDLE means the label bounds are horizontally aligned with the bounds of the vertex. Note this value doesn’t affect the positioning of label within the label bounds, to move the label vertically within the label bounds, use STYLE_VERTICAL_ALIGN.
-
-
STYLE_IMAGE_ALIGN
public static $STYLE_IMAGE_ALIGN
Defines the key for the align style. Possible values are ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT. The value defines how any image in the vertex label is aligned horizontally within the label bounds of a SHAPE_LABEL shape.
-
-
STYLE_IMAGE_VERTICALALIGN
Defines the key for the verticalAlign style. Possible values are ALIGN_TOP, ALIGN_MIDDLE and ALIGN_BOTTOM. The value defines how any image in the vertex label is aligned vertically within the label bounds of a SHAPE_LABEL shape.
-
-
STYLE_IMAGE
public static $STYLE_IMAGE
Defines the key for the image style. Possible values are any image URL, registered key in <mxImageResources> or short data URI as defined in mxImageBundle. The type of the value is String. This is the path to the image to image that is to be displayed within the label of a vertex. Finally, mxUtils.loadImage is used for loading the image for a given value.
-
-
STYLE_IMAGE_WIDTH
public static $STYLE_IMAGE_WIDTH
Defines the key for the imageWidth style. The type of this value is int, the value is the image width in pixels and must be greater than 0.
-
-
STYLE_IMAGE_HEIGHT
public static $STYLE_IMAGE_HEIGHT
Defines the key for the imageHeight style. The type of this value is int, the value is the image height in pixels and must be greater than 0.
-
-
STYLE_IMAGE_BACKGROUND
public static $STYLE_IMAGE_BACKGROUND
Defines the key for the image background color. This style is only used in <mxImageShape>. Possible values are all HTML color names or HEX codes.
-
-
STYLE_IMAGE_BORDER
public static $STYLE_IMAGE_BORDER
Defines the key for the image border color. This style is only used in <mxImageShape>. Possible values are all HTML color names or HEX codes.
-
-
STYLE_IMAGE_FLIPH
public static $STYLE_IMAGE_FLIPH
Defines the key for the horizontal image flip. This style is only used for painting images. Possible values are 0 and 1. Default is 0.
-
-
STYLE_IMAGE_FLIPV
public static $STYLE_IMAGE_FLIPV
Defines the key for the vertical image flip. This style is only used for painting images. Possible values are 0 and 1. Default is 0.
-
-
STYLE_NOLABEL
public static $STYLE_NOLABEL
Defines the key for the noLabel style. If this is true then no label is visible for a given cell. Possible values are true or false (1 or 0). Default is false.
-
-
STYLE_NOEDGESTYLE
public static $STYLE_NOEDGESTYLE
Defines the key for the noEdgeStyle style. If this is true then no edge style is applied for a given edge. Possible values are true or false (1 or 0). Default is false.
-
-
STYLE_LABEL_BACKGROUNDCOLOR
public static $STYLE_LABEL_BACKGROUNDCOLOR
Defines the key for the label background color. Possible values are all HTML color names or HEX codes.
-
-
STYLE_LABEL_BORDERCOLOR
public static $STYLE_LABEL_BORDERCOLOR
Defines the key for the label border color. Possible values are all HTML color names or HEX codes.
-
-
STYLE_INDICATOR_SHAPE
public static $STYLE_INDICATOR_SHAPE
Defines the key for the indicatorShape style. Possible values are any of the SHAPE_* constants.
-
-
STYLE_INDICATOR_IMAGE
public static $STYLE_INDICATOR_IMAGE
Defines the key for the indicatorImage style. Possible values are any image URL.
-
-
STYLE_INDICATOR_COLOR
public static $STYLE_INDICATOR_COLOR
Defines the key for the indicatorColor style. Possible values are all HTML color names or HEX codes, as well as the special ‘swimlane’ keyword to refer to the color of the parent swimlane if one exists.
-
-
STYLE_INDICATOR_GRADIENTCOLOR
public static $STYLE_INDICATOR_GRADIENTCOLOR
Defines the key for the indicatorGradientColor style. Possible values are all HTML color names or HEX codes. This style is only supported in SHAPE_LABEL shapes.
-
-
STYLE_INDICATOR_SPACING
public static $STYLE_INDICATOR_SPACING
Defines the key for the indicatorSpacing style (in px).
-
-
STYLE_INDICATOR_WIDTH
public static $STYLE_INDICATOR_WIDTH
Defines the key for the indicatorWidth style (in px).
-
-
STYLE_INDICATOR_HEIGHT
public static $STYLE_INDICATOR_HEIGHT
Defines the key for the indicatorHeight style (in px).
-
-
STYLE_SHADOW
public static $STYLE_SHADOW
Defines the key for the shadow style. The type of the value is Boolean.
-
-
STYLE_SEGMENT
public static $STYLE_SEGMENT
Defines the key for the segment style. The type of this value is float and the value represents the size of the horizontal segment of the entity relation style. Default is ENTITY_SEGMENT.
-
-
STYLE_ENDARROW
public static $STYLE_ENDARROW
Defines the key for the endArrow style. Possible values are all constants in this class that start with ARROW_. This style is supported in the <mxConnector> shape.
Defines the key for the startArrow style. Possible values are all constants in this class that start with ARROW_. See <public static $STYLE_ENDARROW>. This style is supported in the <mxConnector> shape.
-
-
STYLE_ENDSIZE
public static $STYLE_ENDSIZE
Defines the key for the endSize style. The type of this value is numeric and the value represents the size of the end marker in pixels.
-
-
STYLE_STARTSIZE
public static $STYLE_STARTSIZE
Defines the key for the startSize style. The type of this value is numeric and the value represents the size of the start marker or the size of the swimlane title region depending on the shape it is used for.
-
-
STYLE_SWIMLANE_LINE
public static $STYLE_SWIMLANE_LINE
Defines the key for the swimlaneLine style. This style specifies whether the line between the title regio of a swimlane should be visible. Use 0 for hidden or 1 (default) for visible. Value is “swimlaneLine”.
-
-
STYLE_DASHED
public static $STYLE_DASHED
Defines the key for the endSize style. The type of this value is numeric and the value represents the size of the end marker in pixels.
-
-
STYLE_ROUNDED
public static $STYLE_ROUNDED
Defines the key for the rounded style. The type of this value is Boolean. For edges this determines whether or not joins between edges segments are smoothed to a rounded finish. For vertices that have the rectangle shape, this determines whether or not the rectangle is rounded.
-
-
STYLE_SOURCE_PERIMETER_SPACING
public static $STYLE_SOURCE_PERIMETER_SPACING
Defines the key for the source perimeter spacing. The type of this value is numeric. This is the distance between the source connection point of an edge and the perimeter of the source vertex in pixels. This style only applies to edges.
-
-
STYLE_TARGET_PERIMETER_SPACING
public static $STYLE_TARGET_PERIMETER_SPACING
Defines the key for the source perimeter spacing. The type of this value is numeric. This is the distance between the target connection point of an edge and the perimeter of the target vertex in pixels.
-
-
STYLE_PERIMETER_SPACING
public static $STYLE_PERIMETER_SPACING
Defines the key for the perimeter spacing. This is the distance between the connection point and the perimeter in pixels. When used in a vertex style, this applies to all incoming edges to floating ports (edges that terminate on the perimeter of the vertex). When used in an edge style, this spacing applies to the source and target separately, if they terminate in floating ports (on the perimeter of the vertex).
-
-
STYLE_SPACING
public static $STYLE_SPACING
Defines the key for the spacing. The value represents the spacing, in pixels, added to each side of a label in a vertex (style applies to vertices only).
-
-
STYLE_SPACING_TOP
public static $STYLE_SPACING_TOP
Defines the key for the spacingTop style. The value represents the spacing, in pixels, added to the top side of a label in a vertex (style applies to vertices only).
-
-
STYLE_SPACING_LEFT
public static $STYLE_SPACING_LEFT
Defines the key for the spacingLeft style. The value represents the spacing, in pixels, added to the left side of a label in a vertex (style applies to vertices only).
-
-
STYLE_SPACING_BOTTOM
public static $STYLE_SPACING_BOTTOM
Defines the key for the spacingBottom style The value represents the spacing, in pixels, added to the bottom side of a label in a vertex (style applies to vertices only).
-
-
STYLE_SPACING_RIGHT
public static $STYLE_SPACING_RIGHT
Defines the key for the spacingRight style The value represents the spacing, in pixels, added to the right side of a label in a vertex (style applies to vertices only).
-
-
STYLE_HORIZONTAL
public static $STYLE_HORIZONTAL
Defines the key for the horizontal style. Possible values are true or false. This value only applies to vertices. If the STYLE_SHAPE is <code>SHAPE_SWIMLANE</code> a value of false indicates that the swimlane should be drawn vertically, true indicates to draw it horizontally. If the shape style does not indicate that this vertex is a swimlane, this value affects only whether the label is drawn horizontally or vertically.
Defines the key for the elbow style. Possible values are ELBOW_HORIZONTAL and ELBOW_VERTICAL. Default is ELBOW_HORIZONTAL. This defines how the three segment orthogonal edge style leaves its terminal vertices. The vertical style leaves the terminal vertices at the top and bottom sides.
-
-
STYLE_FONTCOLOR
public static $STYLE_FONTCOLOR
Defines the key for the fontColor style. Possible values are all HTML color names or HEX codes.
-
-
STYLE_FONTFAMILY
public static $STYLE_FONTFAMILY
Defines the key for the fontFamily style. Possible values are names such as Arial; Dialog; Verdana; Times New Roman. The value is of type String.
-
-
STYLE_FONTSIZE
public static $STYLE_FONTSIZE
Defines the key for the fontSize style (in px). The type of the value is int.
-
-
STYLE_FONTSTYLE
public static $STYLE_FONTSTYLE
Defines the key for the fontStyle style. Values may be any logical AND (sum) of FONT_BOLD, FONT_ITALIC and FONT_UNDERLINE. The type of the value is int.
-
-
STYLE_SHAPE
public static $STYLE_SHAPE
Defines the key for the shape. Possible values are all constants with a SHAPE-prefix or any newly defined shape names.
-
-
STYLE_EDGE
public static $STYLE_EDGE
Defines the key for the edge style. Possible values are the functions defined in mxEdgeStyle.
-
-
STYLE_LOOP
public static $STYLE_LOOP
Defines the key for the loop style. Possible values are the functions defined in mxEdgeStyle.
-
-
STYLE_ROUTING_CENTER_X
public static $STYLE_ROUTING_CENTER_X
Defines the key for the horizontal routing center. Possible values are between -0.5 and 0.5. This is the relative offset from the center used for connecting edges. The type of this value is numeric.
-
-
STYLE_ROUTING_CENTER_Y
public static $STYLE_ROUTING_CENTER_Y
Defines the key for the vertical routing center. Possible values are between -0.5 and 0.5. This is the relative offset from the center used for connecting edges. The type of this value is numeric.
-
-
FONT_BOLD
public static $FONT_BOLD
-
-
FONT_ITALIC
public static $FONT_ITALIC
-
-
FONT_UNDERLINE
public static $FONT_UNDERLINE
-
-
SHAPE_RECTANGLE
public static $SHAPE_RECTANGLE
-
-
SHAPE_ELLIPSE
public static $SHAPE_ELLIPSE
-
-
SHAPE_DOUBLE_ELLIPSE
public static $SHAPE_DOUBLE_ELLIPSE
-
-
SHAPE_RHOMBUS
public static $SHAPE_RHOMBUS
-
-
SHAPE_LINE
public static $SHAPE_LINE
-
-
SHAPE_IMAGE
public static $SHAPE_IMAGE
-
-
SHAPE_ARROW
public static $SHAPE_ARROW
-
-
SHAPE_LABEL
public static $SHAPE_LABEL
-
-
SHAPE_CYLINDER
public static $SHAPE_CYLINDER
-
-
SHAPE_SWIMLANE
public static $SHAPE_SWIMLANE
-
-
SHAPE_CONNECTOR
public static $SHAPE_CONNECTOR
-
-
SHAPE_ACTOR
public static $SHAPE_ACTOR
-
-
SHAPE_CLOUD
public static $SHAPE_CLOUD
-
-
SHAPE_TRIANGLE
public static $SHAPE_TRIANGLE
-
-
SHAPE_HEXAGON
public static $SHAPE_HEXAGON
-
-
ARROW_CLASSIC
public static $ARROW_CLASSIC
-
-
ARROW_BLOCK
public static $ARROW_BLOCK
-
-
ARROW_OPEN
public static $ARROW_OPEN
-
-
ARROW_OVAL
public static $ARROW_OVAL
-
-
ARROW_DIAMOND
public static $ARROW_DIAMOND
-
-
ALIGN_LEFT
public static $ALIGN_LEFT
-
-
ALIGN_CENTER
public static $ALIGN_CENTER
-
-
ALIGN_RIGHT
public static $ALIGN_RIGHT
-
-
ALIGN_TOP
public static $ALIGN_TOP
-
-
ALIGN_MIDDLE
public static $ALIGN_MIDDLE
-
-
ALIGN_BOTTOM
public static $ALIGN_BOTTOM
-
-
DIRECTION_NORTH
public static $DIRECTION_NORTH
-
-
DIRECTION_SOUTH
public static $DIRECTION_SOUTH
-
-
DIRECTION_EAST
public static $DIRECTION_EAST
-
-
DIRECTION_WEST
public static $DIRECTION_WEST
-
-
ELBOW_VERTICAL
public static $ELBOW_VERTICAL
-
-
ELBOW_HORIZONTAL
public static $ELBOW_HORIZONTAL
-
-
EDGESTYLE_ENTITY_RELATION
public static $EDGESTYLE_ENTITY_RELATION
Name of the entity relation edge style. Can be used as a string value for the STYLE_EDGE style.
-
-
EDGESTYLE_LOOP
public static $EDGESTYLE_LOOP
Name of the loop edge style. Can be used as a string value for the STYLE_EDGE style.
-
-
EDGESTYLE_SIDETOSIDE
public static $EDGESTYLE_SIDETOSIDE
Name of the side to side edge style. Can be used as a string value for the STYLE_EDGE style.
-
-
EDGESTYLE_TOPTOBOTTOM
public static $EDGESTYLE_TOPTOBOTTOM
Name of the top to bottom edge style. Can be used as a string value for the STYLE_EDGE style.
-
-
PERIMETER_ELLIPSE
public static $PERIMETER_ELLIPSE
Name of the ellipse perimeter. Can be used as a string value for the STYLE_PERIMETER style.
-
-
PERIMETER_RECTANGLE
public static $PERIMETER_RECTANGLE
Name of the rectangle perimeter. Can be used as a string value for the STYLE_PERIMETER style.
-
-
PERIMETER_RHOMBUS
public static $PERIMETER_RHOMBUS
Name of the rhombus perimeter. Can be used as a string value for the STYLE_PERIMETER style.
-
-
PERIMETER_TRIANGLE
public static $PERIMETER_TRIANGLE
Name of the triangle perimeter. Can be used as a string value for the STYLE_PERIMETER style.
Defines the portion of the cell which is to be used as a connectable region.
public static $MIN_ACTIVE_REGION
Defines the minimum size in pixels of the portion of the cell cell which is to be used as a connectable region.
public static $NS_SVG
Defines the SVG namespace.
public static $NS_XHTML
Defines the XHTML namespace.
public static $NS_XLINK
Defined the XLink namespace.
public static $W3C_SHADOWCOLOR
Defines the color to be used to draw shadows in DOM documents.
public static $SHADOW_OFFSETX
Defines the x-offset to be used for shadows.
public static $SHADOW_OFFSETY
Defines the y-offset to be used for shadows.
public static $W3C_DEFAULT_FONTFAMILY
Defines the default family for HTML markup.
public static $TTF_ENABLED
Whether TrueType fonts should be enabled in the mxGdCanvas by default.
public static $TTF_SIZEFACTOR
Defines the factor which wich the font sizes are to be multiplied when used in truetype fonts.
public static $DEFAULT_FONTFAMILY
Defines the default family for all truetype fonts.
public static $DEFAULT_FONTSIZE
Defines the default size (in px).
public static $DEFAULT_STARTSIZE
Defines the default start size for swimlanes.
public static $DEFAULT_LINESPACING
Defines the default linespacing.
public static $LABEL_INSET
Defines the inset in absolute pixels between the label bounding box and the label text.
public static $DEFAULT_MARKERSIZE
Defines the default size for all markers.
public static $DEFAULT_IMAGESIZE
Defines the default width and height for images used in the label shape.
public static $ENTITY_SEGMENT
Defines the length of the horizontal segment of an Entity Relation.
public static $ARROW_SPACING
Defines the spacing between the arrow shape and its terminals.
public static $ARROW_WIDTH
Defines the width of the arrow shape.
public static $ARROW_SIZE
Defines the size of the arrowhead in the arrow shape.
public static $NONE
Defines the value for none.
public static $STYLE_PERIMETER
Defines the key for the perimeter style.
public static $STYLE_OPACITY
Defines the key for the opacity style.
public static $STYLE_TEXT_OPACITY
Defines the key for the text opacity style.
public static $STYLE_OVERFLOW
Defines the key for the overflow style.
public static $STYLE_ORTHOGONAL
Defines if the connection points on either end of the edge should be computed so that the edge is vertical or horizontal if possible and if the point is not at a fixed location.
public static $STYLE_EXIT_X
Defines the key for the horizontal relative coordinate connection point of an edge with its source terminal.
public static $STYLE_EXIT_Y
Defines the key for the vertical relative coordinate connection point of an edge with its source terminal.
public static $STYLE_EXIT_PERIMETER
Defines if the perimeter should be used to find the exact entry point along the perimeter of the source.
public static $STYLE_ENTRY_X
Defines the key for the horizontal relative coordinate connection point of an edge with its target terminal.
public static $STYLE_ENTRY_Y
Defines the key for the vertical relative coordinate connection point of an edge with its target terminal.
public static $STYLE_WHITE_SPACE
Defines the key for the white-space style.
public static $STYLE_ROTATION
Defines the key for the rotation style.
public static $STYLE_FILLCOLOR
Defines the key for the fill color.
public static $STYLE_SWIMLANE_FILLCOLOR
Defines the key for the fill color of the swimlane background.
public static $STYLE_GRADIENTCOLOR
Defines the key for the gradient color.
public static $STYLE_GRADIENT_DIRECTION
Defines the key for the gradient direction.
public static $STYLE_STROKECOLOR
Defines the key for the strokeColor style.
public static $STYLE_SEPARATORCOLOR
Defines the key for the separatorColor style.
public static $STYLE_STROKEWIDTH
Defines the key for the strokeWidth style.
public static $STYLE_ALIGN
Defines the key for the align style.
public static $STYLE_VERTICAL_ALIGN
Defines the key for the verticalAlign style.
public static $STYLE_LABEL_POSITION
Defines the key for the horizontal label position of vertices.
public static $STYLE_VERTICAL_LABEL_POSITION
Defines the key for the vertical label position of vertices.
public static $STYLE_IMAGE_ALIGN
Defines the key for the align style.
public static $STYLE_IMAGE
Defines the key for the image style.
public static $STYLE_IMAGE_WIDTH
Defines the key for the imageWidth style.
public static $STYLE_IMAGE_HEIGHT
Defines the key for the imageHeight style.
public static $STYLE_IMAGE_BACKGROUND
Defines the key for the image background color.
public static $STYLE_IMAGE_BORDER
Defines the key for the image border color.
public static $STYLE_IMAGE_FLIPH
Defines the key for the horizontal image flip.
public static $STYLE_IMAGE_FLIPV
Defines the key for the vertical image flip.
public static $STYLE_NOLABEL
Defines the key for the noLabel style.
public static $STYLE_NOEDGESTYLE
Defines the key for the noEdgeStyle style.
public static $STYLE_LABEL_BACKGROUNDCOLOR
Defines the key for the label background color.
public static $STYLE_LABEL_BORDERCOLOR
Defines the key for the label border color.
public static $STYLE_INDICATOR_SHAPE
Defines the key for the indicatorShape style.
public static $STYLE_INDICATOR_IMAGE
Defines the key for the indicatorImage style.
public static $STYLE_INDICATOR_COLOR
Defines the key for the indicatorColor style.
public static $STYLE_INDICATOR_GRADIENTCOLOR
Defines the key for the indicatorGradientColor style.
public static $STYLE_INDICATOR_SPACING
Defines the key for the indicatorSpacing style (in px).
public static $STYLE_INDICATOR_WIDTH
Defines the key for the indicatorWidth style (in px).
public static $STYLE_INDICATOR_HEIGHT
Defines the key for the indicatorHeight style (in px).
public static $STYLE_SHADOW
Defines the key for the shadow style.
public static $STYLE_SEGMENT
Defines the key for the segment style.
public static $STYLE_ENDARROW
Defines the key for the endArrow style.
public static $STYLE_STARTARROW
Defines the key for the startArrow style.
public static $STYLE_ENDSIZE
Defines the key for the endSize style.
public static $STYLE_STARTSIZE
Defines the key for the startSize style.
public static $STYLE_SWIMLANE_LINE
Defines the key for the swimlaneLine style.
public static $STYLE_DASHED
Defines the key for the endSize style.
public static $STYLE_ROUNDED
Defines the key for the rounded style.
public static $STYLE_SOURCE_PERIMETER_SPACING
Defines the key for the source perimeter spacing.
public static $STYLE_TARGET_PERIMETER_SPACING
Defines the key for the source perimeter spacing.
public static $STYLE_PERIMETER_SPACING
Defines the key for the perimeter spacing.
public static $STYLE_SPACING
Defines the key for the spacing.
public static $STYLE_SPACING_TOP
Defines the key for the spacingTop style.
public static $STYLE_SPACING_LEFT
Defines the key for the spacingLeft style.
public static $STYLE_SPACING_BOTTOM
Defines the key for the spacingBottom style The value represents the spacing, in pixels, added to the bottom side of a label in a vertex (style applies to vertices only).
public static $STYLE_SPACING_RIGHT
Defines the key for the spacingRight style The value represents the spacing, in pixels, added to the right side of a label in a vertex (style applies to vertices only).
public static $STYLE_HORIZONTAL
Defines the key for the horizontal style.
public static $STYLE_DIRECTION
Defines the key for the direction style.
public static $STYLE_ELBOW
Defines the key for the elbow style.
public static $STYLE_FONTCOLOR
Defines the key for the fontColor style.
public static $STYLE_FONTFAMILY
Defines the key for the fontFamily style.
public static $STYLE_FONTSIZE
Defines the key for the fontSize style (in px).
public static $STYLE_FONTSTYLE
Defines the key for the fontStyle style.
public static $STYLE_SHAPE
Defines the key for the shape.
public static $STYLE_EDGE
Defines the key for the edge style.
public static $STYLE_LOOP
Defines the key for the loop style.
public static $STYLE_ROUTING_CENTER_X
Defines the key for the horizontal routing center.
public static $STYLE_ROUTING_CENTER_Y
Defines the key for the vertical routing center.
public static $FONT_BOLD
public static $FONT_ITALIC
public static $FONT_UNDERLINE
public static $SHAPE_RECTANGLE
public static $SHAPE_ELLIPSE
public static $SHAPE_DOUBLE_ELLIPSE
public static $SHAPE_RHOMBUS
public static $SHAPE_LINE
public static $SHAPE_IMAGE
public static $SHAPE_ARROW
public static $SHAPE_LABEL
public static $SHAPE_CYLINDER
public static $SHAPE_SWIMLANE
public static $SHAPE_CONNECTOR
public static $SHAPE_ACTOR
public static $SHAPE_CLOUD
public static $SHAPE_TRIANGLE
public static $SHAPE_HEXAGON
public static $ARROW_CLASSIC
public static $ARROW_BLOCK
public static $ARROW_OPEN
public static $ARROW_OVAL
public static $ARROW_DIAMOND
public static $ALIGN_LEFT
public static $ALIGN_CENTER
public static $ALIGN_RIGHT
public static $ALIGN_TOP
public static $ALIGN_MIDDLE
public static $ALIGN_BOTTOM
public static $DIRECTION_NORTH
public static $DIRECTION_SOUTH
public static $DIRECTION_EAST
public static $DIRECTION_WEST
public static $ELBOW_VERTICAL
public static $ELBOW_HORIZONTAL
public static $EDGESTYLE_ENTITY_RELATION
Name of the entity relation edge style.
public static $EDGESTYLE_LOOP
Name of the loop edge style.
public static $EDGESTYLE_SIDETOSIDE
Name of the side to side edge style.
public static $EDGESTYLE_TOPTOBOTTOM
Name of the top to bottom edge style.
public static $PERIMETER_ELLIPSE
Name of the ellipse perimeter.
public static $PERIMETER_RECTANGLE
Name of the rectangle perimeter.
public static $PERIMETER_RHOMBUS
Name of the rhombus perimeter.
public static $PERIMETER_TRIANGLE
Name of the triangle perimeter.
Provides various perimeter functions to be used in a style as the value of mxConstants.STYLE_PERIMETER.
Singleton class that acts as a global converter from string to object values in a style.
function isOrthogonal(
$edge
)
Returns true if perimeter points should be computed such that the resulting edge has only horizontal or vertical segments.
Maps from keys to base64 encoded images or file locations.
static function loadImage(
$url
)
Loads an image from the local filesystem, a data URI or any other URL.
Provides various edge styles to be used as the values for mxConstants.STYLE_EDGE in a cell style.
Holds the event properties in an associative array that maps from string (key) to object (value).
-
-
consumed
var $consumed
Holds the consumed state of the event. Default is false.
-
-
Functions
-
-
mxEventObject
function mxEventObject(
$name
)
Constructs a new event for the given name and properties. The optional properties are specified using a sequence of keys and values, eg. new mxEventObject($name, $key1, $value1, $key2, $value2, .., $keyN, $valueN)
Adds a listener for the given event name. Note that the method of the listener object must have the same name as the event it’s being added for. This is different from other language implementations of this class.
-
-
-
\ No newline at end of file
diff --git a/docs/php-api/files/util/mxImageBundle-php.html b/docs/php-api/files/util/mxImageBundle-php.html
deleted file mode 100644
index 4c1b25f3a..000000000
--- a/docs/php-api/files/util/mxImageBundle-php.html
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-mxImageBundle
-
-
-
-
-
-
-
-
-
-
mxImageBundle
Maps from keys to base64 encoded images or file locations. All values must be URLs or use the format data:image/format followed by a comma and the base64 encoded image data, eg. “data:image/gif,XYZ”, where XYZ is the base64 encoded image data.
$bundle = new mxImageBundle();
-$bundle->putImage("myImage", "data:image/gif,R0lGODlhEAAQAMIGAAAAAICAAICAgP".
- "//AOzp2O3r2////////yH+FUNyZWF0ZWQgd2l0aCBUaGUgR0lNUAAh+QQBCgAHACwAAAAAEA".
- "AQAAADTXi63AowynnAMDfjPUDlnAAJhmeBFxAEloliKltWmiYCQvfVr6lBPB1ggxN1hilaSS".
- "ASFQpIV5HJBDyHpqK2ejVRm2AAgZCdmCGO9CIBADs=");
-$graph->addImageBundle($bundle);
-(end);
-
-The image can then be referenced in any cell style using image=myImage.
-
-To convert an image at a given URL to a base64 encoded String, the following
-code can be used:
-
-(code)
-echo "base64=".base64_encode(file_get_contents($url));
Loads an image from the local filesystem, a data URI or any other URL.
function postProcessCellStyle(
$style
)
Tries to resolve the value for the image style in the image bundles and turns short data URIs as defined in mxImageBundle to data URIs as defined in RFC 2397 of the IETF.
Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height.
Constructs a new rectangle for the optional parameters. If no parameters are given then the respective default values are used.
-
-
setRect
function setRect(
$x,
$y,
$width,
$height
)
Sets this rectangle to the specified values.
-
-
getCenterX
function getCenterX()
Returns the x-coordinate of the center point.
-
-
getCenterY
function getCenterY()
Returns the y-coordinate of the center point.
-
-
add
function add(
$rect
)
Adds the given rectangle to this rectangle.
-
-
grow
function grow(
$amount
)
Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height.
-
-
equals
function equals(
$obj
)
Returns true if the given object equals this rectangle.
Constructs a new rectangle for the optional parameters.
function setRect(
$x,
$y,
$width,
$height
)
Sets this rectangle to the specified values.
function getCenterX()
Returns the x-coordinate of the center point.
function getCenterY()
Returns the y-coordinate of the center point.
function add(
$rect
)
Adds the given rectangle to this rectangle.
function grow(
$amount
)
Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height.
function equals(
$obj
)
Returns true if the given object equals this rectangle.
Returns the bounds for a label for the given location and size, taking into account the alignment and spacing in the specified style, as well as the width and height of the rectangle that contains the label.
Returns the bounds for a label for the given location and size, taking into account the alignment and spacing in the specified style, as well as the width and height of the rectangle that contains the label. (For edge labels this width and height is 0.) The scale is used to scale the given size and the spacings in the specified style.
-
-
getSizeForString
static function getSizeForString(
$text,
$fontSize
=
0,
$fontFamily
=
null
)
Returns an mxRectangle with the size (width and height in pixels) of the given string. The string may contain HTML markup. Newlines should be converted to <br> before calling this method.
Flips the given image horizontally and/or vertically and returns a new image instance.
-
-
toRadians
static function toRadians(
$deg
)
Converts the given degree to radians.
-
-
getBoundingBox
static function getBoundingBox(
$rect,
$rotation
)
Returns the bounding box for the rotated rectangle.
-
-
getRotatedPoint
static function getRotatedPoint(
$pt,
$cos,
$sin,
$cx
=
null
)
Rotates the given point by the given cos and sin.
-
-
translatePoints
static function translatePoints(
$pts,
$dx,
$dy
)
Creates a new list of new points obtained by translating the points in the given list by the given vector. Elements that are not mxPoints are added to the result as-is.
-
-
contains
static function contains(
$state,
$x,
$y
)
Returns true if the specified point (x, y) is contained in the given rectangle.
Returns the intersection of two lines as an mxPoint.
Parameters
x0
X-coordinate of the first line’s startpoint.
y0
X-coordinate of the first line’s startpoint.
x1
X-coordinate of the first line’s endpoint.
y1
Y-coordinate of the first line’s endpoint.
x2
X-coordinate of the second line’s startpoint.
y2
Y-coordinate of the second line’s startpoint.
x3
X-coordinate of the second line’s endpoint.
y3
Y-coordinate of the second line’s endpoint.
-
-
encodeImage
static function encodeImage(
$image,
$format
=
null
)
Encodes the given image using the GD image encoding routines. Supported formats are gif, jpg and png (default).
Parameters
image
GD image to be encoded.
format
String that defines the encoding format. Default is png.
-
-
getStylename
static function getStylename(
$style
)
Returns the stylename in a style of the form [stylename;|key=value;] or an empty string if the given style does not contain a stylename.
Parameters
style
String of the form [stylename;|key=value;].
-
-
getStylenames
static function getStylenames(
$style
)
Returns the stylenames in a style of the form [stylename;|key=value;] or an empty array if the given style does not contain any stylenames.
Parameters
style
String of the form [stylename;|key=value;].
-
-
indexOfStylename
static function indexOfStylename(
$style,
$stylename
)
Returns the index of the given stylename in the given style. This returns -1 if the given stylename does not occur (as a stylename) in the given style, otherwise it returns the index of the first character.
-
-
addStylename
static function addStylename(
$style,
$stylename
)
Adds the specified stylename to the given style if it does not already contain the stylename.
-
-
removeStylename
static function removeStylename(
$style,
$stylename
)
Removes all occurrences of the specified stylename in the given style and returns the updated style. Trailing semicolons are preserved.
-
-
removeAllStylenames
static function removeAllStylenames(
$style
)
Removes all stylenames from the given style and returns the updated style.
-
-
setCellStyles
static function setCellStyles(
$model,
$cells,
$key,
$value
)
Assigns the value for the given key in the styles of the given cells, or removes the key from the styles if the value is null.
Adds or removes the given key, value pair to the style and returns the new style. If value is null or zero length then the key is removed from the style.
Parameters
style
String of the form stylename[;key=value]
key
Key of the style to be changed.
value
New value for the given key.
-
-
setCellStyleFlags
static function setCellStyleFlags(
$model,
$cells,
$key,
$flag,
$value
)
Sets or toggles the flag bit for the given key in the cell’s styles. If value is null then the flag is toggled.
Sets or removes the given key from the specified style and returns the new style. If value is null then the flag is toggled.
Parameters
style
String of the form stylename[;key=value].
key
Key of the style to be changed.
flag
Integer for the bit to be changed.
value
Optional boolean value for the given flag.
-
-
getValue
static function getValue(
$dict,
$key,
$default
=
null
)
Returns the value for key in dictionary or the given default value if no value is defined for the key.
Parameters
dict
Dictionary that contains the key, value pairs.
key
Key whose value should be returned.
default
Default value to return if the key is undefined. Default is null.
-
-
getNumber
static function getNumber(
$dict,
$key,
$default
=
)
Returns the value for key in dictionary or 0 if no value is defined for the key.
Parameters
dict
Dictionary that contains the key, value pairs.
key
Key whose value should be returned.
default
Optional default value to return if no value is defined for the given key. Default is 0.
-
-
indexOf
static function indexOf(
$array,
$object
)
Returns the index of obj in array or -1 if the array does not contains the given object.
Parameters
array
Array to check for the given obj.
obj
Object to find in the given array.
-
-
readFile
static function readFile(
$filename
)
Reads the given filename into a string. Shortcut for file_get_contents.
Parameters
filename
The name of the file to read.
-
-
isNode
static function isNode(
$value,
$nodeName
=
null,
$attributeName
=
null,
$attributeValue
=
null
)
Returns true if the given value is an XML node with the node name and if the optional attribute has the specified value.
This implementation assumes that the given value is a DOM node if the nodeName property is not null.
Parameters
value
Object that should be examined as a node.
nodeName
String that specifies the node name.
attributeName
Optional attribute name to check.
attributeValue
Optional attribute value to check.
-
-
loadImage
static function loadImage(
$url
)
Loads an image from the local filesystem, a data URI or any other URL.
-
-
createXmlDocument
static function createXmlDocument()
Returns a new, empty XML document.
-
-
loadXmlDocument
static function loadXmlDocument(
$uri
)
Returns a new DOM document for the given URI.
-
-
parseXml
static function parseXml(
$xml
)
Returns a new DOM document for the given XML string.
-
-
evaluate
static function evaluate(
$expression
)
Evaluates an expression to a class member. The range of supported expressions is limited to static class members with a dot-notation, such as mxEdgeStyle.ElbowConnector.
-
-
findNode
static function findNode(
$node,
$attr,
$value
)
Returns the first node where attr equals value. This implementation does not use XPath.
-
-
getTrueTypeFont
static function getTrueTypeFont(
$style
)
Returns the truetype font to be used to draw the text with the given style.
-
-
getTrueTypeFontSize
static function getTrueTypeFontSize(
$size
)
Returns the truetype font size to be used to draw the text with the given style. This returns the fontSize in the style of the default fontsize multiplied with <ttfSizeFactor>.
-
-
getFixedFontSize
static function getFixedFontSize(
$fontSize,
$fontFamily,
$fontStyle
=
null
)
Returns the fixed font size for GD (1 t0 5) for the given font properties
Returns the bounds for a label for the given location and size, taking into account the alignment and spacing in the specified style, as well as the width and height of the rectangle that contains the label.
static function getSizeForString(
$text,
$fontSize
=
0,
$fontFamily
=
null
)
Returns an mxRectangle with the size (width and height in pixels) of the given string.
Implements a 2-dimensional rectangle with double precision coordinates.
static function flipImage(
$img,
$flipH,
$flipV
)
Flips the given image horizontally and/or vertically and returns a new image instance.
static function toRadians(
$deg
)
Converts the given degree to radians.
static function getBoundingBox(
$rect,
$rotation
)
Returns the bounding box for the rotated rectangle.
static function getRotatedPoint(
$pt,
$cos,
$sin,
$cx
=
null
)
Rotates the given point by the given cos and sin.
static function translatePoints(
$pts,
$dx,
$dy
)
Creates a new list of new points obtained by translating the points in the given list by the given vector.
static function contains(
$state,
$x,
$y
)
Returns true if the specified point (x, y) is contained in the given rectangle.
static function intersection(
$x0,
$y0,
$x1,
$y1,
$x2,
$y2,
$x3,
$y3
)
Returns the intersection of two lines as an mxPoint.
Implements a 2-dimensional point with double precision coordinates.
static function encodeImage(
$image,
$format
=
null
)
Encodes the given image using the GD image encoding routines.
static function getStylename(
$style
)
Returns the stylename in a style of the form [stylename;|key=value;] or an empty string if the given style does not contain a stylename.
static function getStylenames(
$style
)
Returns the stylenames in a style of the form [stylename;|key=value;] or an empty array if the given style does not contain any stylenames.
static function indexOfStylename(
$style,
$stylename
)
Returns the index of the given stylename in the given style.
static function addStylename(
$style,
$stylename
)
Adds the specified stylename to the given style if it does not already contain the stylename.
static function removeStylename(
$style,
$stylename
)
Removes all occurrences of the specified stylename in the given style and returns the updated style.
static function removeAllStylenames(
$style
)
Removes all stylenames from the given style and returns the updated style.
static function setCellStyles(
$model,
$cells,
$key,
$value
)
Assigns the value for the given key in the styles of the given cells, or removes the key from the styles if the value is null.
static function setStyle(
$style,
$key,
$value
)
Adds or removes the given key, value pair to the style and returns the new style.
static function setCellStyleFlags(
$model,
$cells,
$key,
$flag,
$value
)
Sets or toggles the flag bit for the given key in the cell’s styles.
static function setStyleFlag(
$style,
$key,
$flag,
$value
)
Sets or removes the given key from the specified style and returns the new style.
static function getValue(
$dict,
$key,
$default
=
null
)
Returns the value for key in dictionary or the given default value if no value is defined for the key.
static function getNumber(
$dict,
$key,
$default
=
)
Returns the value for key in dictionary or 0 if no value is defined for the key.
static function indexOf(
$array,
$object
)
Returns the index of obj in array or -1 if the array does not contains the given object.
static function readFile(
$filename
)
Reads the given filename into a string.
static function isNode(
$value,
$nodeName
=
null,
$attributeName
=
null,
$attributeValue
=
null
)
Returns true if the given value is an XML node with the node name and if the optional attribute has the specified value.
static function loadImage(
$url
)
Loads an image from the local filesystem, a data URI or any other URL.
static function createXmlDocument()
Returns a new, empty XML document.
static function loadXmlDocument(
$uri
)
Returns a new DOM document for the given URI.
static function parseXml(
$xml
)
Returns a new DOM document for the given XML string.
static function evaluate(
$expression
)
Evaluates an expression to a class member.
static function findNode(
$node,
$attr,
$value
)
Returns the first node where attr equals value.
static function getTrueTypeFont(
$style
)
Returns the truetype font to be used to draw the text with the given style.
static function getTrueTypeFontSize(
$size
)
Returns the truetype font size to be used to draw the text with the given style.
static function getFixedFontSize(
$fontSize,
$fontFamily,
$fontStyle
=
null
)
Returns the fixed font size for GD (1 t0 5) for the given font properties
static function stackTrace()
Prints a simple stack trace in the error log.
public static $DEFAULT_FONTSIZE
Defines the default size (in px).
public static $DEFAULT_FONTFAMILY
Defines the default family for all truetype fonts.
Returns a copy of this state where all members are deeply cloned except the view and cell references, which are copied with no cloning to the new instance.
Reference to the mxCell that is represented by this state.
-
-
style
var $style
Contains an array of key, value pairs that represent the style of the cell.
-
-
invalid
var $invalid
Specifies if the state is invalid. Default is true.
-
-
origin
var $origin
mxPoint that holds the origin for all child cells. Default is a new empty mxPoint.
-
-
absolutePoints
var $absolutePoints
Holds an array of mxPoints that represent the absolute points of an edge.
-
-
absoluteOffset
var $absoluteOffset
mxPoint that holds the absolute offset. For edges, this is the absolute coordinates of the label position. For vertices, this is the offset of the label relative to the top, left corner of the vertex.
-
-
terminalDistance
var $terminalDistance
Caches the distance between the end points for an edge.
-
-
length
var $length
Caches the length of an edge.
-
-
segments
var $segments
Array of numbers that represent the cached length of each segment of the edge.
-
-
labelBounds
var $labelBounds
Holds the rectangle which contains the label.
-
-
boundingBox
var $boundingBox
Holds the largest rectangle which contains all rendering for this cell.
-
-
Functions
-
-
mxCellState
function mxCellState(
$view
=
null,
$cell
=
null,
$style
=
null
)
Constructs a new object that represents the current state of the given cell in the specified view.
Array of key, value pairs that constitute the style.
-
-
getPerimeterBounds
function getPerimeterBounds(
$border
=
0
)
Returns the mxRectangle that should be used as the perimeter of the cell.
-
-
copy
function copy()
Returns a copy of this state where all members are deeply cloned except the view and cell references, which are copied with no cloning to the new instance.
Reference to the mxCell that is represented by this state.
Cells are the elements of the graph model.
var $style
Contains an array of key, value pairs that represent the style of the cell.
var $invalid
Specifies if the state is invalid.
var $origin
mxPoint that holds the origin for all child cells.
Implements a 2-dimensional point with double precision coordinates.
var $absolutePoints
Holds an array of mxPoints that represent the absolute points of an edge.
var $absoluteOffset
mxPoint that holds the absolute offset.
var $terminalDistance
Caches the distance between the end points for an edge.
var $length
Caches the length of an edge.
var $segments
Array of numbers that represent the cached length of each segment of the edge.
var $labelBounds
Holds the rectangle which contains the label.
var $boundingBox
Holds the largest rectangle which contains all rendering for this cell.
function mxCellState(
$view
=
null,
$cell
=
null,
$style
=
null
)
Constructs a new object that represents the current state of the given cell in the specified view.
function getPerimeterBounds(
$border
=
0
)
Returns the mxRectangle that should be used as the perimeter of the cell.
Implements a 2-dimensional rectangle with double precision coordinates.
function copy()
Returns a copy of this state where all members are deeply cloned except the view and cell references, which are copied with no cloning to the new instance.
Implements an edge style function. At the time the function is called, the result array contains a placeholder (null) for the first absolute point, that is, the point where the edge and source terminal are connected. The implementation of the style then adds all intermediate waypoints except for the last point, that is, the connection point between the edge and the target terminal. The first ant the last point in the result array are then replaced with mxPoints that take into account the terminal’s perimeter and next point on the edge.
Parameters
state
mxCellState that represents the edge to be updated.
Array of mxPoints that represent the actual points of the edge.
-
-
mxEntityRelation
Implements an entity relation style for edges (as used in database schema diagrams). At the time the function is called, the result array contains a placeholder (null) for the first absolute point, that is, the point where the edge and source terminal are connected. The implementation of the style then adds all intermediate waypoints except for the last point, that is, the connection point between the edge and the target terminal. The first ant the last point in the result array are then replaced with mxPoints that take into account the terminal’s perimeter and next point on the edge.
-
-
mxLoop
Implements a self-reference, aka. loop.
-
-
mxElbowConnector
Uses either <SideToSide> or <TopToBottom> depending on the horizontal flag in the cell style. <SideToSide> is used if horizontal is true or unspecified. See <EntityRelation> for a description of the parameters.
-
-
mxSideToSide
Implements a vertical elbow edge. See <EntityRelation> for a description of the parameters.
-
-
mxTopToBottom
Implements a horizontal elbow edge. See <EntityRelation> for a description of the parameters.
-
-
mxEdgeStyle
Provides various edge styles to be used as the values for mxConstants.STYLE_EDGE in a cell style.
Tries to resolve the value for the image style in the image bundles and turns short data URIs as defined in mxImageBundle to data URIs as defined in RFC 2397 of the IETF.
Returns the first child child of mxGraphModel.root. The value returned by this function should be used as the parent for new cells (aka default layer).
-
-
convertValueToString
function convertValueToString(
$cell
)
Returns the textual representation for the given cell. This implementation returns the nodename or string-representation of the user object.
-
-
getLabel
function getLabel(
$cell
)
Returns a string or DOM node that represents the label for the given cell. This implementation uses convertValueToString if labelsVisible is true. Otherwise it returns an empty string.
-
-
getChildOffsetForCell
function getChildOffsetForCell(
$cell
)
Returns the offset to be used for the cells inside the given cell. The root and layer cells may be identified using <mxGraphModel.isRoot> and <mxGraphModel.isLayer>. For all other current roots, the <mxGraphView.currentRoot> field points to the respective cell, so that the following holds: cell == this.view.currentRoot. This implementation returns null.
Tries to resolve the value for the image style in the image bundles and turns short data URIs as defined in mxImageBundle to data URIs as defined in RFC 2397 of the IETF.
-
-
setCellStyles
function setCellStyles(
$key,
$value,
$cells
)
Sets the key to value in the styles of the given cells. This will modify the existing cell styles in-place and override any existing assignment for the given key. If no cells are specified, then the selection cells are changed. If no value is specified, then the respective key is removed from the styles.
Adds a new vertex into the given parent mxCell using value as the user object and the given coordinates as the mxGeometry of the new vertex. The id and style are used for the respective properties of the new mxCell, which is returned.
Parameters
parent
mxCell that specifies the parent of the new vertex.
id
Optional string that defines the Id of the new vertex.
value
Object to be used as the user object.
x
Integer that defines the x coordinate of the vertex.
y
Integer that defines the y coordinate of the vertex.
width
Integer that defines the width of the vertex.
height
Integer that defines the height of the vertex.
style
Optional string that defines the cell style.
relative
Optional boolean that specifies if the geometry is relative. Default is false.
-
-
createVertex
function createVertex(
$parent,
$id
=
null,
$value
=
null,
$x
=
0,
$y
=
0,
$width
=
1,
$height
=
1,
$style
=
null,
$relative
=
false
)
Creates the vertex to be used in insertVertex.
-
-
insertEdge
function insertEdge(
$parent,
$id
=
null,
$value
=
null,
$source
=
null,
$target
=
null,
$style
=
null
)
Adds a new edge into the given parent mxCell using value as the user object and the given source and target as the terminals of the new edge. The id and style are used for the respective properties of the new mxCell, which is returned.
Creates the edge to be used in insertEdge. This implementation does not set the source and target of the edge, these are set when the edge is added to the model.
Returns all children in the given parent which do not have incoming edges. If the result is empty then the with the greatest difference between incoming and outgoing edges is returned.
Optional boolean that specifies if edges should be ignored if the opposite end is not a child of the given parent cell. Default is false.
invert
Optional boolean that specifies if outgoing or incoming edges should be counted for a tree root. If false then outgoing edges will be counted. Default is false.
-
-
createImage
function createImage(
$clip
=
null,
$background
=
null
)
-
-
drawGraph
function drawGraph(
$canvas
)
Draws the given cell onto the specified canvas.
-
-
paintCell
Draws the given cell onto the specified canvas.
-
-
paintState
Draws the given cell and label onto the specified canvas. No children or descendants are painted.
Constructs a new graph model using the specified root cell.
var $stylesheet
Holds the mxStylesheet.
Defines the appearance of the cells in a graph.
var $view
Holds the mxGraphView.
Implements a view for the graph.
var $gridSize
Specifies the grid size.
var $labelsVisible
Specifies if labels should be visible.
var $defaultLoopStyle
mxEdgeStyle to be used for loops.
Provides various edge styles to be used as the values for mxConstants.STYLE_EDGE in a cell style.
protected $imageBundles
Holds the list of image bundles.
function createStylesheet()
Creates a new mxStylesheet to be used in this graph.
function createGraphView()
Creates a new mxGraphView to be used in this graph.
function getModel()
Returns the mxGraphModel that contains the cells.
function getStylesheet()
Returns the mxStylesheet that defines the style.
function getView()
Returns the mxGraphView that contains the mxCellStates.
Represents the current state of a cell in a given mxGraphView.
function getDefaultParent()
Returns the first child child of mxGraphModel.root.
var $root
Holds the root cell, which in turn contains the cells that represent the layers of the diagram as child cells.
function convertValueToString(
$cell
)
Returns the textual representation for the given cell.
function getLabel(
$cell
)
Returns a string or DOM node that represents the label for the given cell.
function getChildOffsetForCell(
$cell
)
Returns the offset to be used for the cells inside the given cell.
function isOrthogonal(
$edge
)
Returns true if perimeter points should be computed such that the resulting edge has only horizontal or vertical segments.
function isCellVisible(
$cell
)
Returns true if the given cell is visible.
function isCellCollapsed(
$cell
)
Returns true if the given cell is collapsed.
function getCellGeometry(
$cell
)
Returns the mxGeometry for the given mxCell.
Represents the geometry of a cell.
Cells are the elements of the graph model.
function getCellStyle(
$cell
)
function postProcessCellStyle(
$style
)
Tries to resolve the value for the image style in the image bundles and turns short data URIs as defined in mxImageBundle to data URIs as defined in RFC 2397 of the IETF.
function setCellStyles(
$key,
$value,
$cells
)
Sets the key to value in the styles of the given cells.
Maps from keys to base64 encoded images or file locations.
function removeImageBundle(
$bundle
)
Removes the specified mxImageBundle.
function getImageFromBundles(
$key
)
Searches all imageBundles for the specified key and returns the value for the first match or null if the key is not found.
function getImageBundles()
Returns the imageBundles.
function setImageBundles(
$value
)
Sets the imageBundles.
function insertVertex(
$parent,
$id
=
null,
$value
=
null,
$x
=
0,
$y
=
0,
$width
=
1,
$height
=
1,
$style
=
null,
$relative
=
false
)
Adds a new vertex into the given parent mxCell using value as the user object and the given coordinates as the mxGeometry of the new vertex.
function createVertex(
$parent,
$id
=
null,
$value
=
null,
$x
=
0,
$y
=
0,
$width
=
1,
$height
=
1,
$style
=
null,
$relative
=
false
)
Creates the vertex to be used in insertVertex.
function insertEdge(
$parent,
$id
=
null,
$value
=
null,
$source
=
null,
$target
=
null,
$style
=
null
)
Adds a new edge into the given parent mxCell using value as the user object and the given source and target as the terminals of the new edge.
function createEdge(
$parent,
$id
=
null,
$value
=
null,
$source
=
null,
$target
=
null,
$style
=
null
)
Creates the edge to be used in insertEdge.
function getGraphBounds()
Returns the bounds of the visible graph.
function getBoundingBox(
$cell,
$includeEdges
=
false,
$includeDescendants
=
false
)
Returns the bounding box of the given cell including all connected edges if includeEdge is true.
function getPaintBounds(
$cells
)
Returns the bounding box of the given cells and their descendants.
function getBoundsForCells(
$cells,
$includeEdges
=
false,
$includeDescendants
=
false,
$boundingBox
=
false
)
Returns the bounds for the given cells.
function getCellBounds(
$cell,
$includeEdges
=
false,
$includeDescendants
=
false,
$boundingBox
=
false
)
Returns the bounds of the given cell including all connected edges if includeEdge is true.
function getConnectionConstraint(
$edge,
$terminal,
$source
)
Returns an mxConnectionConstraint that describes the given connection point.
Defines an object that contains the constraints about how to connect one side of an edge to its terminal.
function getConnectionPoint(
$vertex,
$constraint
)
Returns the nearest point in the list of absolute points or the center of the opposite terminal.
function findTreeRoots(
$parent,
$isolate
=
false,
$invert
=
false
)
Returns all children in the given parent which do not have incoming edges.
-
-
-
\ No newline at end of file
diff --git a/docs/php-api/files/view/mxGraphView-php.html b/docs/php-api/files/view/mxGraphView-php.html
deleted file mode 100644
index 9b99cc61a..000000000
--- a/docs/php-api/files/view/mxGraphView-php.html
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-mxGraphView
-
-
-
-
-
-
-
-
-
-
mxGraphView
Implements a view for the graph. Fires scale and translate events if one of the values change.
This class fires the following events
mxEvent.SCALE fires after the scale was changed in setScale. The <code>scale</code> and <code>previousScale</code> arguments contain the new and previous scale.
mxEvent.TRANSLATE fires after the translate was changed in setTranslate. The <code>translate</code> and <code>previousTranslate</code> arguments contain the new and previous value for translate.
Returns an mxPoint that defines the location of the intersection point between the perimeter and the line between the center of the shape and the given point.
Returns the bounding for for an array of cells or null, if no cells are specified.
-
-
invalidate
-
-
invalidate
function invalidate()
Invalidates the cached cell states.
-
-
validate
function validate(
$cell
=
null
)
Calls validateCell and <validateCellState> and updates the graphBounds using getBoundingBox. Finally the background is validated using <validateBackground>.
Parameters
cell
Optional mxCell to be used as the root of the validation. Default is the root of the model.
-
-
getBoundingBox
function getBoundingBox(
$state,
$recurse
=
true
)
Returns the bounding box of the shape and the label for the given mxCellState and its children if recurse is true.
Parameters
state
mxCellState whose bounding box should be returned.
recurse
Optional boolean indicating if the children should be included. Default is true.
-
-
validateCell
function validateCell(
$cell,
$visible
=
true
)
Recursively creates the cell state for the given cell if visible is true and the given cell is visible. If the cell is not visible but the state exists then it is removed using removeState.
Boolean indicating if the given terminal is the source terminal.
-
-
getPerimeterPoint
function getPerimeterPoint(
$terminal,
$next,
$orthogonal,
$border
=
null
)
Returns an mxPoint that defines the location of the intersection point between the perimeter and the line between the center of the shape and the given point.
Boolean that specifies if the orthogonal projection onto the perimeter should be returned. If this is false then the intersection of the perimeter and the line between the next and the center point is returned.
border
Optional border between the perimeter and the shape.
-
-
getRoutingCenterX
function getRoutingCenterX(
$state
)
Returns the x-coordinate of the center point for automatic routing.
-
-
getRoutingCenterY
function getRoutingCenterY(
$state
)
Returns the y-coordinate of the center point for automatic routing.
-
-
getPerimeterBounds
function getPerimeterBounds(
$terminal,
$border
=
0
)
Returns the perimeter bounds for the given terminal, edge pair as an mxRectangle.
Returns the cell state for the specified cell. If create is true then the state is created and added to the cache if it does not yet exist.
-
-
getHashCode
function getHashCode(
$cell
)
Returns a unique string that represents the given instance.
-
-
getStates
function getStates()
Returns the mxCellStates for the given array of mxCells. The array contains all states that are not null, that is, the returned array may have less elements than the given array.
-
-
getStates
Returns the mxCellStates for the given array of mxCells. The array contains all states that are not null, that is, the returned array may have less elements than the given array.
-
-
removeState
function removeState(
$cell,
$recurse
=
false
)
Removes and returns the mxCellState for the given cell.
Implements a 2-dimensional point with double precision coordinates.
var $graph
Holds the mxGraph.
Implements a graph component.
var $graphBounds
Holds the bounds of the current view.
var $scale
Holds the current scale.
var $translate
Holds the current translate.
var $states
Maps from cells to states.
function mxGraphView(
$graph
)
Constructs a new view for the specified mxGraph.
function setScale(
$scale
)
Sets the scale, revalidates the view and fires a scale event.
function setTranslate(
$translate
)
Sets the translation, revalidates the view and fires a translate event.
function getGraphBounds()
Returns graphBounds.
function setGraphBounds(
$value
)
Sets graphBounds.
function getBounds(
$cells,
$boundingBox
=
false
)
Returns the bounding for for an array of cells or null, if no cells are specified.
function invalidate()
Invalidates the cached cell states.
function validate(
$cell
=
null
)
Calls validateCell and validateCellState and updates the graphBounds using getBoundingBox.
function validateCell(
$cell,
$visible
=
true
)
Recursively creates the cell state for the given cell if visible is true and the given cell is visible.
function getBoundingBox(
$state,
$recurse
=
true
)
Returns the bounding box of the shape and the label for the given mxCellState and its children if recurse is true.
Represents the current state of a cell in a given mxGraphView.
Cells are the elements of the graph model.
function updateCellState(
$state,
$source,
$target
)
Updates the given mxCellState.
function updateVertexState(
$state,
$geo
)
Validates the given cell state.
function updateEdgeState(
$state,
$geo,
$source,
$target
)
Validates the given cell state.
function updateVertexLabelOffset(
$state
)
Updates the absoluteOffset of the given vertex cell state.
function updateLabelBounds(
$state
)
Updates the label bounds in the given state.
function updateBoundingBox(
$state
)
Updates the bounding box in the given cell state.
function updateFixedTerminalPoints(
$edge,
$source,
$target
)
Sets the initial absolute terminal points in the given state before the edge style is computed.
function updateFixedTerminalPoint(
$edge,
$terminal,
$source,
$constraint
)
Sets the fixed source or target terminal point on the given edge.
function updatePoints(
$edge,
$points,
$source,
$target
)
Updates the absolute points in the given state using the specified array of mxPoints as the relative points.
function transformControlPoint(
$state,
$pt
)
Transforms the given control point to an absolute point.
function getEdgeStyle(
$edge,
$points,
$source,
$target
)
Returns the edge style function to be used to render the given edge state.
function updateFloatingTerminalPoints(
$state,
$source,
$target
)
Updates the terminal points in the given state after the edge style was computed for the edge.
function updateFloatingTerminalPoint(
$edge,
$start,
$end,
$source
)
Updates the absolute terminal point in the given state for the given start and end state, where start is the source if source is true.
function getTerminalPort(
$state,
$terminal,
$source
)
Returns an mxCellState that represents the source or target terminal or port for the given edge.
function getPerimeterPoint(
$terminal,
$next,
$orthogonal,
$border
=
null
)
Returns an mxPoint that defines the location of the intersection point between the perimeter and the line between the center of the shape and the given point.
function getRoutingCenterX(
$state
)
Returns the x-coordinate of the center point for automatic routing.
function getRoutingCenterY(
$state
)
Returns the y-coordinate of the center point for automatic routing.
function getPerimeterBounds(
$terminal,
$border
=
0
)
Returns the perimeter bounds for the given terminal, edge pair as an mxRectangle.
Implements a 2-dimensional rectangle with double precision coordinates.
function getPerimeterFunction(
$state
)
Returns the perimeter function for the given state.
function getNextPoint(
$edge,
$opposite,
$source
)
Returns the nearest point in the list of absolute points or the center of the opposite terminal.
function getVisibleTerminal(
$edge,
$source
)
Returns the nearest ancestor terminal that is visible.
function updateEdgeBounds(
$state
)
Updates the bounds of the specified state based on the absolute points in the state.
function getPoint(
$state,
$geometry
=
null
)
Returns the absolute point on the edge for the given relative mxGeometry as an mxPoint.
Represents the geometry of a cell.
function getState(
$cell,
$create
=
false
)
Returns the cell state for the specified cell.
function getHashCode(
$cell
)
Returns a unique string that represents the given instance.
function getStates()
Returns the mxCellStates for the given array of mxCells.
function removeState(
$cell,
$recurse
=
false
)
Removes and returns the mxCellState for the given cell.
function createState(
$cell
)
Creates the state for the specified cell.
Defines an object that contains the constraints about how to connect one side of an edge to its terminal.
mxPoint that represents the nearest neighbour point on the given edge.
orthogonal
Boolean that specifies if the orthogonal projection onto the perimeter should be returned. If this is false then the intersection of the perimeter and the line between the next and the center point is returned.
-
-
mxRectanglePerimeter
Implements a rectangular perimeter for the given bounds.
-
-
mxEllipsePerimeter
Implements an elliptic perimeter. See <RectanglePerimeter> for a description of the parameters.
-
-
mxRhombusPerimeter
Implements a rhombus (aka diamond) perimeter. See <RectanglePerimeter> for a description of the parameters.
-
-
mxTrianglePerimeter
Implements a triangle perimeter. See <RectanglePerimeter> for a description of the parameters.
Returns the cell style for the specified cell or the given defaultStyle if no style can be found for the given stylename.
-
-
Functions
-
-
styles
var $styles = array()
Maps from names to styles.
-
-
mxStylesheet
function mxStylesheet()
Constructs a new stylesheet and assigns default styles.
-
-
createDefaultVertexStyle
function createDefaultVertexStyle()
Creates and returns the default vertex style.
-
-
createDefaultEdgeStyle
function createDefaultEdgeStyle()
Creates and returns the default edge style.
-
-
putDefaultVertexStyle
function putDefaultVertexStyle(
$style
)
Sets the default style for vertices.
-
-
putDefaultEdgeStyle
function putDefaultEdgeStyle(
$style
)
Sets the default style for edges.
-
-
getDefaultVertexStyle
function getDefaultVertexStyle()
Returns the default style for vertices.
-
-
getDefaultEdgeStyle
function getDefaultEdgeStyle()
Sets the default style for edges.
-
-
putCellStyle
function putCellStyle(
$name,
$style
)
Stores the specified style under the given name.
Example
The following example adds a new style (called ‘rounded’) into an existing stylesheet:
var style = new Array();
-style[mxConstants.STYLE_SHAPE] = mxConstants.SHAPE_RECTANGLE;
-style[mxConstants.STYLE_PERIMETER] = mxPerimeter.RightAngleRectanglePerimeter;
-style[mxConstants.STYLE_ROUNDED] = 'true';
-graph.stylesheet.putCellStyle('rounded', style);
In the above example, the new style is an array. The possible keys of the array are all the constants in mxConstants that start with STYLE and the values are either JavaScript objects, such as <mxPerimeter.RightAngleRectanglePerimeter> (which is in fact a function) or expressions, such as ‘true’. Note that not all keys will be interpreted by all shapes (eg. the line shape ignores the fill color). The final call to this method associates the style with a name in the stylesheet. The style is used in a cell with the following code:
model.setStyle(cell, 'rounded');
Parameters
name
Name for the style to be stored.
style
Key, value pairs that define the style.
-
-
getCellStyle
function getCellStyle(
$name,
$defaultStyle
=
null
)
Returns the cell style for the specified cell or the given defaultStyle if no style can be found for the given stylename.
Parameters
name
String of the form [(stylename|key=value);] that represents the style.
defaultStyle
Default style to be returned if no style can be found.
Adds the specified child to the parent at the given index using mxChildChange and adds the change to the current transaction.
function add(
$rect
)
Adds the given rectangle to this rectangle.
static function addAlias(
$classname,
$codecname
)
Adds an alias for mapping a classname to a codecname.
Adds the specified mxImageBundle.
function addElement(
$node
)
Adds the given element to elements if it has an ID.
function addListener(
$name,
$listener
)
Adds a listener for the given event name.
static function addLogfile(
$filename
)
Adds a file for logging.
function addObjectValue(
&
$obj,
$fieldname,
$value,
$template
)
Sets the decoded child node as a value of the given object.
static function addStylename(
$style,
$stylename
)
Adds the specified stylename to the given style if it does not already contain the stylename.
function afterDecode(
$dec,
$node,
&
$obj
)
Hook for subclassers to post-process the object after decoding.
function afterEncode(
$enc,
$obj,
$node
)
Hook for subclassers to post-process the node for the given object after encoding and return the post-processed node.
public function apply(
$state,
$source,
$target,
$points,
&
$result
)
Implements an edge style function.
public function apply(
$bounds,
$vertex,
$next,
$orthogonal
)
Implements a perimeter function.
-
-
-
-
function beforeDecode(
$dec,
$node,
&
$obj
)
Hook for subclassers to pre-process the node for the specified object and return the node to be used for further processing by decode.
function beforeEncode(
$enc,
$obj,
$node
)
Hook for subclassers to pre-process the object before encoding.
function beginUpdate()
Increments the updateLevel by one.
-
-
-
-
function cellAdded(
$cell
)
Inner callback to update cells when a cell has been added.
function cellCloned(
$cell
)
Hook for cloning the cell.
function cellRemoved(
$cell
)
Inner callback to update cells when a cell has been removed.
function clear()
Sets a new root using createRoot.
function cloneCell(
$cell
)
Returns a deep clone of the given mxCell (including the children) which is created using cloneCells.
function cloneCellImpl(
$cell,
$mapping,
$includeChildren
)
Inner helper method for cloning cells recursively.
function cloneCells(
$cells,
$includeChildren
=
true
)
Returns an array of clones for the given array of mxCells.
function cloneTemplate()
Creates a new instance of the template for this codec.
static function close()
Closes all open logfiles.
function consume()
Consumes the event.
function contains(
$cell
)
Returns true if the model contains the given mxCell.
static function contains(
$state,
$x,
$y
)
Returns true if the specified point (x, y) is contained in the given rectangle.
static function convert(
$string,
$background
=
null
)
Creates the HTML markup for the given display XML string.
static function convert(
$string,
$background
=
null
)
Creates the image for the given display XML string.
static function convertFile(
$filename,
$background
=
null
)
Creates the HTML markup for the given display XML file.
static function convertFile(
$filename,
$background
=
null
)
Creates the image for the given display XML file.
function convertValueFromXml(
$value
)
Returns the given value.
function convertValueToString(
$cell
)
Returns the textual representation for the given cell.
function convertValueToXml(
$value
)
Returns the given value without applying a conversion.
function copy()
Returns a clone of the cell.
function copy()
Returns a copy of this state where all members are deeply cloned except the view and cell references, which are copied with no cloning to the new instance.
function copy()
Returns a copy of this mxGeometry.
function copy()
Returns a copy of this mxPoint.
function copy()
Returns a copy of this mxRectangle.
function copyValue()
Returns a clone of the cell’s user object.
static function create(
$cell
)
Creates the cell path for the given cell.
function createCanvas(
$attrs
)
Returns the canvas to be used for rendering.
function createCanvas(
$attrs
)
Returns the canvas to be used for rendering.
function createDefaultEdgeStyle()
Creates and returns the default edge style.
function createDefaultVertexStyle()
Creates and returns the default vertex style.
function createEdge(
$parent,
$id
=
null,
$value
=
null,
$source
=
null,
$target
=
null,
$style
=
null
)
Creates the edge to be used in insertEdge.
function createGraphView()
Creates a new mxGraphView to be used in this graph.
function createId(
$cell
)
Hook method to create an Id for the specified cell.
function createImage(
$clip
=
null,
$background
=
null
)
function createRoot()
Creates a new root cell with a default layer (child 0).
function createState(
$cell
)
Creates the state for the specified cell.
function createStylesheet()
Creates a new mxStylesheet to be used in this graph.
Encodes the specified object and returns the resulting XML node.
function encode(
$enc,
$obj
)
Encodes the specified object and returns a node representing then given object.
function encodeCell(
$cell,
$node,
$includeChildren
=
true
)
Encoding of cell hierarchies is built-into the core, but is a higher-level function that needs to be explicitely used by the respective object encoders (eg.
static function encodeImage(
$image,
$format
=
null
)
Encodes the given image using the GD image encoding routines.
function encodeObject(
$enc,
$obj,
$node
)
Encodes the value of each member in then given obj into the given node using encodeValue.
function encodeValue(
$enc,
$obj,
$name,
$value,
$node
)
Converts the given value according to the mappings and id-refs in this codec and uses writeAttribute to write the attribute into the given node.
function endElement(
$parser,
$name
)
Invoked by the SAX parser when an element ends.
function endUpdate()
Decrements the updateLevel by one and fires a notification event if the updateLevel reaches 0.
static function enter(
$method,
$text
=
""
)
Logs a method entry.
function equals(
$obj
)
Returns true if the given object equals this point.
function equals(
$obj
)
Returns true if the given object equals this rectangle.
static function error(
$text
)
Logs an error trace.
static function evaluate(
$expression
)
Evaluates an expression to a class member.
-
-
-
-
static function findNode(
$node,
$attr,
$value
)
Returns the first node where attr equals value.
function findTreeRoots(
$parent,
$isolate
=
false,
$invert
=
false
)
Returns all children in the given parent which do not have incoming edges.
static function fine(
$text
)
Logs a fine trace.
function fireEvent(
$event
)
Fires the event for the specified name.
static function flipImage(
$img,
$flipH,
$flipV
)
Flips the given image horizontally and/or vertically and returns a new image instance.
Returns the specified attribute from the user object if it is an XML node.
function getAttributeName(
$fieldname
)
Returns the attributename for the given fieldname.
function getBoundingBox(
$cell,
$includeEdges
=
false,
$includeDescendants
=
false
)
Returns the bounding box of the given cell including all connected edges if includeEdge is true.
function getBoundingBox(
$state,
$recurse
=
true
)
Returns the bounding box of the shape and the label for the given mxCellState and its children if recurse is true.
static function getBoundingBox(
$rect,
$rotation
)
Returns the bounding box for the rotated rectangle.
function getBounds(
$cells,
$boundingBox
=
false
)
Returns the bounding for for an array of cells or null, if no cells are specified.
function getBoundsForCells(
$cells,
$includeEdges
=
false,
$includeDescendants
=
false,
$boundingBox
=
false
)
Returns the bounds for the given cells.
function getCellBounds(
$cell,
$includeEdges
=
false,
$includeDescendants
=
false,
$boundingBox
=
false
)
Returns the bounds of the given cell including all connected edges if includeEdge is true.
function getCellGeometry(
$cell
)
Returns the mxGeometry for the given mxCell.
function getCells()
Returns the internal lookup table that is used to map from Ids to cells.
function getCellStyle(
$cell
)
function getCellStyle(
$name,
$defaultStyle
=
null
)
Returns the cell style for the specified cell or the given defaultStyle if no style can be found for the given stylename.
function getCenterX()
Returns the x-coordinate of the center point.
function getCenterY()
Returns the y-coordinate of the center point.
function getChildAt(
$index
)
Returns the child at the specified index.
function getChildAt(
$cell,
$index
)
Returns the child of the given mxCell at the given index.
function getChildCount()
Returns the number of child cells.
function getChildCount(
$cell
)
Returns the number of children in the given cell.
function getChildOffsetForCell(
$cell
)
Returns the offset to be used for the cells inside the given cell.
static function getCodec(
$name
)
Returns a codec that handles objects that are constructed using the given ctor.
function getColor(
$hex,
$default
=
null
)
Allocates the given color and returns a reference to it.
function getConnectionConstraint(
$edge,
$terminal,
$source
)
Returns an mxConnectionConstraint that describes the given connection point.
function getConnectionPoint(
$vertex,
$constraint
)
Returns the nearest point in the list of absolute points or the center of the opposite terminal.
function getDefaultEdgeStyle()
Sets the default style for edges.
function getDefaultParent()
Returns the first child child of mxGraphModel.root.
function getDefaultVertexStyle()
Returns the default style for vertices.
function getDirectedEdgeCount(
$cell,
$outgoing,
$ignoredEdge
=
null
)
Returns the number of incoming or outgoing edges, ignoring the given edge.
function getEdgeAt(
$index
)
Returns the edge at the specified index in edges.
function getEdgeAt(
$cell,
$index
)
Returns the edge of cell at the given index.
function getEdgeCount()
Returns the number of edges in the edge array.
function getEdgeCount(
$cell
)
Returns the number of distinct edges connected to the given cell.
function getEdgeIndex(
$edge
)
Returns the index of the specified edge in edges.
function getEdges(
$cell
)
Returns all distinct edges connected to this cell as an array of mxCells.
function getEdgeStyle(
$edge,
$points,
$source,
$target
)
Returns the edge style function to be used to render the given edge state.
function getElementById(
$id
)
Returns the element with the given ID from document.
function getFieldName(
$attributename
)
Returns the fieldname for the given attributename.
function getFieldTemplate(
&
$obj,
$fieldname,
$child
)
Returns the template instance for the given field.
function getFixedFontSize(
$fontSize,
$fontFamily,
$fontStyle
=
null
)
Returns the fixed font size for GD (1 t0 5) for the given font properties
static function getFixedFontSize(
$fontSize,
$fontFamily,
$fontStyle
=
null
)
Returns the fixed font size for GD (1 t0 5) for the given font properties
function getGeometry()
Returns the mxGeometry that describes the geometry.
function getGeometry(
$cell
)
Returns the mxGeometry of the given mxCell.
function getGraphBounds()
Returns the bounds of the visible graph.
function getGraphBounds()
Returns graphBounds.
function getHashCode(
$cell
)
Returns a unique string that represents the given instance.
function getHtml()
Gets the HTML that represents the canvas.
function getId()
Returns the Id of the cell as a string.
function getId(
$obj
)
Returns the ID of the specified object.
function getImage()
Returns an image that represents this canvas.
function getImage(
$key
)
Returns the value for the given key.
function getImageBundles()
Returns the imageBundles.
function getImageForStyle(
$style
)
Returns an image that represents this canvas.
function getImageFromBundles(
$key
)
Searches all imageBundles for the specified key and returns the value for the first match or null if the key is not found.
function getImages()
Returns the images.
function getIndex(
$child
)
Returns the index of the specified child in the child array.
static function getInstanceForName(
$name
)
Creates and returns a new instance for the given class name.
function getLabel(
$cell
)
Returns a string or DOM node that represents the label for the given cell.
static function getLabelPaintBounds(
$label,
$style,
$isHtml,
$offset,
$vertexBounds,
$scale
)
Returns the paint bounds for the given label.
static function getLabelSize(
$label,
$style
)
Returns the size of the given label.
function getModel()
Returns the mxGraphModel that contains the cells.
static function getName(
$obj
)
Returns the codec name for the given object instance.
function getName()
Returns name.
function getName()
Creates a new instance of the template for this codec.
static function getName(
$value
)
Returns the name for the given value.
function getNearestCommonAncestor(
$cell1,
$cell2
)
Returns the nearest common ancestor for the specified cells.
function getNextPoint(
$edge,
$opposite,
$source
)
Returns the nearest point in the list of absolute points or the center of the opposite terminal.
static function getNumber(
$dict,
$key,
$default
=
)
Returns the value for key in dictionary or 0 if no value is defined for the key.
function getObject(
$id
)
Returns the decoded object for the element with the specified ID in document.
function getOrigin(
$cell
)
Returns the absolute, cummulated origin for the children inside the given parent as an mxPoint.
function getPaintBounds(
$cells
)
Returns the bounding box of the given cells and their descendants.
function getParent()
Returns the cell’s parent.
function getParent(
$cell
)
Returns the parent of the given cell.
static function getParentPath(
$path
)
Returns the cell for the specified cell path using the given root as the root of the path.
function getPerimeterBounds(
$border
=
0
)
Returns the mxRectangle that should be used as the perimeter of the cell.
function getPerimeterBounds(
$terminal,
$border
=
0
)
Returns the perimeter bounds for the given terminal, edge pair as an mxRectangle.
function getPerimeterFunction(
$state
)
Returns the perimeter function for the given state.
function getPerimeterPoint(
$terminal,
$next,
$orthogonal,
$border
=
null
)
Returns an mxPoint that defines the location of the intersection point between the perimeter and the line between the center of the shape and the given point.
function getPoint(
$state,
$geometry
=
null
)
Returns the absolute point on the edge for the given relative mxGeometry as an mxPoint.
function getProperties()
Returns properties.
function getProperty(
$key
)
Returns the property value for the given key.
function getRoot()
Returns the root of the model.
static function getRotatedPoint(
$pt,
$cos,
$sin,
$cx
=
null
)
Rotates the given point by the given cos and sin.
function getRoutingCenterX(
$state
)
Returns the x-coordinate of the center point for automatic routing.
function getRoutingCenterY(
$state
)
Returns the y-coordinate of the center point for automatic routing.
static function getScaledLabelBounds(
$x,
$y,
$size,
$outerWidth,
$outerHeight,
$style,
$scale
)
Returns the bounds for a label for the given location and size, taking into account the alignment and spacing in the specified style, as well as the width and height of the rectangle that contains the label.
static function getSizeForString(
$text,
$fontSize
=
0,
$fontFamily
=
null
)
Returns an mxRectangle with the size (width and height in pixels) of the given string.
function getState(
$cell,
$create
=
false
)
Returns the cell state for the specified cell.
function getStates()
Returns the mxCellStates for the given array of mxCells.
function getStyle()
Returns a string that describes the style.
function getStyle(
$cell
)
Returns the style of the given mxCell.
static function getStylename(
$style
)
Returns the stylename in a style of the form [stylename;|key=value;] or an empty string if the given style does not contain a stylename.
static function getStylenames(
$style
)
Returns the stylenames in a style of the form [stylename;|key=value;] or an empty array if the given style does not contain any stylenames.
function getStylesheet()
Returns the mxStylesheet that defines the style.
function getTerminal(
$source
)
Returns the source or target terminal.
function getTerminal(
$edge,
$cource
)
Returns the source or target mxCell of the given edge depending on the value of the boolean parameter.
function getTerminalPoint(
$isSource
)
Returns the mxPoint representing the source or target point of this edge.
function getTerminalPort(
$state,
$terminal,
$source
)
Returns an mxCellState that represents the source or target terminal or port for the given edge.
function getTrueTypeFont(
$style
)
Returns the truetype font to be used to draw the text with the given style.
static function getTrueTypeFont(
$style
)
Returns the truetype font to be used to draw the text with the given style.
function getTrueTypeFontSize(
$style
)
Returns the truetype font size to be used to draw the text with the given style.
static function getTrueTypeFontSize(
$size
)
Returns the truetype font size to be used to draw the text with the given style.
function getValue()
Returns the user object of the cell.
function getValue(
$cell
)
Returns the user object of the given mxCell using mxCell.getValue.
static function getValue(
$name
)
Returns the value associated with the given name.
static function getValue(
$dict,
$key,
$default
=
null
)
Returns the value for key in dictionary or the given default value if no value is defined for the key.
function getView()
Returns the mxGraphView that contains the mxCellStates.
function getVisibleTerminal(
$edge,
$source
)
Returns the nearest ancestor terminal that is visible.
function graphModelChanged(
$event
)
Called when the graph model has changed.
function grow(
$amount
)
Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height.
Returns the index of obj in array or -1 if the array does not contains the given object.
static function indexOfStylename(
$style,
$stylename
)
Returns the index of the given stylename in the given style.
static function info(
$text
)
Logs an info trace.
function insert(
$child,
$index
=
null
)
Inserts the specified child into the child array at the specified index and updates the parent reference of the child.
function insertEdge(
$edge,
$outgoing
)
Inserts the specified edge into the edge array and returns the edge.
function insertEdge(
$parent,
$id
=
null,
$value
=
null,
$source
=
null,
$target
=
null,
$style
=
null
)
Adds a new edge into the given parent mxCell using value as the user object and the given source and target as the terminals of the new edge.
function insertIntoGraph(
$cell
)
Inserts the given cell into its parent and terminal cells.
function insertVertex(
$parent,
$id
=
null,
$value
=
null,
$x
=
0,
$y
=
0,
$width
=
1,
$height
=
1,
$style
=
null,
$relative
=
false
)
Adds a new vertex into the given parent mxCell using value as the user object and the given coordinates as the mxGeometry of the new vertex.
static function intersection(
$x0,
$y0,
$x1,
$y1,
$x2,
$y2,
$x3,
$y3
)
Returns the intersection of two lines as an mxPoint.
function isAncestor(
$parent,
$child
)
Returns true if the given parent is an ancestor of the given child.
function isCellCollapsed(
$cell
)
Returns true if the given cell is collapsed.
function isCellVisible(
$cell
)
Returns true if the given cell is visible.
function isCollapsed()
Returns true if the cell is collapsed.
function isCollapsed(
$cell
)
Returns true if the given mxCell is collapsed.
function isConnectable()
Returns true if the cell is connectable.
function isConnectable(
$cell
)
Returns true if the given mxCell is connectable.
function isConsumed()
Returns true if the event has been consumed.
function isEdge()
Returns true if the cell is an edge.
function isEdge(
$cell
)
Returns true if the given cell is an edge.
function isExcluded(
$obj,
$attr,
$value,
$write
)
Returns true if the given attribute is to be ignored by the codec.
static function isNode(
$value,
$nodeName
=
null,
$attributeName
=
null,
$attributeValue
=
null
)
Returns true if the given value is an XML node with the node name and if the optional attribute has the specified value.
function isOrthogonal(
$edge
)
Returns true if perimeter points should be computed such that the resulting edge has only horizontal or vertical segments.
function isReference(
$obj,
$attr,
$value,
$write
)
Returns true if the given fieldname is to be treated as a textual reference (ID).
function isVertex()
Returns true if the cell is a vertex.
function isVertex(
$cell
)
Returns true if the given cell is a vertex.
function isVisible()
Returns true if the cell is visibile.
function isVisible(
$cell
)
Returns true if the given mxCell is visible.
-
-
-
-
static function leave(
$text
=
""
)
Logs a method exit.
function loadImage(
$image
)
Returns an image instance for the given URL.
static function loadImage(
$url
)
Loads an image from the local filesystem, a data URI or any other URL.
static function loadXmlDocument(
$uri
)
Returns a new DOM document for the given URI.
function lookup(
$id
)
Hook for subclassers to implement a custom lookup mechanism for cell IDs.
-
-
-
-
function mergeChildren(
$from,
$to,
$cloneAllEdges
=
true
)
Merges the children of the given cell into the given target cell inside this model.
function mergeChildrenImpl(
$from,
$to,
$cloneAllEdges,
$mapping
)
Clones the children of the source cell into the given target cell in this model and adds an entry to the mapping that maps from the source cell to the target cell with the same id or the clone of the source cell that was inserted into this model.
function mxCell(
$value
=
null,
$geometry
=
null,
$style
=
null
)
Constructs a new cell to be used in a graph model.
function mxCellState(
$view
=
null,
$cell
=
null,
$style
=
null
)
Constructs a new object that represents the current state of the given cell in the specified view.
function mxConnectionConstraint(
$point
=
null,
$perimeter
=
true
)
Constructs a new connection constraint for the given point and boolean arguments.
function mxEventObject(
$name
)
Constructs a new event for the given name and properties.
function mxGdCanvas(
$width
=
0,
$height
=
0,
$scale
=
1,
$background
=
null,
$imageBasePath
=
""
)
Constructs a new GD canvas.
Constructs a new GD canvas.
function mxGeometry(
$x
=
0,
$y
=
0,
$width
=
0,
$height
=
0
)
Constructs a new object to describe the size and location of a vertex or the control points of an edge.
Constructs a new graph model using the specified root cell.
function mxGraphModel(
$root
=
null
)
Constructs a new graph model using the specified root cell.
function mxGraphView(
$graph
)
Constructs a new view for the specified mxGraph.
Constructs a new HTML graph view reader.
function mxGraphViewHtmlReader()
Constructs a new HTML graph view reader.
function mxGraphViewImageReader(
$background
=
null,
$border
=
0
)
Constructs a new image graph view reader.
function mxImageBundle()
Constructs a new image bundle.
Constructs a new codec for the specified template object.
Constructs a new codec for the specified template object.
function mxObjectCodec(
$template,
$exclude
=
array(),
$idrefs
=
array(),
$mapping
=
array()
)
Constructs a new codec for the specified template object.
Constructs a new codec for the specified template object.
function mxPoint(
$x
=
0,
$y
=
0
)
Constructs a new point for the optional x and y coordinates.
function mxRectangle(
$x
=
0,
$y
=
0,
$width
=
0,
$height
=
0
)
Constructs a new rectangle for the optional parameters.
function mxStylesheet()
Constructs a new stylesheet and assigns default styles.
-
-
-
-
function offset(
$points,
$dx
=
null,
$dy
=
null
)
Creates a new array of x, y sequences where the each coordinate is translated by dx and dy, respectively.
Draws the given cell and label onto the specified canvas.
function parsePoints(
$str
)
Parses a string that represents a list of points into an array of mxPoints.
function parseState(
$state,
$edge
)
Parses the bounds, absolute points and label information from the style of the state into its respective fields and returns the label of the cell.
static function parseXml(
$xml
)
Returns a new DOM document for the given XML string.
function postProcessCellStyle(
$style
)
Tries to resolve the value for the image style in the image bundles and turns short data URIs as defined in mxImageBundle to data URIs as defined in RFC 2397 of the IETF.
function processInclude(
$dec,
$node,
$into
)
Returns true if the given node is an include directive and executes the include by decoding the XML document.
function putCellStyle(
$name,
$style
)
Stores the specified style under the given name.
function putDefaultEdgeStyle(
$style
)
Sets the default style for edges.
function putDefaultVertexStyle(
$style
)
Sets the default style for vertices.
function putImage(
$key,
$value
)
Adds the specified entry to the map.
function putObject(
$id,
$object
)
Assoiates the given object with the given ID.
static function putValue(
$name,
$value
)
Puts the given object into the registry under the given name.
-
-
-
-
function read(
$string
)
Reads the specified view XML string.
function readFile(
$filename
)
Reads the specified view XML file in blocks of 4096 bytes.
static function readFile(
$filename
)
Reads the given filename into a string.
function reference(
$obj
)
Hook for subclassers to implement a custom method for retrieving IDs from objects.
static function register(
$codec
)
Registers a new codec and associates the name of the template constructor in the codec with the codec object.
function remove(
$index
)
Removes the child at the specified index from the child array and returns the child that was removed.
function remove(
$cell
)
Removes the specified cell from the model using mxChildChange and adds the change to the current transaction.
static function removeAllStylenames(
$style
)
Removes all stylenames from the given style and returns the updated style.
function removeEdge(
$edge,
$outgoing
)
Removes the specified edge from the edge array and returns the edge.
function removeFromParent()
Removes the cell from its parent.
function removeFromTerminal(
$source
)
Removes the edge from its source or target terminal.
function removeImageBundle(
$bundle
)
Removes the specified mxImageBundle.
function removeState(
$cell,
$recurse
=
false
)
Removes and returns the mxCellState for the given cell.
static function removeStylename(
$style,
$stylename
)
Removes all occurrences of the specified stylename in the given style and returns the updated style.
static function resolve(
$root,
$path
)
Returns the cell for the specified cell path using the given root as the root of the path.
function restoreClone(
$clne,
$cell,
$mapping
)
Inner helper method for restoring the connections in a network of cloned cells.
Reference to the mxCell that is represented by this state.
function cellAdded(
$cell
)
Inner callback to update cells when a cell has been added.
function cellCloned(
$cell
)
Hook for cloning the cell.
function cellRemoved(
$cell
)
Inner callback to update cells when a cell has been removed.
var $cells
Maps from Ids to cells.
var $children
Holds the child cells.
function clear()
Sets a new root using createRoot.
function cloneCell(
$cell
)
Returns a deep clone of the given mxCell (including the children) which is created using cloneCells.
function cloneCellImpl(
$cell,
$mapping,
$includeChildren
)
Inner helper method for cloning cells recursively.
function cloneCells(
$cells,
$includeChildren
=
true
)
Returns an array of clones for the given array of mxCells.
function cloneTemplate()
Creates a new instance of the template for this codec.
static function close()
Closes all open logfiles.
Maps from constructor names to codecs.
public static $codecs
Maps from constructor names to codecs.
var $collapsed
Specifies whether the cell is collapsed.
var $connectable
Specifies whether the cell is connectable.
function consume()
Consumes the event.
var $consumed
Holds the consumed state of the event.
function contains(
$cell
)
Returns true if the model contains the given mxCell.
static function contains(
$state,
$x,
$y
)
Returns true if the specified point (x, y) is contained in the given rectangle.
static function convert(
$string,
$background
=
null
)
Creates the HTML markup for the given display XML string.
static function convert(
$string,
$background
=
null
)
Creates the image for the given display XML string.
static function convertFile(
$filename,
$background
=
null
)
Creates the HTML markup for the given display XML file.
static function convertFile(
$filename,
$background
=
null
)
Creates the image for the given display XML file.
function convertValueFromXml(
$value
)
Returns the given value.
function convertValueToString(
$cell
)
Returns the textual representation for the given cell.
function convertValueToXml(
$value
)
Returns the given value without applying a conversion.
function copy()
Returns a clone of the cell.
function copy()
Returns a copy of this state where all members are deeply cloned except the view and cell references, which are copied with no cloning to the new instance.
function copy()
Returns a copy of this mxGeometry.
function copy()
Returns a copy of this mxPoint.
function copy()
Returns a copy of this mxRectangle.
function copyValue()
Returns a clone of the cell’s user object.
static function create(
$cell
)
Creates the cell path for the given cell.
function createCanvas(
$attrs
)
Returns the canvas to be used for rendering.
function createCanvas(
$attrs
)
Returns the canvas to be used for rendering.
function createDefaultEdgeStyle()
Creates and returns the default edge style.
function createDefaultVertexStyle()
Creates and returns the default vertex style.
function createEdge(
$parent,
$id
=
null,
$value
=
null,
$source
=
null,
$target
=
null,
$style
=
null
)
Creates the edge to be used in insertEdge.
function createGraphView()
Creates a new mxGraphView to be used in this graph.
function createId(
$cell
)
Hook method to create an Id for the specified cell.
var $createIds
Specifies if the model should automatically create Ids for new cells.
function createImage(
$clip
=
null,
$background
=
null
)
function createRoot()
Creates a new root cell with a default layer (child 0).
function createState(
$cell
)
Creates the state for the specified cell.
function createStylesheet()
Creates a new mxStylesheet to be used in this graph.
Specifies if truetype fonts are enabled if available.
function encode(
$obj
)
Encodes the specified object and returns the resulting XML node.
function encode(
$enc,
$obj
)
Encodes the specified object and returns a node representing then given object.
function encodeCell(
$cell,
$node,
$includeChildren
=
true
)
Encoding of cell hierarchies is built-into the core, but is a higher-level function that needs to be explicitely used by the respective object encoders (eg.
var $encodeDefaults
Specifies if default values should be encoded.
static function encodeImage(
$image,
$format
=
null
)
Encodes the given image using the GD image encoding routines.
function encodeObject(
$enc,
$obj,
$node
)
Encodes the value of each member in then given obj into the given node using encodeValue.
function encodeValue(
$enc,
$obj,
$name,
$value,
$node
)
Converts the given value according to the mappings and id-refs in this codec and uses writeAttribute to write the attribute into the given node.
function endElement(
$parser,
$name
)
Invoked by the SAX parser when an element ends.
function endUpdate()
Decrements the updateLevel by one and fires a notification event if the updateLevel reaches 0.
static function enter(
$method,
$text
=
""
)
Logs a method entry.
public static $ENTITY_SEGMENT
Defines the length of the horizontal segment of an Entity Relation.
public static $EntityRelation
Provides an entity relation style for edges (as used in database schema diagrams).
function equals(
$obj
)
Returns true if the given object equals this point.
function equals(
$obj
)
Returns true if the given object equals this rectangle.
static function error(
$text
)
Logs an error trace.
static function evaluate(
$expression
)
Evaluates an expression to a class member.
var $eventListeners
Holds the registered listeners.
var $exclude
Array containing the variable names that should be ignored by the codec.
-
-
-
-
static function findNode(
$node,
$attr,
$value
)
Returns the first node where attr equals value.
function findTreeRoots(
$parent,
$isolate
=
false,
$invert
=
false
)
Returns all children in the given parent which do not have incoming edges.
static function fine(
$text
)
Logs a fine trace.
function fireEvent(
$event
)
Fires the event for the specified name.
static function flipImage(
$img,
$flipH,
$flipV
)
Flips the given image horizontally and/or vertically and returns a new image instance.
Returns the specified attribute from the user object if it is an XML node.
function getAttributeName(
$fieldname
)
Returns the attributename for the given fieldname.
function getBoundingBox(
$cell,
$includeEdges
=
false,
$includeDescendants
=
false
)
Returns the bounding box of the given cell including all connected edges if includeEdge is true.
function getBoundingBox(
$state,
$recurse
=
true
)
Returns the bounding box of the shape and the label for the given mxCellState and its children if recurse is true.
static function getBoundingBox(
$rect,
$rotation
)
Returns the bounding box for the rotated rectangle.
function getBounds(
$cells,
$boundingBox
=
false
)
Returns the bounding for for an array of cells or null, if no cells are specified.
function getBoundsForCells(
$cells,
$includeEdges
=
false,
$includeDescendants
=
false,
$boundingBox
=
false
)
Returns the bounds for the given cells.
function getCellBounds(
$cell,
$includeEdges
=
false,
$includeDescendants
=
false,
$boundingBox
=
false
)
Returns the bounds of the given cell including all connected edges if includeEdge is true.
function getCellGeometry(
$cell
)
Returns the mxGeometry for the given mxCell.
function getCells()
Returns the internal lookup table that is used to map from Ids to cells.
function getCellStyle(
$cell
)
function getCellStyle(
$name,
$defaultStyle
=
null
)
Returns the cell style for the specified cell or the given defaultStyle if no style can be found for the given stylename.
function getCenterX()
Returns the x-coordinate of the center point.
function getCenterY()
Returns the y-coordinate of the center point.
function getChildAt(
$index
)
Returns the child at the specified index.
function getChildAt(
$cell,
$index
)
Returns the child of the given mxCell at the given index.
function getChildCount()
Returns the number of child cells.
function getChildCount(
$cell
)
Returns the number of children in the given cell.
function getChildOffsetForCell(
$cell
)
Returns the offset to be used for the cells inside the given cell.
static function getCodec(
$name
)
Returns a codec that handles objects that are constructed using the given ctor.
function getColor(
$hex,
$default
=
null
)
Allocates the given color and returns a reference to it.
function getConnectionConstraint(
$edge,
$terminal,
$source
)
Returns an mxConnectionConstraint that describes the given connection point.
function getConnectionPoint(
$vertex,
$constraint
)
Returns the nearest point in the list of absolute points or the center of the opposite terminal.
function getDefaultEdgeStyle()
Sets the default style for edges.
function getDefaultParent()
Returns the first child child of mxGraphModel.root.
function getDefaultVertexStyle()
Returns the default style for vertices.
function getDirectedEdgeCount(
$cell,
$outgoing,
$ignoredEdge
=
null
)
Returns the number of incoming or outgoing edges, ignoring the given edge.
function getEdgeAt(
$index
)
Returns the edge at the specified index in edges.
function getEdgeAt(
$cell,
$index
)
Returns the edge of cell at the given index.
function getEdgeCount()
Returns the number of edges in the edge array.
function getEdgeCount(
$cell
)
Returns the number of distinct edges connected to the given cell.
function getEdgeIndex(
$edge
)
Returns the index of the specified edge in edges.
function getEdges(
$cell
)
Returns all distinct edges connected to this cell as an array of mxCells.
function getEdgeStyle(
$edge,
$points,
$source,
$target
)
Returns the edge style function to be used to render the given edge state.
function getElementById(
$id
)
Returns the element with the given ID from document.
function getFieldName(
$attributename
)
Returns the fieldname for the given attributename.
function getFieldTemplate(
&
$obj,
$fieldname,
$child
)
Returns the template instance for the given field.
function getFixedFontSize(
$fontSize,
$fontFamily,
$fontStyle
=
null
)
Returns the fixed font size for GD (1 t0 5) for the given font properties
static function getFixedFontSize(
$fontSize,
$fontFamily,
$fontStyle
=
null
)
Returns the fixed font size for GD (1 t0 5) for the given font properties
function getGeometry()
Returns the mxGeometry that describes the geometry.
function getGeometry(
$cell
)
Returns the mxGeometry of the given mxCell.
function getGraphBounds()
Returns the bounds of the visible graph.
function getGraphBounds()
Returns graphBounds.
function getHashCode(
$cell
)
Returns a unique string that represents the given instance.
function getHtml()
Gets the HTML that represents the canvas.
function getId()
Returns the Id of the cell as a string.
function getId(
$obj
)
Returns the ID of the specified object.
function getImage()
Returns an image that represents this canvas.
function getImage(
$key
)
Returns the value for the given key.
function getImageBundles()
Returns the imageBundles.
function getImageForStyle(
$style
)
Returns an image that represents this canvas.
function getImageFromBundles(
$key
)
Searches all imageBundles for the specified key and returns the value for the first match or null if the key is not found.
function getImages()
Returns the images.
function getIndex(
$child
)
Returns the index of the specified child in the child array.
static function getInstanceForName(
$name
)
Creates and returns a new instance for the given class name.
function getLabel(
$cell
)
Returns a string or DOM node that represents the label for the given cell.
static function getLabelPaintBounds(
$label,
$style,
$isHtml,
$offset,
$vertexBounds,
$scale
)
Returns the paint bounds for the given label.
static function getLabelSize(
$label,
$style
)
Returns the size of the given label.
function getModel()
Returns the mxGraphModel that contains the cells.
static function getName(
$obj
)
Returns the codec name for the given object instance.
function getName()
Returns name.
function getName()
Creates a new instance of the template for this codec.
static function getName(
$value
)
Returns the name for the given value.
function getNearestCommonAncestor(
$cell1,
$cell2
)
Returns the nearest common ancestor for the specified cells.
function getNextPoint(
$edge,
$opposite,
$source
)
Returns the nearest point in the list of absolute points or the center of the opposite terminal.
static function getNumber(
$dict,
$key,
$default
=
)
Returns the value for key in dictionary or 0 if no value is defined for the key.
function getObject(
$id
)
Returns the decoded object for the element with the specified ID in document.
function getOrigin(
$cell
)
Returns the absolute, cummulated origin for the children inside the given parent as an mxPoint.
function getPaintBounds(
$cells
)
Returns the bounding box of the given cells and their descendants.
function getParent()
Returns the cell’s parent.
function getParent(
$cell
)
Returns the parent of the given cell.
static function getParentPath(
$path
)
Returns the cell for the specified cell path using the given root as the root of the path.
function getPerimeterBounds(
$border
=
0
)
Returns the mxRectangle that should be used as the perimeter of the cell.
function getPerimeterBounds(
$terminal,
$border
=
0
)
Returns the perimeter bounds for the given terminal, edge pair as an mxRectangle.
function getPerimeterFunction(
$state
)
Returns the perimeter function for the given state.
function getPerimeterPoint(
$terminal,
$next,
$orthogonal,
$border
=
null
)
Returns an mxPoint that defines the location of the intersection point between the perimeter and the line between the center of the shape and the given point.
function getPoint(
$state,
$geometry
=
null
)
Returns the absolute point on the edge for the given relative mxGeometry as an mxPoint.
function getProperties()
Returns properties.
function getProperty(
$key
)
Returns the property value for the given key.
function getRoot()
Returns the root of the model.
static function getRotatedPoint(
$pt,
$cos,
$sin,
$cx
=
null
)
Rotates the given point by the given cos and sin.
function getRoutingCenterX(
$state
)
Returns the x-coordinate of the center point for automatic routing.
function getRoutingCenterY(
$state
)
Returns the y-coordinate of the center point for automatic routing.
static function getScaledLabelBounds(
$x,
$y,
$size,
$outerWidth,
$outerHeight,
$style,
$scale
)
Returns the bounds for a label for the given location and size, taking into account the alignment and spacing in the specified style, as well as the width and height of the rectangle that contains the label.
static function getSizeForString(
$text,
$fontSize
=
0,
$fontFamily
=
null
)
Returns an mxRectangle with the size (width and height in pixels) of the given string.
function getState(
$cell,
$create
=
false
)
Returns the cell state for the specified cell.
function getStates()
Returns the mxCellStates for the given array of mxCells.
function getStyle()
Returns a string that describes the style.
function getStyle(
$cell
)
Returns the style of the given mxCell.
static function getStylename(
$style
)
Returns the stylename in a style of the form [stylename;|key=value;] or an empty string if the given style does not contain a stylename.
static function getStylenames(
$style
)
Returns the stylenames in a style of the form [stylename;|key=value;] or an empty array if the given style does not contain any stylenames.
function getStylesheet()
Returns the mxStylesheet that defines the style.
function getTerminal(
$source
)
Returns the source or target terminal.
function getTerminal(
$edge,
$cource
)
Returns the source or target mxCell of the given edge depending on the value of the boolean parameter.
function getTerminalPoint(
$isSource
)
Returns the mxPoint representing the source or target point of this edge.
function getTerminalPort(
$state,
$terminal,
$source
)
Returns an mxCellState that represents the source or target terminal or port for the given edge.
function getTrueTypeFont(
$style
)
Returns the truetype font to be used to draw the text with the given style.
static function getTrueTypeFont(
$style
)
Returns the truetype font to be used to draw the text with the given style.
function getTrueTypeFontSize(
$style
)
Returns the truetype font size to be used to draw the text with the given style.
static function getTrueTypeFontSize(
$size
)
Returns the truetype font size to be used to draw the text with the given style.
function getValue()
Returns the user object of the cell.
function getValue(
$cell
)
Returns the user object of the given mxCell using mxCell.getValue.
static function getValue(
$name
)
Returns the value associated with the given name.
static function getValue(
$dict,
$key,
$default
=
null
)
Returns the value for key in dictionary or the given default value if no value is defined for the key.
function getView()
Returns the mxGraphView that contains the mxCellStates.
function getVisibleTerminal(
$edge,
$source
)
Returns the nearest ancestor terminal that is visible.
var $graph
Holds the mxGraph.
public static $GRAPH_MODEL_CHANGED
Defines the name of the graphModelChanged event.
var $graphBounds
Holds the bounds of the current view.
function graphModelChanged(
$event
)
Called when the graph model has changed.
var $gridSize
Specifies the grid size.
function grow(
$amount
)
Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height.
Specifies if edges should automatically be moved into the nearest common ancestor of their terminals.
var $mapping
Maps from from fieldnames to XML attribute names.
function mergeChildren(
$from,
$to,
$cloneAllEdges
=
true
)
Merges the children of the given cell into the given target cell inside this model.
function mergeChildrenImpl(
$from,
$to,
$cloneAllEdges,
$mapping
)
Clones the children of the source cell into the given target cell in this model and adds an entry to the mapping that maps from the source cell to the target cell with the same id or the clone of the source cell that was inserted into this model.
public static $MIN_ACTIVE_REGION
Defines the minimum size in pixels of the portion of the cell cell which is to be used as a connectable region.
var $model
Holds the mxGraphModel.
Cells are the elements of the graph model.
function mxCell(
$value
=
null,
$geometry
=
null,
$style
=
null
)
Constructs a new cell to be used in a graph model.
Codec for mxCells.
Implements a mechanism for temporary cell Ids.
Represents the current state of a cell in a given mxGraphView.
function mxCellState(
$view
=
null,
$cell
=
null,
$style
=
null
)
Constructs a new object that represents the current state of the given cell in the specified view.
XML codec for PHP object graphs.
A class to register codecs for objects.
Defines an object that contains the constraints about how to connect one side of an edge to its terminal.
function mxConnectionConstraint(
$point
=
null,
$perimeter
=
true
)
Constructs a new connection constraint for the given point and boolean arguments.
Defines global constants.
Provides various edge styles to be used as the values for mxConstants.STYLE_EDGE in a cell style.
Defines the requirements for an edge style function.
Uses either SideToSide or TopToBottom depending on the horizontal flag in the cell style.
Implements an elliptic perimeter.
Implements an entity relation style for edges (as used in database schema diagrams).
Defines global constants.
Base class for all events.
function mxEventObject(
$name
)
Constructs a new event for the given name and properties.
Base class for all event sources.
Canvas for drawing graphs using the GD library.
function mxGdCanvas(
$width
=
0,
$height
=
0,
$scale
=
1,
$background
=
null,
$imageBasePath
=
""
)
Constructs a new GD canvas.
Constructs a new GD canvas.
Represents the geometry of a cell.
function mxGeometry(
$x
=
0,
$y
=
0,
$width
=
0,
$height
=
0
)
Constructs a new object to describe the size and location of a vertex or the control points of an edge.
Implements a graph component.
Cells are the elements of the graph model.
Constructs a new graph model using the specified root cell.
function mxGraphModel(
$root
=
null
)
Constructs a new graph model using the specified root cell.
Implements a view for the graph.
function mxGraphView(
$graph
)
Constructs a new view for the specified mxGraph.
A display XML to HTML converter.
Constructs a new HTML graph view reader.
function mxGraphViewHtmlReader()
Constructs a new HTML graph view reader.
A display XML to image converter.
function mxGraphViewImageReader(
$background
=
null,
$border
=
0
)
Constructs a new image graph view reader.
Canvas for drawing graphs using HTML.
Maps from keys to base64 encoded images or file locations.
function mxImageBundle()
Constructs a new image bundle.
Logging facility.
Implements a self-reference, aka.
Codec for mxGraphModels.
XML codec for PHP object graphs.
Constructs a new codec for the specified template object.
Constructs a new codec for the specified template object.
function mxObjectCodec(
$template,
$exclude
=
array(),
$idrefs
=
array(),
$mapping
=
array()
)
Constructs a new codec for the specified template object.
Constructs a new codec for the specified template object.
Provides various perimeter functions to be used in a style as the value of mxConstants.STYLE_PERIMETER.
Defines the requirements for a perimeter function.
Implements a 2-dimensional point with double precision coordinates.
function mxPoint(
$x
=
0,
$y
=
0
)
Constructs a new point for the optional x and y coordinates.
Implements a 2-dimensional rectangle with double precision coordinates.
function mxRectangle(
$x
=
0,
$y
=
0,
$width
=
0,
$height
=
0
)
Constructs a new rectangle for the optional parameters.
Implements a rectangular perimeter for the given bounds.
Implements a rhombus (aka diamond) perimeter.
Implements a vertical elbow edge.
Singleton class that acts as a global converter from string to object values in a style.
Defines the appearance of the cells in a graph.
function mxStylesheet()
Constructs a new stylesheet and assigns default styles.
Codec for mxStylesheets.
Implements a horizontal elbow edge.
Implements a triangle perimeter.
Helper methods.
-
-
-
-
var $name
Holds the name of the event.
var $nextId
Specifies the next Id to be created.
public static $NONE
Defines the value for none.
public static $NS_SVG
Defines the SVG namespace.
public static $NS_XHTML
Defines the XHTML namespace.
public static $NS_XLINK
Defined the XLink namespace.
-
-
-
-
var $objects
Maps from IDs to objects.
function offset(
$points,
$dx
=
null,
$dy
=
null
)
Creates a new array of x, y sequences where the each coordinate is translated by dx and dy, respectively.
var $offset
Holds the offset of the label for edges.
var $origin
mxPoint that holds the origin for all child cells.
Draws the given cell and label onto the specified canvas.
var $parent
Reference to the parent cell.
function parsePoints(
$str
)
Parses a string that represents a list of points into an array of mxPoints.
var $parser
Holds the SAX parser.
function parseState(
$state,
$edge
)
Parses the bounds, absolute points and label information from the style of the state into its respective fields and returns the label of the cell.
static function parseXml(
$xml
)
Returns a new DOM document for the given XML string.
var $perimeter
Boolean that specifies if the point should be projected onto the perimeter of the terminal.
public static $PERIMETER_ELLIPSE
Name of the ellipse perimeter.
public static $PERIMETER_RECTANGLE
Name of the rectangle perimeter.
public static $PERIMETER_RHOMBUS
Name of the rhombus perimeter.
public static $PERIMETER_TRIANGLE
Name of the triangle perimeter.
var $point
mxPoint that specifies the fixed location of the connection point.
var $points
Array of mxPoints which specifies the control points along the edge.
function postProcessCellStyle(
$style
)
Tries to resolve the value for the image style in the image bundles and turns short data URIs as defined in mxImageBundle to data URIs as defined in RFC 2397 of the IETF.
public static $printLog
Specifies if the log should be printed out.
function processInclude(
$dec,
$node,
$into
)
Returns true if the given node is an include directive and executes the include by decoding the XML document.
var $properties
Holds the event properties in an associative array that maps from string (key) to object (value).
function putCellStyle(
$name,
$style
)
Stores the specified style under the given name.
function putDefaultEdgeStyle(
$style
)
Sets the default style for edges.
function putDefaultVertexStyle(
$style
)
Sets the default style for vertices.
function putImage(
$key,
$value
)
Adds the specified entry to the map.
function putObject(
$id,
$object
)
Assoiates the given object with the given ID.
static function putValue(
$name,
$value
)
Puts the given object into the registry under the given name.
-
-
-
-
public static $RAD_PER_DEG
Defines the number of radiants per degree.
function read(
$string
)
Reads the specified view XML string.
function readFile(
$filename
)
Reads the specified view XML file in blocks of 4096 bytes.
static function readFile(
$filename
)
Reads the given filename into a string.
public static $RectanglePerimeter
Provides a rectangular perimeter.
function reference(
$obj
)
Hook for subclassers to implement a custom method for retrieving IDs from objects.
static function register(
$codec
)
Registers a new codec and associates the name of the template constructor in the codec with the codec object.
var $relative
Specifies if the coordinates in the geometry are to be interpreted as relative coordinates.
function remove(
$index
)
Removes the child at the specified index from the child array and returns the child that was removed.
function remove(
$cell
)
Removes the specified cell from the model using mxChildChange and adds the change to the current transaction.
static function removeAllStylenames(
$style
)
Removes all stylenames from the given style and returns the updated style.
function removeEdge(
$edge,
$outgoing
)
Removes the specified edge from the edge array and returns the edge.
function removeFromParent()
Removes the cell from its parent.
function removeFromTerminal(
$source
)
Removes the edge from its source or target terminal.
function removeImageBundle(
$bundle
)
Removes the specified mxImageBundle.
function removeState(
$cell,
$recurse
=
false
)
Removes and returns the mxCellState for the given cell.
static function removeStylename(
$style,
$stylename
)
Removes all occurrences of the specified stylename in the given style and returns the updated style.
static function resolve(
$root,
$path
)
Returns the cell for the specified cell path using the given root as the root of the path.
function restoreClone(
$clne,
$cell,
$mapping
)
Inner helper method for restoring the connections in a network of cloned cells.
var $reverse
Maps from from XML attribute names to fieldnames.
public static $RhombusPerimeter
Provides a rhombus (aka diamond) perimeter.
var $root
Holds the root cell, which in turn contains the cells that represent the layers of the diagram as child cells.
Array of numbers that represent the cached length of each segment of the edge.
function setAttribute(
$key,
$value
)
Sets the specified attribute on the user object if it is an XML node.
function setAttribute(
$node,
$attribute,
$value
)
Sets the attribute on the specified node to value.
static function setCellStyleFlags(
$model,
$cells,
$key,
$flag,
$value
)
Sets or toggles the flag bit for the given key in the cell’s styles.
function setCellStyles(
$key,
$value,
$cells
)
Sets the key to value in the styles of the given cells.
static function setCellStyles(
$model,
$cells,
$key,
$value
)
Assigns the value for the given key in the styles of the given cells, or removes the key from the styles if the value is null.
function setCollapsed(
$collapsed
)
Sets the collapsed state.
function setCollapsed(
$cell,
$isCollapsed
)
Sets the collapsed state of the given mxCell using mxCollapseChange and adds the change to the current transaction.
function setConnectable(
$connectable
)
Sets the connectable state.
function setEdge(
$edge
)
Specifies if the cell is an edge.
function setGeometry(
$geometry
)
Sets the mxGeometry to be used as the geometry.
function setGeometry(
$cell,
$geometry
)
Sets the mxGeometry of the given mxCell.
function setGraphBounds(
$value
)
Sets graphBounds.
function setId(
$id
)
Sets the Id of the cell to the given string.
function setImage(
$img
)
Sets the image that represents the canvas.
function setImageBundles(
$value
)
Sets the imageBundles.
function setParent(
$parent
)
Sets the parent cell.
function setRect(
$x,
$y,
$width,
$height
)
Sets this rectangle to the specified values.
function setScale(
$scale
)
Sets the scale, revalidates the view and fires a scale event.
function setStyle(
$style
)
Sets the string to be used as the style.
function setStyle(
$cell,
$style
)
Sets the style of the given mxCell using mxStyleChange and adds the change to the current transaction.
static function setStyle(
$style,
$key,
$value
)
Adds or removes the given key, value pair to the style and returns the new style.
static function setStyleFlag(
$style,
$key,
$flag,
$value
)
Sets or removes the given key from the specified style and returns the new style.
function setTerminal(
$terminal,
$source
)
Sets the source or target terminal and returns the new terminal.
function setTerminal(
$edge,
$terminal,
$source
)
Sets the source or target terminal of the given mxCell using mxTerminalChange and adds the change to the current transaction.
function setTerminalPoint(
$point,
$isSource
)
Sets the sourcePoint or targetPoint to the given mxPoint and returns the new point.
function setTerminals(
$edge,
$source,
$target
)
Sets the source and target mxCell of the given mxCell in a single transaction using setTerminal for each end of the edge.
function setTranslate(
$translate
)
Sets the translation, revalidates the view and fires a translate event.
function setValue(
$value
)
Sets the user object of the cell.
function setValue(
$cell,
$value
)
Sets the user object of then given mxCell using mxValueChange and adds the change to the current transaction.
function setVertex(
$vertex
)
Specifies if the cell is a vertex.
function setVisible(
$visible
)
Specifies if the cell is visible.
function setVisible(
$cell,
$visible
)
Sets the visible state of the given mxCell using mxVisibleChange and adds the change to the current transaction.
public static $SHADOW_OFFSETX
Defines the x-offset to be used for shadows.
public static $SHADOW_OFFSETY
Defines the y-offset to be used for shadows.
var $shadowColor
Holds the color object for the shadow color defined in mxConstants.W3C_SHADOWCOLOR.
public static $SHAPE_ACTOR
public static $SHAPE_ARROW
public static $SHAPE_CLOUD
public static $SHAPE_CONNECTOR
public static $SHAPE_CYLINDER
public static $SHAPE_DOUBLE_ELLIPSE
public static $SHAPE_ELLIPSE
public static $SHAPE_HEXAGON
public static $SHAPE_IMAGE
public static $SHAPE_LABEL
public static $SHAPE_LINE
public static $SHAPE_RECTANGLE
public static $SHAPE_RHOMBUS
public static $SHAPE_SWIMLANE
public static $SHAPE_TRIANGLE
public static $SideToSide
Provides a side to side connector.
var $source
Reference to the source terminal.
var $sourcePoint
Defines the source point of the edge.
Defines if the perimeter should be used to find the exact entry point along the perimeter of the target.
static function stackTrace()
Prints a simple stack trace in the error log.
function startElement(
$parser,
$name,
$attrs
)
Invoked by the SAX parser when an element starts.
var $states
Maps from cells to states.
var $style
Holds the style as a string of the form [(stylename|key=value);].
var $style
Contains an array of key, value pairs that represent the style of the cell.
public static $STYLE_ALIGN
Defines the key for the align style.
public static $STYLE_DASHED
Defines the key for the endSize style.
public static $STYLE_DIRECTION
Defines the key for the direction style.
public static $STYLE_EDGE
Defines the key for the edge style.
public static $STYLE_ELBOW
Defines the key for the elbow style.
public static $STYLE_ENDARROW
Defines the key for the endArrow style.
public static $STYLE_ENDSIZE
Defines the key for the endSize style.
public static $STYLE_ENTRY_X
Defines the key for the horizontal relative coordinate connection point of an edge with its target terminal.
public static $STYLE_ENTRY_Y
Defines the key for the vertical relative coordinate connection point of an edge with its target terminal.
public static $STYLE_EXIT_PERIMETER
Defines if the perimeter should be used to find the exact entry point along the perimeter of the source.
public static $STYLE_EXIT_X
Defines the key for the horizontal relative coordinate connection point of an edge with its source terminal.
public static $STYLE_EXIT_Y
Defines the key for the vertical relative coordinate connection point of an edge with its source terminal.
public static $STYLE_FILLCOLOR
Defines the key for the fill color.
public static $STYLE_FONTCOLOR
Defines the key for the fontColor style.
public static $STYLE_FONTFAMILY
Defines the key for the fontFamily style.
public static $STYLE_FONTSIZE
Defines the key for the fontSize style (in px).
public static $STYLE_FONTSTYLE
Defines the key for the fontStyle style.
public static $STYLE_GRADIENT_DIRECTION
Defines the key for the gradient direction.
public static $STYLE_GRADIENTCOLOR
Defines the key for the gradient color.
public static $STYLE_HORIZONTAL
Defines the key for the horizontal style.
public static $STYLE_IMAGE
Defines the key for the image style.
public static $STYLE_IMAGE_ALIGN
Defines the key for the align style.
public static $STYLE_IMAGE_BACKGROUND
Defines the key for the image background color.
public static $STYLE_IMAGE_BORDER
Defines the key for the image border color.
public static $STYLE_IMAGE_FLIPH
Defines the key for the horizontal image flip.
public static $STYLE_IMAGE_FLIPV
Defines the key for the vertical image flip.
public static $STYLE_IMAGE_HEIGHT
Defines the key for the imageHeight style.
Defines the key for the verticalAlign style.
public static $STYLE_IMAGE_WIDTH
Defines the key for the imageWidth style.
public static $STYLE_INDICATOR_COLOR
Defines the key for the indicatorColor style.
public static $STYLE_INDICATOR_GRADIENTCOLOR
Defines the key for the indicatorGradientColor style.
public static $STYLE_INDICATOR_HEIGHT
Defines the key for the indicatorHeight style (in px).
public static $STYLE_INDICATOR_IMAGE
Defines the key for the indicatorImage style.
public static $STYLE_INDICATOR_SHAPE
Defines the key for the indicatorShape style.
public static $STYLE_INDICATOR_SPACING
Defines the key for the indicatorSpacing style (in px).
public static $STYLE_INDICATOR_WIDTH
Defines the key for the indicatorWidth style (in px).
public static $STYLE_LABEL_BACKGROUNDCOLOR
Defines the key for the label background color.
public static $STYLE_LABEL_BORDERCOLOR
Defines the key for the label border color.
public static $STYLE_LABEL_POSITION
Defines the key for the horizontal label position of vertices.
public static $STYLE_LOOP
Defines the key for the loop style.
public static $STYLE_NOEDGESTYLE
Defines the key for the noEdgeStyle style.
public static $STYLE_NOLABEL
Defines the key for the noLabel style.
public static $STYLE_OPACITY
Defines the key for the opacity style.
public static $STYLE_ORTHOGONAL
Defines if the connection points on either end of the edge should be computed so that the edge is vertical or horizontal if possible and if the point is not at a fixed location.
public static $STYLE_OVERFLOW
Defines the key for the overflow style.
public static $STYLE_PERIMETER
Defines the key for the perimeter style.
public static $STYLE_PERIMETER_SPACING
Defines the key for the perimeter spacing.
public static $STYLE_ROTATION
Defines the key for the rotation style.
public static $STYLE_ROUNDED
Defines the key for the rounded style.
public static $STYLE_ROUTING_CENTER_X
Defines the key for the horizontal routing center.
public static $STYLE_ROUTING_CENTER_Y
Defines the key for the vertical routing center.
public static $STYLE_SEGMENT
Defines the key for the segment style.
public static $STYLE_SEPARATORCOLOR
Defines the key for the separatorColor style.
public static $STYLE_SHADOW
Defines the key for the shadow style.
public static $STYLE_SHAPE
Defines the key for the shape.
public static $STYLE_SOURCE_PERIMETER_SPACING
Defines the key for the source perimeter spacing.
public static $STYLE_SPACING
Defines the key for the spacing.
public static $STYLE_SPACING_BOTTOM
Defines the key for the spacingBottom style The value represents the spacing, in pixels, added to the bottom side of a label in a vertex (style applies to vertices only).
public static $STYLE_SPACING_LEFT
Defines the key for the spacingLeft style.
public static $STYLE_SPACING_RIGHT
Defines the key for the spacingRight style The value represents the spacing, in pixels, added to the right side of a label in a vertex (style applies to vertices only).
public static $STYLE_SPACING_TOP
Defines the key for the spacingTop style.
public static $STYLE_STARTARROW
Defines the key for the startArrow style.
public static $STYLE_STARTSIZE
Defines the key for the startSize style.
public static $STYLE_STROKECOLOR
Defines the key for the strokeColor style.
public static $STYLE_STROKEWIDTH
Defines the key for the strokeWidth style.
public static $STYLE_SWIMLANE_FILLCOLOR
Defines the key for the fill color of the swimlane background.
public static $STYLE_SWIMLANE_LINE
Defines the key for the swimlaneLine style.
public static $STYLE_TARGET_PERIMETER_SPACING
Defines the key for the source perimeter spacing.
public static $STYLE_TEXT_OPACITY
Defines the key for the text opacity style.
public static $STYLE_VERTICAL_ALIGN
Defines the key for the verticalAlign style.
public static $STYLE_VERTICAL_LABEL_POSITION
Defines the key for the vertical label position of vertices.
Array of numbers that represent the cached length of each segment of the edge.
public static $SHADOW_OFFSETX
Defines the x-offset to be used for shadows.
public static $SHADOW_OFFSETY
Defines the y-offset to be used for shadows.
var $shadowColor
Holds the color object for the shadow color defined in mxConstants.W3C_SHADOWCOLOR.
public static $SHAPE_ACTOR
public static $SHAPE_ARROW
public static $SHAPE_CLOUD
public static $SHAPE_CONNECTOR
public static $SHAPE_CYLINDER
public static $SHAPE_DOUBLE_ELLIPSE
public static $SHAPE_ELLIPSE
public static $SHAPE_HEXAGON
public static $SHAPE_IMAGE
public static $SHAPE_LABEL
public static $SHAPE_LINE
public static $SHAPE_RECTANGLE
public static $SHAPE_RHOMBUS
public static $SHAPE_SWIMLANE
public static $SHAPE_TRIANGLE
public static $SideToSide
Provides a side to side connector.
var $source
Reference to the source terminal.
var $sourcePoint
Defines the source point of the edge.
Defines if the perimeter should be used to find the exact entry point along the perimeter of the target.
var $states
Maps from cells to states.
var $style
Holds the style as a string of the form [(stylename|key=value);].
var $style
Contains an array of key, value pairs that represent the style of the cell.
public static $STYLE_ALIGN
Defines the key for the align style.
public static $STYLE_DASHED
Defines the key for the endSize style.
public static $STYLE_DIRECTION
Defines the key for the direction style.
public static $STYLE_EDGE
Defines the key for the edge style.
public static $STYLE_ELBOW
Defines the key for the elbow style.
public static $STYLE_ENDARROW
Defines the key for the endArrow style.
public static $STYLE_ENDSIZE
Defines the key for the endSize style.
public static $STYLE_ENTRY_X
Defines the key for the horizontal relative coordinate connection point of an edge with its target terminal.
public static $STYLE_ENTRY_Y
Defines the key for the vertical relative coordinate connection point of an edge with its target terminal.
public static $STYLE_EXIT_PERIMETER
Defines if the perimeter should be used to find the exact entry point along the perimeter of the source.
public static $STYLE_EXIT_X
Defines the key for the horizontal relative coordinate connection point of an edge with its source terminal.
public static $STYLE_EXIT_Y
Defines the key for the vertical relative coordinate connection point of an edge with its source terminal.
public static $STYLE_FILLCOLOR
Defines the key for the fill color.
public static $STYLE_FONTCOLOR
Defines the key for the fontColor style.
public static $STYLE_FONTFAMILY
Defines the key for the fontFamily style.
public static $STYLE_FONTSIZE
Defines the key for the fontSize style (in px).
public static $STYLE_FONTSTYLE
Defines the key for the fontStyle style.
public static $STYLE_GRADIENT_DIRECTION
Defines the key for the gradient direction.
public static $STYLE_GRADIENTCOLOR
Defines the key for the gradient color.
public static $STYLE_HORIZONTAL
Defines the key for the horizontal style.
public static $STYLE_IMAGE
Defines the key for the image style.
public static $STYLE_IMAGE_ALIGN
Defines the key for the align style.
public static $STYLE_IMAGE_BACKGROUND
Defines the key for the image background color.
public static $STYLE_IMAGE_BORDER
Defines the key for the image border color.
public static $STYLE_IMAGE_FLIPH
Defines the key for the horizontal image flip.
public static $STYLE_IMAGE_FLIPV
Defines the key for the vertical image flip.
public static $STYLE_IMAGE_HEIGHT
Defines the key for the imageHeight style.
Defines the key for the verticalAlign style.
public static $STYLE_IMAGE_WIDTH
Defines the key for the imageWidth style.
public static $STYLE_INDICATOR_COLOR
Defines the key for the indicatorColor style.
public static $STYLE_INDICATOR_GRADIENTCOLOR
Defines the key for the indicatorGradientColor style.
public static $STYLE_INDICATOR_HEIGHT
Defines the key for the indicatorHeight style (in px).
public static $STYLE_INDICATOR_IMAGE
Defines the key for the indicatorImage style.
public static $STYLE_INDICATOR_SHAPE
Defines the key for the indicatorShape style.
public static $STYLE_INDICATOR_SPACING
Defines the key for the indicatorSpacing style (in px).
public static $STYLE_INDICATOR_WIDTH
Defines the key for the indicatorWidth style (in px).
public static $STYLE_LABEL_BACKGROUNDCOLOR
Defines the key for the label background color.
public static $STYLE_LABEL_BORDERCOLOR
Defines the key for the label border color.
public static $STYLE_LABEL_POSITION
Defines the key for the horizontal label position of vertices.
public static $STYLE_LOOP
Defines the key for the loop style.
public static $STYLE_NOEDGESTYLE
Defines the key for the noEdgeStyle style.
public static $STYLE_NOLABEL
Defines the key for the noLabel style.
public static $STYLE_OPACITY
Defines the key for the opacity style.
public static $STYLE_ORTHOGONAL
Defines if the connection points on either end of the edge should be computed so that the edge is vertical or horizontal if possible and if the point is not at a fixed location.
public static $STYLE_OVERFLOW
Defines the key for the overflow style.
public static $STYLE_PERIMETER
Defines the key for the perimeter style.
public static $STYLE_PERIMETER_SPACING
Defines the key for the perimeter spacing.
public static $STYLE_ROTATION
Defines the key for the rotation style.
public static $STYLE_ROUNDED
Defines the key for the rounded style.
public static $STYLE_ROUTING_CENTER_X
Defines the key for the horizontal routing center.
public static $STYLE_ROUTING_CENTER_Y
Defines the key for the vertical routing center.
public static $STYLE_SEGMENT
Defines the key for the segment style.
public static $STYLE_SEPARATORCOLOR
Defines the key for the separatorColor style.
public static $STYLE_SHADOW
Defines the key for the shadow style.
public static $STYLE_SHAPE
Defines the key for the shape.
public static $STYLE_SOURCE_PERIMETER_SPACING
Defines the key for the source perimeter spacing.
public static $STYLE_SPACING
Defines the key for the spacing.
public static $STYLE_SPACING_BOTTOM
Defines the key for the spacingBottom style The value represents the spacing, in pixels, added to the bottom side of a label in a vertex (style applies to vertices only).
public static $STYLE_SPACING_LEFT
Defines the key for the spacingLeft style.
public static $STYLE_SPACING_RIGHT
Defines the key for the spacingRight style The value represents the spacing, in pixels, added to the right side of a label in a vertex (style applies to vertices only).
public static $STYLE_SPACING_TOP
Defines the key for the spacingTop style.
public static $STYLE_STARTARROW
Defines the key for the startArrow style.
public static $STYLE_STARTSIZE
Defines the key for the startSize style.
public static $STYLE_STROKECOLOR
Defines the key for the strokeColor style.
public static $STYLE_STROKEWIDTH
Defines the key for the strokeWidth style.
public static $STYLE_SWIMLANE_FILLCOLOR
Defines the key for the fill color of the swimlane background.
public static $STYLE_SWIMLANE_LINE
Defines the key for the swimlaneLine style.
public static $STYLE_TARGET_PERIMETER_SPACING
Defines the key for the source perimeter spacing.
public static $STYLE_TEXT_OPACITY
Defines the key for the text opacity style.
public static $STYLE_VERTICAL_ALIGN
Defines the key for the verticalAlign style.
public static $STYLE_VERTICAL_LABEL_POSITION
Defines the key for the vertical label position of vertices.
- *
- * For a fairly comprehensive set of languages see the
- * README
- * file that came with this source. At a minimum, the lexer should work on a
- * number of languages including C and friends, Java, Python, Bash, SQL, HTML,
- * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk
- * and a subset of Perl, but, because of commenting conventions, doesn't work on
- * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class.
- *
- * Usage:
- *
include this source file in an html page via
- * {@code }
- *
define style rules. See the example page for examples.
- *
mark the {@code
} and {@code } tags in your source with
- * {@code class=prettyprint.}
- * You can also use the (html deprecated) {@code } tag, but the pretty
- * printer needs to do more substantial DOM manipulations to support that, so
- * some css styles may not be preserved.
- *
- * That's it. I wanted to keep the API as simple as possible, so there's no
- * need to specify which language the code is in, but if you wish, you can add
- * another class to the {@code
} or {@code } element to specify the
- * language, as in {@code
}. Any class that
- * starts with "lang-" followed by a file extension, specifies the file type.
- * See the "lang-*.js" files in this directory for code that implements
- * per-language file handlers.
- *
- * Change log:
- * cbeust, 2006/08/22
- *
- * Java annotations (start with "@") are now captured as literals ("lit")
- *
- * @requires console
- * @overrides window
- */
-
-// JSLint declarations
-/*global console, document, navigator, setTimeout, window */
-
-/**
- * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
- * UI events.
- * If set to {@code false}, {@code prettyPrint()} is synchronous.
- */
-window['PR_SHOULD_USE_CONTINUATION'] = true;
-
-/** the number of characters between tab columns */
-window['PR_TAB_WIDTH'] = 8;
-
-/** Walks the DOM returning a properly escaped version of innerHTML.
- * @param {Node} node
- * @param {Array.} out output buffer that receives chunks of HTML.
- */
-window['PR_normalizedHtml']
-
-/** Contains functions for creating and registering new language handlers.
- * @type {Object}
- */
- = window['PR']
-
-/** Pretty print a chunk of code.
- *
- * @param {string} sourceCodeHtml code as html
- * @return {string} code as html, but prettier
- */
- = window['prettyPrintOne']
-/** Find all the {@code
} and {@code } tags in the DOM with
- * {@code class=prettyprint} and prettify them.
- * @param {Function?} opt_whenDone if specified, called when the last entry
- * has been finished.
- */
- = window['prettyPrint'] = void 0;
-
-/** browser detection. @extern @returns false if not IE, otherwise the major version. */
-window['_pr_isIE6'] = function () {
- var ieVersion = navigator && navigator.userAgent &&
- navigator.userAgent.match(/\bMSIE ([678])\./);
- ieVersion = ieVersion ? +ieVersion[1] : false;
- window['_pr_isIE6'] = function () { return ieVersion; };
- return ieVersion;
-};
-
-
-(function () {
- // Keyword lists for various languages.
- var FLOW_CONTROL_KEYWORDS =
- "break continue do else for if return while ";
- var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " +
- "double enum extern float goto int long register short signed sizeof " +
- "static struct switch typedef union unsigned void volatile ";
- var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " +
- "new operator private protected public this throw true try typeof ";
- var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " +
- "concept concept_map const_cast constexpr decltype " +
- "dynamic_cast explicit export friend inline late_check " +
- "mutable namespace nullptr reinterpret_cast static_assert static_cast " +
- "template typeid typename using virtual wchar_t where ";
- var JAVA_KEYWORDS = COMMON_KEYWORDS +
- "abstract boolean byte extends final finally implements import " +
- "instanceof null native package strictfp super synchronized throws " +
- "transient ";
- var CSHARP_KEYWORDS = JAVA_KEYWORDS +
- "as base by checked decimal delegate descending event " +
- "fixed foreach from group implicit in interface internal into is lock " +
- "object out override orderby params partial readonly ref sbyte sealed " +
- "stackalloc string select uint ulong unchecked unsafe ushort var ";
- var JSCRIPT_KEYWORDS = COMMON_KEYWORDS +
- "debugger eval export function get null set undefined var with " +
- "Infinity NaN ";
- var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " +
- "goto if import last local my next no our print package redo require " +
- "sub undef unless until use wantarray while BEGIN END ";
- var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " +
- "elif except exec finally from global import in is lambda " +
- "nonlocal not or pass print raise try with yield " +
- "False True None ";
- var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" +
- " defined elsif end ensure false in module next nil not or redo rescue " +
- "retry self super then true undef unless until when yield BEGIN END ";
- var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " +
- "function in local set then until ";
- var ALL_KEYWORDS = (
- CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS +
- PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS);
-
- // token style names. correspond to css classes
- /** token style for a string literal */
- var PR_STRING = 'str';
- /** token style for a keyword */
- var PR_KEYWORD = 'kwd';
- /** token style for a comment */
- var PR_COMMENT = 'com';
- /** token style for a type */
- var PR_TYPE = 'typ';
- /** token style for a literal value. e.g. 1, null, true. */
- var PR_LITERAL = 'lit';
- /** token style for a punctuation string. */
- var PR_PUNCTUATION = 'pun';
- /** token style for a punctuation string. */
- var PR_PLAIN = 'pln';
-
- /** token style for an sgml tag. */
- var PR_TAG = 'tag';
- /** token style for a markup declaration such as a DOCTYPE. */
- var PR_DECLARATION = 'dec';
- /** token style for embedded source. */
- var PR_SOURCE = 'src';
- /** token style for an sgml attribute name. */
- var PR_ATTRIB_NAME = 'atn';
- /** token style for an sgml attribute value. */
- var PR_ATTRIB_VALUE = 'atv';
-
- /**
- * A class that indicates a section of markup that is not code, e.g. to allow
- * embedding of line numbers within code listings.
- */
- var PR_NOCODE = 'nocode';
-
- /** A set of tokens that can precede a regular expression literal in
- * javascript.
- * http://www.mozilla.org/js/language/js20/rationale/syntax.html has the full
- * list, but I've removed ones that might be problematic when seen in
- * languages that don't support regular expression literals.
- *
- *
Specifically, I've removed any keywords that can't precede a regexp
- * literal in a syntactically legal javascript program, and I've removed the
- * "in" keyword since it's not a keyword in many languages, and might be used
- * as a count of inches.
- *
- *
The link a above does not accurately describe EcmaScript rules since
- * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
- * very well in practice.
- *
- * @private
- */
- var REGEXP_PRECEDER_PATTERN = function () {
- var preceders = [
- "!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=",
- "&=", "(", "*", "*=", /* "+", */ "+=", ",", /* "-", */ "-=",
- "->", /*".", "..", "...", handled below */ "/", "/=", ":", "::", ";",
- "<", "<<", "<<=", "<=", "=", "==", "===", ">",
- ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[",
- "^", "^=", "^^", "^^=", "{", "|", "|=", "||",
- "||=", "~" /* handles =~ and !~ */,
- "break", "case", "continue", "delete",
- "do", "else", "finally", "instanceof",
- "return", "throw", "try", "typeof"
- ];
- var pattern = '(?:^^|[+-]';
- for (var i = 0; i < preceders.length; ++i) {
- pattern += '|' + preceders[i].replace(/([^=<>:&a-z])/g, '\\$1');
- }
- pattern += ')\\s*'; // matches at end, and matches empty string
- return pattern;
- // CAVEAT: this does not properly handle the case where a regular
- // expression immediately follows another since a regular expression may
- // have flags for case-sensitivity and the like. Having regexp tokens
- // adjacent is not valid in any language I'm aware of, so I'm punting.
- // TODO: maybe style special characters inside a regexp as punctuation.
- }();
-
- // Define regexps here so that the interpreter doesn't have to create an
- // object each time the function containing them is called.
- // The language spec requires a new object created even if you don't access
- // the $1 members.
- var pr_amp = /&/g;
- var pr_lt = //g;
- var pr_quot = /\"/g;
- /** like textToHtml but escapes double quotes to be attribute safe. */
- function attribToHtml(str) {
- return str.replace(pr_amp, '&')
- .replace(pr_lt, '<')
- .replace(pr_gt, '>')
- .replace(pr_quot, '"');
- }
-
- /** escapest html special characters to html. */
- function textToHtml(str) {
- return str.replace(pr_amp, '&')
- .replace(pr_lt, '<')
- .replace(pr_gt, '>');
- }
-
-
- var pr_ltEnt = /</g;
- var pr_gtEnt = />/g;
- var pr_aposEnt = /'/g;
- var pr_quotEnt = /"/g;
- var pr_ampEnt = /&/g;
- var pr_nbspEnt = / /g;
- /** unescapes html to plain text. */
- function htmlToText(html) {
- var pos = html.indexOf('&');
- if (pos < 0) { return html; }
- // Handle numeric entities specially. We can't use functional substitution
- // since that doesn't work in older versions of Safari.
- // These should be rare since most browsers convert them to normal chars.
- for (--pos; (pos = html.indexOf('', pos + 1)) >= 0;) {
- var end = html.indexOf(';', pos);
- if (end >= 0) {
- var num = html.substring(pos + 3, end);
- var radix = 10;
- if (num && num.charAt(0) === 'x') {
- num = num.substring(1);
- radix = 16;
- }
- var codePoint = parseInt(num, radix);
- if (!isNaN(codePoint)) {
- html = (html.substring(0, pos) + String.fromCharCode(codePoint) +
- html.substring(end + 1));
- }
- }
- }
-
- return html.replace(pr_ltEnt, '<')
- .replace(pr_gtEnt, '>')
- .replace(pr_aposEnt, "'")
- .replace(pr_quotEnt, '"')
- .replace(pr_nbspEnt, ' ')
- .replace(pr_ampEnt, '&');
- }
-
- /** is the given node's innerHTML normally unescaped? */
- function isRawContent(node) {
- return 'XMP' === node.tagName;
- }
-
- var newlineRe = /[\r\n]/g;
- /**
- * Are newlines and adjacent spaces significant in the given node's innerHTML?
- */
- function isPreformatted(node, content) {
- // PRE means preformatted, and is a very common case, so don't create
- // unnecessary computed style objects.
- if ('PRE' === node.tagName) { return true; }
- if (!newlineRe.test(content)) { return true; } // Don't care
- var whitespace = '';
- // For disconnected nodes, IE has no currentStyle.
- if (node.currentStyle) {
- whitespace = node.currentStyle.whiteSpace;
- } else if (window.getComputedStyle) {
- // Firefox makes a best guess if node is disconnected whereas Safari
- // returns the empty string.
- whitespace = window.getComputedStyle(node, null).whiteSpace;
- }
- return !whitespace || whitespace === 'pre';
- }
-
- function normalizedHtml(node, out) {
- switch (node.nodeType) {
- case 1: // an element
- var name = node.tagName.toLowerCase();
- out.push('<', name);
- for (var i = 0; i < node.attributes.length; ++i) {
- var attr = node.attributes[i];
- if (!attr.specified) { continue; }
- out.push(' ');
- normalizedHtml(attr, out);
- }
- out.push('>');
- for (var child = node.firstChild; child; child = child.nextSibling) {
- normalizedHtml(child, out);
- }
- if (node.firstChild || !/^(?:br|link|img)$/.test(name)) {
- out.push('<\/', name, '>');
- }
- break;
- case 2: // an attribute
- out.push(node.name.toLowerCase(), '="', attribToHtml(node.value), '"');
- break;
- case 3: case 4: // text
- out.push(textToHtml(node.nodeValue));
- break;
- }
- }
-
- /**
- * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
- * matches the union o the sets o strings matched d by the input RegExp.
- * Since it matches globally, if the input strings have a start-of-input
- * anchor (/^.../), it is ignored for the purposes of unioning.
- * @param {Array.} regexs non multiline, non-global regexs.
- * @return {RegExp} a global regex.
- */
- function combinePrefixPatterns(regexs) {
- var capturedGroupIndex = 0;
-
- var needToFoldCase = false;
- var ignoreCase = false;
- for (var i = 0, n = regexs.length; i < n; ++i) {
- var regex = regexs[i];
- if (regex.ignoreCase) {
- ignoreCase = true;
- } else if (/[a-z]/i.test(regex.source.replace(
- /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
- needToFoldCase = true;
- ignoreCase = false;
- break;
- }
- }
-
- function decodeEscape(charsetPart) {
- if (charsetPart.charAt(0) !== '\\') { return charsetPart.charCodeAt(0); }
- switch (charsetPart.charAt(1)) {
- case 'b': return 8;
- case 't': return 9;
- case 'n': return 0xa;
- case 'v': return 0xb;
- case 'f': return 0xc;
- case 'r': return 0xd;
- case 'u': case 'x':
- return parseInt(charsetPart.substring(2), 16)
- || charsetPart.charCodeAt(1);
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7':
- return parseInt(charsetPart.substring(1), 8);
- default: return charsetPart.charCodeAt(1);
- }
- }
-
- function encodeEscape(charCode) {
- if (charCode < 0x20) {
- return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
- }
- var ch = String.fromCharCode(charCode);
- if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
- ch = '\\' + ch;
- }
- return ch;
- }
-
- function caseFoldCharset(charSet) {
- var charsetParts = charSet.substring(1, charSet.length - 1).match(
- new RegExp(
- '\\\\u[0-9A-Fa-f]{4}'
- + '|\\\\x[0-9A-Fa-f]{2}'
- + '|\\\\[0-3][0-7]{0,2}'
- + '|\\\\[0-7]{1,2}'
- + '|\\\\[\\s\\S]'
- + '|-'
- + '|[^-\\\\]',
- 'g'));
- var groups = [];
- var ranges = [];
- var inverse = charsetParts[0] === '^';
- for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
- var p = charsetParts[i];
- switch (p) {
- case '\\B': case '\\b':
- case '\\D': case '\\d':
- case '\\S': case '\\s':
- case '\\W': case '\\w':
- groups.push(p);
- continue;
- }
- var start = decodeEscape(p);
- var end;
- if (i + 2 < n && '-' === charsetParts[i + 1]) {
- end = decodeEscape(charsetParts[i + 2]);
- i += 2;
- } else {
- end = start;
- }
- ranges.push([start, end]);
- // If the range might intersect letters, then expand it.
- if (!(end < 65 || start > 122)) {
- if (!(end < 65 || start > 90)) {
- ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
- }
- if (!(end < 97 || start > 122)) {
- ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
- }
- }
- }
-
- // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
- // -> [[1, 12], [14, 14], [16, 17]]
- ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); });
- var consolidatedRanges = [];
- var lastRange = [NaN, NaN];
- for (var i = 0; i < ranges.length; ++i) {
- var range = ranges[i];
- if (range[0] <= lastRange[1] + 1) {
- lastRange[1] = Math.max(lastRange[1], range[1]);
- } else {
- consolidatedRanges.push(lastRange = range);
- }
- }
-
- var out = ['['];
- if (inverse) { out.push('^'); }
- out.push.apply(out, groups);
- for (var i = 0; i < consolidatedRanges.length; ++i) {
- var range = consolidatedRanges[i];
- out.push(encodeEscape(range[0]));
- if (range[1] > range[0]) {
- if (range[1] + 1 > range[0]) { out.push('-'); }
- out.push(encodeEscape(range[1]));
- }
- }
- out.push(']');
- return out.join('');
- }
-
- function allowAnywhereFoldCaseAndRenumberGroups(regex) {
- // Split into character sets, escape sequences, punctuation strings
- // like ('(', '(?:', ')', '^'), and runs of characters that do not
- // include any of the above.
- var parts = regex.source.match(
- new RegExp(
- '(?:'
- + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]' // a character set
- + '|\\\\u[A-Fa-f0-9]{4}' // a unicode escape
- + '|\\\\x[A-Fa-f0-9]{2}' // a hex escape
- + '|\\\\[0-9]+' // a back-reference or octal escape
- + '|\\\\[^ux0-9]' // other escape sequence
- + '|\\(\\?[:!=]' // start of a non-capturing group
- + '|[\\(\\)\\^]' // start/emd of a group, or line start
- + '|[^\\x5B\\x5C\\(\\)\\^]+' // run of other characters
- + ')',
- 'g'));
- var n = parts.length;
-
- // Maps captured group numbers to the number they will occupy in
- // the output or to -1 if that has not been determined, or to
- // undefined if they need not be capturing in the output.
- var capturedGroups = [];
-
- // Walk over and identify back references to build the capturedGroups
- // mapping.
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- var p = parts[i];
- if (p === '(') {
- // groups are 1-indexed, so max group index is count of '('
- ++groupIndex;
- } else if ('\\' === p.charAt(0)) {
- var decimalValue = +p.substring(1);
- if (decimalValue && decimalValue <= groupIndex) {
- capturedGroups[decimalValue] = -1;
- }
- }
- }
-
- // Renumber groups and reduce capturing groups to non-capturing groups
- // where possible.
- for (var i = 1; i < capturedGroups.length; ++i) {
- if (-1 === capturedGroups[i]) {
- capturedGroups[i] = ++capturedGroupIndex;
- }
- }
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- var p = parts[i];
- if (p === '(') {
- ++groupIndex;
- if (capturedGroups[groupIndex] === undefined) {
- parts[i] = '(?:';
- }
- } else if ('\\' === p.charAt(0)) {
- var decimalValue = +p.substring(1);
- if (decimalValue && decimalValue <= groupIndex) {
- parts[i] = '\\' + capturedGroups[groupIndex];
- }
- }
- }
-
- // Remove any prefix anchors so that the output will match anywhere.
- // ^^ really does mean an anchored match though.
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
- }
-
- // Expand letters to groupts to handle mixing of case-sensitive and
- // case-insensitive patterns if necessary.
- if (regex.ignoreCase && needToFoldCase) {
- for (var i = 0; i < n; ++i) {
- var p = parts[i];
- var ch0 = p.charAt(0);
- if (p.length >= 2 && ch0 === '[') {
- parts[i] = caseFoldCharset(p);
- } else if (ch0 !== '\\') {
- // TODO: handle letters in numeric escapes.
- parts[i] = p.replace(
- /[a-zA-Z]/g,
- function (ch) {
- var cc = ch.charCodeAt(0);
- return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
- });
- }
- }
- }
-
- return parts.join('');
- }
-
- var rewritten = [];
- for (var i = 0, n = regexs.length; i < n; ++i) {
- var regex = regexs[i];
- if (regex.global || regex.multiline) { throw new Error('' + regex); }
- rewritten.push(
- '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
- }
-
- return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
- }
-
- var PR_innerHtmlWorks = null;
- function getInnerHtml(node) {
- // inner html is hopelessly broken in Safari 2.0.4 when the content is
- // an html description of well formed XML and the containing tag is a PRE
- // tag, so we detect that case and emulate innerHTML.
- if (null === PR_innerHtmlWorks) {
- var testNode = document.createElement('PRE');
- testNode.appendChild(
- document.createTextNode('\n'));
- PR_innerHtmlWorks = !/)[\r\n]+/g, '$1')
- .replace(/(?:[\r\n]+[ \t]*)+/g, ' ');
- }
- return content;
- }
-
- var out = [];
- for (var child = node.firstChild; child; child = child.nextSibling) {
- normalizedHtml(child, out);
- }
- return out.join('');
- }
-
- /** returns a function that expand tabs to spaces. This function can be fed
- * successive chunks of text, and will maintain its own internal state to
- * keep track of how tabs are expanded.
- * @return {function (string) : string} a function that takes
- * plain text and return the text with tabs expanded.
- * @private
- */
- function makeTabExpander(tabWidth) {
- var SPACES = ' ';
- var charInLine = 0;
-
- return function (plainText) {
- // walk over each character looking for tabs and newlines.
- // On tabs, expand them. On newlines, reset charInLine.
- // Otherwise increment charInLine
- var out = null;
- var pos = 0;
- for (var i = 0, n = plainText.length; i < n; ++i) {
- var ch = plainText.charAt(i);
-
- switch (ch) {
- case '\t':
- if (!out) { out = []; }
- out.push(plainText.substring(pos, i));
- // calculate how much space we need in front of this part
- // nSpaces is the amount of padding -- the number of spaces needed
- // to move us to the next column, where columns occur at factors of
- // tabWidth.
- var nSpaces = tabWidth - (charInLine % tabWidth);
- charInLine += nSpaces;
- for (; nSpaces >= 0; nSpaces -= SPACES.length) {
- out.push(SPACES.substring(0, nSpaces));
- }
- pos = i + 1;
- break;
- case '\n':
- charInLine = 0;
- break;
- default:
- ++charInLine;
- }
- }
- if (!out) { return plainText; }
- out.push(plainText.substring(pos));
- return out.join('');
- };
- }
-
- var pr_chunkPattern = new RegExp(
- '[^<]+' // A run of characters other than '<'
- + '|<\!--[\\s\\S]*?--\>' // an HTML comment
- + '|' // a CDATA section
- // a probable tag that should not be highlighted
- + '|<\/?[a-zA-Z](?:[^>\"\']|\'[^\']*\'|\"[^\"]*\")*>'
- + '|<', // A '<' that does not begin a larger chunk
- 'g');
- var pr_commentPrefix = /^<\!--/;
- var pr_cdataPrefix = /^) into their textual equivalent.
- *
- * @param {string} s html where whitespace is considered significant.
- * @return {Object} source code and extracted tags.
- * @private
- */
- function extractTags(s) {
- // since the pattern has the 'g' modifier and defines no capturing groups,
- // this will return a list of all chunks which we then classify and wrap as
- // PR_Tokens
- var matches = s.match(pr_chunkPattern);
- var sourceBuf = [];
- var sourceBufLen = 0;
- var extractedTags = [];
- if (matches) {
- for (var i = 0, n = matches.length; i < n; ++i) {
- var match = matches[i];
- if (match.length > 1 && match.charAt(0) === '<') {
- if (pr_commentPrefix.test(match)) { continue; }
- if (pr_cdataPrefix.test(match)) {
- // strip CDATA prefix and suffix. Don't unescape since it's CDATA
- sourceBuf.push(match.substring(9, match.length - 3));
- sourceBufLen += match.length - 12;
- } else if (pr_brPrefix.test(match)) {
- // tags are lexically significant so convert them to text.
- // This is undone later.
- sourceBuf.push('\n');
- ++sourceBufLen;
- } else {
- if (match.indexOf(PR_NOCODE) >= 0 && isNoCodeTag(match)) {
- // A will start a section that should be
- // ignored. Continue walking the list until we see a matching end
- // tag.
- var name = match.match(pr_tagNameRe)[2];
- var depth = 1;
- var j;
- end_tag_loop:
- for (j = i + 1; j < n; ++j) {
- var name2 = matches[j].match(pr_tagNameRe);
- if (name2 && name2[2] === name) {
- if (name2[1] === '/') {
- if (--depth === 0) { break end_tag_loop; }
- } else {
- ++depth;
- }
- }
- }
- if (j < n) {
- extractedTags.push(
- sourceBufLen, matches.slice(i, j + 1).join(''));
- i = j;
- } else { // Ignore unclosed sections.
- extractedTags.push(sourceBufLen, match);
- }
- } else {
- extractedTags.push(sourceBufLen, match);
- }
- }
- } else {
- var literalText = htmlToText(match);
- sourceBuf.push(literalText);
- sourceBufLen += literalText.length;
- }
- }
- }
- return { source: sourceBuf.join(''), tags: extractedTags };
- }
-
- /** True if the given tag contains a class attribute with the nocode class. */
- function isNoCodeTag(tag) {
- return !!tag
- // First canonicalize the representation of attributes
- .replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,
- ' $1="$2$3$4"')
- // Then look for the attribute we want.
- .match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/);
- }
-
- /**
- * Apply the given language handler to sourceCode and add the resulting
- * decorations to out.
- * @param {number} basePos the index of sourceCode within the chunk of source
- * whose decorations are already present on out.
- */
- function appendDecorations(basePos, sourceCode, langHandler, out) {
- if (!sourceCode) { return; }
- var job = {
- source: sourceCode,
- basePos: basePos
- };
- langHandler(job);
- out.push.apply(out, job.decorations);
- }
-
- /** Given triples of [style, pattern, context] returns a lexing function,
- * The lexing function interprets the patterns to find token boundaries and
- * returns a decoration list of the form
- * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
- * where index_n is an index into the sourceCode, and style_n is a style
- * constant like PR_PLAIN. index_n-1 <= index_n, and style_n-1 applies to
- * all characters in sourceCode[index_n-1:index_n].
- *
- * The stylePatterns is a list whose elements have the form
- * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
- *
- * Style is a style constant like PR_PLAIN, or can be a string of the
- * form 'lang-FOO', where FOO is a language extension describing the
- * language of the portion of the token in $1 after pattern executes.
- * E.g., if style is 'lang-lisp', and group 1 contains the text
- * '(hello (world))', then that portion of the token will be passed to the
- * registered lisp handler for formatting.
- * The text before and after group 1 will be restyled using this decorator
- * so decorators should take care that this doesn't result in infinite
- * recursion. For example, the HTML lexer rule for SCRIPT elements looks
- * something like ['lang-js', /<[s]cript>(.+?)<\/script>/]. This may match
- * '
-
-
-
-
-
-
-
-
-
-