public class mxCell extends Object implements mxICell, Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
protected List<Object> |
children
Holds the child cells and connected edges.
|
protected boolean |
collapsed
Specifies whether the cell is a vertex or edge and whether it is
connectable, visible and collapsed.
|
protected boolean |
connectable
Specifies whether the cell is a vertex or edge and whether it is
connectable, visible and collapsed.
|
protected boolean |
edge
Specifies whether the cell is a vertex or edge and whether it is
connectable, visible and collapsed.
|
protected List<Object> |
edges
Holds the child cells and connected edges.
|
protected mxGeometry |
geometry
Holds the geometry.
|
protected String |
id
Holds the Id.
|
protected mxICell |
parent
Reference to the parent cell and source and target terminals for edges.
|
protected mxICell |
source
Reference to the parent cell and source and target terminals for edges.
|
protected String |
style
Holds the style as a string of the form
stylename[;key=value].
|
protected mxICell |
target
Reference to the parent cell and source and target terminals for edges.
|
protected Object |
value
Holds the user object.
|
protected boolean |
vertex
Specifies whether the cell is a vertex or edge and whether it is
connectable, visible and collapsed.
|
protected boolean |
visible
Specifies whether the cell is a vertex or edge and whether it is
connectable, visible and collapsed.
|
Constructor and Description |
---|
mxCell()
Constructs a new cell with an empty user object.
|
mxCell(Object value)
Constructs a new cell for the given user object.
|
mxCell(Object value,
mxGeometry geometry,
String style)
Constructs a new cell for the given parameters.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a clone of the cell.
|
protected Object |
cloneValue()
Returns a clone of the user object.
|
String |
getAttribute(String name)
Returns the specified attribute from the user object if it is an XML
node.
|
String |
getAttribute(String name,
String defaultValue)
Returns the specified attribute from the user object if it is an XML
node.
|
mxICell |
getChildAt(int index)
Returns the child at the specified index.
|
int |
getChildCount()
Returns the number of child cells.
|
mxICell |
getEdgeAt(int index)
Returns the edge at the specified index in the edge array.
|
int |
getEdgeCount()
Returns the number of edges in the edge array.
|
int |
getEdgeIndex(mxICell edge)
Returns the index of the specified edge in the edge array.
|
mxGeometry |
getGeometry()
Returns the object that describes the geometry.
|
String |
getId()
Returns the Id of the cell as a string.
|
int |
getIndex(mxICell child)
Returns the index of the specified child in the child array.
|
mxICell |
getParent()
Returns the cell's parent.
|
mxICell |
getSource()
Returns the source terminal.
|
String |
getStyle()
Returns the string that describes the style.
|
mxICell |
getTarget()
Returns the target terminal.
|
mxICell |
getTerminal(boolean source)
Returns the source or target terminal.
|
Object |
getValue()
Returns the user object of the cell.
|
mxICell |
insert(mxICell child)
Appends the specified child into the child array and updates the parent
reference of the child.
|
mxICell |
insert(mxICell child,
int index)
Inserts the specified child into the child array at the specified index
and updates the parent reference of the child.
|
mxICell |
insertEdge(mxICell edge,
boolean isOutgoing)
Inserts the specified edge into the edge array and returns the edge.
|
boolean |
isCollapsed()
Returns true if the cell is collapsed.
|
boolean |
isConnectable()
Returns true if the cell is connectable.
|
boolean |
isEdge()
Returns true if the cell is an edge.
|
boolean |
isVertex()
Returns true if the cell is a vertex.
|
boolean |
isVisible()
Returns true if the cell is visibile.
|
mxICell |
remove(int index)
Removes the child at the specified index from the child array and
returns the child that was removed.
|
mxICell |
remove(mxICell child)
Removes the given child from the child array and returns it.
|
mxICell |
removeEdge(mxICell edge,
boolean isOutgoing)
Removes the specified edge from the edge array and returns the edge.
|
void |
removeFromParent()
Removes the cell from its parent.
|
void |
removeFromTerminal(boolean isSource)
Removes the edge from its source or target terminal.
|
void |
setAttribute(String name,
String value)
Sets the specified attribute on the user object if it is an XML node.
|
void |
setCollapsed(boolean collapsed)
Sets the collapsed state.
|
void |
setConnectable(boolean connectable) |
void |
setEdge(boolean edge) |
void |
setGeometry(mxGeometry geometry)
Sets the object to be used as the geometry.
|
void |
setId(String id)
Sets the Id of the cell to the given string.
|
void |
setParent(mxICell parent)
Sets the parent cell.
|
void |
setSource(mxICell source)
Sets the source terminal.
|
void |
setStyle(String style)
Sets the string to be used as the style.
|
void |
setTarget(mxICell target)
Sets the target terminal.
|
mxICell |
setTerminal(mxICell terminal,
boolean isSource)
Sets the source or target terminal and returns the new terminal.
|
void |
setValue(Object value)
Sets the user object of the cell.
|
void |
setVertex(boolean vertex) |
void |
setVisible(boolean visible)
Specifies if the cell is visible.
|
protected String id
protected Object value
protected mxGeometry geometry
protected String style
protected boolean vertex
protected boolean edge
protected boolean connectable
protected boolean visible
protected boolean collapsed
protected mxICell parent
protected mxICell source
protected mxICell target
public mxCell()
public mxCell(Object value)
value
- Object that represents the value of the cell.public mxCell(Object value, mxGeometry geometry, String style)
value
- Object that represents the value of the cell.geometry
- Specifies the geometry of the cell.style
- Specifies the style as a formatted string.public String getId()
mxICell
public void setId(String id)
mxICell
public Object getValue()
mxICell
public void setValue(Object value)
mxICell
public mxGeometry getGeometry()
mxICell
getGeometry
in interface mxICell
public void setGeometry(mxGeometry geometry)
mxICell
setGeometry
in interface mxICell
public String getStyle()
mxICell
public void setStyle(String style)
mxICell
public boolean isVertex()
mxICell
public void setVertex(boolean vertex)
public boolean isEdge()
mxICell
public void setEdge(boolean edge)
public boolean isConnectable()
mxICell
isConnectable
in interface mxICell
public void setConnectable(boolean connectable)
public boolean isVisible()
mxICell
public void setVisible(boolean visible)
mxICell
setVisible
in interface mxICell
visible
- Boolean that specifies the new visible state.public boolean isCollapsed()
mxICell
isCollapsed
in interface mxICell
public void setCollapsed(boolean collapsed)
mxICell
setCollapsed
in interface mxICell
collapsed
- Boolean that specifies the new collapsed state.public mxICell getParent()
mxICell
public void setParent(mxICell parent)
mxICell
public mxICell getSource()
public void setSource(mxICell source)
source
- Cell that represents the new source terminal.public mxICell getTarget()
public void setTarget(mxICell target)
target
- Cell that represents the new target terminal.public mxICell getTerminal(boolean source)
mxICell
getTerminal
in interface mxICell
source
- Boolean that specifies if the source terminal should be
returned.public mxICell setTerminal(mxICell terminal, boolean isSource)
mxICell
setTerminal
in interface mxICell
terminal
- Cell that represents the new source or target terminal.isSource
- Boolean that specifies if the source or target terminal
should be set.public int getChildCount()
mxICell
getChildCount
in interface mxICell
public int getIndex(mxICell child)
mxICell
public mxICell getChildAt(int index)
mxICell
getChildAt
in interface mxICell
index
- Integer that specifies the child to be returned.public mxICell insert(mxICell child)
mxICell
public mxICell insert(mxICell child, int index)
mxICell
public mxICell remove(int index)
mxICell
public mxICell remove(mxICell child)
mxICell
public void removeFromParent()
mxICell
removeFromParent
in interface mxICell
public int getEdgeCount()
mxICell
getEdgeCount
in interface mxICell
public int getEdgeIndex(mxICell edge)
mxICell
getEdgeIndex
in interface mxICell
edge
- Cell whose index should be returned.public mxICell getEdgeAt(int index)
mxICell
public mxICell insertEdge(mxICell edge, boolean isOutgoing)
mxICell
insertEdge
in interface mxICell
edge
- Cell to be inserted into the edge array.isOutgoing
- Boolean that specifies if the edge is outgoing.public mxICell removeEdge(mxICell edge, boolean isOutgoing)
mxICell
removeEdge
in interface mxICell
edge
- Cell to be removed from the edge array.isOutgoing
- Boolean that specifies if the edge is outgoing.public void removeFromTerminal(boolean isSource)
mxICell
removeFromTerminal
in interface mxICell
isSource
- Boolean that specifies if the edge should be removed
from its source or target terminal.public String getAttribute(String name)
name
- Name of the attribute whose value should be returned.public String getAttribute(String name, String defaultValue)
name
- Name of the attribute whose value should be returned.defaultValue
- Default value to use if the attribute has no value.public void setAttribute(String name, String value)
name
- Name of the attribute whose value should be set.value
- New value of the attribute.public Object clone() throws CloneNotSupportedException
clone
in interface mxICell
clone
in class Object
CloneNotSupportedException
protected Object cloneValue()
Copyright (c) 2010-2017 Gaudenz Alder, JGraph Ltd. All rights reserved.