Lines Matching refs:graph

15 	var graph = this.editor.graph;
16 graph.lightbox = lightbox;
19 var graphGetGraphBounds = graph.getGraphBounds;
21 graph.getGraphBounds = function(img) method
41 if (graph.useCssTransforms)
66 graph.isEnabled = function() { return false; }; method
67 graph.panningHandler.isForcePanningEvent = function(me) method
77 if (!graph.standalone)
97 var state = graph.view.getState(cell);
104 var defaultStyle = graph.getCellStyle(clone);
118 var cellStyle = graph.getModel().getStyle(state.cell);
140 if (graph.getModel().isEdge(state.cell))
142 graph.currentEdgeStyle = {};
146 graph.currentVertexStyle = {}
160 graph.currentEdgeStyle = mxUtils.clone(graph.defaultEdgeStyle);
161 graph.currentVertexStyle = mxUtils.clone(graph.defaultVertexStyle);
213 vertexStyle = (vertexStyle != null) ? vertexStyle : graph.currentVertexStyle;
214 edgeStyle = (edgeStyle != null) ? edgeStyle : graph.currentEdgeStyle;
217 model = (model != null) ? model : graph.getModel();
326 graph.addListener('cellsInserted', function(sender, evt)
331 graph.addListener('textInserted', function(sender, evt)
350 return graph.isEditing() || (evt != null && this.isSelectionAllowed(evt));
415 graph.panningHandler.usePopupTrigger = false;
419 graph.init(this.diagramContainer);
422 if (mxClient.IS_SVG && graph.view.getDrawPane() != null)
424 var root = graph.view.getDrawPane().ownerSVGElement;
436 if (graph.graphHandler != null)
438 var graphHandlerStart = graph.graphHandler.start;
440 graph.graphHandler.start = function()
480 if (evt.which == 32 /* Space */ && !graph.isEditing())
484 graph.container.style.cursor = 'move';
487 if (!graph.isEditing() && mxEvent.getSource(evt) == graph.container)
502 graph.container.style.cursor = '';
509 var panningHandlerIsForcePanningEvent = graph.panningHandler.isForcePanningEvent;
510 graph.panningHandler.isForcePanningEvent = function(me) method
523 var cellEditorIsStopEditingEvent = graph.cellEditor.isStopEditingEvent;
524 graph.cellEditor.isStopEditingEvent = function(evt) method
533 var graphIsZoomWheelEvent = graph.isZoomWheelEvent;
535 graph.isZoomWheelEvent = function() method
548 if (this.toolbar != null && textMode != graph.cellEditor.isContentEditing())
586 textMode = graph.cellEditor.isContentEditing();
596 var cellEditorStartEditing = graph.cellEditor.startEditing;
597 graph.cellEditor.startEditing = function() method
602 if (graph.cellEditor.isContentEditing())
614 var node = graph.getSelectedEditingElement();
632 mxEvent.addListener(graph.cellEditor.textarea, 'input', updateCssHandler)
633 mxEvent.addListener(graph.cellEditor.textarea, 'touchend', updateCssHandler);
634 mxEvent.addListener(graph.cellEditor.textarea, 'mouseup', updateCssHandler);
635 mxEvent.addListener(graph.cellEditor.textarea, 'keyup', updateCssHandler);
641 var cellEditorStopEditing = graph.cellEditor.stopEditing;
642 graph.cellEditor.stopEditing = function(cell, trigger) method
656 graph.container.setAttribute('tabindex', '0');
657 graph.container.style.cursor = 'default';
660 if (window.self === window.top && graph.container.parentNode != null)
664 graph.container.focus();
673 var graphFireMouseEvent = graph.fireMouseEvent;
674 graph.fireMouseEvent = function(evtName, me, sender) method
685 graph.popupMenuHandler.autoExpand = true;
690 graph.popupMenuHandler.factoryMethod = mxUtils.bind(this, function(menu, cell, evt)
699 graph.popupMenuHandler.hideMenu();
711 graph.connectionHandler.addListener(mxEvent.CONNECT, function(sender, evt)
723 ui.hoverIcons.update(graph.view.getState(cells[cells.length - 1]));
742 vertex = graph.getModel().isVertex(cells[i]) || vertex;
743 edge = graph.getModel().isEdge(cells[i]) || edge;
774 delete graph.currentEdgeStyle[keys[i]];
778 graph.currentEdgeStyle[keys[i]] = values[i];
786 delete graph.currentVertexStyle[keys[i]];
790 graph.currentVertexStyle[keys[i]] = values[i];
800 delete graph.currentVertexStyle[keys[i]];
804 graph.currentVertexStyle[keys[i]] = values[i];
812 delete graph.currentEdgeStyle[keys[i]];
816 graph.currentEdgeStyle[keys[i]] = values[i];
825 this.toolbar.setFontName(graph.currentVertexStyle['fontFamily'] || Menus.prototype.defaultFont);
826 … this.toolbar.setFontSize(graph.currentVertexStyle['fontSize'] || Menus.prototype.defaultFontSize);
833 …if (graph.currentEdgeStyle['edgeStyle'] == 'orthogonalEdgeStyle' && graph.currentEdgeStyle['curved…
837 …else if (graph.currentEdgeStyle['edgeStyle'] == 'straight' || graph.currentEdgeStyle['edgeStyle'] …
838 graph.currentEdgeStyle['edgeStyle'] == null)
842 else if (graph.currentEdgeStyle['edgeStyle'] == 'entityRelationEdgeStyle')
846 else if (graph.currentEdgeStyle['edgeStyle'] == 'elbowEdgeStyle')
848 … edgeStyleDiv.className = 'geSprite geSprite-' + ((graph.currentEdgeStyle['elbow'] == 'vertical') ?
851 else if (graph.currentEdgeStyle['edgeStyle'] == 'isometricEdgeStyle')
853 … edgeStyleDiv.className = 'geSprite geSprite-' + ((graph.currentEdgeStyle['elbow'] == 'vertical') ?
867 if (graph.currentEdgeStyle['shape'] == 'link')
871 else if (graph.currentEdgeStyle['shape'] == 'flexArrow')
875 else if (graph.currentEdgeStyle['shape'] == 'arrow')
891 graph.currentEdgeStyle['shape'], graph.currentEdgeStyle[mxConstants.STYLE_STARTARROW],
892 mxUtils.getValue(graph.currentEdgeStyle, 'startFill', '1'));
901 graph.currentEdgeStyle['shape'], graph.currentEdgeStyle[mxConstants.STYLE_ENDARROW],
902 mxUtils.getValue(graph.currentEdgeStyle, 'endFill', '1'));
912 var ff = graph.currentVertexStyle['fontFamily'] || 'Helvetica';
913 var fs = String(graph.currentVertexStyle['fontSize'] || '12');
914 var state = graph.getView().getState(graph.getSelectionCell());
931 graph.getSelectionModel().addListener(mxEvent.CHANGE, update);
932 graph.getModel().addListener(mxEvent.CHANGE, update);
936 graph.addListener(mxEvent.CELLS_ADDED, function(sender, evt)
941 if (parent != null && graph.getModel().isLayer(parent) &&
942 !graph.isCellVisible(parent) && cells != null &&
945 graph.getModel().setVisible(parent, true);
967 if (this.editor.graph != null)
1008 graph.view.validateBackground();
1013 graph.view.validateBackground();
1019 graph.addListener('gridSizeChanged', mxUtils.bind(this, function()
1021 if (graph.isGridEnabled())
1023 graph.view.validateBackground();
1033 if (!graph.standalone)
1113 var graph = this.editor.graph;
1115 if (!graph.standalone)
1123 mxEvent.addListener(graph.container, 'scroll', mxUtils.bind(this, function()
1125 graph.tooltipHandler.hide();
1127 if (graph.connectionHandler != null && graph.connectionHandler.constraintHandler != null)
1129 graph.connectionHandler.constraintHandler.reset();
1134 graph.addListener(mxEvent.ESCAPE, mxUtils.bind(this, function()
1136 graph.tooltipHandler.hide();
1137 var rb = graph.getRubberband();
1145 mxEvent.addListener(graph.container, 'keydown', mxUtils.bind(this, function(evt)
1150 mxEvent.addListener(graph.container, 'keypress', mxUtils.bind(this, function(evt)
1159 graph.getSelectionModel().addListener(mxEvent.CHANGE, mxUtils.bind(this, function()
1164 graph.getModel().addListener(mxEvent.CHANGE, mxUtils.bind(this, function()
1170 var graphSetDefaultParent = graph.setDefaultParent;
1173 this.editor.graph.setDefaultParent = function()
1180 graph.editLink = ui.actions.get('editLink').funct;
1198 var graph = this.editor.graph;
1202 graph.addListener(mxEvent.FIRE_MOUSE_EVENT, mxUtils.bind(this, function(sender, evt)
1215 graph.addListener('wheel', hidePicker);
1216 graph.addListener(mxEvent.ESCAPE, hidePicker);
1217 graph.view.addListener(mxEvent.SCALE, hidePicker);
1218 graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE, hidePicker);
1219 graph.getSelectionModel().addListener(mxEvent.CHANGE, hidePicker);
1220 graph.getModel().addListener(mxEvent.CHANGE, hidePicker);
1223 var popupMenuHandlerIsMenuShowing = graph.popupMenuHandler.isMenuShowing;
1225 graph.popupMenuHandler.isMenuShowing = function()
1231 var graphDblClick = graph.dblClick;
1233 graph.dblClick = function(evt, cell)
1238 !graph.isCellLocked(graph.getDefaultParent()))
1273 if (!this.graph.isCloneEvent(evt) && !mxEvent.isShiftDown(evt))
1275 …this.graph.connectVertex(state.cell, dir, this.graph.defaultEdgeLength, evt, null, null, mxUtils.b…
1277 var temp = graph.getCompositeParent(state.cell);
1278 var geo = graph.getCellGeometry(temp);
1281 while (temp != null && graph.model.isVertex(temp) && geo != null && geo.relative)
1284 temp = graph.model.getParent(cell)
1285 geo = graph.getCellGeometry(temp);
1297 ui.hoverIcons.update(graph.view.getState(cell));
1303 this.graph.selectCellsForConnectVertex(result, evt, this);
1328 var offset = mxUtils.getOffset(graph.container);
1329 var x = graph.container.scrollLeft + rect.x - offset.x;
1330 var y = graph.container.scrollTop + rect.y - offset.y;
1332 var temp = graph.getCompositeParent((this.hoverIcons.currentState != null) ?
1338graph.connectVertex(temp, dir, graph.defaultEdgeLength, mouseEvent, true, true, function(x, y, exe…
1344 ui.hoverIcons.update(graph.view.getState(cell));
1348 graph.selectCellsForConnectVertex(cells);
1432 var graph = this.editor.graph;
1433 graph.popupMenuHandler.hideMenu();
1434 graph.tooltipHandler.hideTooltip();
1455 var graph = this.editor.graph;
1457 var sourceState = graph.view.getState(source);
1459 !graph.isTransparentState(sourceState))) ?
1460 graph.copyStyle(source) : null;
1475 if (graph.background != null && graph.background != mxConstants.NONE)
1477 div.style.backgroundColor = graph.background;
1480 graph.container.appendChild(div);
1493 this.sidebar.graph.pasteStyle(style, [cell]);
1497 …ui.insertHandler([cell], cell.value != '' && urlParams['sketch'] != '1', this.sidebar.graph.model);
1504 var clone = graph.cloneCell(cell);
1512 clone.geometry.x = graph.snap(Math.round(x / graph.view.scale) -
1513 graph.view.translate.x - cell.geometry.width / 2);
1514 clone.geometry.y = graph.snap(Math.round(y / graph.view.scale) -
1515 graph.view.translate.y - cell.geometry.height / 2);
1517 graph.model.beginUpdate();
1520 graph.addCell(clone);
1524 graph.model.endUpdate();
1527 graph.setSelectionCell(clone);
1528 graph.scrollCellToVisible(clone);
1529 graph.startEditingAtCell(clone);
1533 ui.hoverIcons.update(graph.view.getState(clone));
1549 var b = graph.container.scrollTop + graph.container.offsetHeight;
1554 div.style.top = Math.max(graph.container.scrollTop + 22, y - dy) + 'px';
1557 var r = graph.container.scrollLeft + graph.container.offsetWidth;
1562 div.style.left = Math.max(graph.container.scrollLeft + 22, x - dx) + 'px';
1576 …return this.editor.graph.createVertex(null, null, value || '', 0, 0, w || 120, h || 60, style, fal…
1579 return [(cell != null) ? this.editor.graph.cloneCell(cell) :
1622 var graph = this.editor.graph;
1625 if (evt.which == 9 && graph.isEnabled() && !mxEvent.isControlDown(evt))
1627 if (graph.isEditing())
1631 graph.stopEditing(false);
1637 if (graph.cellEditor.isContentEditing() && graph.cellEditor.isTextSelected())
1645 graph.stopEditing(false);
1650 graph.cellEditor.insertTab(!graph.cellEditor.isContentEditing() ? 4 : null);
1661 graph.selectParentCell();
1665 graph.selectCell(!mxEvent.isShiftDown(evt));
1677 var graph = this.editor.graph;
1680 …if (this.isImmediateEditingEvent(evt) && !graph.isEditing() && !graph.isSelectionEmpty() && evt.wh…
1683 graph.escape();
1684 graph.startEditing();
1689 var ce = graph.cellEditor;
1836 var graph = this.editor.graph;
1840 paste.setEnabled(this.editor.graph.cellEditor.isContentEditing() ||
1842 graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent())));
1854 mxClipboard.cut = function(graph) argument
1856 if (graph.cellEditor.isContentEditing())
1869 mxClipboard.copy = function(graph) argument
1873 if (graph.cellEditor.isContentEditing())
1879 result = result || graph.getSelectionCells();
1880 result = graph.getExportableCells(graph.model.getTopmostCells(result));
1883 var lookup = graph.createCellLookup(result);
1884 var clones = graph.cloneCells(result, null, cloneMap);
1897 var state = graph.view.getState(result[i]);
1901 var geo = graph.getCellGeometry(clones[i]);
1914 graph.updateCustomLinks(graph.createCellMapping(cloneMap, lookup), clones);
1926 mxClipboard.paste = function(graph) argument
1930 if (graph.cellEditor.isContentEditing())
1945 var cellEditorStartEditing = this.editor.graph.cellEditor.startEditing;
1947 this.editor.graph.cellEditor.startEditing = function()
1953 var cellEditorStopEditing = this.editor.graph.cellEditor.stopEditing;
1955 this.editor.graph.cellEditor.stopEditing = function(cell, trigger)
1985 var graph = this.editor.graph;
1986 graph.timerAutoScroll = true;
1991 graph.getPagePadding = function()
1993 return new mxPoint(Math.max(0, Math.round((graph.container.offsetWidth - 34) / graph.view.scale)),
1994 Math.max(0, Math.round((graph.container.offsetHeight - 34) / graph.view.scale)));
1998 graph.view.getBackgroundPageBounds = function()
2000 var layout = this.graph.getPageLayout();
2001 var page = this.graph.getPageSize();
2009 graph.getPreferredPageSize = function(bounds, width, height)
2025 if (graph.container != null && !graph.isViewer())
2030 … var bds = (graph.pageVisible) ? graph.view.getBackgroundPageBounds() : graph.getGraphBounds();
2031 var scroll = mxUtils.hasScrollbars(graph.container);
2032 var tr = graph.view.translate;
2033 var s = graph.view.scale;
2042 var st = graph.container.scrollTop;
2043 var sl = graph.container.scrollLeft;
2051 var cw = graph.container.offsetWidth - sb;
2052 var ch = graph.container.offsetHeight - sb;
2066 graph.view.scaleAndTranslate(ns, Math.floor(dx - b.x), Math.floor(dy - b.y));
2067 graph.container.scrollTop = st * ns / s;
2068 graph.container.scrollLeft = sl * ns / s;
2072 var t = graph.view.translate;
2073 graph.view.setTranslate(Math.floor(t.x + cx / s), Math.floor(t.y + cy / s));
2107 graph.zoomIn();
2112 graph.zoomOut();
2128 this.chromelessToolbar.style.left = (graph.isViewer()) ? '0' : '50%';
2145 var css = mxUtils.getCurrentStyle(graph.container);
2147 if (graph.isViewer())
2282 if (graph.isLightboxView())
2284 if (graph.view.scale == 1)
2290 graph.zoomTo(1);
2365 this.layersDialog = graph.createLayersDialog(null, true);
2398 var style = mxUtils.getCurrentStyle(this.editor.graph.container);
2409 var model = graph.getModel();
2436 graph.openLink(this.editor.editButtonLink, 'editWindow');
2475 graph.openLink(toolbarConfig.fullscreenBtn.url);
2479 graph.openLink(window.location.href);
2487 (graph.lightbox && (urlParams['close'] == '1' || this.container != document.body)))
2506 if (!graph.isViewer())
2511 graph.container.appendChild(this.chromelessToolbar);
2513 …mxEvent.addListener(graph.container, (mxClient.IS_POINTER) ? 'pointermove' : 'mousemove', mxUtils.…
2533 graph.tooltipHandler.resetTimer();
2534 graph.tooltipHandler.hideTooltip();
2569 var tol = graph.getTolerance();
2571 graph.addMouseListener(
2581 this.scrollLeft = graph.container.scrollLeft;
2582 this.scrollTop = graph.container.scrollTop;
2589 if ((Math.abs(this.scrollLeft - graph.container.scrollLeft) < tol &&
2590 Math.abs(this.scrollTop - graph.container.scrollTop) < tol) &&
2621 var graphViewValidate = graph.view.validate;
2622 graph.view.validate = function()
2624 if (this.graph.container != null && mxUtils.hasScrollbars(this.graph.container))
2626 var pad = this.graph.getPagePadding();
2627 var size = this.graph.getPageSize();
2640 if (!graph.isViewer())
2642 var graphSizeDidChange = graph.sizeDidChange;
2644 graph.sizeDidChange = function()
2656 var min = graph.minimumGraphSize;
2662 graph.minimumGraphSize = new mxRectangle(0, 0, minw, minh);
2678 var tx = graph.view.translate.x;
2679 var ty = graph.view.translate.y;
2680 graph.view.setTranslate(dx, dy);
2683 graph.container.scrollLeft += Math.round((dx - tx) * graph.view.scale);
2684 graph.container.scrollTop += Math.round((dy - ty) * graph.view.scale);
2704 var bgGroup = graph.view.getBackgroundPane();
2705 var mainGroup = graph.view.getDrawPane();
2706 graph.cumulativeZoomFactor = 1;
2722 if (!graph.isMouseDown || forcedZoom)
2726 if (graph.isFastZoomEnabled())
2729 if (graph.view.backgroundPageShape != null && graph.view.backgroundPageShape.node != null)
2731 … mxUtils.setPrefixedStyle(graph.view.backgroundPageShape.node.style, 'transform-origin', null);
2732 mxUtils.setPrefixedStyle(graph.view.backgroundPageShape.node.style, 'transform', null);
2758 graph.view.getDecoratorPane().style.opacity = '';
2759 graph.view.getOverlayPane().style.opacity = '';
2762 var sp = new mxPoint(graph.container.scrollLeft, graph.container.scrollTop);
2763 var offset = mxUtils.getOffset(graph.container);
2764 var prev = graph.view.scale;
2770 dx = graph.container.offsetWidth / 2 - cursorPosition.x + offset.x;
2771 dy = graph.container.offsetHeight / 2 - cursorPosition.y + offset.y;
2774 graph.zoom(graph.cumulativeZoomFactor);
2775 var s = graph.view.scale;
2787 ui.chromelessResize(false, null, dx * (graph.cumulativeZoomFactor - 1),
2788 dy * (graph.cumulativeZoomFactor - 1));
2791 if (mxUtils.hasScrollbars(graph.container) && (dx != 0 || dy != 0))
2793 graph.container.scrollLeft -= dx * (graph.cumulativeZoomFactor - 1);
2794 graph.container.scrollTop -= dy * (graph.cumulativeZoomFactor - 1);
2803 graph.cumulativeZoomFactor = 1;
2809 …}), (delay != null) ? delay : ((graph.isFastZoomEnabled()) ? ui.wheelZoomDelay : ui.lazyZoomDelay)…
2816 graph.lazyZoom = function(zoomIn, ignoreCursorPosition, delay)
2819 ignoreCursorPosition = ignoreCursorPosition || !graph.scrollbars;
2824 graph.container.offsetLeft + graph.container.clientWidth / 2,
2825 graph.container.offsetTop + graph.container.clientHeight / 2);
2868 if (graph.isFastZoomEnabled())
2876 scrollPosition = new mxPoint(graph.container.scrollLeft, graph.container.scrollTop);
2878 var cx = (ignoreCursorPosition) ? graph.container.scrollLeft + graph.container.clientWidth / 2 :
2879 cursorPosition.x + graph.container.scrollLeft - graph.container.offsetLeft;
2880 var cy = (ignoreCursorPosition) ? graph.container.scrollTop + graph.container.clientHeight / 2 :
2881 cursorPosition.y + graph.container.scrollTop - graph.container.offsetTop;
2887 if (graph.view.backgroundPageShape != null && graph.view.backgroundPageShape.node != null)
2889 var page = graph.view.backgroundPageShape.node;
2892 ((ignoreCursorPosition) ? ((graph.container.clientWidth / 2 + graph.container.scrollLeft -
2893 page.offsetLeft) + 'px') : ((cursorPosition.x + graph.container.scrollLeft -
2894 page.offsetLeft - graph.container.offsetLeft) + 'px')) + ' ' +
2895 ((ignoreCursorPosition) ? ((graph.container.clientHeight / 2 + graph.container.scrollTop -
2896 page.offsetTop) + 'px') : ((cursorPosition.y + graph.container.scrollTop -
2897 page.offsetTop - graph.container.offsetTop) + 'px')));
2902 graph.view.getDecoratorPane().style.opacity = '0';
2903 graph.view.getOverlayPane().style.opacity = '0';
2915 mxEvent.addGestureListeners(graph.container, function(evt)
2923 if (graph.cumulativeZoomFactor != 1)
2930 mxEvent.addListener(graph.container, 'scroll', function(evt)
2932 if (updateZoomTimeout != null && !graph.isMouseDown && graph.cumulativeZoomFactor != 1)
2940 graph.fireEvent(new mxEventObject('wheel'));
2945 if (!graph.scrollbars && !force && graph.isScrollWheelEvent(evt))
2947 var t = graph.view.getTranslate();
2948 var step = 40 / graph.view.scale;
2952 graph.view.setTranslate(t.x, t.y + ((up) ? step : -step));
2956 graph.view.setTranslate(t.x + ((up) ? -step : step), t.y);
2959 else if (force || graph.isZoomWheelEvent(evt))
2965 if (source == graph.container)
2967 graph.tooltipHandler.hideTooltip();
2971 graph.lazyZoom(up);
2981 }), graph.container);
2984 graph.panningHandler.zoomGraph = function(evt)
2986 graph.cumulativeZoomFactor = evt.scale;
2987 graph.lazyZoom(evt.scale > 0, true);
3033 this.editor.graph.addClickHandler(hl);
3060 this.editor.graph.view.setScale(1);
3073 this.editor.graph.maxFitScale = this.lightboxMaxFitScale;
3074 this.editor.graph.fit(border, null, null, null, null, null, maxHeight);
3075 this.editor.graph.maxFitScale = null;
3087 var model = this.editor.graph.getModel();
3170 this.editor.graph.view.validate();
3174 this.editor.graph.sizeDidChange();
3183 this.editor.graph.popupMenuHandler.hideMenu();
3254 return new HoverIcons(this.editor.graph);
3264 var graph = this.editor.graph;
3266 if (graph.isEditing())
3288 var graph = this.editor.graph;
3290 if (graph.isEditing())
3294 var value = graph.cellEditor.textarea.innerHTML;
3297 if (value == graph.cellEditor.textarea.innerHTML)
3299 graph.stopEditing(true);
3319 return this.editor.graph.isEditing() || this.editor.undoManager.canRedo();
3327 return this.editor.graph.isEditing() || this.editor.undoManager.canUndo();
3370 var graph = this.editor.graph;
3371 var prev = graph.container.style.overflow;
3372 graph.scrollbars = value;
3375 if (prev != graph.container.style.overflow)
3377 graph.container.scrollTop = 0;
3378 graph.container.scrollLeft = 0;
3379 graph.view.scaleAndTranslate(1, 0, 0);
3391 return this.editor.graph.scrollbars;
3399 var graph = this.editor.graph;
3403 graph.container.scrollTop = 0;
3404 graph.container.scrollLeft = 0;
3406 if (!mxUtils.hasScrollbars(graph.container))
3408 graph.view.setTranslate(0, 0);
3413 if (mxUtils.hasScrollbars(graph.container))
3415 if (graph.pageVisible)
3417 var pad = graph.getPagePadding();
3418 graph.container.scrollTop = Math.floor(pad.y - this.editor.initialTopSpacing) - 1;
3419 graph.container.scrollLeft = Math.floor(Math.min(pad.x,
3420 (graph.container.scrollWidth - graph.container.clientWidth) / 2)) - 1;
3423 var bounds = graph.getGraphBounds();
3427 if (bounds.x > graph.container.scrollLeft + graph.container.clientWidth * 0.9)
3429graph.container.scrollLeft = Math.min(bounds.x + bounds.width - graph.container.clientWidth, bound…
3432 if (bounds.y > graph.container.scrollTop + graph.container.clientHeight * 0.9)
3434graph.container.scrollTop = Math.min(bounds.y + bounds.height - graph.container.clientHeight, boun…
3440 var bounds = graph.getGraphBounds();
3441 var width = Math.max(bounds.width, graph.scrollTileSize.width * graph.view.scale);
3442 var height = Math.max(bounds.height, graph.scrollTileSize.height * graph.view.scale);
3443graph.container.scrollTop = Math.floor(Math.max(0, bounds.y - Math.max(20, (graph.container.client…
3444graph.container.scrollLeft = Math.floor(Math.max(0, bounds.x - Math.max(0, (graph.container.client…
3449 …var b = mxRectangle.fromRectangle((graph.pageVisible) ? graph.view.getBackgroundPageBounds() : gra…
3450 var tr = graph.view.translate;
3451 var s = graph.view.scale;
3457 … var dy = (graph.pageVisible) ? 0 : Math.max(0, (graph.container.clientHeight - b.height) / 4);
3459 graph.view.setTranslate(Math.floor(Math.max(0,
3460 (graph.container.clientWidth - b.width) / 2) - b.x + 2),
3471 var graph = this.editor.graph;
3472 var hasScrollbars = mxUtils.hasScrollbars(graph.container);
3478 tx = graph.view.translate.x * graph.view.scale - graph.container.scrollLeft;
3479 ty = graph.view.translate.y * graph.view.scale - graph.container.scrollTop;
3482 graph.pageVisible = value;
3483 graph.pageBreaksVisible = value;
3484 graph.preferPageSize = value;
3485 graph.view.validateBackground();
3490 var cells = graph.getSelectionCells();
3491 graph.clearSelection();
3492 graph.setSelectionCells(cells);
3496 graph.sizeDidChange();
3500 graph.container.scrollLeft = graph.view.translate.x * graph.view.scale - tx;
3501 graph.container.scrollTop = graph.view.translate.y * graph.view.scale - ty;
3504 graph.defaultPageVisible = value;
3524 var temp = this.ui.editor.graph.view.gridColor;
3562 var graph = this.ui.editor.graph;
3567 var tmp = graph.background;
3575 var tmp = graph.backgroundImage;
3590 var tmp = graph.pageFormat;
3600 if (this.foldingEnabled != null && this.foldingEnabled != this.ui.editor.graph.foldingEnabled)
3608 var currentPageScale = this.ui.editor.graph.pageScale;
3646 this.editor.graph.background = value;
3647 this.editor.graph.view.validateBackground();
3657 this.editor.graph.foldingEnabled = value;
3658 this.editor.graph.view.revalidate();
3669 this.editor.graph.pageFormat = value;
3673 if (!this.editor.graph.pageVisible)
3679 this.editor.graph.view.validateBackground();
3680 this.editor.graph.sizeDidChange();
3692 this.editor.graph.pageScale = value;
3694 if (!this.editor.graph.pageVisible)
3700 this.editor.graph.view.validateBackground();
3701 this.editor.graph.sizeDidChange();
3712 this.editor.graph.view.gridColor = value;
3713 this.editor.graph.view.validateBackground();
3739 var cellEditorStartEditing = this.editor.graph.cellEditor.startEditing;
3741 this.editor.graph.cellEditor.startEditing = function()
3747 var cellEditorStopEditing = this.editor.graph.cellEditor.stopEditing;
3749 this.editor.graph.cellEditor.stopEditing = function(cell, trigger)
3764 var graph = this.editor.graph;
3771 var cells = graph.getSelectionCells();
3779 if (graph.isCellEditable(cell))
3784 if (graph.getModel().isEdge(cell))
3789 if (graph.getModel().isVertex(cell))
3793 if (graph.getModel().getChildCount(cell) > 0 ||
3794 graph.isContainer(cell))
3815 this.actions.get('lockUnlock').setEnabled(!graph.isSelectionEmpty());
3816 this.actions.get('setAsDefaultStyle').setEnabled(graph.getSelectionCount() == 1);
3818 this.actions.get('copySize').setEnabled(graph.getSelectionCount() == 1);
3821 this.actions.get('turn').setEnabled(graph.getResizableCells(graph.getSelectionCells()).length > 0);
3826 var oneVertexSelected = vertexSelected && graph.getSelectionCount() == 1;
3827 this.actions.get('group').setEnabled(graph.getSelectionCount() > 1 ||
3828 (oneVertexSelected && !graph.isContainer(graph.getSelectionCell())));
3831 graph.getModel().isVertex(graph.getModel().getParent(editable[0])));
3834 var state = graph.view.getState(graph.getSelectionCell());
3835 this.menus.get('navigation').setEnabled(selected || graph.view.currentRoot != null);
3837 …(graph.isContainer(graph.getSelectionCell()) || graph.model.getChildCount(graph.getSelectionCell()…
3838 this.actions.get('home').setEnabled(graph.view.currentRoot != null);
3839 this.actions.get('exitGroup').setEnabled(graph.view.currentRoot != null);
3840 …this.actions.get('enterGroup').setEnabled(graph.getSelectionCount() == 1 && graph.isValidRoot(grap…
3841 …var foldable = graph.getSelectionCount() == 1 && graph.isCellFoldable(graph.getSelectionCell()); /…
3845 this.actions.get('openLink').setEnabled(graph.getSelectionCount() == 1 &&
3846 graph.getLinkForCell(graph.getSelectionCell()) != null);
3847 this.actions.get('guides').setEnabled(graph.isEnabled());
3850 var unlocked = graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent());
3854 this.menus.get('align').setEnabled(unlocked && vertexSelected && graph.getSelectionCount() > 1);
3855 …this.menus.get('distribute').setEnabled(unlocked && vertexSelected && graph.getSelectionCount() > …
3980 this.editor.graph.sizeDidChange();
4327 this.editor.graph.tooltipHandler.resetTimer();
4328 this.editor.graph.tooltipHandler.hideTooltip();
4363 if (this.dialog == null && this.editor.graph.container.style.visibility != 'hidden')
4367 if (this.editor.graph.isEditing() && this.editor.graph.cellEditor.textarea != null)
4369 this.editor.graph.cellEditor.textarea.focus();
4374 this.editor.graph.container.focus();
4386 var graph = this.editor.graph;
4388 if (graph.isEnabled())
4392 var cells = graph.getSelectionCells();
4399 var cell = (graph.isTableCell(cells[i])) ? graph.model.getParent(cells[i]) : cells[i];
4408 graph.setSelectionCells(graph.duplicateCells(newCells, false));
4422 var graph = this.editor.graph;
4423 var selState = graph.cellEditor.saveSelection();
4429 graph.cellEditor.restoreSelection(selState);
4433 graph.cellEditor.restoreSelection(selState);
4631 this.editor.graph.sanitizeHtml(data);
4826 if (this.editor.graph.isEditing())
4828 this.editor.graph.stopEditing();
4878 var graph = this.editor.graph;
4880 if (graph.isEnabled())
4882 graph.getModel().beginUpdate();
4899 var morph = new mxMorphing(graph);
4902 graph.getModel().endUpdate();
4914 graph.getModel().endUpdate();
4930 var cellEditor = this.editor.graph.cellEditor;
4990 this.editor.graph.model.execute(change);
5022 this.editor.graph.setBackgroundImage(image);
5023 this.editor.graph.view.validateBackgroundImage();
5051 var outline = new mxOutline(this.editor.graph);
5079 var graph = this.editor.graph;
5080 var keyHandler = new mxKeyHandler(graph);
5091 !this.isControlDown(evt) || (this.graph.cellEditor.isContentEditing() &&
5113 if (!graph.isSelectionEmpty() && graph.isEnabled())
5120 graph.getModel().beginUpdate();
5123 var cells = graph.getSelectionCells();
5127 if (graph.getModel().isVertex(cells[i]) && graph.isCellResizable(cells[i]))
5129 var geo = graph.getCellGeometry(cells[i]);
5152 graph.getModel().setGeometry(cells[i], geo);
5159 graph.getModel().endUpdate();
5165 var cell = graph.getSelectionCell();
5166 var parent = graph.model.getParent(cell);
5167 var scale = graph.getView().scale;
5170 if (graph.getSelectionCount() == 1 && graph.model.isVertex(cell) &&
5171 graph.layoutManager != null && !graph.isCellLocked(cell))
5173 layout = graph.layoutManager.getLayout(parent);
5182 graph.model.add(parent, cell, Math.max(0, index - 1));
5186 graph.model.add(parent, cell, Math.min(graph.model.getChildCount(parent), index + 1));
5191 var handler = graph.graphHandler;
5197 handler.start(graph.getSelectionCell(),
5198 0, 0, graph.getSelectionCells());
5259 if (graph.isEnabled())
5272 if (directions[evt.keyCode] != null && !graph.isSelectionEmpty())
5277 if (graph.model.isVertex(graph.getSelectionCell()))
5281 var cells = graph.connectVertex(graph.getSelectionCell(), directions[evt.keyCode],
5282 graph.defaultEdgeLength, evt, true);
5286 if (cells.length == 1 && graph.model.isEdge(cells[0]))
5288 graph.setSelectionCell(graph.model.getTerminal(cells[0], false));
5292 graph.setSelectionCell(cells[cells.length - 1]);
5295 graph.scrollCellToVisible(graph.getSelectionCell());
5299 editorUi.hoverIcons.update(graph.view.getState(graph.getSelectionCell()));
5313 nudge(evt.keyCode, (mxEvent.isShiftDown(evt)) ? graph.gridSize : null, true);
5320 nudge(evt.keyCode, (mxEvent.isShiftDown(evt)) ? graph.gridSize : null);
5381 keyHandler.bindControlShiftKey(36, function() { graph.exitGroup(); }); // Ctrl+Shift+Home
5382 keyHandler.bindControlShiftKey(35, function() { graph.enterGroup(); }); // Ctrl+Shift+End
5383 keyHandler.bindShiftKey(36, function() { graph.home(); }); // Ctrl+Shift+Home
5384 keyHandler.bindKey(35, function() { graph.refresh(); }); // End
5392 …keyHandler.bindControlKey(36, function() { if (graph.isEnabled()) { graph.foldCells(true); }}); //…
5393 …keyHandler.bindControlKey(35, function() { if (graph.isEnabled()) { graph.foldCells(false); }}); /…
5437 …keyHandler.bindKey(113, function() { if (graph.isEnabled()) { graph.startEditingAtCell(); }}); // …