mxGraph
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
com.mxgraph.mxGraph Class Reference

Implements a graph object that allows to create diagrams from a graph model and stylesheet. More...

Public Member Functions

 mxGraph ()
 Constructs a new graph with an empty graph model. More...
 
 mxGraph (mxIGraphModel model)
 Constructs a new graph for the specified model. If no model is specified, then a new, empty graph model is used. More...
 
 mxGraph (mxStylesheet stylesheet)
 Constructs a new graph for the specified model. If no model is specified, then a new, empty graph model is used. More...
 
 mxGraph (mxIGraphModel model, mxStylesheet stylesheet)
 Constructs a new graph for the specified model. If no model is specified, then a new, empty graph model is used. More...
 
double Snap (double value)
 Snaps the given numeric value to the grid if gridEnabled is true. More...
 
Object GetDefaultParent ()
 Returns the first child of the root in the model, that is, the first or default layer of the diagram. More...
 
string ConvertValueToString (Object cell)
 Returns the textual representation for the given cell. More...
 
string GetLabel (Object cell)
 Returns a string or markup that represents the label for the given cell. This implementation uses ConvertValueToString if labelsVisible is true. Otherwise it returns an empty string. More...
 
mxPoint GetChildOffsetForCell (Object 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. This implementation returns null. More...
 
bool IsOrthogonal (mxCellState edge)
 Returns true if perimeter points should be computed such that the resulting edge has only horizontal or vertical segments. More...
 
bool IsSwimlane (Object cell)
 Returns true if the given cell is a swimlane. More...
 
bool IsCellMovable (Object cell)
 Returns true if the given cell is movable. This implementation always returns true. More...
 
bool IsCellVisible (Object cell)
 Returns true if the given cell is visible. This implementation returns true if the visible state of the cell in the model is true. More...
 
bool IsCellCollapsed (Object cell)
 Returns true if the given cell is collapsed. This implementation returns true if the collapsed state of the cell in the model is true. More...
 
bool IsCellConnectable (Object cell)
 Returns true if the given cell is connectable. This implementation returns true if the connectable state of the cell in the model is true. More...
 
mxGeometry GetCellGeometry (Object cell)
 Returns the geometry for the given cell. More...
 
Dictionary< string, Object > GetCellStyle (Object cell)
 Returns the style for the given cell. More...
 
void AddImageBundle (mxImageBundle bundle)
 Adds the specified bundle. More...
 
void RemoveImageBundle (mxImageBundle bundle)
 Removes the specified bundle. More...
 
String GetImageFromBundles (String key)
 Searches all bundles for the specified key and returns the value for the first match or null if the key is not found. More...
 
void SetCellStyles (String key, String value, Object[] 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. More...
 
Object InsertVertex (Object parent, string id, Object value, double x, double y, double width, double height)
 Creates and adds a new vertex with an empty style, see AddVertex. More...
 
Object InsertVertex (Object parent, string id, Object value, double x, double y, double width, double height, string style)
 Creates and adds a new vertex with an empty style, see AddVertex. More...
 
Object InsertVertex (Object parent, string id, Object value, double x, double y, double width, double height, string style, bool relative)
 Adds a new vertex into the given parent using value as the user object and the given coordinates as the geometry of the new vertex. The id and style are used for the respective properties of the new cell, which is returned. More...
 
Object CreateVertex (Object parent, string id, Object value, double x, double y, double width, double height, string style)
 Creates a new vertex to be used in insertVertex. More...
 
Object CreateVertex (Object parent, string id, Object value, double x, double y, double width, double height, string style, bool relative)
 Creates a new vertex to be used in insertVertex. More...
 
Object InsertEdge (Object parent, string id, Object value, Object source, Object target)
 Creates and adds a new edge with an empty style. More...
 
Object InsertEdge (Object parent, string id, Object value, Object source, Object target, string style)
 Adds a new edge into the given parent 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 cell, which is returned. More...
 
Object CreateEdge (Object parent, string id, Object value, Object source, Object target, string style)
 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. More...
 
mxRectangle GetGraphBounds ()
 Returns the bounds of the visible graph. More...
 
mxRectangle GetCellBounds (Object cell)
 Returns the bounds of the given cell. More...
 
mxRectangle GetCellBounds (Object cell, bool includeEdges)
 Returns the bounds of the given cell including all connected edges if includeEdge is true. More...
 
mxRectangle GetCellBounds (Object cell, bool includeEdges, bool includeDescendants)
 Returns the bounds of the given cell including all connected edges if includeEdge is true. More...
 
mxRectangle GetBoundingBox (Object cell)
 Returns the bounds of the given cell. More...
 
mxRectangle GetBoundingBox (Object cell, bool includeEdges)
 Returns the bounding box of the given cell including all connected edges if includeEdge is true. More...
 
mxRectangle GetBoundingBox (Object cell, bool includeEdges, bool includeDescendants)
 Returns the bounding box of the given cell including all connected edges if includeEdge is true. More...
 
mxRectangle GetPaintBounds (Object[] cells)
 Returns the bounding box of the given cells and their descendants. More...
 
mxRectangle GetBoundsForCells (Object[] cells, bool includeEdges, bool includeDescendants, bool boundingBox)
 Returns the bounds for the given cells. More...
 
mxRectangle GetCellBounds (Object cell, bool includeEdges, bool includeDescendants, bool boundingBox)
 Returns the bounds of the given cell including all connected edges if includeEdge is true. More...
 
mxConnectionConstraint GetConnectionConstraint (mxCellState edge, mxCellState terminal, bool source)
 Returns a connection constraint that describes the given connection point. This result can then be passed to getConnectionPoint. More...
 
mxPoint GetConnectionPoint (mxCellState vertex, mxConnectionConstraint constraint)
 Returns the nearest point in the list of absolute points or the center of the opposite terminal. More...
 
Object GetCellAt (int x, int y)
 Returns the cell at the given location. More...
 
Object GetCellAt (int x, int y, bool hitSwimlaneContent)
 Returns the cell at the given location. More...
 
Object GetCellAt (int x, int y, bool hitSwimlaneContent, Object parent)
 Returns the bottom-most cell that intersects the given point (x, y) in the cell hierarchy starting at the given parent. More...
 
bool Intersects (mxCellState state, Rectangle rect)
 Returns the bottom-most cell that intersects the given point (x, y) in the cell hierarchy that starts at the given parent. More...
 
bool HitsSwimlaneContent (Object swimlane, int x, int y)
 Returns true if the given point is inside the content area of the given swimlane. (The content area of swimlanes is transparent to events.) This implementation does not check if the given state is a swimlane, it is assumed that the caller has checked this before using this method. More...
 
Object[] GetChildVertices (Object parent)
 Returns the visible child vertices of the given parent. More...
 
Object[] GetChildEdges (Object parent)
 Returns the visible child edges of the given parent. More...
 
Object[] GetChildCells (Object parent)
 Returns the visible children of the given parent. More...
 
Object[] GetChildCells (Object parent, bool vertices, bool edges)
 Returns the visible child vertices or edges in the given parent. If vertices and edges is false, then all children are returned. More...
 
Object[] GetConnections (Object cell)
 Returns all visible edges connected to the given cell without loops. More...
 
Object[] GetConnections (Object cell, Object parent)
 Returns all visible edges connected to the given cell without loops. More...
 
Object[] GetIncomingEdges (Object cell)
 Returns all incoming visible edges connected to the given cell without loops. More...
 
Object[] GetIncomingEdges (Object cell, Object parent)
 Returns the visible incoming edges for the given cell. If the optional parent argument is specified, then only child edges of the given parent are returned. More...
 
Object[] GetOutgoingEdges (Object cell)
 Returns all outgoing visible edges connected to the given cell without loops. More...
 
Object[] GetOutgoingEdges (Object cell, Object parent)
 Returns the visible outgoing edges for the given cell. If the optional parent argument is specified, then only child edges of the given parent are returned. More...
 
Object[] GetEdges (Object cell)
 Returns all visible edges connected to the given cell including loops. More...
 
Object[] GetEdges (Object cell, Object parent)
 Returns all visible edges connected to the given cell including loops. More...
 
Object[] GetEdges (Object cell, Object parent, bool incoming, bool outgoing, bool includeLoops)
 Returns the incoming and/or outgoing edges for the given cell. If the optional parent argument is specified, then only edges are returned where the opposite is in the given parent cell. If at least one of incoming or outgoing is true, then loops are ignored, if both are false, then all edges connected to the given cell are returned including loops. More...
 
Object[] GetEdges (Object cell, Object parent, bool incoming, bool outgoing, bool includeLoops, bool recurse)
 Returns the incoming and/or outgoing edges for the given cell. If the optional parent argument is specified, then only edges are returned where the opposite is in the given parent cell. If at least one of incoming or outgoing is true, then loops are ignored, if both are false, then all edges connected to the given cell are returned including loops. More...
 
bool IsValidAncestor (Object cell, Object parent, bool recurse)
 Returns whether or not the specified parent is a valid ancestor of the specified cell, either direct or indirectly based on whether ancestor recursion is enabled. More...
 
Object[] GetOpposites (Object[] edges, Object terminal)
 Returns all distinct visible opposite cells of the terminal on the given edges. More...
 
Object[] GetOpposites (Object[] edges, Object terminal, bool sources, bool targets)
 Returns all distincts visible opposite cells for the specified terminal on the given edges. More...
 
Object[] GetEdgesBetween (Object source, Object target)
 Returns the edges between the given source and target. This takes into account collapsed and invisible cells and returns the connected edges as displayed on the screen. More...
 
Object[] GetEdgesBetween (Object source, Object target, bool directed)
 Returns the edges between the given source and target. This takes into account collapsed and invisible cells and returns the connected edges as displayed on the screen. More...
 
List< Object > FindTreeRoots (Object parent)
 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. More...
 
List< Object > FindTreeRoots (Object parent, bool isolate)
 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. More...
 
List< Object > FindTreeRoots (Object parent, bool isolate, bool invert)
 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. More...
 
void DrawGraph (mxICanvas canvas)
 Draws the graph onto the given canvas. More...
 
void DrawCell (mxICanvas canvas, Object cell)
 Draws the given cell onto the specified canvas. More...
 
void DrawState (mxICanvas canvas, mxCellState state, String label)
 Draws the given cell and label onto the specified canvas. No children or descendants are painted. More...
 
void GraphModelChanged ()
 Called when the graph model has changed to invalidate the view. More...
 

Public Attributes

const String VERSION = "3.4.0.2"
 Holds the version number of this release. Current version is 3.4.0.2. More...
 

Protected Member Functions

mxStylesheet CreateStylesheet ()
 Constructs a new stylesheet to be used in this graph. More...
 
mxGraphView CreateGraphView ()
 Constructs a new view to be used in this graph. More...
 
Dictionary< string, Object > PostProcessCellStyle (Dictionary< string, Object > 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. More...
 

Protected Attributes

mxIGraphModel model
 Holds the model that contains the cells to be displayed. More...
 
mxStylesheet stylesheet
 Holds the stylesheet that defines the appearance of the cells. More...
 
mxGraphView view
 Holds the view that caches the cell states. More...
 
mxEdgeStyleFunction defaultLoopStyle = mxEdgeStyle.Loop
 Specifies the default style for loops. More...
 
int tolerance = 4
 Specifies the tolerance for mouse clicks. Default is 4. More...
 
bool labelsVisible = true
 Specifies if labels should be visible. This is used in GetLabel. Default is true. More...
 
int gridSize = 10
 Specifies the grid size. Default is 10. More...
 
bool gridEnabled = true
 Specifies if the grid is enabled. Default is true. More...
 
List< mxImageBundleimageBundles = new List<mxImageBundle>()
 Holds the list of image bundles. More...
 

Properties

mxIGraphModel Model [get, set]
 Sets or returns the graph model that contains the graph data. More...
 
mxStylesheet Stylesheet [get, set]
 Sets or returns the stylesheet that provides the style. More...
 
mxGraphView View [get, set]
 Sets or returns the view that contains the cell states. More...
 
mxEdgeStyleFunction DefaultLoopStyle [get, set]
 Sets or returns the default edge style for loops. More...
 
bool GridEnabled [get, set]
 Sets or returns the enabled state of the grid. More...
 
int GridSize [get, set]
 Sets or returns the grid size. More...
 
bool LabelsVisible [get, set]
 Sets or returns if labels are visible More...
 
List< mxImageBundleImageBundles [get, set]
 Sets or returns the image bundles. More...
 

Detailed Description

Implements a graph object that allows to create diagrams from a graph model and stylesheet.

Constructor & Destructor Documentation

com.mxgraph.mxGraph.mxGraph ( )
inline

Constructs a new graph with an empty graph model.

com.mxgraph.mxGraph.mxGraph ( mxIGraphModel  model)
inline

Constructs a new graph for the specified model. If no model is specified, then a new, empty graph model is used.

com.mxgraph.mxGraph.mxGraph ( mxStylesheet  stylesheet)
inline

Constructs a new graph for the specified model. If no model is specified, then a new, empty graph model is used.

com.mxgraph.mxGraph.mxGraph ( mxIGraphModel  model,
mxStylesheet  stylesheet 
)
inline

Constructs a new graph for the specified model. If no model is specified, then a new, empty graph model is used.

Member Function Documentation

void com.mxgraph.mxGraph.AddImageBundle ( mxImageBundle  bundle)
inline

Adds the specified bundle.

string com.mxgraph.mxGraph.ConvertValueToString ( Object  cell)
inline

Returns the textual representation for the given cell.

Parameters
cellCell to be converted to a string.
Returns
Returns the textual representation of the cell.
Object com.mxgraph.mxGraph.CreateEdge ( Object  parent,
string  id,
Object  value,
Object  source,
Object  target,
string  style 
)
inline

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.

mxGraphView com.mxgraph.mxGraph.CreateGraphView ( )
inlineprotected

Constructs a new view to be used in this graph.

Returns
mxStylesheet com.mxgraph.mxGraph.CreateStylesheet ( )
inlineprotected

Constructs a new stylesheet to be used in this graph.

Returns
Object com.mxgraph.mxGraph.CreateVertex ( Object  parent,
string  id,
Object  value,
double  x,
double  y,
double  width,
double  height,
string  style 
)
inline

Creates a new vertex to be used in insertVertex.

Object com.mxgraph.mxGraph.CreateVertex ( Object  parent,
string  id,
Object  value,
double  x,
double  y,
double  width,
double  height,
string  style,
bool  relative 
)
inline

Creates a new vertex to be used in insertVertex.

void com.mxgraph.mxGraph.DrawCell ( mxICanvas  canvas,
Object  cell 
)
inline

Draws the given cell onto the specified canvas.

Parameters
canvasCanvas onto which the cell should be drawn.
cellCell that should be drawn onto the canvas.
void com.mxgraph.mxGraph.DrawGraph ( mxICanvas  canvas)
inline

Draws the graph onto the given canvas.

Parameters
canvasCanvas onto which the graph should be drawn.
void com.mxgraph.mxGraph.DrawState ( mxICanvas  canvas,
mxCellState  state,
String  label 
)
inline

Draws the given cell and label onto the specified canvas. No children or descendants are painted.

References com.mxgraph.mxCellState.Cell, com.mxgraph.mxRectangle.GetRectangle(), and com.mxgraph.mxCellState.LabelBounds.

List<Object> com.mxgraph.mxGraph.FindTreeRoots ( Object  parent)
inline

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.

Parameters
parentCell whose children should be checked.
Returns
List<Object> com.mxgraph.mxGraph.FindTreeRoots ( Object  parent,
bool  isolate 
)
inline

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.

Parameters
parentCell whose children should be checked.
isolateSpecifies if edges should be ignored if the opposite end is not a child of the given parent cell.
Returns
Array of tree roots in parent.
List<Object> com.mxgraph.mxGraph.FindTreeRoots ( Object  parent,
bool  isolate,
bool  invert 
)
inline

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.

Parameters
parentCell whose children should be checked.
isolateSpecifies if edges should be ignored if the opposite end is not a child of the given parent cell.
invertSpecifies if outgoing or incoming edges should be counted for a tree root. If false then outgoing edges will be counted.
Returns
Array of tree roots in parent.
mxRectangle com.mxgraph.mxGraph.GetBoundingBox ( Object  cell)
inline

Returns the bounds of the given cell.

mxRectangle com.mxgraph.mxGraph.GetBoundingBox ( Object  cell,
bool  includeEdges 
)
inline

Returns the bounding box of the given cell including all connected edges if includeEdge is true.

mxRectangle com.mxgraph.mxGraph.GetBoundingBox ( Object  cell,
bool  includeEdges,
bool  includeDescendants 
)
inline

Returns the bounding box of the given cell including all connected edges if includeEdge is true.

mxRectangle com.mxgraph.mxGraph.GetBoundsForCells ( Object[]  cells,
bool  includeEdges,
bool  includeDescendants,
bool  boundingBox 
)
inline

Returns the bounds for the given cells.

Object com.mxgraph.mxGraph.GetCellAt ( int  x,
int  y 
)
inline

Returns the cell at the given location.

Object com.mxgraph.mxGraph.GetCellAt ( int  x,
int  y,
bool  hitSwimlaneContent 
)
inline

Returns the cell at the given location.

Object com.mxgraph.mxGraph.GetCellAt ( int  x,
int  y,
bool  hitSwimlaneContent,
Object  parent 
)
inline

Returns the bottom-most cell that intersects the given point (x, y) in the cell hierarchy starting at the given parent.

Parameters
xX-coordinate of the location to be checked.
yY-coordinate of the location to be checked.
hitSwimlaneContent
parentthat should be used as the root of the recursion.
Returns
Returns the child at the given location.
mxRectangle com.mxgraph.mxGraph.GetCellBounds ( Object  cell)
inline

Returns the bounds of the given cell.

mxRectangle com.mxgraph.mxGraph.GetCellBounds ( Object  cell,
bool  includeEdges 
)
inline

Returns the bounds of the given cell including all connected edges if includeEdge is true.

mxRectangle com.mxgraph.mxGraph.GetCellBounds ( Object  cell,
bool  includeEdges,
bool  includeDescendants 
)
inline

Returns the bounds of the given cell including all connected edges if includeEdge is true.

mxRectangle com.mxgraph.mxGraph.GetCellBounds ( Object  cell,
bool  includeEdges,
bool  includeDescendants,
bool  boundingBox 
)
inline

Returns the bounds of the given cell including all connected edges if includeEdge is true.

mxGeometry com.mxgraph.mxGraph.GetCellGeometry ( Object  cell)
inline

Returns the geometry for the given cell.

Parameters
cellCell whose geometry should be returned.
Returns
Returns the geometry of the cell.
Dictionary<string, Object> com.mxgraph.mxGraph.GetCellStyle ( Object  cell)
inline

Returns the style for the given cell.

Parameters
cellCell whose style should be returned.
Returns
Returns the style of the cell.
Object [] com.mxgraph.mxGraph.GetChildCells ( Object  parent)
inline

Returns the visible children of the given parent.

Object [] com.mxgraph.mxGraph.GetChildCells ( Object  parent,
bool  vertices,
bool  edges 
)
inline

Returns the visible child vertices or edges in the given parent. If vertices and edges is false, then all children are returned.

Parameters
parentCell whose children should be returned.
verticesSpecifies if child vertices should be returned.
edgesSpecifies if child edges should be returned.
Returns
Object [] com.mxgraph.mxGraph.GetChildEdges ( Object  parent)
inline

Returns the visible child edges of the given parent.

Parameters
parentCell whose children should be returned.
Returns
mxPoint com.mxgraph.mxGraph.GetChildOffsetForCell ( Object  cell)
inline

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. This implementation returns null.

Parameters
cellCell whose offset should be returned.
Returns
Returns the child offset for the given cell.
Object [] com.mxgraph.mxGraph.GetChildVertices ( Object  parent)
inline

Returns the visible child vertices of the given parent.

Parameters
parentCell whose children should be returned.
Returns
mxConnectionConstraint com.mxgraph.mxGraph.GetConnectionConstraint ( mxCellState  edge,
mxCellState  terminal,
bool  source 
)
inline

Returns a connection constraint that describes the given connection point. This result can then be passed to getConnectionPoint.

Parameters
edgeCell state that represents the edge.
terminalCell state that represents the terminal.
sourceBoolean indicating if the terminal is the source or target.
Returns

References com.mxgraph.mxCellState.Style, com.mxgraph.mxConstants.STYLE_ENTRY_PERIMETER, com.mxgraph.mxConstants.STYLE_ENTRY_X, com.mxgraph.mxConstants.STYLE_ENTRY_Y, com.mxgraph.mxConstants.STYLE_EXIT_PERIMETER, com.mxgraph.mxConstants.STYLE_EXIT_X, and com.mxgraph.mxConstants.STYLE_EXIT_Y.

mxPoint com.mxgraph.mxGraph.GetConnectionPoint ( mxCellState  vertex,
mxConnectionConstraint  constraint 
)
inline

Returns the nearest point in the list of absolute points or the center of the opposite terminal.

Parameters
vertexCell state that represents the vertex.
constraintConnection constraint that represents the connection point constraint as returned by getConnectionConstraint.

References com.mxgraph.mxRectangle.Height, com.mxgraph.mxConnectionConstraint.Perimeter, com.mxgraph.mxConnectionConstraint.Point, com.mxgraph.mxRectangle.Width, com.mxgraph.mxPoint.X, and com.mxgraph.mxPoint.Y.

Object [] com.mxgraph.mxGraph.GetConnections ( Object  cell)
inline

Returns all visible edges connected to the given cell without loops.

Parameters
cellCell whose connections should be returned.
Returns
Returns the connected edges for the given cell.
Object [] com.mxgraph.mxGraph.GetConnections ( Object  cell,
Object  parent 
)
inline

Returns all visible edges connected to the given cell without loops.

Parameters
cellCell whose connections should be returned.
parentOptional parent of the opposite end for a connection to be returned.
Returns
Returns the connected edges for the given cell.
Object com.mxgraph.mxGraph.GetDefaultParent ( )
inline

Returns the first child of the root in the model, that is, the first or default layer of the diagram.

Returns
Returns the default parent for new cells.
Object [] com.mxgraph.mxGraph.GetEdges ( Object  cell)
inline

Returns all visible edges connected to the given cell including loops.

Parameters
cellCell whose edges should be returned.
Returns
Returns the edges of the given cell.
Object [] com.mxgraph.mxGraph.GetEdges ( Object  cell,
Object  parent 
)
inline

Returns all visible edges connected to the given cell including loops.

Parameters
cellCell whose edges should be returned.
parentOptional parent of the opposite end for an edge to be returned.
Returns
Returns the edges of the given cell.
Object [] com.mxgraph.mxGraph.GetEdges ( Object  cell,
Object  parent,
bool  incoming,
bool  outgoing,
bool  includeLoops 
)
inline

Returns the incoming and/or outgoing edges for the given cell. If the optional parent argument is specified, then only edges are returned where the opposite is in the given parent cell. If at least one of incoming or outgoing is true, then loops are ignored, if both are false, then all edges connected to the given cell are returned including loops.

Parameters
cellCell whose edges should be returned.
parentOptional parent of the opposite end for an edge to be returned.
incomingSpecifies if incoming edges should be included in the result.
outgoingSpecifies if outgoing edges should be included in the result.
includeLoopsSpecifies if loops should be included in the result.
Returns
Returns the edges connected to the given cell.
Object [] com.mxgraph.mxGraph.GetEdges ( Object  cell,
Object  parent,
bool  incoming,
bool  outgoing,
bool  includeLoops,
bool  recurse 
)
inline

Returns the incoming and/or outgoing edges for the given cell. If the optional parent argument is specified, then only edges are returned where the opposite is in the given parent cell. If at least one of incoming or outgoing is true, then loops are ignored, if both are false, then all edges connected to the given cell are returned including loops.

Parameters
cellCell whose edges should be returned.
parentOptional parent of the opposite end for an edge to be returned.
incomingSpecifies if incoming edges should be included in the result.
outgoingSpecifies if outgoing edges should be included in the result.
includeLoopsSpecifies if loops should be included in the result.
recurseBoolean the specifies if the parent specified only need be an ancestral parent, true, or the direct parent, false.
Returns
Returns the edges connected to the given cell.
Object [] com.mxgraph.mxGraph.GetEdgesBetween ( Object  source,
Object  target 
)
inline

Returns the edges between the given source and target. This takes into account collapsed and invisible cells and returns the connected edges as displayed on the screen.

Parameters
source
target
Returns
Object [] com.mxgraph.mxGraph.GetEdgesBetween ( Object  source,
Object  target,
bool  directed 
)
inline

Returns the edges between the given source and target. This takes into account collapsed and invisible cells and returns the connected edges as displayed on the screen.

Parameters
source
target
directed
Returns
mxRectangle com.mxgraph.mxGraph.GetGraphBounds ( )
inline

Returns the bounds of the visible graph.

String com.mxgraph.mxGraph.GetImageFromBundles ( String  key)
inline

Searches all bundles for the specified key and returns the value for the first match or null if the key is not found.

Parameters
key
Returns
Object [] com.mxgraph.mxGraph.GetIncomingEdges ( Object  cell)
inline

Returns all incoming visible edges connected to the given cell without loops.

Parameters
cellCell whose incoming edges should be returned.
Returns
Returns the incoming edges of the given cell.
Object [] com.mxgraph.mxGraph.GetIncomingEdges ( Object  cell,
Object  parent 
)
inline

Returns the visible incoming edges for the given cell. If the optional parent argument is specified, then only child edges of the given parent are returned.

Parameters
cellCell whose incoming edges should be returned.
parentOptional parent of the opposite end for a connection to be returned.
Returns
Returns the incoming edges of the given cell.
string com.mxgraph.mxGraph.GetLabel ( Object  cell)
inline

Returns a string or markup that represents the label for the given cell. This implementation uses ConvertValueToString if labelsVisible is true. Otherwise it returns an empty string.

Parameters
cell
Returns

References com.mxgraph.mxUtils.IsTrue(), com.mxgraph.mxCellState.Style, and com.mxgraph.mxConstants.STYLE_NOLABEL.

Object [] com.mxgraph.mxGraph.GetOpposites ( Object[]  edges,
Object  terminal 
)
inline

Returns all distinct visible opposite cells of the terminal on the given edges.

Parameters
edges
terminal
Returns
Object [] com.mxgraph.mxGraph.GetOpposites ( Object[]  edges,
Object  terminal,
bool  sources,
bool  targets 
)
inline

Returns all distincts visible opposite cells for the specified terminal on the given edges.

Parameters
edgesEdges whose opposite terminals should be returned.
terminalTerminal that specifies the end whose opposite should be returned.
sourcesSpecifies if source terminals should be included in the result.
targetsSpecifies if targer terminals should be included in the result.
Returns
Object [] com.mxgraph.mxGraph.GetOutgoingEdges ( Object  cell)
inline

Returns all outgoing visible edges connected to the given cell without loops.

Parameters
cellCell whose outgoing edges should be returned.
Returns
Returns the outgoing edges of the given cell.
Object [] com.mxgraph.mxGraph.GetOutgoingEdges ( Object  cell,
Object  parent 
)
inline

Returns the visible outgoing edges for the given cell. If the optional parent argument is specified, then only child edges of the given parent are returned.

Parameters
cellCell whose outgoing edges should be returned.
parentOptional parent of the opposite end for a connection to be returned.
Returns
Returns the outgoing edges of the given cell.
mxRectangle com.mxgraph.mxGraph.GetPaintBounds ( Object[]  cells)
inline

Returns the bounding box of the given cells and their descendants.

void com.mxgraph.mxGraph.GraphModelChanged ( )
inline

Called when the graph model has changed to invalidate the view.

bool com.mxgraph.mxGraph.HitsSwimlaneContent ( Object  swimlane,
int  x,
int  y 
)
inline

Returns true if the given point is inside the content area of the given swimlane. (The content area of swimlanes is transparent to events.) This implementation does not check if the given state is a swimlane, it is assumed that the caller has checked this before using this method.

References com.mxgraph.mxConstants.DEFAULT_STARTSIZE, com.mxgraph.mxUtils.GetDouble(), com.mxgraph.mxUtils.IsTrue(), com.mxgraph.mxCellState.Style, com.mxgraph.mxConstants.STYLE_HORIZONTAL, and com.mxgraph.mxConstants.STYLE_STARTSIZE.

Object com.mxgraph.mxGraph.InsertEdge ( Object  parent,
string  id,
Object  value,
Object  source,
Object  target 
)
inline

Creates and adds a new edge with an empty style.

Object com.mxgraph.mxGraph.InsertEdge ( Object  parent,
string  id,
Object  value,
Object  source,
Object  target,
string  style 
)
inline

Adds a new edge into the given parent 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 cell, which is returned.

Parameters
parentCell that specifies the parent of the new edge.
idOptional string that defines the Id of the new edge.
valueObject to be used as the user object.
sourceCell that defines the source of the edge.
targetCell that defines the target of the edge.
styleOptional string that defines the cell style.
Returns
Returns the new edge that has been inserted.
Object com.mxgraph.mxGraph.InsertVertex ( Object  parent,
string  id,
Object  value,
double  x,
double  y,
double  width,
double  height 
)
inline

Creates and adds a new vertex with an empty style, see AddVertex.

Object com.mxgraph.mxGraph.InsertVertex ( Object  parent,
string  id,
Object  value,
double  x,
double  y,
double  width,
double  height,
string  style 
)
inline

Creates and adds a new vertex with an empty style, see AddVertex.

Object com.mxgraph.mxGraph.InsertVertex ( Object  parent,
string  id,
Object  value,
double  x,
double  y,
double  width,
double  height,
string  style,
bool  relative 
)
inline

Adds a new vertex into the given parent using value as the user object and the given coordinates as the geometry of the new vertex. The id and style are used for the respective properties of the new cell, which is returned.

Parameters
parentCell that specifies the parent of the new vertex.
idOptional string that defines the Id of the new vertex.
valueObject to be used as the user object.
xInteger that defines the x coordinate of the vertex.
yInteger that defines the y coordinate of the vertex.
widthInteger that defines the width of the vertex.
heightInteger that defines the height of the vertex.
styleOptional string that defines the cell style.
Returns
Returns the new vertex that has been inserted.
bool com.mxgraph.mxGraph.Intersects ( mxCellState  state,
Rectangle  rect 
)
inline

Returns the bottom-most cell that intersects the given point (x, y) in the cell hierarchy that starts at the given parent.

Parameters
state
rect
Returns
Returns true if the given cell state and rectangle intersect.

References com.mxgraph.mxRectangle.GetRectangle(), and com.mxgraph.mxCellState.LabelBounds.

bool com.mxgraph.mxGraph.IsCellCollapsed ( Object  cell)
inline

Returns true if the given cell is collapsed. This implementation returns true if the collapsed state of the cell in the model is true.

Parameters
cellCell whose collapsed state should be returned.
Returns
Returns the collapsed state of the cell.
bool com.mxgraph.mxGraph.IsCellConnectable ( Object  cell)
inline

Returns true if the given cell is connectable. This implementation returns true if the connectable state of the cell in the model is true.

Parameters
cellCell whose connectable state should be returned.
Returns
Returns the connectable state of the cell.
bool com.mxgraph.mxGraph.IsCellMovable ( Object  cell)
inline

Returns true if the given cell is movable. This implementation always returns true.

Parameters
cellCell whose movable state should be returned.
Returns
Returns true if the cell is movable.
bool com.mxgraph.mxGraph.IsCellVisible ( Object  cell)
inline

Returns true if the given cell is visible. This implementation returns true if the visible state of the cell in the model is true.

Parameters
cellCell whose visible state should be returned.
Returns
Returns the visible state of the cell.
bool com.mxgraph.mxGraph.IsOrthogonal ( mxCellState  edge)
inline

Returns true if perimeter points should be computed such that the resulting edge has only horizontal or vertical segments.

Parameters
edgeCell state that represents the edge.
Returns
True if the edge is orthogonal.

References com.mxgraph.mxEdgeStyleFunction(), com.mxgraph.mxCellState.Style, and com.mxgraph.mxConstants.STYLE_ORTHOGONAL.

bool com.mxgraph.mxGraph.IsSwimlane ( Object  cell)
inline

Returns true if the given cell is a swimlane.

Parameters
cellCell that should be checked.
Returns
Returns true if the cell is a swimlane.

References com.mxgraph.mxConstants.SHAPE_SWIMLANE, and com.mxgraph.mxCellState.Style.

bool com.mxgraph.mxGraph.IsValidAncestor ( Object  cell,
Object  parent,
bool  recurse 
)
inline

Returns whether or not the specified parent is a valid ancestor of the specified cell, either direct or indirectly based on whether ancestor recursion is enabled.

Parameters
cellThe possible child cell
parentThe possible parent cell
recurseboolean whether or not to recurse the child ancestors
Dictionary<string, Object> com.mxgraph.mxGraph.PostProcessCellStyle ( Dictionary< string, Object >  style)
inlineprotected

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.

void com.mxgraph.mxGraph.RemoveImageBundle ( mxImageBundle  bundle)
inline

Removes the specified bundle.

void com.mxgraph.mxGraph.SetCellStyles ( String  key,
String  value,
Object[]  cells 
)
inline

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.

Parameters
keyString representing the key to be assigned.
valueString representing the new value for the key.
cellsArray of cells to change the style for.
double com.mxgraph.mxGraph.Snap ( double  value)
inline

Snaps the given numeric value to the grid if gridEnabled is true.

Parameters
valueNumeric value to be snapped to the grid.
Returns
Returns the value aligned to the grid.

Member Data Documentation

mxEdgeStyleFunction com.mxgraph.mxGraph.defaultLoopStyle = mxEdgeStyle.Loop
protected

Specifies the default style for loops.

bool com.mxgraph.mxGraph.gridEnabled = true
protected

Specifies if the grid is enabled. Default is true.

int com.mxgraph.mxGraph.gridSize = 10
protected

Specifies the grid size. Default is 10.

List<mxImageBundle> com.mxgraph.mxGraph.imageBundles = new List<mxImageBundle>()
protected

Holds the list of image bundles.

bool com.mxgraph.mxGraph.labelsVisible = true
protected

Specifies if labels should be visible. This is used in GetLabel. Default is true.

mxIGraphModel com.mxgraph.mxGraph.model
protected

Holds the model that contains the cells to be displayed.

mxStylesheet com.mxgraph.mxGraph.stylesheet
protected

Holds the stylesheet that defines the appearance of the cells.

int com.mxgraph.mxGraph.tolerance = 4
protected

Specifies the tolerance for mouse clicks. Default is 4.

const String com.mxgraph.mxGraph.VERSION = "3.4.0.2"

Holds the version number of this release. Current version is 3.4.0.2.

mxGraphView com.mxgraph.mxGraph.view
protected

Holds the view that caches the cell states.

Property Documentation

mxEdgeStyleFunction com.mxgraph.mxGraph.DefaultLoopStyle
getset

Sets or returns the default edge style for loops.

bool com.mxgraph.mxGraph.GridEnabled
getset

Sets or returns the enabled state of the grid.

int com.mxgraph.mxGraph.GridSize
getset

Sets or returns the grid size.

List<mxImageBundle> com.mxgraph.mxGraph.ImageBundles
getset

Sets or returns the image bundles.

bool com.mxgraph.mxGraph.LabelsVisible
getset

Sets or returns if labels are visible

mxIGraphModel com.mxgraph.mxGraph.Model
getset

Sets or returns the graph model that contains the graph data.

mxStylesheet com.mxgraph.mxGraph.Stylesheet
getset

Sets or returns the stylesheet that provides the style.

mxGraphView com.mxgraph.mxGraph.View
getset

Sets or returns the view that contains the cell states.


The documentation for this class was generated from the following file: