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.9.3"
 Holds the version number of this release. Current version is 3.9.3. 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

◆ mxGraph() [1/4]

com.mxgraph.mxGraph.mxGraph ( )
inline

Constructs a new graph with an empty graph model.

◆ mxGraph() [2/4]

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.

◆ mxGraph() [3/4]

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.

◆ mxGraph() [4/4]

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

◆ AddImageBundle()

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

Adds the specified bundle.

◆ ConvertValueToString()

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.

References com.mxgraph.mxIGraphModel.GetValue().

◆ CreateEdge()

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.

References com.mxgraph.mxGeometry.Relative.

◆ CreateGraphView()

mxGraphView com.mxgraph.mxGraph.CreateGraphView ( )
inlineprotected

Constructs a new view to be used in this graph.

Returns

◆ CreateStylesheet()

mxStylesheet com.mxgraph.mxGraph.CreateStylesheet ( )
inlineprotected

Constructs a new stylesheet to be used in this graph.

Returns

◆ CreateVertex() [1/2]

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.

◆ CreateVertex() [2/2]

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.

References com.mxgraph.mxGeometry.Relative.

◆ DrawCell()

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.

References com.mxgraph.mxIGraphModel.GetChildAt(), com.mxgraph.mxIGraphModel.GetChildCount(), and com.mxgraph.mxGraphView.GetState().

Referenced by com.mxgraph.mxCellRenderer.DrawCells().

◆ DrawGraph()

void com.mxgraph.mxGraph.DrawGraph ( mxICanvas  canvas)
inline

Draws the graph onto the given canvas.

Parameters
canvasCanvas onto which the graph should be drawn.

References com.mxgraph.mxIGraphModel.Root.

◆ DrawState()

void com.mxgraph.mxGraph.DrawState ( mxICanvas  canvas,
mxCellState  state,
String  label 
)
inline

◆ FindTreeRoots() [1/3]

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

◆ FindTreeRoots() [2/3]

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.

◆ FindTreeRoots() [3/3]

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.

References com.mxgraph.mxIGraphModel.GetChildAt(), com.mxgraph.mxIGraphModel.GetChildCount(), com.mxgraph.mxGraphView.GetVisibleTerminal(), and com.mxgraph.mxIGraphModel.IsVertex().

◆ GetBoundingBox() [1/3]

mxRectangle com.mxgraph.mxGraph.GetBoundingBox ( Object  cell)
inline

Returns the bounds of the given cell.

◆ GetBoundingBox() [2/3]

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.

◆ GetBoundingBox() [3/3]

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.

◆ GetBoundsForCells()

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

Returns the bounds for the given cells.

References com.mxgraph.mxRectangle.Add().

◆ GetCellAt() [1/3]

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

Returns the cell at the given location.

◆ GetCellAt() [2/3]

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

Returns the cell at the given location.

◆ GetCellAt() [3/3]

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.

References com.mxgraph.mxIGraphModel.GetChildAt(), com.mxgraph.mxIGraphModel.GetChildCount(), and com.mxgraph.mxGraphView.GetState().

◆ GetCellBounds() [1/4]

mxRectangle com.mxgraph.mxGraph.GetCellBounds ( Object  cell)
inline

Returns the bounds of the given cell.

◆ GetCellBounds() [2/4]

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.

◆ GetCellBounds() [3/4]

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.

◆ GetCellBounds() [4/4]

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

◆ GetCellGeometry()

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.

References com.mxgraph.mxIGraphModel.GetGeometry().

Referenced by com.mxgraph.mxGraphView.UpdateCellState(), and com.mxgraph.mxGraphView.UpdateFixedTerminalPoint().

◆ GetCellStyle()

Dictionary<string, Object> com.mxgraph.mxGraph.GetCellStyle ( Object  cell)
inline

◆ GetChildCells() [1/2]

Object [] com.mxgraph.mxGraph.GetChildCells ( Object  parent)
inline

Returns the visible children of the given parent.

◆ GetChildCells() [2/2]

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

References com.mxgraph.mxGraphModel.getChildCells().

◆ GetChildEdges()

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

◆ GetChildOffsetForCell()

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.

Referenced by com.mxgraph.mxGraphView.UpdateCellState().

