|
JGraph X 0.15.0.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mxgraph.util.mxEventSource
com.mxgraph.view.mxGraph
public class mxGraph
Implements a graph object that allows to create diagrams from a graph model and stylesheet.
Image img = mxCellRenderer.createBufferedImage(
graph, null, 1, Color.WHITE, false, null);
ImageIO.write(img, "png", file);
If the XML is given as a string rather than a document, the document can
be obtained using mxUtils.parse.
Nested Class Summary | |
---|---|
static interface |
mxGraph.mxICellVisitor
|
Nested classes/interfaces inherited from class com.mxgraph.util.mxEventSource |
---|
mxEventSource.mxEventListener, mxEventSource.mxIEventSource |
Field Summary | |
---|---|
protected boolean |
allowDanglingEdges
Specifies if edges with disconnected terminals are allowed in the graph. |
protected boolean |
allowLoops
Specifies if loops (aka self-references) are allowed. |
protected String |
alternateEdgeStyle
Specifies the alternate edge style to be used if the main control point on an edge is being doubleclicked. |
protected boolean |
autoLayout
Specifies if automatic layout should be carried out if a non-null value is returned from getLayout. |
protected boolean |
autoSize
Specifies if the graph should automatically update the cell size after an edit. |
protected boolean |
bendable
Specifies the return value for isBendable. |
protected int |
border
Border to be added to the bottom and right side when the container is being resized after the graph has been changed. |
protected boolean |
bubbleLayout
Specifies if parent layouts should be executed when children have been layouted. |
protected PropertyChangeSupport |
changeSupport
Property change event handling. |
protected boolean |
cloneable
Specifies the return value for isCloneable. |
protected boolean |
cloneInvalidEdges
Specifies if edges that are cloned should be validated and only inserted if they are valid. |
protected mxImage |
collapsedImage
Specifies the mxImage to indicate a collapsed state. |
protected boolean |
collapseToPreferredSize
Specifies if the cell size should be changed to the preferred size when a cell is first collapsed. |
protected boolean |
connectableEdges
Specifies if edges are connectable. |
protected mxEdgeStyle.mxEdgeStyleFunction |
defaultLoopStyle
Specifies the default style for loops. |
protected double |
defaultOverlap
Value returned by getOverlap if isAllowOverlapParent returns true for the given cell. |
protected Object |
defaultParent
Specifies the default parent to be used to insert new cells. |
protected boolean |
deletable
Specifies the return value for isDeletable. |
protected boolean |
disconnectable
Specifies the return value for isDisconntable. |
protected boolean |
disconnectOnMove
Specifies if edges should be disconnected from their terminals when they are moved. |
protected boolean |
dropEnabled
Specifies the return value for isDropEnabled. |
protected boolean |
edgeLabelsMovable
Specifies the return value for edges in isLabelMovable. |
protected boolean |
editable
Specifies the return value for isEditable. |
protected boolean |
enabled
Specifies the return value for isEnabled. |
static String |
EVENT_ADD
|
static String |
EVENT_AFTER_ADD
|
static String |
EVENT_AFTER_COLLAPSE
|
static String |
EVENT_AFTER_CONNECT
|
static String |
EVENT_AFTER_DISCONNECT
|
static String |
EVENT_AFTER_EXPAND
|
static String |
EVENT_AFTER_HIDE
|
static String |
EVENT_AFTER_LAYOUT
|
static String |
EVENT_AFTER_MOVE
|
static String |
EVENT_AFTER_REMOVE
|
static String |
EVENT_AFTER_RESIZE
|
static String |
EVENT_AFTER_SHOW
|
static String |
EVENT_AFTER_UPDATESIZE
|
static String |
EVENT_BEFORE_ADD
|
static String |
EVENT_BEFORE_COLLAPSE
|
static String |
EVENT_BEFORE_CONNECT
|
static String |
EVENT_BEFORE_DISCONNECT
|
static String |
EVENT_BEFORE_EXPAND
|
static String |
EVENT_BEFORE_HIDE
|
static String |
EVENT_BEFORE_LAYOUT
|
static String |
EVENT_BEFORE_MOVE
|
static String |
EVENT_BEFORE_REMOVE
|
static String |
EVENT_BEFORE_RESIZE
|
static String |
EVENT_BEFORE_SHOW
|
static String |
EVENT_BEFORE_UPDATESIZE
|
static String |
EVENT_CLONE
|
static String |
EVENT_COLLAPSE
|
static String |
EVENT_CONNECT
|
static String |
EVENT_DISCONNECT
|
static String |
EVENT_EXPAND
|
static String |
EVENT_FLIP
|
static String |
EVENT_HIDE
|
static String |
EVENT_INDEX_CHANGED
|
static String |
EVENT_LAYOUT
|
static String |
EVENT_MOVE
|
static String |
EVENT_REMOVE
|
static String |
EVENT_REPAINT
|
static String |
EVENT_RESIZE
|
static String |
EVENT_SHOW
|
static String |
EVENT_UPDATESIZE
|
protected mxImage |
expandedImage
Specifies the mxImage to indicate a expanded state. |
protected boolean |
extendParentOnResize
Specifies if a parent should contain the child bounds after a resize of the child. |
protected mxEventSource.mxEventListener |
fullRepaintHandler
Fires repaint events for full repaints. |
protected mxEventSource.mxEventListener |
graphModelChangeHandler
Fires repaint events for model changes. |
protected boolean |
gridEnabled
Specifies if the grid is enabled. |
protected int |
gridSize
Specifies the grid size. |
protected boolean |
htmlLabels
Specifies the return value for isHtmlLabel. |
protected boolean |
keepEdgesInBackground
Specifies if edges should appear in the background regardless of their order in the model. |
protected boolean |
keepEdgesInForeground
Specifies if edges should appear in the foreground regardless of their order in the model. |
protected boolean |
keepInsideParentOnMove
Specifies the return value for isKeepInsideParentOnMove. |
protected boolean |
labelsVisible
Specifies if labels should be visible. |
protected boolean |
locked
Specifies the return value for isLocked. |
protected mxRectangle |
maximumContainerSize
mxRectangle that specifies the maximum size of the container if resizeContainer is true. |
protected mxRectangle |
maximumGraphBounds
|
protected mxRectangle |
minimumContainerSize
mxRectangle that specifies the minimum size of the container if resizeContainer is true. |
protected mxIGraphModel |
model
Holds the model that contains the cells to be displayed. |
protected boolean |
movable
Specifies the return value for isMovable. |
protected boolean |
multigraph
Specifies if multiple edges in the same direction between the same pair of vertices are allowed. |
protected mxMultiplicity[] |
multiplicities
Specifies the multiplicities to be used for validation of the graph. |
protected boolean |
resetEdgesOnMove
Specifies if edge control points should be reset after the move of a connected cell. |
protected boolean |
resetEdgesOnResize
Specifies if loops (aka self-references) are allowed. |
protected boolean |
selectable
Specifies the return value for isSelectable. |
protected mxSelectionModel |
selection
Holds the |
protected boolean |
shiftDownwards
Specifies if the cells below a resized cell should be shifted downwards. |
protected boolean |
shiftRightwards
Specifies if the cells to the right of a resized cell should be shifted rightwards. |
protected boolean |
sizable
Specifies the return value for isSizable. |
protected mxStylesheet |
stylesheet
Holds the stylesheet that defines the appearance of the cells. |
protected boolean |
swimlaneNesting
Specifies if nesting of swimlanes is allowed. |
static String |
VERSION
Holds the version number of this release. |
protected boolean |
vertexLabelsMovable
Specifies the return value for vertices in isLabelMovable. |
protected mxGraphView |
view
Holds the view that caches the cell states. |
protected mxImage |
warningImage
Specifies the mxImage for the image to be used to display a warning overlay. |
Fields inherited from class com.mxgraph.util.mxEventSource |
---|
EMPTY_ARRAY, eventListeners, eventsEnabled, source |
Constructor Summary | |
---|---|
mxGraph()
Constructs a new graph with an empty mxGraphModel . |
|
mxGraph(mxIGraphModel model)
Constructs a new graph for the specified model. |
|
mxGraph(mxIGraphModel model,
mxStylesheet stylesheet)
Constructs a new graph for the specified model. |
|
mxGraph(mxStylesheet stylesheet)
Constructs a new graph for the specified model. |
Method Summary | |
---|---|
Object |
addCell(Object cell)
Adds the given cell to the children of the default parent. |
Object |
addCell(Object cell,
Object parent)
Adds the given cell to the children of the given parent. |
Object |
addCell(Object cell,
Object parent,
Integer index,
Object source,
Object target)
Adds the given cell to the children of the given parent at the given index. |
Object[] |
addCells(Object[] cells)
Adds the given cells to the children of the default parent. |
Object[] |
addCells(Object[] cells,
Object parent)
Adds the given cells to the children of the given parent. |
Object[] |
addCells(Object[] cells,
Object parent,
Integer index)
Adds the given cells to the children of the given parent starting at the given index and fires an add event. |
Object |
addEdge(Object edge,
Object source,
Object target)
Adds the given edge to the model. |
Object |
addEdge(Object edge,
Object parent,
Object source,
Object target,
Integer index)
Adds the given edge to the children of the given parent at the given index. |
Object |
addGroup(Object group,
Object[] cells)
|
Object |
addGroup(Object group,
Object[] cells,
double border)
Sets the bounds of the given group to cover the area of the given cells and adds the given border around the area. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
|
void |
alignCells(String align)
Aligns the selection cells vertically or horizontally according to the given alignment. |
void |
alignCells(String align,
Object[] cells)
Aligns the given cells vertically or horizontally according to the given alignment. |
void |
alignCells(String align,
Object[] cells,
Object param)
Aligns the given cells vertically or horizontally according to the given alignment using the optional parameter as the coordinate. |
void |
cascadeResize(Object cell)
Shifts the cells returned by |
protected void |
cellDrawn(Object cell,
Object element,
Object labelElement)
Called when a cell has been painted as the specified object, typically a DOM node that represents the given cell graphically in a document. |
protected void |
cellRemoved(Object cell,
boolean clearSelection)
Removes all cached information for the given cell and its descendants and clears the cells selection state is isClearSelection is true. |
void |
cellsMoved(Object[] cells,
Point location)
Called from |
void |
clearSelection()
|
Object[] |
cloneCells(Object[] cells)
Returns the clones for the given cells. |
void |
collapse()
|
void |
collapse(Object[] cells)
Collapses the given cells or the selection cells if no cells are specified and fires a |
void |
collapse(Object[] cells,
boolean recurse)
Collapses the given cells or the selection cells if no cells are specified and fires a |
void |
connect(Object edge,
Object terminal,
boolean isSource)
Assigns the given edge the new source or target terminal depending on isSource and fires a |
String |
convertValueToString(Object cell)
Returns the textual representation for the given cell. |
Object |
createEdge(Object parent,
String id,
Object value,
Object source,
Object target,
String style)
Hook method that creates the new edge for insertEdge. |
Object |
createGroupCell(Object[] cells)
Hook for creating the group cell to hold the given array of |
Object |
createVertex(Object parent,
String id,
Object value,
double x,
double y,
double width,
double height,
String style)
Hook method that creates the new vertex for insertVertex. |
void |
disconnect(Object[] cells)
Disconnects the given edges from the terminals which are not in the given array. |
void |
draw(mxICanvas canvas)
Draws the graph onto the given canvas. |
void |
drawCell(mxICanvas canvas,
Object cell)
Draws the given cell and its descendants onto the specified canvas. |
void |
drawStateWithLabel(mxICanvas canvas,
mxCellState state,
String label)
Draws the given cell and label onto the specified canvas. |
void |
enterGroup()
|
void |
enterGroup(Object cell)
Uses the given cell as the root of the displayed cell hierarchy. |
void |
exitGroup()
Changes the current root to the next valid root in the displayed cell hierarchy. |
void |
expand()
|
void |
expand(Object[] cells)
Expands the given cells or the selection cells if no cells are specified and fires an |
void |
expand(Object[] cells,
boolean recurse)
Expands the given cells or the selection cells if no cells are specified and fires an |
void |
extendParent(Object cell)
Resizes the parents recursively so that they contain the complete area of the resized child cell. |
Object[] |
findTreeRoots(Object parent)
Returns all visible children in the given parent which do not have incoming edges. |
Object[] |
findTreeRoots(Object parent,
boolean isolate)
Returns all visible children in the given parent which do not have incoming edges. |
Object[] |
findTreeRoots(Object parent,
boolean isolate,
boolean invert)
Returns all visible children in the given parent which do not have incoming edges. |
Object |
flip(Object edge)
Called when the main control point of the edge is double-clicked. |
String |
getAlternateEdgeStyle()
|
int |
getBorder()
Returns the value of |
mxRectangle |
getBoundingBox(Object cell)
Returns the bounds of the given cell. |
mxRectangle |
getBoundingBox(Object cell,
boolean includeEdges)
Returns the bounding box of the given cell including all connected edges if includeEdge is true. |
mxRectangle |
getBoundingBox(Object cell,
boolean includeEdges,
boolean includeDescendants)
Returns the bounding box of the given cell including all connected edges if includeEdge is true. |
mxRectangle |
getBounds()
Returns the bounds of the visible graph. |
mxRectangle |
getBoundsForCells(Object[] cells,
boolean includeEdges,
boolean includeDescendants,
boolean boundingBox)
Returns the bounds for the given cells. |
mxRectangle |
getCellBounds(Object cell)
Returns the bounds of the given cell. |
mxRectangle |
getCellBounds(Object cell,
boolean includeEdges)
Returns the bounds of the given cell including all connected edges if includeEdge is true. |
mxRectangle |
getCellBounds(Object cell,
boolean includeEdges,
boolean includeDescendants)
Returns the bounds of the given cell including all connected edges if includeEdge is true. |
mxRectangle |
getCellBounds(Object cell,
boolean includeEdges,
boolean includeDescendants,
boolean boundingBox)
Returns the bounds of the given cell including all connected edges if includeEdge is true. |
mxGeometry |
getCellGeometry(Object cell)
Returns the geometry for the given cell. |
Object[] |
getCellsBeyond(double x0,
double y0,
Object parent,
boolean rightHalfpane,
boolean bottomHalfpane)
Returns the children of the given parent that are contained in the halfpane from the given point (x0, y0) rightwards and downwards depending on rightHalfpane and bottomHalfpane. |
Object[] |
getCellsToShift(mxCellState state)
Returns the cells to shift after a resize of the specified |
Hashtable |
getCellStyle(Object cell)
Returns an array of key, value pairs representing the cell style for the given cell. |
String |
getCellValidationError(Object cell)
Checks all multiplicities that cannot be enforced while the graph is being modified, namely, all multiplicities that require a minimum of 1 edge. |
Object[] |
getChildCells(Object parent)
Returns the visible children of the given parent. |
Object[] |
getChildCells(Object parent,
boolean vertices,
boolean edges)
Returns the visible child vertices or edges in the given parent. |
Object[] |
getChildEdges(Object parent)
Returns the visible child edges of the given parent. |
mxPoint |
getChildOffsetForCell(Object cell)
Returns the offset to be used for the cells inside the given cell. |
Object[] |
getChildVertices(Object parent)
Returns the visible child vertices of the given parent. |
Object[] |
getConnections(Object cell)
Returns all visible edges connected to the given cell without loops. |
Object[] |
getConnections(Object cell,
Object parent)
Returns all visible edges connected to the given cell without loops. |
mxRectangle |
getContentArea(Object cell)
Returns the mxRectangle inside which a cell is to be kept. |
Object |
getCurrentRoot()
Returns the current root of the displayed cell hierarchy. |
mxEdgeStyle.mxEdgeStyleFunction |
getDefaultLoopStyle()
Returns the default edge style used for loops. |
Object |
getDefaultParent()
Returns the first child of the root in the model, that is, the first or default layer of the diagram. |
Object |
getDropTarget(Object[] cells,
Point pt,
Object cell)
Function: getDropTarget Returns the given cell if it is a drop target for the given cells or the nearest ancestor that may be used as a drop target for the given cells. |
Object[] |
getEdges(Object cell)
Returns all visible edges connected to the given cell including loops. |
Object[] |
getEdges(Object cell,
Object parent)
Returns all visible edges connected to the given cell including loops. |
Object[] |
getEdges(Object cell,
Object parent,
boolean incoming,
boolean outgoing,
boolean includeLoops)
Returns the incoming and/or outgoing edges for the given cell. |
Object[] |
getEdgesBetween(Object source,
Object target)
Returns the edges between the given source and target. |
Object[] |
getEdgesBetween(Object source,
Object target,
boolean directed)
Returns the edges between the given source and target. |
String |
getEdgeValidationError(Object edge,
Object source,
Object target)
Returns the validation error message to be displayed when inserting or changing an edges' connectivity. |
int |
getGridSize()
Returns the grid size. |
String |
getImage(mxCellState state)
Returns the image URL for the given cell state. |
Object[] |
getIncomingEdges(Object cell)
Returns all incoming visible edges connected to the given cell without loops. |
Object[] |
getIncomingEdges(Object cell,
Object parent)
Returns the visible incoming edges for the given cell. |
String |
getLabel(Object cell)
Returns a string or DOM node that represents the label for the given cell. |
mxIGraphLayout |
getLayout(Object cell)
/** Returns the layout to be used to arrange the children of the given cell. |
protected String |
getLinkForCell(Object cell)
Returns the hyperlink to be used for the given cell. |
mxRectangle |
getMaximumContainerSize()
Returns the maximum size of the diagram. |
mxRectangle |
getMaximumGraphBounds()
|
mxRectangle |
getMinimumContainerSize()
Returns the minimum size of the diagram. |
mxIGraphModel |
getModel()
Returns the graph model that contains the graph data. |
mxMultiplicity[] |
getMultiplicities()
|
Object[] |
getOpposites(Object[] edges,
Object terminal)
Returns all distinct visible opposite cells of the terminal on the given edges. |
Object[] |
getOpposites(Object[] edges,
Object terminal,
boolean sources,
boolean targets)
Returns all distincts visible opposite cells for the specified terminal on the given edges. |
Object[] |
getOutgoingEdges(Object cell)
Returns all outgoing visible edges connected to the given cell without loops. |
Object[] |
getOutgoingEdges(Object cell,
Object parent)
Returns the visible outgoing edges for the given cell. |
double |
getOverlap(Object cell)
Returns a decimal number representing the amount of the width and height of the given cell that is allowed to overlap its parent. |
mxRectangle |
getPaintBounds(Object[] cells)
Returns the bounding box of the given cells and their descendants. |
Object[] |
getParents(Object[] cells)
Returns an array that represents the set (no duplicates) of all parents for the given array of mxCells. |
mxRectangle |
getPreferredSizeForCell(Object cell)
Returns the preferred width and height of the given |
mxSelectionModel |
getSelection()
|
Object |
getSelectionCell()
|
Object[] |
getSelectionCells()
|
int |
getSelectionCount()
|
mxRectangle |
getStartSize(Object swimlane)
Returns the start size of the given swimlane, that is, the width or height of the part that contains the title, depending on the horizontal style. |
mxStylesheet |
getStylesheet()
Returns the stylesheet that provides the style. |
protected String |
getTargetForCell(Object cell)
Returns the hyperlink to be used for the given cell. |
String |
getToolTipForCell(Object cell)
Returns the tooltip to be used for the given cell. |
mxPoint |
getTranslateForRoot(Object cell)
Returns the translation to be used if the given cell is the root cell as an |
mxGraphView |
getView()
Returns the view that contains the cell states. |
mxRectangle |
graphModelChanged(mxIGraphModel sender,
List changes)
Called when the graph model changes. |
Object |
group()
|
Object |
group(Object group)
|
Object |
group(Object group,
double border)
|
Object |
group(Object group,
double border,
Object[] tmp)
Puts the selection cells into the given group using border around the children and the group bounds. |
Object |
groupCells(Object parent,
Object group,
Object[] cells,
double dx,
double dy)
Adds the group into the given parent and the given cells into the group. |
Object[] |
hide()
Hides the seletion cells. |
Object[] |
hide(Object[] cells,
boolean includeEdges)
Hides the given cells. |
Object[] |
hideEdges(Object cell,
boolean recurse)
|
void |
home()
Uses the root of the model as the root of the displayed cell hierarchy and selects the previous root. |
Object |
insertEdge(Object parent,
String id,
Object value,
Object source,
Object target)
Creates and adds a new edge with an empty style. |
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. |
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. |
Object |
insertVertex(Object parent,
String id,
Object value,
double x,
double y,
double width,
double height,
String style)
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. |
boolean |
isAllowDanglingEdges()
|
boolean |
isAllowLoops()
|
boolean |
isAllowOverlapParent(Object cell)
Returns true if the given cell is allowed to be placed outside of the parents area. |
boolean |
isAutoLayout(Object cell)
Returns true if the associated layout for the given cell should be executed automatically whenever a child was changed. |
boolean |
isBendable(Object cell)
Returns true if the given cell is bendable. |
boolean |
isBubbleLayout()
Returns true if a layout should bubble, that is, if the parent layout should be executed whenever a cell layout (layout of the children of a cell) has been executed. |
boolean |
isCellCloneable(Object cell)
Returns true if the given cell is visible. |
boolean |
isCellCollapsed(Object cell)
Returns true if the given cell is collapsed in this graph. |
boolean |
isCellVisible(Object cell)
Returns true if the given cell is visible in this graph. |
boolean |
isCloneable()
Returns true if the graph is |
boolean |
isCloneInvalidEdges()
|
boolean |
isCollapsable(Object cell)
Returns true if the given cell is collapsable. |
boolean |
isConnectableEdges()
|
boolean |
isDeletable(Object cell)
Returns true if the given cell is movable. |
boolean |
isDisconnectable(Object cell,
Object terminal,
boolean source)
Returns true if the given cell is disconnectable from the source or target terminal. |
boolean |
isDisconnectOnMove()
|
boolean |
isDropEnabled()
Returns true if the graph allows drop into other cells. |
boolean |
isEdgeLabelsMovable()
|
boolean |
isEdgeValid(Object edge,
Object source,
Object target)
Checks if the return value of getEdgeValidationError for the given arguments is null. |
boolean |
isEditable()
Returns true if editing is allowed in this graph. |
boolean |
isEditable(Object cell)
Returns true if the given cell is movable. |
boolean |
isEnabled()
Returns true if the graph is |
boolean |
isExpandable(Object cell)
Returns true if the given cell is expandable. |
boolean |
isExtendParentOnResize(Object cell)
Returns true if the parent of the given cell should be extended if the child has been resized so that it overlaps the parent. |
boolean |
isGridEnabled()
Returns true if the grid is enabled. |
boolean |
isHtmlLabel(Object cell)
Returns true if the label must be rendered as HTML markup. |
boolean |
isHtmlLabels()
|
boolean |
isKeepEdgesInBackground()
|
boolean |
isKeepEdgesInForeground()
|
boolean |
isKeepInsideParentOnMove(Object cell)
Returns true if the given cell should be kept inside the bounds of its parent according to the rules defined by getOverlap and isAllowOverlapParent. |
boolean |
isLabelMovable(Object cell)
Returns true if the given edges's label is moveable. |
boolean |
isLabelsVisible()
|
boolean |
isLocked(Object cell)
Returns true if the given cell may not be moved, sized, bended, disconnected, edited or selected. |
boolean |
isLoop(mxCellState state)
Returns true if the given cell state is a loop. |
boolean |
isMovable(Object cell)
Returns true if the given cell is movable. |
boolean |
isMultigraph()
|
boolean |
isOrthogonal(mxCellState edge,
mxCellState vertex)
Returns true if perimeter points should be computed such that the resulting edge has only horizontal or vertical segments. |
boolean |
isParentDropTarget(Object target,
Object[] cells)
Returns true if the given target is a valid parent for the specified cells. |
boolean |
isResetEdgesOnMove()
|
boolean |
isResetEdgesOnResize()
|
boolean |
isSelectable(Object cell)
Returns true if the given cell is selectable. |
boolean |
isSelected(Object cell)
|
boolean |
isSelectionEmpty()
|
boolean |
isShiftable(Object cell)
Returns true if the cell requires shifting of all cells beyond the top right corner after a resize. |
boolean |
isShiftDownwards()
|
boolean |
isShiftRightwards()
|
boolean |
isSizable(Object cell)
Returns true if the given cell is sizable. |
boolean |
isSplitDropTarget(Object edge,
Object cell)
Returns true if the given edge may be splitted into two edges with the given cell as a new terminal between the two. |
boolean |
isSwimlane(Object cell)
Returns true if the given cell is a swimlane. |
boolean |
isSwimlaneNesting()
|
boolean |
isUpdateSize(Object cell)
Returns true if the size of the given cell should automatically be updated after a change of the label. |
boolean |
isValidConnection(Object source,
Object target)
Returns true if the given target cell is a valid target for source. |
boolean |
isValidDropTarget(Object cell,
Object[] cells)
Returns true if the given cell is a valid drop target for the specified cells. |
boolean |
isValidRoot(Object cell)
Returns true if the given cell is a valid root for the cell display hierarchy. |
boolean |
isValidSource(Object cell)
Returns true if the given cell is a valid source for new connections. |
boolean |
isValidTarget(Object cell)
Returns isValidSource for the given cell. |
boolean |
isVertexLabelsMovable()
|
void |
keepInside(Object[] cells)
Keeps the given cells inside the bounds returned by |
Object[] |
layout(Object[] cells)
|
Object[] |
layoutAfterAdd(Object parent,
Object[] cells)
Called from add and addCell with the parent and the new child cells. |
Object[] |
layoutAfterCollapsedState(Object[] cells,
boolean collapsed)
Called from |
Object[] |
layoutAfterConnect(Object edge,
Object terminal,
boolean isSource)
Called from |
Object[] |
layoutAfterMove(Object[] parents,
Object[] cells,
Object target)
Called from |
Object[] |
layoutAfterRemove(Object[] parents,
Object[] cells,
boolean hide,
boolean show)
Called from |
Object[] |
layoutAfterResize(Object[] parents,
Object[] cells)
Called from |
Object[] |
layoutAfterSplit(Object parent,
Object edge,
Object cell,
Object newEdge)
Called from |
static void |
main(String[] args)
Prints the version number on the console. |
Object[] |
move(Object[] cells,
double dx,
double dy)
|
Object[] |
move(Object[] cells,
double dx,
double dy,
boolean clone)
|
Object[] |
move(Object[] cells,
double dx,
double dy,
boolean clone,
Object target,
Point location)
Moves the given cells by the given vector (dx, dy) and clones the cells if clone is true. |
void |
moveInto(Object[] cells,
Object target)
|
void |
moveInto(Object[] cells,
Object target,
Point location)
Appends the given cells to the children of the given target and fires a move event. |
mxRectangle |
processChange(Object change,
boolean invalidate)
Processes the given change and invalidates the respective cached data in |
mxRectangle |
processChanges(List changes,
boolean invalidate)
Processes the changes and returns the minimal rectangle to be repainted in the buffer. |
void |
refresh()
Clears all cell states or the states for the hierarchy starting at the given cell and validates the graph. |
Object[] |
remove()
Removes the selection cells from the graph. |
Object[] |
remove(Object[] cells)
Removes the given cells from the graph. |
Object[] |
remove(Object[] cells,
boolean includeEdges)
Removes the given cells from the graph. |
Object[] |
remove(Object[] cells,
boolean includeEdges,
boolean isHide,
boolean isShow)
Removes, shows or hides the given cells including the connected edges if includeEdges is true. |
Object[] |
removeEdges(Object cell,
boolean recurse)
|
Object[] |
removeEdges(Object cell,
boolean recurse,
boolean isHide,
boolean isShow)
Removes, shows or hides the edges connected to the given cell recursively. |
void |
removeFromParent()
Removes the selection cells from their parents and adds them to the default parent returned by getDefaultParent. |
void |
removeFromParent(Object[] cells)
Removes the specified cells from their parents and adds them to the default parent returned by getDefaultParent. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
|
void |
repaint()
Fires a repaint event. |
void |
resetEdges(Object[] cells)
Resets the control points of the edges that are connected to the given cells if not both ends of the edge are in the given cells array. |
void |
resize(Object cell,
mxRectangle bounds)
Sets the bounds of the given cell using |
void |
resizeCells(Object[] cells,
mxRectangle[] boundsArray)
Sets the bounds of the given cells, cascades the resize using |
void |
select(boolean isNext,
boolean isParent,
boolean isChild)
Selects the next, parent, first child or previous cell, if all arguments are false. |
void |
selectAll()
|
void |
selectAll(Object parent)
Selects all children of the given parent cell or the children of the default parent if no parent is specified. |
void |
selectCells(boolean vertices,
boolean edges)
Selects all vertices and/or edges depending on the given boolean arguments recursively, starting at the default parent. |
void |
selectCells(boolean vertices,
boolean edges,
Object parent)
Selects all vertices and/or edges depending on the given boolean arguments recursively, starting at the given parent or the default parent if no parent is specified. |
void |
selectCellsForChanges(List changes)
|
void |
selectChild()
Selects the first child cell. |
void |
selectEdges()
Selects all vertices inside the default parent. |
void |
selectEdges(Object parent)
Selects all vertices inside the given parent or the default parent if no parent is given. |
void |
selectNext()
Selects the next cell. |
void |
selectParent()
Selects the parent cell. |
void |
selectPrevious()
Selects the previous cell. |
void |
selectVertices()
Selects all vertices inside the default parent. |
void |
selectVertices(Object parent)
Selects all vertices inside the given parent or the default parent if no parent is given. |
void |
setAllowDanglingEdges(boolean allowDanglingEdges)
|
void |
setAllowLoops(boolean allowLoops)
|
void |
setAlternateEdgeStyle(String alternateEdgeStyle)
|
void |
setAutoLayout(boolean autoLayout)
|
void |
setBendable(boolean bendable)
Sets if the graph is bendable. |
void |
setBorder(int border)
Sets the value of |
void |
setBubbleLayout(boolean bubbleLayout)
Returns true if a layout should bubble, that is, if the parent layout should be executed whenever a cell layout (layout of the children of a cell) has been executed. |
void |
setCellStyle(String style)
Sets the style of the selection cells to the given value. |
void |
setCellStyle(String style,
Object[] cells)
Sets the style of the specified cells. |
void |
setCellStyleFlags(String key,
int flag,
boolean value)
Sets or toggles the given bit for the given key in the styles of the selection cells. |
void |
setCellStyleFlags(String key,
int flag,
Boolean value,
Object[] cells)
Sets or toggles the given bit for the given key in the styles of the specified cells. |
void |
setCellStyles(String key,
String value)
Sets the key to value in the styles of the selection cells. |
void |
setCellStyles(String key,
String value,
Object[] cells)
Sets the key to value in the styles of the given cells. |
void |
setCloneable(boolean cloneable)
Specifies if the graph should allow cloning of cells by holding down the control key while cells are being moved. |
void |
setCloneInvalidEdges(boolean cloneInvalidEdges)
|
void |
setCollapsedState(boolean collapsed)
|
void |
setCollapsedState(Object[] cells,
boolean collapsed)
Sets the collapsed state of the given cells or the selection cells if no cells are specified and fires a beforeCollapse, collapse and afterCollapse or beforeExpand, expand and afterExpand event. |
void |
setCollapsedState(Object[] cells,
boolean collapsed,
boolean recurse)
Sets the collapsed state of the given cells or the selection cells if no cells are specified and fires a beforeCollapse, collapse and afterCollapse or beforeExpand, expand and afterExpand event. |
void |
setConnectableEdges(boolean connectableEdges)
|
void |
setDefaultLoopStyle(mxEdgeStyle.mxEdgeStyleFunction loopStyle)
Sets the default style used for loops. |
void |
setDeletable(boolean deletable)
Specifies if the graph should allow deleting of cells. |
void |
setDisconnectable(boolean disconnectable)
Specifies if the graph should allow disconnecting of edges. |
void |
setDisconnectOnMove(boolean disconnectOnMove)
|
void |
setDropEnabled(boolean dropEnabled)
|
void |
setEdgeLabelsMovable(boolean movable)
|
void |
setEditable(boolean editable)
Sets if the graph is editable. |
void |
setEnabled(boolean enabled)
Specifies if the graph should allow any interactions. |
void |
setExtendParentOnResize(boolean extendParentOnResize)
|
void |
setGridEnabled(boolean gridEnabled)
Sets if the grid is enabled. |
void |
setGridSize(int gridSize)
Sets the grid size and fires a property change event for gridSize. |
void |
setHtmlLabels(boolean htmlLabels)
|
void |
setIndexForCells(Object[] cells,
Integer index)
Reinserts the given cells into their parent at the given index. |
void |
setKeepEdgesInBackground(boolean keepEdgesInBackground)
|
void |
setKeepEdgesInForeground(boolean keepEdgesInForeground)
|
void |
setKeepInsideParentOnMove(boolean keepInsideParentOnMove)
|
void |
setLabelsVisible(boolean labelsVisible)
|
void |
setLocked(boolean locked)
Sets if any cell may be moved, sized, bended, disconnected, edited or selected. |
void |
setMaximumContainerSize(mxRectangle maximumContainerSize)
|
void |
setMaximumGraphBounds(mxRectangle maximumGraphBounds)
|
void |
setMinimumContainerSize(mxRectangle minimumContainerSize)
|
void |
setModel(mxIGraphModel model)
Sets the graph model that contains the data, and fires an EVENT_MODE_CHANGED followed by an EVENT_REPAINT event. |
void |
setMovable(boolean movable)
|
void |
setMultigraph(boolean multigraph)
|
void |
setMultiplicities(mxMultiplicity[] multiplicities)
|
void |
setResetEdgesOnMove(boolean resetEdgesOnMove)
|
void |
setResetEdgesOnResize(boolean resetEdgesOnResize)
|
void |
setSelectable(boolean selectable)
Sets the seletable state of the graph. |
void |
setSelectionCell(Object cell)
|
void |
setSelectionCells(Collection cells)
|
void |
setSelectionCells(Object[] cells)
|
void |
setShiftDownwards(boolean shiftDownwards)
|
void |
setShiftRightwards(boolean shiftRightwards)
|
void |
setSizable(boolean sizable)
Sets if the graph is sizable. |
void |
setStylesheet(mxStylesheet stylesheet)
Sets the stylesheet that provides the style. |
void |
setSwimlaneNesting(boolean swimlaneNesting)
|
void |
setUpdateSize(boolean updateSize)
Specifies if cell sizes should be automatically updated after a label change. |
void |
setVertexLabelsMovable(boolean movable)
|
void |
setView(mxGraphView view)
Sets the view that contains the cell states and fires an EVENT_VIEW_CHANGED event. |
Object[] |
show()
Shows the seletion cells. |
Object[] |
show(Object[] cells,
boolean includeEdges)
Shows the given cells. |
Object[] |
showEdges(Object cell,
boolean recurse)
|
double |
snap(double value)
Snaps the given numeric value to the grid if |
Object |
splitEdge(Object edge,
Object cell)
|
Object |
splitEdge(Object edge,
Object cell,
Object newEdge)
Splits the given edge by adding a newEdge between the previous source and the given cell and reconnecting the source of the given edge to the given cell. |
void |
swapBounds(Object cell,
boolean willCollapse)
Swaps the alternate and the actual bounds in the geometry of the given cell invoking |
void |
toBack()
Moves the selection cells to the background. |
void |
toBack(Object[] cells)
Moves the given cells to the background. |
void |
toFront()
Brings the selection cells to the front. |
void |
toFront(Object[] cells)
Brings the given cells to the front. |
void |
toggleCellStyle(String key,
boolean defaultValue,
Object cell)
Toggles the boolean value for the given key in the style of the given cell. |
void |
toggleCellStyleFlags(String key,
int flag)
Toggles the given bit for the given key in the styles of the selection cells. |
void |
toggleCellStyleFlags(String key,
int flag,
Object[] cells)
Toggles the given bit for the given key in the styles of the specified cells. |
void |
toggleCellStyles(String key,
boolean defaultValue)
Toggles the boolean value for the given key in the style of the selection cells. |
void |
toggleCellStyles(String key,
boolean defaultValue,
Object[] cells)
Toggles the boolean value for the given key in the style of the given cells. |
void |
traverse(Object vertex,
boolean directed,
mxGraph.mxICellVisitor visitor)
|
void |
traverse(Object vertex,
boolean directed,
mxGraph.mxICellVisitor visitor,
Object edge,
Set visited)
Traverses the (directed) graph invoking the given function for each visited vertex and edge. |
void |
ungroup()
|
void |
ungroup(Object[] cells)
Ungroups the given group cells and selects the children. |
void |
updateAlternateBounds(Object cell,
mxGeometry g,
boolean willCollapse)
Updates or sets the alternate bounds in the given geometry for the given cell depending on whether the cell is going to be collapsed. |
Object |
updateSize(Object cell)
Updates the size of the given cell in the model using getPreferredSizeForCell to get the new size. |
mxGeometry |
updateSwimlaneSize(Object swimlane,
mxGeometry geometry,
mxRectangle pSize)
Updates the size of the given swimlane and returns the updated geometry to be used in the model. |
String |
validate()
Validates the graph by validating each descendant of the given cell or the root of the model. |
String |
validate(Object cell,
Hashtable context)
Validates the graph by validating each descendant of the given cell or the root of the model. |
String |
validateCell(Object cell,
Hashtable context)
Hook method for subclassers to return an error message for the given cell and validation context. |
String |
validateEdge(Object edge,
Object source,
Object target)
Hook method for subclassers to return an error message for the given edge and terminals. |
Methods inherited from class com.mxgraph.util.mxEventSource |
---|
addListener, fireEvent, fireEvent, fireEvent, isEventsEnabled, removeListener, removeListener, setEventsEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VERSION
public static String EVENT_BEFORE_SHOW
public static String EVENT_BEFORE_HIDE
public static String EVENT_BEFORE_REMOVE
public static String EVENT_SHOW
public static String EVENT_HIDE
public static String EVENT_REMOVE
public static String EVENT_AFTER_SHOW
public static String EVENT_AFTER_HIDE
public static String EVENT_AFTER_REMOVE
public static String EVENT_BEFORE_MOVE
public static String EVENT_MOVE
public static String EVENT_CLONE
public static String EVENT_AFTER_MOVE
public static String EVENT_BEFORE_ADD
public static String EVENT_ADD
public static String EVENT_AFTER_ADD
public static String EVENT_BEFORE_CONNECT
public static String EVENT_CONNECT
public static String EVENT_AFTER_CONNECT
public static String EVENT_BEFORE_DISCONNECT
public static String EVENT_DISCONNECT
public static String EVENT_AFTER_DISCONNECT
public static String EVENT_BEFORE_RESIZE
public static String EVENT_RESIZE
public static String EVENT_AFTER_RESIZE
public static String EVENT_BEFORE_COLLAPSE
public static String EVENT_COLLAPSE
public static String EVENT_AFTER_COLLAPSE
public static String EVENT_BEFORE_EXPAND
public static String EVENT_EXPAND
public static String EVENT_AFTER_EXPAND
public static String EVENT_BEFORE_LAYOUT
public static String EVENT_LAYOUT
public static String EVENT_AFTER_LAYOUT
public static String EVENT_BEFORE_UPDATESIZE
public static String EVENT_UPDATESIZE
public static String EVENT_AFTER_UPDATESIZE
public static String EVENT_FLIP
public static String EVENT_INDEX_CHANGED
public static String EVENT_REPAINT
protected PropertyChangeSupport changeSupport
protected mxIGraphModel model
protected mxGraphView view
protected mxStylesheet stylesheet
protected mxSelectionModel selection
protected int gridSize
protected boolean gridEnabled
protected double defaultOverlap
protected Object defaultParent
protected String alternateEdgeStyle
protected boolean enabled
protected boolean locked
protected boolean cloneable
protected boolean editable
protected boolean deletable
protected boolean movable
protected boolean edgeLabelsMovable
protected boolean vertexLabelsMovable
protected boolean dropEnabled
protected boolean sizable
protected boolean bendable
protected boolean disconnectable
protected boolean selectable
protected boolean autoSize
protected boolean autoLayout
protected boolean bubbleLayout
protected mxRectangle maximumGraphBounds
protected mxRectangle minimumContainerSize
protected mxRectangle maximumContainerSize
protected int border
protected boolean keepEdgesInForeground
protected boolean keepEdgesInBackground
protected boolean keepInsideParentOnMove
protected boolean extendParentOnResize
protected boolean shiftDownwards
protected boolean shiftRightwards
protected boolean collapseToPreferredSize
protected boolean resetEdgesOnResize
protected boolean resetEdgesOnMove
protected boolean allowLoops
protected mxMultiplicity[] multiplicities
protected mxEdgeStyle.mxEdgeStyleFunction defaultLoopStyle
protected boolean multigraph
protected boolean connectableEdges
protected boolean allowDanglingEdges
protected boolean cloneInvalidEdges
protected boolean disconnectOnMove
protected boolean labelsVisible
protected boolean htmlLabels
protected boolean swimlaneNesting
protected mxImage collapsedImage
protected mxImage expandedImage
protected mxImage warningImage
protected mxEventSource.mxEventListener fullRepaintHandler
protected mxEventSource.mxEventListener graphModelChangeHandler
Constructor Detail |
---|
public mxGraph()
mxGraphModel
.
public mxGraph(mxIGraphModel model)
mxGraphModel
is
used.
model
- Model that contains the graph datapublic mxGraph(mxStylesheet stylesheet)
mxGraphModel
is
used.
stylesheet
- The stylesheet to use for the graph.public mxGraph(mxIGraphModel model, mxStylesheet stylesheet)
mxGraphModel
is
used.
model
- Model that contains the graph dataMethod Detail |
---|
public mxIGraphModel getModel()
public void setModel(mxIGraphModel model)
model
- Model that contains the graph datapublic mxStylesheet getStylesheet()
public void setStylesheet(mxStylesheet stylesheet)
stylesheet
- Stylesheet that provides the style.public mxGraphView getView()
public void setView(mxGraphView view)
view
- View that contains the cell statespublic void selectCellsForChanges(List changes)
public mxRectangle graphModelChanged(mxIGraphModel sender, List changes)
public mxRectangle processChanges(List changes, boolean invalidate)
public mxRectangle processChange(Object change, boolean invalidate)
protected void cellRemoved(Object cell, boolean clearSelection)
public Hashtable getCellStyle(Object cell)
cell
- Cell whose style should be returned.
public void setCellStyle(String style)
style
- String representing the new style of the cells.public void setCellStyle(String style, Object[] cells)
style
- String representing the new style of the cells.cells
- Optional array of public void toggleCellStyle(String key, boolean defaultValue, Object cell)
key
- Key for the boolean value to be toggled.defaultValue
- Default boolean value if no value is defined.cell
- Cell whose style should be modified.public void toggleCellStyles(String key, boolean defaultValue)
key
- Key for the boolean value to be toggled.defaultValue
- Default boolean value if no value is defined.public void toggleCellStyles(String key, boolean defaultValue, Object[] cells)
key
- String representing the key of the boolean style to be toggled.defaultValue
- Default boolean value if no value is defined.cells
- Cells whose styles should be modified.public void setCellStyles(String key, String value)
key
- String representing the key to be assigned.value
- String representing the new value for the key.public void setCellStyles(String key, String value, Object[] cells)
key
- String representing the key to be assigned.value
- String representing the new value for the key.cells
- Array of cells to change the style for.public void toggleCellStyleFlags(String key, int flag)
key
- String representing the key to toggle the flag in.flag
- Integer that represents the bit to be toggled.public void toggleCellStyleFlags(String key, int flag, Object[] cells)
key
- String representing the key to toggle the flag in.flag
- Integer that represents the bit to be toggled.cells
- Optional array of public void setCellStyleFlags(String key, int flag, boolean value)
key
- String representing the key to toggle the flag in.flag
- Integer that represents the bit to be toggled.value
- Boolean value to be used or null if the value should be
toggled.public void setCellStyleFlags(String key, int flag, Boolean value, Object[] cells)
key
- String representing the key to toggle the flag in.flag
- Integer that represents the bit to be toggled.value
- Boolean value to be used or null if the value should be
toggled.cells
- Optional array of cells to change the style for. If no
cells are specified then the selection cells are used.public void alignCells(String align)
align
- Specifies the alignment. Possible values are all constants
in mxConstants with an ALIGN prefix.public void alignCells(String align, Object[] cells)
align
- Specifies the alignment. Possible values are all constants
in mxConstants with an ALIGN prefix.cells
- Array of cells to be aligned.public void alignCells(String align, Object[] cells, Object param)
align
- Specifies the alignment. Possible values are all constants
in mxConstants with an ALIGN prefix.cells
- Array of cells to be aligned.param
- Optional coordinate for the alignment.public Object flip(Object edge)
edge
- Cell that represents the edge to be flipped.
public void toBack()
public void toBack(Object[] cells)
cells
- Array of cells to move to the background.public void toFront()
public void toFront(Object[] cells)
cells
- Array of cells to bring to front.public void setIndexForCells(Object[] cells, Integer index)
cells
- Optional array of cells to be reinserted. Default is the
selection cells.index
- Integer that specifies the new index or null to append.public Object[] cloneCells(Object[] cells)
cells
- Array of mxCells to be cloned.
public Object insertVertex(Object parent, String id, Object value, double x, double y, double width, double height)
public Object insertVertex(Object parent, String id, Object value, double x, double y, double width, double height, String style)
parent
- Cell that specifies the parent of the new vertex.id
- Optional string that defines the Id of the new vertex.value
- Object to be used as the user object.x
- Integer that defines the x coordinate of the vertex.y
- Integer that defines the y coordinate of the vertex.width
- Integer that defines the width of the vertex.height
- Integer that defines the height of the vertex.style
- Optional string that defines the cell style.
public Object createVertex(Object parent, String id, Object value, double x, double y, double width, double height, String style)
parent
- Cell that specifies the parent of the new vertex.id
- Optional string that defines the Id of the new vertex.value
- Object to be used as the user object.x
- Integer that defines the x coordinate of the vertex.y
- Integer that defines the y coordinate of the vertex.width
- Integer that defines the width of the vertex.height
- Integer that defines the height of the vertex.style
- Optional string that defines the cell style.
public Object insertEdge(Object parent, String id, Object value, Object source, Object target)
public Object insertEdge(Object parent, String id, Object value, Object source, Object target, String style)
parent
- Cell that specifies the parent of the new edge.id
- Optional string that defines the Id of the new edge.value
- Object to be used as the user object.source
- Cell that defines the source of the edge.target
- Cell that defines the target of the edge.style
- Optional string that defines the cell style.
public Object createEdge(Object parent, String id, Object value, Object source, Object target, String style)
parent
- Cell that specifies the parent of the new edge.id
- Optional string that defines the Id of the new edge.value
- Object to be used as the user object.source
- Cell that defines the source of the edge.target
- Cell that defines the target of the edge.style
- Optional string that defines the cell style.
public Object addEdge(Object edge, Object source, Object target)
public Object addEdge(Object edge, Object parent, Object source, Object target, Integer index)
edge
- Cell to be inserted into the given parent.parent
- Cell that represents the new parent. Default is
defaultParent.source
- Optional Cell that represents the source terminal.target
- Optional Cell that represents the target terminal.index
- Optional index to insert the cells at. Default is to append.
public Object addCell(Object cell)
cell
- Cell to be inserted into the default parent.
public Object addCell(Object cell, Object parent)
cell
- Cell to be inserted into the given parent.
public Object addCell(Object cell, Object parent, Integer index, Object source, Object target)
cell
- Cell to be inserted into the given parent.parent
- Object that represents the new parent. If no parent is
given then the default parent is used.index
- Optional index to insert the cells at. Default is to append.source
- Optional cell that represents the source terminal.target
- Optional cell that represents the target terminal.
public Object[] addCells(Object[] cells)
cells
- Array of cells to be inserted.
public Object[] addCells(Object[] cells, Object parent)
cells
- Array of cells to be inserted.parent
- Optional cell that represents the new parent. If no parent
is specified then the default parent is used.
public Object[] addCells(Object[] cells, Object parent, Integer index)
cells
- Array of cells to be inserted.parent
- Optional cell that represents the new parent. If no parent
is specified then the default parent is used.index
- Optional index to insert the cells at. Default is to append.
public Object[] layoutAfterAdd(Object parent, Object[] cells)
parent
- Object that represents the parent of the new cells.cells
- Array of cells that have been added.public Object splitEdge(Object edge, Object cell)
public Object splitEdge(Object edge, Object cell, Object newEdge)
edge
- Object that represents the edge to be splitted.cell
- Object that represents the cell to insert into the edge.newEdge
- Object that represents the edge to be inserted.
public Object[] layoutAfterSplit(Object parent, Object edge, Object cell, Object newEdge)
parent
- edge
- cell
- newEdge
- public Object[] remove()
public Object[] remove(Object[] cells)
public Object[] remove(Object[] cells, boolean includeEdges)
public Object[] hide()
public Object[] hide(Object[] cells, boolean includeEdges)
public Object[] show()
public Object[] show(Object[] cells, boolean includeEdges)
public Object[] remove(Object[] cells, boolean includeEdges, boolean isHide, boolean isShow)
public Object[] layoutAfterRemove(Object[] parents, Object[] cells, boolean hide, boolean show)
parents
- Array of cells
- Array of hide
- Boolean indicating if the cells were hidden.show
- Boolean indicating if the cells were shown.public Object[] removeEdges(Object cell, boolean recurse)
public Object[] hideEdges(Object cell, boolean recurse)
public Object[] showEdges(Object cell, boolean recurse)
public Object[] removeEdges(Object cell, boolean recurse, boolean isHide, boolean isShow)
cell
- recurse
- public Object updateSize(Object cell)
cell
- public mxGeometry updateSwimlaneSize(Object swimlane, mxGeometry geometry, mxRectangle pSize)
swimlane
- geometry
- pSize
- public mxRectangle getPreferredSizeForCell(Object cell)
cell
- public void resize(Object cell, mxRectangle bounds)
cell
- bounds
- public void resizeCells(Object[] cells, mxRectangle[] boundsArray)
cells
- Array of boundsArray
- Array of public Object[] layoutAfterResize(Object[] parents, Object[] cells)
parents
- Array of cells
- Array of public void cascadeResize(Object cell)
cell
- public void extendParent(Object cell)
cell
- public Object[] getCellsToShift(mxCellState state)
public Object[] move(Object[] cells, double dx, double dy)
public Object[] move(Object[] cells, double dx, double dy, boolean clone)
public Object[] move(Object[] cells, double dx, double dy, boolean clone, Object target, Point location)
cells
- Array of cells to be moved.dx
- Integer that specifies the x-coordinate of the move.dy
- Integer that specifies the y-coordinate of the move.clone
- Boolean indicating if the cells should be cloned.target
- Cell that represents the new parent of the cells.location
- Location where the mouse was released.public mxRectangle getContentArea(Object cell)
public mxRectangle getMaximumGraphBounds()
public void setMaximumGraphBounds(mxRectangle maximumGraphBounds)
maximumGraphBounds
- the maximumGraphBounds to setpublic void removeFromParent()
public void removeFromParent(Object[] cells)
cells
- Array of public void moveInto(Object[] cells, Object target)
public void moveInto(Object[] cells, Object target, Point location)
cells
- Array of mxCells to be moved inside the target.target
- mxCell that represents the new parent.location
- Point where the mouse was released.public void cellsMoved(Object[] cells, Point location)
public void keepInside(Object[] cells)
cells
- Array of mxCells which should be kept inside their parents.public void resetEdges(Object[] cells)
cells
- Array of mxCells for which the connected edges should be
reset.public Object[] layoutAfterMove(Object[] parents, Object[] cells, Object target)
public void connect(Object edge, Object terminal, boolean isSource)
public Object[] layoutAfterConnect(Object edge, Object terminal, boolean isSource)
public void disconnect(Object[] cells)
cells
- Array of public mxRectangle getBounds()
public mxRectangle getCellBounds(Object cell)
public mxRectangle getCellBounds(Object cell, boolean includeEdges)
public mxRectangle getCellBounds(Object cell, boolean includeEdges, boolean includeDescendants)
public mxRectangle getBoundingBox(Object cell)
public mxRectangle getBoundingBox(Object cell, boolean includeEdges)
public mxRectangle getBoundingBox(Object cell, boolean includeEdges, boolean includeDescendants)
public mxRectangle getPaintBounds(Object[] cells)
public mxRectangle getBoundsForCells(Object[] cells, boolean includeEdges, boolean includeDescendants, boolean boundingBox)
public mxRectangle getCellBounds(Object cell, boolean includeEdges, boolean includeDescendants, boolean boundingBox)
public void refresh()
public void repaint()
public double snap(double value)
value
- Numeric value to be snapped to the grid.
public boolean isCellVisible(Object cell)
cell
- Cell whose visible state should be returned.
public boolean isCellCollapsed(Object cell)
cell
- Cell whose collapsed state should be returned.
public boolean isOrthogonal(mxCellState edge, mxCellState vertex)
edge
- Cell state that represents the edge.vertex
- Cell state that represents the vertex.public boolean isLoop(mxCellState state)
state
- public void collapse()
public void collapse(Object[] cells)
cells
- Optional array of public void collapse(Object[] cells, boolean recurse)
cells
- Optional array of recurse
- Boolean indicating if the collapsed state of all
descendants should be set.public void expand()
public void expand(Object[] cells)
cells
- Optional array of public void expand(Object[] cells, boolean recurse)
cells
- Optional array of recurse
- Boolean indicating if the collapsed state of all
descendants should be set.public void setCollapsedState(boolean collapsed)
collapsed
- public void setCollapsedState(Object[] cells, boolean collapsed)
cells
- Optional array of cells whose collapsed state should be set.
Default is the selection cells.collapsed
- Boolean indicating the collapsed state to be assigned.public void setCollapsedState(Object[] cells, boolean collapsed, boolean recurse)
cells
- Optional array of cells whose collapsed state should be set.
Default is the selection cells.collapsed
- Boolean indicating the collapsed state to be assigned.recurse
- Boolean indicating if the collapsed state of all
descendants should be set.public Object[] layoutAfterCollapsedState(Object[] cells, boolean collapsed)
cells
- Array of collapsed
- Boolean indicating if the cells have been collapsed.
public void swapBounds(Object cell, boolean willCollapse)
cell
- willCollapse
- Boolean indicating if the cell is going to be collapsed.public void updateAlternateBounds(Object cell, mxGeometry g, boolean willCollapse)
cell
- g
- willCollapse
- Boolean indicating if the cell is going to be collapsed.public mxGeometry getCellGeometry(Object cell)
cell
- Cell whose geometry should be returned.
public Object getCurrentRoot()
public mxPoint getTranslateForRoot(Object cell)
cell
-
public mxPoint getChildOffsetForCell(Object cell)
cell
- Cell whose offset should be returned.
public void enterGroup()
public void enterGroup(Object cell)
cell
- public void exitGroup()
public void home()
public boolean isValidRoot(Object cell)
cell
- public Object group()
public Object group(Object group)
group
-
public Object group(Object group, double border)
group
- border
- public Object group(Object group, double border, Object[] tmp)
group
- border
- Optional integer that specifies the border between the child
area and the group bounds.tmp
- Optional array of cells to be grouped.public Object createGroupCell(Object[] cells)
cells
-
public void ungroup()
public void ungroup(Object[] cells)
cells
- Optional array of public Object addGroup(Object group, Object[] cells)
group
- cells
-
public Object addGroup(Object group, Object[] cells, double border)
group
- cells
- Array of border
- Optional border for the group area in pixels.
public Object groupCells(Object parent, Object group, Object[] cells, double dx, double dy)
parent
- group
- cells
- Array of dx
- X-coordinate of the translation to be applied.dy
- Y-coordinate of the translation to be applied.public mxIGraphLayout getLayout(Object cell)
public boolean isBubbleLayout()
public void setBubbleLayout(boolean bubbleLayout)
bubbleLayout
- public boolean isAutoLayout(Object cell)
cell
-
public void setAutoLayout(boolean autoLayout)
autoLayout
- public Object[] getParents(Object[] cells)
public Object[] layout(Object[] cells)
cells
-
public void setMultiplicities(mxMultiplicity[] multiplicities)
public mxMultiplicity[] getMultiplicities()
public boolean isEdgeValid(Object edge, Object source, Object target)
edge
- Cell that represents the edge to validate.source
- Cell that represents the source terminal.target
- Cell that represents the target terminal.public String getEdgeValidationError(Object edge, Object source, Object target)
edge
- Cell that represents the edge to validate.source
- Cell that represents the source terminal.target
- Cell that represents the target terminal.public String validateEdge(Object edge, Object source, Object target)
edge
- Cell that represents the edge to validate.source
- Cell that represents the source terminal.target
- Cell that represents the target terminal.public String validate()
public String validate(Object cell, Hashtable context)
cell
- Cell to start the validation recursion.context
- Object that represents the global validation state.public String getCellValidationError(Object cell)
cell
- Cell for which the multiplicities should be checked.public String validateCell(Object cell, Hashtable context)
cell
- Cell that represents the cell to validate.context
- Hashtable that represents the global validation state.public boolean isLabelsVisible()
public void setLabelsVisible(boolean labelsVisible)
labelsVisible
- the labelsVisible to setpublic void setHtmlLabels(boolean htmlLabels)
htmlLabels
- the htmlLabels to setpublic boolean isHtmlLabels()
public String convertValueToString(Object cell)
cell
- Cell to be converted to a string.
public String getLabel(Object cell)
cell
- public boolean isHtmlLabel(Object cell)
cell
- public String getToolTipForCell(Object cell)
public mxRectangle getStartSize(Object swimlane)
swimlane
- public String getImage(mxCellState state)
state
-
public int getBorder()
public void setBorder(int border)
border
- Positive integer that represents the border to be used.public mxEdgeStyle.mxEdgeStyleFunction getDefaultLoopStyle()
public void setDefaultLoopStyle(mxEdgeStyle.mxEdgeStyleFunction loopStyle)
loopStyle
- Default style to be used for loops.public boolean isSwimlane(Object cell)
cell
- Cell that should be checked.
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- Boolean indicating if the graph should be enabled.public boolean isLocked(Object cell)
cell
- public void setLocked(boolean locked)
locked
- Boolean that defines the new value for public boolean isCellCloneable(Object cell)
cell
- Cell whose visible state should be returned.
public boolean isCloneable()
public void setCloneable(boolean cloneable)
cloneable
- Boolean indicating if the graph should be cloneable.public void setSwimlaneNesting(boolean swimlaneNesting)
public boolean isSwimlaneNesting()
public boolean isMultigraph()
public void setMultigraph(boolean multigraph)
multigraph
- the multigraph to setpublic boolean isAllowDanglingEdges()
public void setAllowDanglingEdges(boolean allowDanglingEdges)
allowDanglingEdges
- the allowDanglingEdges to setpublic boolean isCloneInvalidEdges()
public void setCloneInvalidEdges(boolean cloneInvalidEdges)
cloneInvalidEdges
- the cloneInvalidEdges to setpublic boolean isDisconnectOnMove()
public void setDisconnectOnMove(boolean disconnectOnMove)
disconnectOnMove
- the disconnectOnMove to setpublic boolean isAllowLoops()
public void setAllowLoops(boolean allowLoops)
allowLoops
- the allowLoops to setpublic boolean isConnectableEdges()
public void setConnectableEdges(boolean connectableEdges)
connectableEdges
- the connectableEdges to setpublic boolean isResetEdgesOnMove()
public void setResetEdgesOnMove(boolean resetEdgesOnMove)
resetEdgesOnMove
- the resetEdgesOnMove to setpublic boolean isResetEdgesOnResize()
public void setResetEdgesOnResize(boolean resetEdgesOnResize)
resetEdgesOnResize
- the resetEdgesOnResize to setpublic boolean isShiftDownwards()
public void setShiftDownwards(boolean shiftDownwards)
shiftDownwards
- the shiftDownwards to setpublic boolean isShiftRightwards()
public void setShiftRightwards(boolean shiftRightwards)
shiftRightwards
- the shiftRightwards to setpublic boolean isSelectable(Object cell)
cell
- public void setSelectable(boolean selectable)
selectable
- Boolean indicating if the graph should allow selection of cells.public boolean isDeletable(Object cell)
cell
- Cell whose movable state should be returned.
public void setDeletable(boolean deletable)
deletable
- Boolean indicating if the graph should allow deletion of cells.public boolean isLabelMovable(Object cell)
cell
- public void setVertexLabelsMovable(boolean movable)
movable
- public boolean isVertexLabelsMovable()
public void setEdgeLabelsMovable(boolean movable)
movable
- public boolean isEdgeLabelsMovable()
public boolean isMovable(Object cell)
cell
- Cell whose movable state should be returned.
public void setMovable(boolean movable)
public boolean isDropEnabled()
public void setDropEnabled(boolean dropEnabled)
public boolean isSizable(Object cell)
cell
- Cell whose sizable state should be returned.
public void setSizable(boolean sizable)
public boolean isEditable(Object cell)
cell
- Cell whose editable state should be returned.
public boolean isEditable()
public void setEditable(boolean editable)
public boolean isValidSource(Object cell)
cell
- Object that represents a possible source or null.
public boolean isValidTarget(Object cell)
cell
- Object that represents a possible target or null.
public boolean isValidConnection(Object source, Object target)
source
- Object that represents the source cell.target
- Object that represents the target cell.
public boolean isBendable(Object cell)
cell
- Cell whose bendable state should be returned.
public void setBendable(boolean bendable)
public boolean isDisconnectable(Object cell, Object terminal, boolean source)
cell
- terminal
- source
- Boolean indicating if the source or target terminal is to be
disconnected.
public void setDisconnectable(boolean disconnectable)
disconnectable
- Boolean indicating if the graph should allow disconnecting of
edges.public void setUpdateSize(boolean updateSize)
updateSize
- Boolean indicating if cells should be resized
automatically.public boolean isUpdateSize(Object cell)
cell
- Cell that should be resized.
public boolean isExtendParentOnResize(Object cell)
cell
- Cell that has been resized.public void setExtendParentOnResize(boolean extendParentOnResize)
public boolean isKeepInsideParentOnMove(Object cell)
public void setKeepInsideParentOnMove(boolean keepInsideParentOnMove)
keepInsideParentOnMove
- the keepInsideParentOnMove to setpublic boolean isKeepEdgesInForeground()
public void setKeepEdgesInForeground(boolean keepEdgesInForeground)
keepEdgesInForeground
- the keepEdgesInForeground to setpublic boolean isKeepEdgesInBackground()
public void setKeepEdgesInBackground(boolean keepEdgesInBackground)
keepEdgesInBackground
- the keepEdgesInBackground to setpublic mxRectangle getMinimumContainerSize()
public void setMinimumContainerSize(mxRectangle minimumContainerSize)
minimumContainerSize
- the minimumContainerSize to setpublic mxRectangle getMaximumContainerSize()
public void setMaximumContainerSize(mxRectangle maximumContainerSize)
maximumContainerSize
- the maximumContainerSize to setpublic double getOverlap(Object cell)
cell
-
public boolean isAllowOverlapParent(Object cell)
cell
-
public boolean isShiftable(Object cell)
cell
- public boolean isExpandable(Object cell)
cell
- public boolean isCollapsable(Object cell)
cell
- public boolean isGridEnabled()
public void setGridEnabled(boolean gridEnabled)
gridEnabled
- Specifies if the grid should be enabled.public int getGridSize()
public void setGridSize(int gridSize)
gridSize
- New grid size to be used.public String getAlternateEdgeStyle()
public void setAlternateEdgeStyle(String alternateEdgeStyle)
alternateEdgeStyle
- the alternateEdgeStyle to setpublic boolean isValidDropTarget(Object cell, Object[] cells)
cell
- Object that represents the possible drop target.cells
-
public boolean isSplitDropTarget(Object edge, Object cell)
edge
- Object that represents the edge to be splitted.cell
- Object that represents the new terminal.
public boolean isParentDropTarget(Object target, Object[] cells)
target
- Object that represents the target cell.cells
-
public Object getDropTarget(Object[] cells, Point pt, Object cell)
public Object getDefaultParent()
public Object[] getChildVertices(Object parent)
parent
- Cell whose children should be returned.public Object[] getChildEdges(Object parent)
parent
- Cell whose children should be returned.public Object[] getChildCells(Object parent)
parent
- Cell whose children should be returned.public Object[] getChildCells(Object parent, boolean vertices, boolean edges)
parent
- Cell whose children should be returned.vertices
- Specifies if child vertices should be returned.edges
- Specifies if child edges should be returned.
public Object[] getConnections(Object cell)
cell
- Cell whose connections should be returned.
public Object[] getConnections(Object cell, Object parent)
cell
- Cell whose connections should be returned.parent
- Optional parent of the opposite end for a connection
to be returned.
public Object[] getIncomingEdges(Object cell)
cell
- Cell whose incoming edges should be returned.
public Object[] getIncomingEdges(Object cell, Object parent)
cell
- Cell whose incoming edges should be returned.parent
- Optional parent of the opposite end for an edge
to be returned.
public Object[] getOutgoingEdges(Object cell)
cell
- Cell whose outgoing edges should be returned.
public Object[] getOutgoingEdges(Object cell, Object parent)
cell
- Cell whose outgoing edges should be returned.parent
- Optional parent of the opposite end for an edge
to be returned.
public Object[] getEdges(Object cell)
cell
- Cell whose edges should be returned.
public Object[] getEdges(Object cell, Object parent)
cell
- Cell whose edges should be returned.parent
- Optional parent of the opposite end for an edge
to be returned.
public Object[] getEdges(Object cell, Object parent, boolean incoming, boolean outgoing, boolean includeLoops)
cell
- Cell whose edges should be returned.parent
- Optional parent of the opposite end for an edge to be
returned.incoming
- Specifies if incoming edges should be included in the
result.outgoing
- Specifies if outgoing edges should be included in the
result.includeLoops
- Specifies if loops should be included in the result.
public Object[] getOpposites(Object[] edges, Object terminal)
edges
- terminal
-
public Object[] getOpposites(Object[] edges, Object terminal, boolean sources, boolean targets)
edges
- Edges whose opposite terminals should be returned.terminal
- Terminal that specifies the end whose opposite should be
returned.sources
- Specifies if source terminals should be included in the
result.targets
- Specifies if targer terminals should be included in the
result.
public Object[] getEdgesBetween(Object source, Object target)
source
- target
-
public Object[] getEdgesBetween(Object source, Object target, boolean directed)
source
- target
- directed
-
public Object[] getCellsBeyond(double x0, double y0, Object parent, boolean rightHalfpane, boolean bottomHalfpane)
x0
- X-coordinate of the origin.y0
- Y-coordinate of the origin.parent
- rightHalfpane
- Boolean indicating if the cells in the right halfpane
from the origin should be returned.bottomHalfpane
- Boolean indicating if the cells in the bottom halfpane
from the origin should be returned.
public Object[] findTreeRoots(Object parent)
parent
- Cell whose children should be checked.
public Object[] findTreeRoots(Object parent, boolean isolate)
parent
- Cell whose children should be checked.isolate
- Specifies if edges should be ignored if the opposite
end is not a child of the given parent cell.
public Object[] findTreeRoots(Object parent, boolean isolate, boolean invert)
parent
- Cell whose children should be checked.isolate
- Specifies if edges should be ignored if the opposite
end is not a child of the given parent cell.invert
- Specifies if outgoing or incoming edges should be counted
for a tree root. If false then outgoing edges will be counted.
public void traverse(Object vertex, boolean directed, mxGraph.mxICellVisitor visitor)
vertex
- directed
- visitor
- public void traverse(Object vertex, boolean directed, mxGraph.mxICellVisitor visitor, Object edge, Set visited)
vertex
- directed
- Optional boolean indicating if edges should only be traversed
from source to target. Default is true.visitor
- Visitor that takes the current vertex and the incoming edge.
The traversal stops if the function returns false.edge
- Optional visited
- Optional array of cell paths for the visited cells.public mxSelectionModel getSelection()
public int getSelectionCount()
public boolean isSelected(Object cell)
cell
-
public boolean isSelectionEmpty()
public void clearSelection()
public Object getSelectionCell()
public void setSelectionCell(Object cell)
cell
- public Object[] getSelectionCells()
public void setSelectionCells(Object[] cells)
public void setSelectionCells(Collection cells)
cells
- public void selectNext()
public void selectPrevious()
public void selectParent()
public void selectChild()
public void select(boolean isNext, boolean isParent, boolean isChild)
isNext
- isParent
- isChild
- public void selectVertices()
public void selectVertices(Object parent)
public void selectEdges()
public void selectEdges(Object parent)
public void selectCells(boolean vertices, boolean edges)
selectAll
to select all cells.
vertices
- Boolean indicating if vertices should be selected.edges
- Boolean indicating if edges should be selected.public void selectCells(boolean vertices, boolean edges, Object parent)
selectAll
to select
all cells.
vertices
- Boolean indicating if vertices should be selected.edges
- Boolean indicating if edges should be selected.parent
- Optional cell that acts as the root of the recursion.
Default is defaultParent
.public void selectAll()
public void selectAll(Object parent)
parent
- Optional public void draw(mxICanvas canvas)
canvas
- Canvas onto which the graph should be drawn.public void drawCell(mxICanvas canvas, Object cell)
canvas
- Canvas onto which the cell should be drawn.cell
- Cell that should be drawn onto the canvas.public void drawStateWithLabel(mxICanvas canvas, mxCellState state, String label)
canvas
- Canvas onto which the cell should be drawn.cell
- Cell that should be drawn onto the canvas.protected void cellDrawn(Object cell, Object element, Object labelElement)
protected String getLinkForCell(Object cell)
protected String getTargetForCell(Object cell)
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- PropertyChangeSupport.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
propertyName
- listener
- PropertyChangeSupport.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- PropertyChangeSupport.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
propertyName
- listener
- PropertyChangeSupport.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
public static void main(String[] args)
|
JGraph X 0.15.0.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |