Lines Matching refs:graph

115 	var graph = editor.graph;
123 graph.getSelectionModel().addListener(mxEvent.CHANGE, this.update);
124 graph.addListener(mxEvent.EDITING_STARTED, this.update);
125 graph.addListener(mxEvent.EDITING_STOPPED, this.update);
126 graph.getModel().addListener(mxEvent.CHANGE, this.update);
127 graph.getView().addListener('unitChanged', this.update);
129 graph.addListener(mxEvent.ROOT, mxUtils.bind(this, function()
173 var cells = this.editorUi.editor.graph.getSelectionCells();
179 var style = this.editorUi.editor.graph.getCurrentCellStyle(cells[i]);
207 var graph = this.editorUi.editor.graph;
210 if (graph.getModel().isVertex(cell))
212 result.resizable = result.resizable && graph.isCellResizable(cell);
213 result.rotatable = result.rotatable && graph.isCellRotatable(cell);
214 result.movable = result.movable && graph.isCellMovable(cell) &&
215 !graph.isTableRow(cell) && !graph.isTableCell(cell);
216 result.table = result.table || graph.isTable(cell);
217 result.cell = result.cell || graph.isTableCell(cell);
218 result.row = result.row || graph.isTableRow(cell);
220 var geo = graph.getCellGeometry(cell);
281 else if (graph.getModel().isEdge(cell))
289 var state = graph.view.getState(cell);
304 graph.mergeStyle(state.style, result.style, initial);
314 (state.view.graph.model.isVertex(state.cell) ||
448 var graph = ui.editor.graph;
492 else if (graph.isSelectionEmpty())
534 (index == ((containsLabel) ? this.labelIndex : ((graph.isSelectionEmpty()) ?
544 if (graph.isSelectionEmpty())
617 else if (graph.isEditing())
711 var graph = ui.editor.graph;
733 if (graph.cellEditor.isContentEditing() && textEditFallback)
741 graph.cellEditor.restoreSelection(selState);
754 if (graph.isEditing())
756 graph.stopEditing(true);
759 graph.getModel().beginUpdate();
763 graph.setCellStyles(key, value, cells);
768 graph.updateLabelElements(cells, function(elt)
777 if (graph.model.getChildCount(cells[i]) == 0)
779 graph.autoSizeCell(cells[i], false);
788 graph.getModel().endUpdate();
796 if (textEditFallback && graph.cellEditor.isContentEditing())
802 if (document.activeElement == graph.cellEditor.textarea)
804 selState = graph.cellEditor.saveSelection();
810 if (document.activeElement == graph.cellEditor.textarea)
812 selState = graph.cellEditor.saveSelection();
1076 var graph = editor.graph;
1082 var style = (cells != null) ? graph.getCommonStyle(cells) : this.format.getSelectionState().style;
1091 graph.stopEditing();
1100 graph.getModel().beginUpdate();
1105 graph.setCellStyles(key, value, temp);
1117 graph.getModel().endUpdate();
1129 graph.getModel().addListener(mxEvent.CHANGE, this.listener);
1133 graph.getModel().removeListener(this.listener);
1325 var graph = editor.graph;
1331 var state = graph.view.getState(self.format.getSelectionState().cells[0]);
1341 graph.getModel().beginUpdate();
1345 graph.setCellStyles(colorKey, color, cells);
1357 graph.getModel().endUpdate();
1366 var state = graph.view.getState(self.format.getSelectionState().cells[0]);
1374 graph.getModel().addListener(mxEvent.CHANGE, this.listener);
1378 graph.getModel().removeListener(this.listener);
1484 var graph = this.editorUi.editor.graph;
1501 var state = graph.view.getState(this.format.getSelectionState().cells[0]);
1512 graph.setCellStyles(key, value, cells);
1541 graph.container.focus();
1547 graph.container.focus();
1552 graph.getModel().addListener(mxEvent.CHANGE, listener);
1553 this.listeners.push({destroy: function() { graph.getModel().removeListener(listener); }});
1594 this.editorUi.editor.graph.container.focus();
1604 this.editorUi.editor.graph.container.focus();
1663 var graph = this.editorUi.editor.graph;
1718 var graph = editor.graph;
1737 var isTable = graph.isTable(ss.vertices[0]) ||
1738 graph.isTableRow(ss.vertices[0]) ||
1739 graph.isTableCell(ss.vertices[0]);
1740 var isStack = graph.isStack(ss.vertices[0]) ||
1741 graph.isStackChild(ss.vertices[0]);
1748 var style = (graph.isStack(ss.vertices[0])) ? ss.style :
1749 graph.getCellStyle(graph.model.getParent(ss.vertices[0]));
1767 graph.insertLane(ss.vertices[0], true);
1771 graph.insertTableColumn(ss.vertices[0], true);
1786 graph.insertLane(ss.vertices[0], false);
1790 graph.insertTableColumn(ss.vertices[0], false);
1805 graph.deleteLane(ss.vertices[0]);
1809 graph.deleteTableColumn(ss.vertices[0]);
1828 graph.insertLane(ss.vertices[0], true);
1832 graph.insertTableRow(ss.vertices[0], true);
1847 graph.insertLane(ss.vertices[0], false);
1851 graph.insertTableRow(ss.vertices[0], false);
1866 graph.deleteLane(ss.vertices[0]);
1870 graph.deleteTableRow(ss.vertices[0]);
1900 var graph = ui.editor.graph;
1921 if (graph.getSelectionCount() == 1)
1956 var graph = ui.editor.graph;
1965 if (graph.getSelectionCount() > 1)
1978 else if (ss.cells.length == 1 && !graph.getModel().isEdge(cell) && !graph.isSwimlane(cell) &&
1979 !graph.isTable(cell) && !ss.row && !ss.cell && graph.getModel().getChildCount(cell) > 0)
1994 if (graph.getModel().isVertex(graph.getSelectionCell()))
2035 if (graph.getSelectionCount() > 0)
2047 var result = graph.getDataForCells(graph.getSelectionCells());
2092 if (ss.cells.length == 1 && graph.getModel().isVertex(cell) && !ss.row &&
2093 !ss.cell && graph.getModel().isVertex(graph.getModel().getParent(cell)))
2175 var graph = this.editorUi.editor.graph;
2189 function() { graph.alignCells(mxConstants.ALIGN_LEFT); }, stylePanel);
2191 function() { graph.alignCells(mxConstants.ALIGN_CENTER); }, stylePanel);
2193 function() { graph.alignCells(mxConstants.ALIGN_RIGHT); }, stylePanel);
2196 function() { graph.alignCells(mxConstants.ALIGN_TOP); }, stylePanel);
2198 function() { graph.alignCells(mxConstants.ALIGN_MIDDLE); }, stylePanel);
2200 function() { graph.alignCells(mxConstants.ALIGN_BOTTOM); }, stylePanel);
2216 var graph = editor.graph;
2229 graph.toggleCellStyles(mxConstants.STYLE_FLIPH, false);
2239 graph.toggleCellStyles(mxConstants.STYLE_FLIPV, false);
2256 var graph = editor.graph;
2264 graph.distributeCells(true);
2274 graph.distributeCells(false);
2291 var graph = editor.graph;
2367 graph.getModel().addListener(mxEvent.CHANGE, listener);
2368 this.listeners.push({destroy: function() { graph.getModel().removeListener(listener); }});
2377 var unit = this.editorUi.editor.graph.view.unit;
2394 return this.editorUi.editor.graph.view.formatUnitText(pixels);
2399 var unit = this.editorUi.editor.graph.view.unit;
2416 return this.editorUi.editor.graph.view.unit != mxConstants.POINTS;
2421 var unit = this.editorUi.editor.graph.view.unit;
2443 var graph = ui.editor.graph;
2444 var model = graph.getModel();
2533 if (graph.isTableCell(cell))
2535 graph.setTableColumnWidth(cell, value - geo.width, true);
2554 if (graph.isTableCell(cell))
2556 cell = graph.model.getParent(cell);
2559 if (graph.isTableRow(cell))
2561 graph.setTableRowHeight(cell, value - geo.height);
2613 if (!rect.containsLabel && rect.vertices.length == graph.getSelectionCount() &&
2633 if (rect.vertices.length == graph.getSelectionCount() &&
2693 var geo = graph.getCellGeometry(rect.vertices[0]);
2732 var graph = ui.editor.graph;
2748 graph.getModel().beginUpdate();
2755 if (graph.getModel().isVertex(cells[i]))
2757 var geo = graph.getCellGeometry(cells[i]);
2765 var state = graph.view.getState(cells[i]);
2767 if (state != null && graph.isRecursiveVertexResize(state))
2769 graph.resizeChildCells(cells[i], geo);
2772 graph.getModel().setGeometry(cells[i], geo);
2773 graph.constrainChildCells(cells[i]);
2781 graph.getModel().endUpdate();
2805 var graph = ui.editor.graph;
2821 graph.getModel().beginUpdate();
2828 if (graph.getModel().isEdge(cells[i]))
2830 var geo = graph.getCellGeometry(cells[i]);
2837 graph.getModel().setGeometry(cells[i], geo);
2844 graph.getModel().endUpdate();
2871 var graph = ui.editor.graph;
2901 graph.setCellStyles('width', value, cells);
2988 if (rect.cells.length == 1 && graph.model.isEdge(cell))
2990 var geo = graph.model.getGeometry(cell);
2992 if (geo.sourcePoint != null && graph.model.getTerminal(cell, true) == null)
3002 if (geo.targetPoint != null && graph.model.getTerminal(cell, false) == null)
3039 graph.getModel().addListener(mxEvent.CHANGE, listener);
3040 this.listeners.push({destroy: function() { graph.getModel().removeListener(listener); }});
3071 var graph = editor.graph;
3088 if (graph.cellEditor.isContentEditing())
3154 (graph.cellEditor.isContentEditing()) ?
3157 graph.cellEditor.alignText(mxConstants.ALIGN_LEFT, evt);
3164 (graph.cellEditor.isContentEditing()) ?
3167 graph.cellEditor.alignText(mxConstants.ALIGN_CENTER, evt);
3174 (graph.cellEditor.isContentEditing()) ?
3177 graph.cellEditor.alignText(mxConstants.ALIGN_RIGHT, evt);
3188 if (graph.cellEditor.isContentEditing())
3222 if (graph.cellEditor.isContentEditing())
3284 graph.cellEditor.toggleViewMode();
3374 if (!graph.isEditing())
3380 graph.getModel().beginUpdate();
3387 graph.setCellStyles(mxConstants.STYLE_LABEL_POSITION, vals[0], ss.cells);
3388 graph.setCellStyles(mxConstants.STYLE_VERTICAL_LABEL_POSITION, vals[1], ss.cells);
3389 graph.setCellStyles(mxConstants.STYLE_ALIGN, vals[2], ss.cells);
3390 graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN, vals[3], ss.cells);
3395 graph.getModel().endUpdate();
3407 graph.setCellStyles(mxConstants.STYLE_TEXT_DIRECTION, dirSet[dirSelect.value], ss.cells);
3438 graph.cellEditor.textarea;
3442 if (graph.cellEditor.textarea != null && elt != graph.cellEditor.textarea &&
3443 graph.cellEditor.textarea.contains(elt) &&
3475 if (container == graph.cellEditor.textarea ||
3481 if (container != graph.cellEditor.textarea)
3534 if (par != null && isOrContains(graph.cellEditor.textarea, par))
3540 var elts = graph.cellEditor.textarea.getElementsByTagName('font');
3580 …var bgPanel = (graph.cellEditor.isContentEditing()) ? this.createColorOption(mxResources.get('back…
3596 graph.updateLabelElements(ss.cells, function(elt)
3600 }, graph.shapeBackgroundColor);
3605 graph.shapeForegroundColor);
3608 …var defs = (ss.vertices.length >= 1) ? graph.stylesheet.getDefaultVertexStyle() : graph.stylesheet…
3609 …var panel = (graph.cellEditor.isContentEditing()) ? this.createColorOption(mxResources.get('fontCo…
3619 var tmp = graph.cellEditor.textarea.getElementsByTagName('font');
3638 var newFonts = graph.cellEditor.textarea.getElementsByTagName('font');
3700 graph.setCellStyles(mxConstants.STYLE_NOLABEL, '1', ss.cells);
3704 graph.setCellStyles(mxConstants.STYLE_NOLABEL, null, ss.cells);
3707 graph.setCellStyles(mxConstants.STYLE_FONTCOLOR, color, ss.cells);
3709 graph.updateLabelElements(ss.cells, function(elt)
3714 }, graph.shapeForegroundColor);
3720 if (!graph.cellEditor.isContentEditing())
3731 var wwCells = graph.filterSelectionCells(mxUtils.bind(this, function(cell)
3733 var state = graph.view.getState(cell);
3737 graph.getModel().isEdge(cell) ||
3738 (!graph.isTableRow(cell) &&
3739 !graph.isTableCell(cell) &&
3740 !graph.isCellResizable(cell));
3806 if (!graph.cellEditor.isContentEditing())
3824 graph.cellEditor.restoreSelection(selState);
3828 var selectedElement = graph.getSelectedElement();
3836 …if (node != null && node == graph.cellEditor.textarea && graph.cellEditor.textarea.firstChild != n…
3838 if (graph.cellEditor.textarea.firstChild.nodeName != 'P')
3840 graph.cellEditor.textarea.innerHTML = '<p>' + graph.cellEditor.textarea.innerHTML + '</p>';
3843 node = graph.cellEditor.textarea.firstChild;
3846 if (node != null && graph.cellEditor.textarea != null && node != graph.cellEditor.textarea &&
3847 graph.cellEditor.textarea.contains(node))
3862 if (document.activeElement == graph.cellEditor.textarea)
3864 selState = graph.cellEditor.saveSelection();
3870 if (document.activeElement == graph.cellEditor.textarea)
3872 selState = graph.cellEditor.saveSelection();
3914 graph.insertColumn(currentTable, (tableCell != null) ? tableCell.cellIndex : 0);
3929 graph.insertColumn(currentTable, (tableCell != null) ? tableCell.cellIndex + 1 : -1);
3944 graph.deleteColumn(currentTable, tableCell.cellIndex);
3959 graph.insertRow(currentTable, tableRow.sectionRowIndex);
3974 graph.insertRow(currentTable, tableRow.sectionRowIndex + 1);
3989 graph.deleteRow(currentTable, tableRow.sectionRowIndex);
4025 graph.processElements(targetElt, function(elt)
4060 graph.processElements(targetElt, function(elt)
4264 graph.getModel().addListener(mxEvent.CHANGE, listener);
4265 this.listeners.push({destroy: function() { graph.getModel().removeListener(listener); }});
4268 if (graph.cellEditor.isContentEditing())
4280 var node = graph.getSelectedEditingElement();
4350 if (graph.getParentByName(node, name, graph.cellEditor.textarea) != null)
4400 if (!graph.cellEditor.isTableSelected())
4402 …var align = graph.cellEditor.align || mxUtils.getValue(ss.style, mxConstants.STYLE_ALIGN, mxConsta…
4427 currentTable = graph.getParentByName(node, 'TABLE', graph.cellEditor.textarea);
4428 tableRow = (currentTable == null) ? null : graph.getParentByName(node, 'TR', currentTable);
4429 …tableCell = (currentTable == null) ? null : graph.getParentByNames(node, ['TD', 'TH'], currentTabl…
4523 mxEvent.addListener(graph.cellEditor.textarea, 'DOMSubtreeModified', updateCssHandler);
4526 mxEvent.addListener(graph.cellEditor.textarea, 'input', updateCssHandler);
4527 mxEvent.addListener(graph.cellEditor.textarea, 'touchend', updateCssHandler);
4528 mxEvent.addListener(graph.cellEditor.textarea, 'mouseup', updateCssHandler);
4529 mxEvent.addListener(graph.cellEditor.textarea, 'keyup', updateCssHandler);
4563 var graph = editor.graph;
4618 var graph = ui.editor.graph;
4667 var graph = ui.editor.graph;
4703 graph.setCellStyles(mxConstants.STYLE_IMAGE, 'data:image/svg+xml,' +
4786 var graph = ui.editor.graph;
4815 …var defs = (ss.vertices.length >= 1) ? graph.stylesheet.getDefaultVertexStyle() : graph.stylesheet…
4829 graph.updateCellStyles(mxConstants.STYLE_GRADIENTCOLOR, color, graph.getSelectionCells());
4837 graph.setCellStyles(fillKey, color, ss.cells);
4838 }), graph.shapeBackgroundColor);
4899 graph.getModel().addListener(mxEvent.CHANGE, listener);
4900 this.listeners.push({destroy: function() { graph.getModel().removeListener(listener); }});
4905 graph.setCellStyles(mxConstants.STYLE_GRADIENT_DIRECTION, gradientSelect.value, ss.cells);
4913 graph.setCellStyles('fillStyle', fillStyleSelect.value, ss.cells);
4955 var graph = ui.editor.graph;
4994 graph.getModel().beginUpdate();
5012 graph.setCellStyles(keys[i], values[i], ss.cells);
5020 graph.getModel().endUpdate();
5037 graph.setCellStyles(strokeKey, color, ss.cells);
5038 }), graph.shapeForegroundColor);
5129 graph.setCellStyles(mxConstants.STYLE_STROKEWIDTH, value, ss.cells);
5146 graph.setCellStyles(mxConstants.STYLE_STROKEWIDTH, value, ss.cells);
5680 graph.getModel().addListener(mxEvent.CHANGE, listener);
5681 this.listeners.push({destroy: function() { graph.getModel().removeListener(listener); }});
5701 var graph = editor.graph;
5735 graph.getModel().beginUpdate();
5738 graph.setCellStyles('jumpStyle', styleSelect.value, ss.cells);
5744 graph.getModel().endUpdate();
5782 graph.getModel().addListener(mxEvent.CHANGE, listener);
5783 this.listeners.push({destroy: function() { graph.getModel().removeListener(listener); }});
5801 var graph = editor.graph;
5871 graph.getModel().addListener(mxEvent.CHANGE, listener);
5872 this.listeners.push({destroy: function() { graph.getModel().removeListener(listener); }});
5916 var graph = editor.graph;
5934 var graph = editor.graph;
5935 var model = graph.getModel();
5939 var sketch = graph.currentVertexStyle['sketch'] == '1' && graph.currentEdgeStyle['sketch'] == '1';
5940 var rounded = graph.currentVertexStyle['rounded'] == '1';
5941 var curved = graph.currentEdgeStyle['curved'] == '1';
5979 graph.currentEdgeStyle['sketch'] = '1';
5980 graph.currentVertexStyle['sketch'] = '1';
5984 delete graph.currentEdgeStyle['sketch'];
5985 delete graph.currentVertexStyle['sketch'];
5988 graph.updateCellStyles('sketch', (checked) ? '1' : null, graph.getVerticesAndEdges());
6004 graph.currentEdgeStyle['rounded'] = '1';
6005 graph.currentVertexStyle['rounded'] = '1';
6009 delete graph.currentEdgeStyle['rounded'];
6010 delete graph.currentVertexStyle['rounded'];
6013 graph.updateCellStyles('rounded', (checked) ? '1' : '0', graph.getVerticesAndEdges());
6036 graph.currentEdgeStyle['curved'] = '1';
6040 delete graph.currentEdgeStyle['curved'];
6043 graph.updateCellStyles('curved', (checked) ? '1' : null, graph.getVerticesAndEdges(false, true));
6056 var cells = graph.getVerticesAndEdges();
6063 var style = graph.getCellStyle(cells[i]);
6068 graph.updateCellStyles('labelBackgroundColor', (graphStyle != null) ?
6074 var current = (edge) ? graph.currentEdgeStyle : graph.currentVertexStyle;
6122 theGraph = (theGraph != null) ? theGraph : graph;
6153 var all = graph.getVerticesAndEdges(true, true);
6160 graph.updateCellStyles('sketch', null, all);
6161 graph.updateCellStyles('rounded', null, all);
6162 graph.updateCellStyles('curved', null, graph.getVerticesAndEdges(false, true));
6190 var graph2 = new Graph(div, null, null, graph.getStylesheet());
6204 var defaultStyle = graph.stylesheet.getDefaultVertexStyle();
6209 defaultStyle = graph.stylesheet.getDefaultEdgeStyle();
6282 graph.currentVertexStyle = mxUtils.clone(graph.defaultVertexStyle);
6283 graph.currentEdgeStyle = mxUtils.clone(graph.defaultEdgeStyle);
6285 applyStyle(commonStyle, graph.currentVertexStyle);
6286 applyStyle(commonStyle, graph.currentEdgeStyle);
6287 applyStyle(vertexStyle, graph.currentVertexStyle);
6288 applyStyle(edgeStyle, graph.currentEdgeStyle);
6292 graph.currentEdgeStyle['sketch'] = '1';
6293 graph.currentVertexStyle['sketch'] = '1';
6297 graph.currentEdgeStyle['sketch'] = '0';
6298 graph.currentVertexStyle['sketch'] = '0';
6303 graph.currentVertexStyle['rounded'] = '1';
6304 graph.currentEdgeStyle['rounded'] = '1';
6308 graph.currentVertexStyle['rounded'] = '0';
6309 graph.currentEdgeStyle['rounded'] = '1';
6314 graph.currentEdgeStyle['curved'] = '1';
6318 graph.currentEdgeStyle['curved'] = '0';
6331 graphStyle.gridColor : graph.view.defaultGridColor));
6341 var prev = graph.getCellStyle;
6342 var prevBg = graph.background;
6343 var prevGrid = graph.view.gridColor;
6345 graph.background = (graphStyle != null) ? graphStyle.background : null;
6346 graph.view.gridColor = (graphStyle != null && graphStyle.gridColor != null) ?
6347 graphStyle.gridColor : graph.view.defaultGridColor;
6349 graph.getCellStyle = function(cell)
6353 var defaultStyle = graph.stylesheet.getDefaultVertexStyle();
6358 defaultStyle = graph.stylesheet.getDefaultEdgeStyle();
6374 graph.refresh();
6375 graph.getCellStyle = prev;
6376 graph.background = prevBg;
6377 graph.view.gridColor = prevGrid;
6382 graph.refresh();
6413 addEntry(s.commonStyle, s.vertexStyle, s.edgeStyle, s.graph, i);
6575 var graph = editor.graph;
6579 if (graph.isEnabled())
6594 var graph = editor.graph;
6606 return graph.pageVisible;
6616 apply(graph.pageVisible);
6628 if (graph.isEnabled())
6633 return graph.background;
6639 graph.model.execute(change);
6646 apply(graph.background);
6672 ui.showBackgroundImageDialog(null, ui.editor.graph.backgroundImage);
6699 var graph = editor.graph;
6703 if (graph.isEnabled())
6708 return graph.connectionArrowsEnabled;
6718 apply(graph.connectionArrowsEnabled);
6732 return graph.connectionHandler.isEnabled();
6742 apply(graph.connectionHandler.isEnabled());
6756 return graph.graphHandler.guidesEnabled;
6766 apply(graph.graphHandler.guidesEnabled);
6788 var graph = ui.editor.graph;
6799 input.value = this.inUnit(graph.getGridSize()) + ' ' + this.getUnit();
6802 input.style.display = (graph.isGridEnabled()) ? '' : 'none';
6809 graph.container.focus();
6814 input.value = graph.getGridSize();
6815 graph.container.focus();
6825 if (value != graph.getGridSize())
6828 graph.setGridSize(value)
6844 var color = graph.view.gridColor;
6846 return (graph.isGridEnabled()) ? color : null;
6849 var enabled = graph.isGridEnabled();
6853 graph.setGridEnabled(false);
6857 graph.setGridEnabled(true);
6861 input.style.display = (graph.isGridEnabled()) ? '' : 'none';
6864 if (enabled != graph.isGridEnabled())
6866 graph.defaultGridEnabled = graph.isGridEnabled();
6869 }, Editor.isDarkMode() ? graph.view.defaultDarkGridColor : graph.view.defaultGridColor,
6875 apply((graph.isGridEnabled()) ? graph.view.gridColor : null);
6900 var graph = editor.graph;
6914 var graph = editor.graph;
6918 …var accessor = PageSetupDialog.addPageFormatPanel(div, 'formatpanel', graph.pageFormat, function(p…
6920 if (graph.pageFormat == null || graph.pageFormat.width != pageFormat.width ||
6921 graph.pageFormat.height != pageFormat.height)
6927 graph.model.execute(change);
6933 accessor.set(graph.pageFormat);
6937 accessor.set(graph.pageFormat);
6942 accessor.set(graph.pageFormat);
6948 graph.getModel().addListener(mxEvent.CHANGE, listener);
6949 this.listeners.push({destroy: function() { graph.getModel().removeListener(listener); }});