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()
mxICellpublic void setId(String id)
mxICellpublic Object getValue()
mxICellpublic void setValue(Object value)
mxICellpublic mxGeometry getGeometry()
mxICellgetGeometry in interface mxICellpublic void setGeometry(mxGeometry geometry)
mxICellsetGeometry in interface mxICellpublic String getStyle()
mxICellpublic void setStyle(String style)
mxICellpublic boolean isVertex()
mxICellpublic void setVertex(boolean vertex)
public boolean isEdge()
mxICellpublic void setEdge(boolean edge)
public boolean isConnectable()
mxICellisConnectable in interface mxICellpublic void setConnectable(boolean connectable)
public boolean isVisible()
mxICellpublic void setVisible(boolean visible)
mxICellsetVisible in interface mxICellvisible - Boolean that specifies the new visible state.public boolean isCollapsed()
mxICellisCollapsed in interface mxICellpublic void setCollapsed(boolean collapsed)
mxICellsetCollapsed in interface mxICellcollapsed - Boolean that specifies the new collapsed state.public mxICell getParent()
mxICellpublic void setParent(mxICell parent)
mxICellpublic 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)
mxICellgetTerminal in interface mxICellsource - Boolean that specifies if the source terminal should be
returned.public mxICell setTerminal(mxICell terminal, boolean isSource)
mxICellsetTerminal in interface mxICellterminal - 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()
mxICellgetChildCount in interface mxICellpublic int getIndex(mxICell child)
mxICellpublic mxICell getChildAt(int index)
mxICellgetChildAt in interface mxICellindex - Integer that specifies the child to be returned.public mxICell insert(mxICell child)
mxICellpublic mxICell insert(mxICell child, int index)
mxICellpublic mxICell remove(int index)
mxICellpublic mxICell remove(mxICell child)
mxICellpublic void removeFromParent()
mxICellremoveFromParent in interface mxICellpublic int getEdgeCount()
mxICellgetEdgeCount in interface mxICellpublic int getEdgeIndex(mxICell edge)
mxICellgetEdgeIndex in interface mxICelledge - Cell whose index should be returned.public mxICell getEdgeAt(int index)
mxICellpublic mxICell insertEdge(mxICell edge, boolean isOutgoing)
mxICellinsertEdge in interface mxICelledge - Cell to be inserted into the edge array.isOutgoing - Boolean that specifies if the edge is outgoing.public mxICell removeEdge(mxICell edge, boolean isOutgoing)
mxICellremoveEdge in interface mxICelledge - Cell to be removed from the edge array.isOutgoing - Boolean that specifies if the edge is outgoing.public void removeFromTerminal(boolean isSource)
mxICellremoveFromTerminal in interface mxICellisSource - 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 mxICellclone in class ObjectCloneNotSupportedExceptionprotected Object cloneValue()
Copyright (c) 2010 Gaudenz Alder. All rights reserved.