Lines Matching refs:graph

149 		var graph = ui.editor.graph;
150 var model = graph.getModel();
165 var style = graph.getCurrentCellStyle(cell);
180 var pstate = graph.view.getState(parent);
181 var style = (pstate != null) ? pstate.style : graph.getCellStyle(parent);
196 var pstate = graph.view.getState(parent);
198 var state = graph.view.getState(parent);
199 var style = (pstate != null) ? pstate.style : graph.getCellStyle(parent);
212 if (graph.getSelectionCount() == 1)
214 var cell = graph.getSelectionCell();
215 var sib = graph.getOutgoingTreeEdges(cell);
220 if (isTreeVertex(graph.getSelectionCell()))
228 if (isTreeVertex(graph.getSelectionCell()))
232 if (graph.getIncomingTreeEdges(cell).length > 0)
237 else if (graph.model.getEdgeCount(cell) > 0)
247 if (graph.isEnabled() && graph.getSelectionCount() == 1)
249 var cell = graph.getSelectionCell();
250 var sib = graph.getOutgoingTreeEdges(cell);
258 tmp.push(graph.model.getTerminal(sib[i], false));
261 graph.setSelectionCells(tmp);
269 if (graph.isEnabled() && graph.getSelectionCount() == 1)
271 var cell = graph.getSelectionCell();
272 var edges = graph.getIncomingTreeEdges(cell);
276 var sib = graph.getOutgoingTreeEdges(graph.model.getTerminal(edges[0], true));
284 tmp.push(graph.model.getTerminal(sib[i], false));
287 graph.setSelectionCells(tmp);
296 if (graph.isEnabled() && graph.getSelectionCount() == 1)
298 var cell = graph.getSelectionCell();
299 var edges = graph.getIncomingTreeEdges(cell);
303 graph.setSelectionCell(graph.model.getTerminal(edges[0], true));
310 var cell = graph.getSelectionCell();
312 if (graph.isEnabled() && graph.model.isVertex(cell))
316 graph.setSelectionCells(graph.model.getTreeEdges(cell,
324 graph.traverse(cell, true, function(vertex, edge)
326 var treeEdge = edge != null && graph.isTreeEdge(edge);
343 graph.setSelectionCells(subtree);
350 var graphRemoveCells = graph.removeCells;
352 graph.removeCells = function(cells, includeEdges)
385 graph.traverse(target, true, function(vertex, edge)
387 var treeEdge = edge != null && graph.isTreeEdge(edge);
405 var edges = graph.getIncomingTreeEdges(cells[i]);
422 return (isTreeVertex(state.cell)) ? null : this.graph.view.getState(this.graph.getCellAt(x, y));
425 var graphDuplicateCells = graph.duplicateCells;
427 graph.duplicateCells = function(cells, append)
435 var state = graph.view.getState(cell);
440 var edges = graph.getIncomingTreeEdges(state.cell);
460 var newEdges = graph.getIncomingTreeEdges(result[i]);
461 var edges = graph.getIncomingTreeEdges(cells[i]);
466 this.addEdge(clone, graph.getDefaultParent(),
481 var graphMoveCells = graph.moveCells;
483 graph.moveCells = function(cells, dx, dy, clone, target, evt, mapping)
498 if (isTreeVertex(cells[i]) || (graph.model.isEdge(cells[i]) &&
499 graph.model.getTerminal(cells[i], true) == null))
501 target = graph.model.getParent(cells[i]);
509 var edges = graph.getIncomingTreeEdges(cells[0]);
513 var state1 = graph.view.getState(graph.model.getTerminal(edges[0], true));
517 var state2 = graph.view.getState(newSource);
521 dx = (state2.getCenterX() - state1.getCenterX()) / graph.view.scale;
522 dy = (state2.getCenterY() - state1.getCenterY()) / graph.view.scale;
547 var edges = graph.getIncomingTreeEdges(cells[i]);
561 var newEdges = graph.getIncomingTreeEdges(result[i]);
567 if (temp == null || temp == graph.model.getParent(cells[i]))
569 temp = graph.model.getTerminal(edges[0], true);
573 this.addEdge(clone, graph.getDefaultParent(), temp, result[i]);
597 var model = graph.model;
612 var geo = graph.getCellGeometry(result[i]);
637 var state = graph.view.getState(cell);
641 var edges = graph.getIncomingTreeEdges(state.cell);
645 var edgeState = graph.view.getState(edges[0]);
682 graph.model.beginUpdate();
685 var parent = graph.model.getParent(cell);
686 var edges = graph.getIncomingTreeEdges(cell);
687 var clones = graph.cloneCells([edges[0], cell]);
688 graph.model.setTerminal(clones[0], graph.model.getTerminal(edges[0], true), true);
703 if (graph.view.currentRoot != parent)
710 var state = graph.view.getState(cell);
711 var s = graph.view.scale;
729 var sib = graph.getOutgoingTreeEdges(graph.model.getTerminal(edges[0], true));
739 var temp = graph.model.getTerminal(sib[i], false);
743 var sibling = graph.view.getState(temp);
773 var temp = graph.model.getTerminal(sib[i], false);
777 var sibling = graph.view.getState(temp);
786 graph.traverse(sibling.cell, true, function(vertex, edge)
788 var treeEdge = edge != null && graph.isTreeEdge(edge);
803 graph.moveCells(subtree, ((after) ? 1 : -1) * dx, ((after) ? 1 : -1) * dy);
811 return graph.addCells(clones, parent);
815 graph.model.endUpdate();
821 graph.model.beginUpdate();
825 var edges = graph.getIncomingTreeEdges(cell);
826 var clones = graph.cloneCells([edges[0], cell]);
827 graph.model.setTerminal(edges[0], clones[1], false);
828 graph.model.setTerminal(clones[0], clones[1], true);
829 graph.model.setTerminal(clones[0], cell, false);
832 var parent = graph.model.getParent(cell);
836 if (graph.view.currentRoot != parent)
842 graph.traverse(cell, true, function(vertex, edge)
844 var treeEdge = edge != null && graph.isTreeEdge(edge);
881 graph.moveCells(subtree, dx, dy);
883 return graph.addCells(clones, parent);
887 graph.model.endUpdate();
893 graph.model.beginUpdate();
896 var parent = graph.model.getParent(cell);
897 var edges = graph.getIncomingTreeEdges(cell);
903 edges = [graph.createEdge(parent, null, '', null, null,
904 graph.createCurrentEdgeStyle())];
908 var clones = graph.cloneCells([edges[0], cell]);
909 graph.model.setTerminal(clones[0], cell, true);
911 if (graph.model.getTerminal(clones[0], false) == null)
913 graph.model.setTerminal(clones[0], clones[1], false);
915 var style = graph.getCellStyle(clones[1]);
926 graph.setCellStyles(key, styles[key], [clones[0]]);
931 graph.setCellStyles('elbow', (dir == mxConstants.DIRECTION_SOUTH ||
945 var edges = graph.getOutgoingTreeEdges(cell);
950 if (graph.view.currentRoot == parent)
957 var target = graph.model.getTerminal(edges[i], false);
965 var bbox = graph.view.getBounds(targets);
966 var tr = graph.view.translate;
967 var s = graph.view.scale;
998 return graph.addCells(clones, parent);
1002 graph.model.endUpdate();
1008 var sib = graph.getOutgoingTreeEdges(cell);
1009 var state = graph.view.getState(ref);
1016 var temp = graph.view.getState(graph.model.getTerminal(sib[i], false));
1048 var sib = graph.getOutgoingTreeEdges(cell);
1052 graph.setSelectionCell(graph.model.getTerminal(sib[0], false));
1057 var edges = graph.getIncomingTreeEdges(cell);
1061 var targets = getOrderedTargets(graph.model.getTerminal(edges[0], true), h2, cell);
1062 var state = graph.view.getState(cell);
1074 graph.setSelectionCell(targets[idx].cell);
1094 if (graph.isEnabled() && !graph.isEditing() &&
1095 isTreeVertex(graph.getSelectionCell()) &&
1096 graph.getSelectionCount() == 1)
1100 if (graph.getIncomingTreeEdges(graph.getSelectionCell()).length > 0)
1105 addParent(graph.getSelectionCell()) :
1106 addChild(graph.getSelectionCell());
1110 cells = addSibling(graph.getSelectionCell(), !mxEvent.isShiftDown(evt));
1116 if (cells.length == 1 && graph.model.isEdge(cells[0]))
1118 graph.setSelectionCell(graph.model.getTerminal(cells[0], false));
1122 graph.setSelectionCell(cells[cells.length - 1]);
1127 ui.hoverIcons.update(graph.view.getState(graph.getSelectionCell()));
1130 graph.startEditingAtCell(graph.getSelectionCell());
1149 selectCell(graph.getSelectionCell(), mxConstants.DIRECTION_WEST);
1154 selectCell(graph.getSelectionCell(), mxConstants.DIRECTION_NORTH);
1159 selectCell(graph.getSelectionCell(), mxConstants.DIRECTION_EAST);
1164 selectCell(graph.getSelectionCell(), mxConstants.DIRECTION_SOUTH);
1182 var graphConnectVertex = graph.connectVertex;
1184graph.connectVertex = function(source, direction, length, evt, forceClone, ignoreCellAt, targetCel…
1186 var edges = graph.getIncomingTreeEdges(source);
1214 graph.getSubtree = function(initialCell)
1222 graph.traverse(initialCell, true, function(vertex, edge)
1224 var treeEdge = edge != null && graph.isTreeEdge(edge);
1252 !hasLayoutParent(this.state.cell)) && this.graph.getOutgoingTreeEdges(
1261 this.graph.container.appendChild(this.moveHandle);
1265 this.graph.graphHandler.start(this.state.cell,
1267 this.graph.getSubtree(this.state.cell));
1268 this.graph.graphHandler.cellWasClicked = true;
1269 this.graph.isMouseTrigger = mxEvent.isMouseEvent(evt);
1270 this.graph.isMouseDown = true;
1327 var graph = this.graph;
1497 graph.setAttributeForCell(cell, 'treeRoot', '1');
1539 graph.setAttributeForCell(cell, 'treeRoot', '1');