Static
BOTTOMStatic
BOTTOM_Static
CENTER_Static
dirStatic
ElbowUses either SideToSide or TopToBottom depending on the horizontal flag in the cell style.
SideToSide is used if horizontal is true
or unspecified.
Static
EntityImplements an entity relation style for edges (as used in database schema diagrams). At the time the function is called, the result array contains a placeholder (null) for the first absolute point, that is, the point where the edge and source terminal are connected. The implementation of the style then adds all intermediate waypoints except for the last point, that is, the connection point between the edge and the target terminal. The first ant the last point in the result array are then replaced with Point that take into account the terminal's perimeter and next point on the edge.
CellState that represents the edge to be updated.
CellState that represents the source terminal.
CellState that represents the target terminal.
List of relative control points.
Array of Point that represent the actual points of the edge.
Static
inlineStatic
LEFTStatic
LEFT_Static
limitsStatic
LoopImplements a self-reference, aka. loop.
Static
MANHATTAN_Static
MANHATTAN_Static
MANHATTAN_Static
MANHATTAN_Static
MANHATTAN_Static
MANHATTAN_Static
ManhattanManhattanConnector code is based on code from https://github.com/mwangm/mxgraph-manhattan-connector
Implements router to find the shortest route that avoids cells using manhattan distance as metric.
Static
orthStatic
OrthImplements a local orthogonal router between the given cells.
CellState that represents the edge to be updated.
CellState that represents the source terminal.
CellState that represents the target terminal.
List of relative control Points.
Array of Points that represent the actual points of the edge.
Static
orthStatic
RIGHTStatic
RIGHT_Static
routeStatic
SegmentImplements an orthogonal edge style. Use EdgeSegmentHandler as an interactive handler for this style.
CellState that represents the edge to be updated.
CellState that represents the source terminal.
CellState that represents the target terminal.
List of relative control points.
Array of Point that represent the actual points of the edge.
Static
SIDE_Static
SideImplements a vertical elbow edge.
Static
SOURCE_Static
TARGET_Static
TOPStatic
TOP_Static
TopImplements a horizontal elbow edge.
Static
VERTEX_Static
vertexStatic
wayStatic
getStatic
get
Provides various edge styles to be used as the values for
edgeStyle
in a cell style.Example:
Sets the default edge style to
ElbowConnector
.Custom edge style:
To write a custom edge style, a function must be added to the EdgeStyle object as follows:
In the above example, a right angle is created using a point on the horizontal center of the target vertex and the vertical center of the source vertex. The code checks if that point intersects the source vertex and makes the edge straight if it does. The point is then added into the result array, which acts as the return value of the function.
The new edge style should then be registered in the StyleRegistry as follows:
The custom edge style above can now be used in a specific edge as follows:
Note that the key of the StyleRegistry entry for the function should be used in string values, unless GraphView#allowEval is true, in which case you can also use
EdgeStyle.MyStyle
for the value in the cell style above.Or it can be used for all edges in the graph as follows:
Note that the object can be used directly when programmatically setting the value, but the key in the StyleRegistry should be used when setting the value via a key, value pair in a cell style.