◆ GetChildVertices()

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

◆ GetConnectionConstraint()

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.mxUtils.GetDouble(), com.mxgraph.mxUtils.IsTrue(), 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.

Referenced by com.mxgraph.mxGraphView.UpdateFixedTerminalPoints().

◆ GetConnectionPoint()

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.

Referenced by com.mxgraph.mxGraphView.UpdateFixedTerminalPoint().

◆ GetConnections() [1/2]

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.

◆ GetConnections() [2/2]

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.

◆ GetDefaultParent()

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.

References com.mxgraph.mxIGraphModel.GetChildAt(), and com.mxgraph.mxIGraphModel.Root.

◆ GetEdges() [1/4]

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.

◆ GetEdges() [2/4]

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.

◆ GetEdges() [3/4]

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.

◆ GetEdges() [4/4]

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.

References com.mxgraph.mxIGraphModel.GetChildAt(), com.mxgraph.mxIGraphModel.GetChildCount(), com.mxgraph.mxGraphModel.GetEdges(), and com.mxgraph.mxGraphView.GetVisibleTerminal().

◆ GetEdgesBetween() [1/2]

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

◆ GetEdgesBetween() [2/2]

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

References com.mxgraph.mxGraphView.GetVisibleTerminal().

◆ GetGraphBounds()

mxRectangle com.mxgraph.mxGraph.GetGraphBounds ( )
inline

Returns the bounds of the visible graph.

References com.mxgraph.mxGraphView.GraphBounds.

◆ GetImageFromBundles()

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

References com.mxgraph.mxImageBundle.GetImage().

◆ GetIncomingEdges() [1/2]

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.

◆ GetIncomingEdges() [2/2]

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.

◆ GetLabel()

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.

Referenced by com.mxgraph.mxGraphView.UpdateLabelBounds().

◆ GetOpposites() [1/2]

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

◆ GetOpposites() [2/2]

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

References com.mxgraph.mxGraphView.GetVisibleTerminal().

◆ GetOutgoingEdges() [1/2]

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.

◆ GetOutgoingEdges() [2/2]

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.

◆ GetPaintBounds()

mxRectangle com.mxgraph.mxGraph.GetPaintBounds ( Object []  cells)
inline

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

Referenced by com.mxgraph.mxCellRenderer.DrawCells().

◆ GraphModelChanged()

void com.mxgraph.mxGraph.GraphModelChanged ( )
inline

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

References com.mxgraph.mxGraphView.Revalidate().

◆ HitsSwimlaneContent()

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.mxRectangle.GetRectangle(), com.mxgraph.mxGraphView.GetState(), com.mxgraph.mxUtils.IsTrue(), com.mxgraph.mxGraphView.Scale, com.mxgraph.mxCellState.Style, com.mxgraph.mxConstants.STYLE_HORIZONTAL, and com.mxgraph.mxConstants.STYLE_STARTSIZE.

◆ InsertEdge() [1/2]

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.

◆ InsertEdge() [2/2]

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.

References com.mxgraph.mxIGraphModel.Add(), com.mxgraph.mxIGraphModel.BeginUpdate(), com.mxgraph.mxIGraphModel.EndUpdate(), com.mxgraph.mxIGraphModel.GetChildCount(), and com.mxgraph.mxIGraphModel.SetTerminal().

◆ InsertVertex() [1/3]

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.

◆ InsertVertex() [2/3]

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.

◆ InsertVertex() [3/3]

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.

References com.mxgraph.mxIGraphModel.Add(), and com.mxgraph.mxIGraphModel.GetChildCount().

◆ Intersects()

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.mxCellState.AbsolutePointCount(), com.mxgraph.mxCellState.AbsolutePoints, com.mxgraph.mxRectangle.GetRectangle(), com.mxgraph.mxRectangle.Grow(), and com.mxgraph.mxCellState.LabelBounds.

◆ IsCellCollapsed()

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.

References com.mxgraph.mxIGraphModel.IsCollapsed().

Referenced by com.mxgraph.mxGraphView.GetVisibleTerminal(), and com.mxgraph.mxGraphView.ValidateCell().

◆ IsCellConnectable()

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.

References com.mxgraph.mxIGraphModel.IsConnectable().

◆ IsCellMovable()

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.

Referenced by com.mxgraph.mxFastOrganicLayout.execute().

◆ IsCellVisible()

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.

References com.mxgraph.mxIGraphModel.IsVisible().

Referenced by com.mxgraph.mxGraphView.GetState(), com.mxgraph.mxGraphView.GetVisibleTerminal(), and com.mxgraph.mxGraphView.ValidateCell().

◆ IsOrthogonal()

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.mxEdgeStyle.ElbowConnector, com.mxgraph.mxEdgeStyle.EntityRelation, com.mxgraph.mxGraphView.GetEdgeStyle(), com.mxgraph.mxUtils.IsTrue(), com.mxgraph.mxEdgeStyleFunction(), com.mxgraph.mxEdgeStyle.SideToSide, com.mxgraph.mxCellState.Style, com.mxgraph.mxConstants.STYLE_ORTHOGONAL, and com.mxgraph.mxEdgeStyle.TopToBottom.

Referenced by com.mxgraph.mxGraphView.UpdateFloatingTerminalPoint().

◆ IsSwimlane()

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.mxUtils.GetString(), com.mxgraph.mxConstants.SHAPE_SWIMLANE, com.mxgraph.mxCellState.Style, and com.mxgraph.mxConstants.STYLE_SHAPE.

◆ IsValidAncestor()

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

References com.mxgraph.mxIGraphModel.GetParent(), and com.mxgraph.mxIGraphModel.IsAncestor().

◆ PostProcessCellStyle()

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.

References com.mxgraph.mxUtils.GetString(), and com.mxgraph.mxConstants.STYLE_IMAGE.

◆ RemoveImageBundle()

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

Removes the specified bundle.

◆ SetCellStyles()

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.

References com.mxgraph.mxUtils.SetCellStyles().

◆ Snap()

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.

Referenced by com.mxgraph.mxFastOrganicLayout.execute().

Member Data Documentation

◆ defaultLoopStyle

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

Specifies the default style for loops.

◆ gridEnabled

bool com.mxgraph.mxGraph.gridEnabled = true
protected

Specifies if the grid is enabled. Default is true.

◆ gridSize

int com.mxgraph.mxGraph.gridSize = 10
protected

Specifies the grid size. Default is 10.

◆ imageBundles

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

Holds the list of image bundles.

◆ labelsVisible

bool com.mxgraph.mxGraph.labelsVisible = true
protected

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

◆ model

mxIGraphModel com.mxgraph.mxGraph.model
protected

Holds the model that contains the cells to be displayed.

◆ stylesheet

mxStylesheet com.mxgraph.mxGraph.stylesheet
protected

Holds the stylesheet that defines the appearance of the cells.

◆ tolerance

int com.mxgraph.mxGraph.tolerance = 4
protected

Specifies the tolerance for mouse clicks. Default is 4.

◆ VERSION

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

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

◆ view

mxGraphView com.mxgraph.mxGraph.view
protected

Holds the view that caches the cell states.

Property Documentation

◆ DefaultLoopStyle

mxEdgeStyleFunction com.mxgraph.mxGraph.DefaultLoopStyle
getset

Sets or returns the default edge style for loops.

Referenced by com.mxgraph.mxGraphView.GetEdgeStyle().

◆ GridEnabled

bool com.mxgraph.mxGraph.GridEnabled
getset

Sets or returns the enabled state of the grid.

◆ GridSize

int com.mxgraph.mxGraph.GridSize
getset

Sets or returns the grid size.

◆ ImageBundles

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

Sets or returns the image bundles.

◆ LabelsVisible

bool com.mxgraph.mxGraph.LabelsVisible
getset

Sets or returns if labels are visible

◆ Model

mxIGraphModel com.mxgraph.mxGraph.Model
getset

◆ Stylesheet

mxStylesheet com.mxgraph.mxGraph.Stylesheet
getset

Sets or returns the stylesheet that provides the style.

◆ View

mxGraphView com.mxgraph.mxGraph.View
getset

Sets or returns the view that contains the cell states.

Referenced by com.mxgraph.mxCellRenderer.DrawCells().


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