Lines Matching refs:graph

131 			ui.editor.graph.popupMenuHandler.hideMenu();
135 ui.editor.graph.popupMenuHandler.hideMenu();
781 if (tokens.length > 0 && graph.isEnabled())
809 if (graph.isEditing())
813 graph.stopEditing();
832 var cells = graph.getSelectionCells();
836 graph.startEditingAtCell(cells[0]);
920 var cell = graph.getSelectionCell();
921 var geo = graph.getCellGeometry(cell);
923 if (graph.getModel().isVertex(cell) && geo != null)
929 geo.height = graph.snap(Math.round(geo.height * 0.5));
934 geo.width = graph.snap(Math.round(geo.width * 0.5));
937 if (geo.width > graph.tolerance && geo.height > graph.tolerance)
939 graph.getModel().setGeometry(cell, geo);
956 var cell = graph.getSelectionCell();
957 var geo = graph.getCellGeometry(cell);
959 if (graph.getModel().isVertex(cell) && geo != null)
973 if (geo.width > graph.tolerance && geo.height > graph.tolerance)
975 graph.getModel().setGeometry(cell, geo);
1025 var cell = graph.getSelectionCell();
1026 var geo = graph.getCellGeometry(cell);
1028 if (graph.getModel().isVertex(cell) && geo != null)
1041 graph.getModel().setGeometry(cell, geo);
1061 var current = graph.getSelectionCell();
1064 graph.clearSelection();
1068 var cell = graph.getSelectionCell();
1071 if (graph.model.isVertex(cell) && graph.model.isEdge(current) &&
1072 (graph.model.getTerminal(current, true) == null ||
1073 graph.model.getTerminal(current, false) == null))
1075 var edgeState = graph.view.getState(current);
1076 var vertexState = graph.view.getState(cell);
1081 var source = graph.model.getTerminal(current, true) == null;
1088 var s = graph.view.scale;
1093 graph.model.beginUpdate();
1096 graph.moveCells(graph.getSelectionCells(), dx / s, dy / s);
1097 graph.model.setTerminal(current, cell, source);
1101 graph.model.endUpdate();
1112 var cell = graph.getSelectionCell();
1114 if (graph.getModel().isVertex(cell))
1140 var length = graph.defaultEdgeLength;
1143 var cells = graph.connectVertex(cell, direction, length, evt);
1144 graph.selectCellsForConnectVertex(cells, evt, ui.hoverIcons);
1152 var cell = graph.getSelectionCell();
1154 if (!graph.isSelectionEmpty())
1168 dx += graph.defaultEdgeLength;
1169 dy += graph.defaultEdgeLength;
1207 dy += -graph.defaultEdgeLength;
1211 dx += -graph.defaultEdgeLength;
1215 dy += graph.defaultEdgeLength;
1219 dx += graph.defaultEdgeLength;
1227 graph.moveCells(graph.getSelectionCells(), dx, dy);
1236 var cells = graph.getSelectionCells();
1238 if (cells.length == 0 && graph.model.contains(lastInserted))
1259 graph.labelChanged(cells[0], value);
1267 var cells = graph.getAllEdges(graph.getSelectionCells());
1275 graph.removeCells(cells);
1282 graph.clearSelection();
1292 if (graph.model.contains(lastInserted))
1294 graph.setSelectionCell(lastInserted);
1295 App.say('{1} selected', [graph.getWordForCell(lastInserted).replace(/([A-Z])/g, ' $1')]);
1302 var edges = graph.getAllEdges(graph.getSelectionCells());
1306 graph.setSelectionCells(edges);
1325 if (graph.isSelectionEmpty())
1328 var parent = graph.getDefaultParent();
1329 var childCount = graph.model.getChildCount(parent);
1333 var child = graph.model.getChildAt(parent, i);
1335 if (graph.model.isVertex(child))
1337 graph.setSelectionCell(child);
1338 App.say('{1} selected', [graph.getWordForCell(child).replace(/([A-Z])/g, ' $1')]);
1346 var cell = graph.getSelectionCell();
1347 var model = graph.getModel();
1357 graph.setSelectionCell(next);
1358 App.say('{1} selected', [graph.getWordForCell(next)]);
1369 var cell = graph.getSelectionCell();
1371 if (graph.model.isEdge(cell))
1373 var terminal = graph.model.getTerminal(cell, tokens[1].toLowerCase() == 'source');
1377 graph.setSelectionCell(terminal);
1384 if (graph.isSelectionEmpty())
1387 var parent = graph.getDefaultParent();
1388 var childCount = graph.model.getChildCount(parent);
1392 var child = graph.model.getChildAt(parent, i);
1394 if (graph.model.isVertex(child))
1396 graph.setSelectionCell(child);
1397 App.say('{1} selected', [graph.getWordForCell(child).replace(/([A-Z])/g, ' $1')]);
1405 var cell = graph.getSelectionCell();
1406 var model = graph.getModel();
1416 graph.setSelectionCell(next);
1417 App.say('{1} selected', [graph.getWordForCell(next).replace(/([A-Z])/g, ' $1')]);
1426 var states = graph.view.states.getValues();
1433 if (!graph.isCellSelected(states[i].cell))
1436 var lab = graph.getLabel(states[i].cell);
1452 graph.setSelectionCell(states[i].cell);
1453 App.say('{1} selected', [graph.getWordForCell(states[i].cell)]);
1481 var wrd = graph.getWordForCell(states[i].cell, true);
1486 graph.setSelectionCell(states[i].cell);
1487 App.say('{1} selected', [graph.getWordForCell(states[i].cell)]);
1497 var cells = graph.getSelectionCells();
1499 if (cells.length == 0 && graph.model.contains(lastInserted))
1510 graph.labelChanged(cells[0], '');
1541 graph.setCellStyles(style, null, cells);
1554 var cells = graph.getSelectionCells();
1556 if (cells.length == 0 && graph.model.contains(lastInserted))
1625 graph.setCellStyles(style, lastValue, cells);
1677 if (graph.model.isEdge(graph.getSelectionCell()))
1700 graph.setCellStyles(style, color, cells);
1738 graph.setCellStyles(style, value, cells);
1754 if (graph.model.isVertex(cell))
1817 graph.setCellStyles(mxConstants.STYLE_SHAPE, shapenameToken, vertices);
1915 var graph = ui.editor.graph;
1927 if (graph.getSelectionCount() == 0)
1931 else if (graph.getSelectionCount() == 1)
1933 var cell = graph.getSelectionCell();
1935 if (graph.getModel().isVertex(cell))
1937 var geo = graph.getCellGeometry(cell)
1941 App.say('{1} at {2} and {3} is {4} times {5} pixels', [graph.getWordForCell(cell, true),
1950 var lab = mxUtils.trim(graph.getLabel(cell));
1959 var cells = graph.getSelectionCells();
1967 if (graph.model.isEdge(cell))
1971 else if (graph.model.isVertex(cell))
2047 graph.getWordForCell = function(cell, ignoreLabel)
2118 graph.addListener(mxEvent.LABEL_CHANGED, function(sender, evt)
2142 graph.addListener(mxEvent.CELL_CONNECTED, function(sender, evt)
2155 graph.addListener(mxEvent.CELLS_ADDED, function(sender, evt)
2169 if (graph.model.isEdge(cell))
2173 else if (graph.model.isVertex(cell))
2218 if (graph.model.isEdge(cell) && graph.model.getTerminal(cell, true) != null &&
2219 graph.model.getTerminal(cell, false) != null)
2221 if (graph.getWordForCell(graph.model.getTerminal(cell, true)) ==
2222 graph.getWordForCell(graph.model.getTerminal(cell, false)))
2228 App.say('{1} connected to {2}', [graph.getWordForCell(graph.model.getTerminal(cell, true)),
2229 graph.getWordForCell(graph.model.getTerminal(cell, false))]);
2232 else if (graph.model.isVertex(cell))
2237 var word = graph.getWordForCell(cell).replace(/([A-Z])/g, ' $1');
2243 graph.addListener(mxEvent.CELLS_REMOVED, function(sender, evt)
2255 App.say('{1} deleted', [graph.getWordForCell(cell)]);