mxCell

Cells are the elements of the graph model.  They represent the state of the groups, vertices and edges in a graph.

Summary
mxCellCells are the elements of the graph model.
Variables
idHolds the Id.
valueHolds the user object.
geometryHolds the mxGeometry.
styleHolds the style as a string of the form [(stylename|key=value);].
vertexSpecifies whether the cell is a vertex.
edgeSpecifies whether the cell is an edge.
connectableSpecifies whether the cell is connectable.
visibleSpecifies whether the cell is visible.
collapsedSpecifies whether the cell is collapsed.
parentReference to the parent cell.
sourceReference to the source terminal.
targetReference to the target terminal.
childrenHolds the child cells.
edgesHolds the edges.
Functions
mxCellConstructs a new cell to be used in a graph model.
getIdReturns the Id of the cell as a string.
setIdSets the Id of the cell to the given string.
getValueReturns the user object of the cell.
setValueSets the user object of the cell.
getGeometryReturns the mxGeometry that describes the geometry.
setGeometrySets the mxGeometry to be used as the geometry.
getStyleReturns a string that describes the style.
setStyleSets the string to be used as the style.
isVertexReturns true if the cell is a vertex.
setVertexSpecifies if the cell is a vertex.
isEdgeReturns true if the cell is an edge.
setEdgeSpecifies if the cell is an edge.
isConnectableReturns true if the cell is connectable.
setConnectableSets the connectable state.
isVisibleReturns true if the cell is visibile.
setVisibleSpecifies if the cell is visible.
isCollapsedReturns true if the cell is collapsed.
setCollapsedSets the collapsed state.
getParentReturns the cell’s parent.
setParentSets the parent cell.
getTerminalReturns the source or target terminal.
setTerminalSets the source or target terminal and returns the new terminal.
getChildCountReturns the number of child cells.
getIndexReturns the index of the specified child in the child array.
getChildAtReturns the child at the specified index.
insertInserts the specified child into the child array at the specified index and updates the parent reference of the child.
removeRemoves the child at the specified index from the child array and returns the child that was removed.
removeFromParentRemoves the cell from its parent.
getEdgeCountReturns the number of edges in the edge array.
getEdgeIndexReturns the index of the specified edge in edges.
getEdgeAtReturns the edge at the specified index in edges.
insertEdgeInserts the specified edge into the edge array and returns the edge.
removeEdgeRemoves the specified edge from the edge array and returns the edge.
removeFromTerminalRemoves the edge from its source or target terminal.
getAttributeReturns the specified attribute from the user object if it is an XML node.
setAttributeSets the specified attribute on the user object if it is an XML node.
copyReturns a clone of the cell.
copyValueReturns a clone of the cell’s user object.

Variables

id

var $id

Holds the Id.  Default is null.

value

var $value

Holds the user object.  Default is null.

geometry

var $geometry

Holds the mxGeometry.  Default is null.

style

var $style

Holds the style as a string of the form [(stylename|key=value);].  Default is null.

vertex

var $vertex

Specifies whether the cell is a vertex.  Default is false.

edge

var $edge

Specifies whether the cell is an edge.  Default is false.

connectable

var $connectable

Specifies whether the cell is connectable.  Default is true.

visible

var $visible

Specifies whether the cell is visible.  Default is true.

collapsed

var $collapsed

Specifies whether the cell is collapsed.  Default is false.

parent

var $parent

Reference to the parent cell.

source

var $source

Reference to the source terminal.

target

var $target

Reference to the target terminal.

children

var $children

Holds the child cells.

edges

var $edges

Holds the edges.

Functions

mxCell

function mxCell($value =  null,
$geometry =  null,
$style =  null)

Constructs a new cell to be used in a graph model.  This method invokes <onInit> upon completion.

Parameters

valueOptional object that represents the cell value.
geometryOptional mxGeometry that specifies the geometry.
styleOptional formatted string that defines the style.

getId

function getId()

Returns the Id of the cell as a string.

setId

function setId($id)

Sets the Id of the cell to the given string.

getValue

function getValue()

Returns the user object of the cell.  The user object is stored in value.

setValue

function setValue($value)

Sets the user object of the cell.  The user object is stored in value.

getGeometry

function getGeometry()

Returns the mxGeometry that describes the geometry.

setGeometry

function setGeometry($geometry)

Sets the mxGeometry to be used as the geometry.

getStyle

function getStyle()

Returns a string that describes the style.

setStyle

function setStyle($style)

Sets the string to be used as the style.

isVertex

function isVertex()

Returns true if the cell is a vertex.

setVertex

function setVertex($vertex)

Specifies if the cell is a vertex.  This should only be assigned at construction of the cell and not be changed during its lifecycle.

Parameters

vertexBoolean that specifies if the cell is a vertex.

isEdge

function isEdge()

Returns true if the cell is an edge.

setEdge

function setEdge($edge)

Specifies if the cell is an edge.  This should only be assigned at construction of the cell and not be changed during its lifecycle.

Parameters

edgeBoolean that specifies if the cell is an edge.

isConnectable

function isConnectable()

Returns true if the cell is connectable.

setConnectable

function setConnectable($connectable)

Sets the connectable state.

Parameters

connectableBoolean that specifies the new connectable state.

isVisible

function isVisible()

Returns true if the cell is visibile.

setVisible

function setVisible($visible)

Specifies if the cell is visible.

Parameters

visibleBoolean that specifies the new visible state.

isCollapsed

function isCollapsed()

Returns true if the cell is collapsed.

setCollapsed

function setCollapsed($collapsed)

Sets the collapsed state.

Parameters

collapsedBoolean that specifies the new collapsed state.

getParent

function getParent()

Returns the cell’s parent.

setParent

function setParent($parent)

Sets the parent cell.

Parameters

parentmxCell that represents the new parent.

getTerminal

function getTerminal($source)

Returns the source or target terminal.

Parameters

sourceBoolean 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

terminalmxCell that represents the new source or target terminal.
sourceBoolean 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

childChild whose index should be returned.

getChildAt

function getChildAt($index)

Returns the child at the specified index.

Parameters

indexInteger 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

childmxCell to be inserted or appended to the child array.
indexOptional 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

indexInteger that specifies the index of the child to be removed.

removeFromParent

function removeFromParent()

Removes the cell from its parent.

getEdgeCount

function getEdgeCount()

Returns the number of edges in the edge array.

getEdgeIndex

function getEdgeIndex($edge)

Returns the index of the specified edge in edges.

Parameters

edgemxCell whose index in edges should be returned.

getEdgeAt

function getEdgeAt($index)

Returns the edge at the specified index in edges.

Parameters

indexInteger that specifies the index of the edge to be returned.

insertEdge

function insertEdge($edge,
$outgoing)

Inserts the specified edge into the edge array and returns the edge.  Will update the respective terminal reference of the edge.

Parameters

edgemxCell to be inserted into the edge array.
outgoingBoolean that specifies if the edge is outgoing.

removeEdge

function removeEdge($edge,
$outgoing)

Removes the specified edge from the edge array and returns the edge.  Will remove the respective terminal reference from the edge.

Parameters

edgemxCell to be removed from the edge array.
outgoingBoolean that specifies if the edge is outgoing.

removeFromTerminal

function removeFromTerminal($source)

Removes the edge from its source or target terminal.

Parameters

sourceBoolean that specifies if the edge should be removed from its source or target terminal.

getAttribute

function getAttribute($key,  
$defaultValue =  null)

Returns the specified attribute from the user object if it is an XML node.

setAttribute

function setAttribute($key,
$value)

Sets the specified attribute on the user object if it is an XML node.

copy

function copy()

Returns a clone of the cell.  Uses <cloneValue> to clone the user object.

copyValue

function copyValue()

Returns a clone of the cell’s user object.

var $id
Holds the Id.
var $value
Holds the user object.
var $geometry
Holds the mxGeometry.
Represents the geometry of a cell.
var $style
Holds the style as a string of the form [(stylename|key=value);].
var $vertex
Specifies whether the cell is a vertex.
var $edge
Specifies whether the cell is an edge.
var $connectable
Specifies whether the cell is connectable.
var $visible
Specifies whether the cell is visible.
var $collapsed
Specifies whether the cell is collapsed.
var $parent
Reference to the parent cell.
var $source
Reference to the source terminal.
var $target
Reference to the target terminal.
var $children
Holds the child cells.
var $edges
Holds the edges.
function mxCell($value =  null,
$geometry =  null,
$style =  null)
Constructs a new cell to be used in a graph model.
function getId()
Returns the Id of the cell as a string.
function setId($id)
Sets the Id of the cell to the given string.
function getValue()
Returns the user object of the cell.
function setValue($value)
Sets the user object of the cell.
function getGeometry()
Returns the mxGeometry that describes the geometry.
function setGeometry($geometry)
Sets the mxGeometry to be used as the geometry.
function getStyle()
Returns a string that describes the style.
function setStyle($style)
Sets the string to be used as the style.
function isVertex()
Returns true if the cell is a vertex.
function setVertex($vertex)
Specifies if the cell is a vertex.
function isEdge()
Returns true if the cell is an edge.
function setEdge($edge)
Specifies if the cell is an edge.
function isConnectable()
Returns true if the cell is connectable.
function setConnectable($connectable)
Sets the connectable state.
function isVisible()
Returns true if the cell is visibile.
function setVisible($visible)
Specifies if the cell is visible.
function isCollapsed()
Returns true if the cell is collapsed.
function setCollapsed($collapsed)
Sets the collapsed state.
function getParent()
Returns the cell’s parent.
function setParent($parent)
Sets the parent cell.
function getTerminal($source)
Returns the source or target terminal.
function setTerminal($terminal,
$source)
Sets the source or target terminal and returns the new terminal.
function getChildCount()
Returns the number of child cells.
function getIndex($child)
Returns the index of the specified child in the child array.
function getChildAt($index)
Returns the child at the specified index.
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 remove($index)
Removes the child at the specified index from the child array and returns the child that was removed.
function removeFromParent()
Removes the cell from its parent.
function getEdgeCount()
Returns the number of edges in the edge array.
function getEdgeIndex($edge)
Returns the index of the specified edge in edges.
function getEdgeAt($index)
Returns the edge at the specified index in edges.
function insertEdge($edge,
$outgoing)
Inserts the specified edge into the edge array and returns the edge.
function removeEdge($edge,
$outgoing)
Removes the specified edge from the edge array and returns the edge.
function removeFromTerminal($source)
Removes the edge from its source or target terminal.
function getAttribute($key,  
$defaultValue =  null)
Returns the specified attribute from the user object if it is an XML node.
function setAttribute($key,
$value)
Sets the specified attribute on the user object if it is an XML node.
function copy()
Returns a clone of the cell.
function copyValue()
Returns a clone of the cell’s user object.
Close