From 92f3207b50a1caca07df5c5b238212af3358905b Mon Sep 17 00:00:00 2001 From: adhitya Date: Mon, 11 Apr 2016 15:10:54 +0000 Subject: Revert last two commits - Keyboard shortcuts are not working --- src/js/view/mxCellEditor.js | 522 ++ src/js/view/mxCellOverlay.js | 233 + src/js/view/mxCellRenderer.js | 1480 +++++ src/js/view/mxCellState.js | 375 ++ src/js/view/mxCellStatePreview.js | 223 + src/js/view/mxConnectionConstraint.js | 42 + src/js/view/mxEdgeStyle.js | 1302 ++++ src/js/view/mxGraph.js | 11176 ++++++++++++++++++++++++++++++++ src/js/view/mxGraphSelectionModel.js | 435 ++ src/js/view/mxGraphView.js | 2545 ++++++++ src/js/view/mxLayoutManager.js | 375 ++ src/js/view/mxMultiplicity.js | 257 + src/js/view/mxOutline.js | 649 ++ src/js/view/mxPerimeter.js | 484 ++ src/js/view/mxPrintPreview.js | 801 +++ src/js/view/mxSpaceManager.js | 460 ++ src/js/view/mxStyleRegistry.js | 70 + src/js/view/mxStylesheet.js | 266 + src/js/view/mxSwimlaneManager.js | 449 ++ src/js/view/mxTemporaryCellStates.js | 105 + 20 files changed, 22249 insertions(+) create mode 100644 src/js/view/mxCellEditor.js create mode 100644 src/js/view/mxCellOverlay.js create mode 100644 src/js/view/mxCellRenderer.js create mode 100644 src/js/view/mxCellState.js create mode 100644 src/js/view/mxCellStatePreview.js create mode 100644 src/js/view/mxConnectionConstraint.js create mode 100644 src/js/view/mxEdgeStyle.js create mode 100644 src/js/view/mxGraph.js create mode 100644 src/js/view/mxGraphSelectionModel.js create mode 100644 src/js/view/mxGraphView.js create mode 100644 src/js/view/mxLayoutManager.js create mode 100644 src/js/view/mxMultiplicity.js create mode 100644 src/js/view/mxOutline.js create mode 100644 src/js/view/mxPerimeter.js create mode 100644 src/js/view/mxPrintPreview.js create mode 100644 src/js/view/mxSpaceManager.js create mode 100644 src/js/view/mxStyleRegistry.js create mode 100644 src/js/view/mxStylesheet.js create mode 100644 src/js/view/mxSwimlaneManager.js create mode 100644 src/js/view/mxTemporaryCellStates.js (limited to 'src/js/view') diff --git a/src/js/view/mxCellEditor.js b/src/js/view/mxCellEditor.js new file mode 100644 index 0000000..2086cca --- /dev/null +++ b/src/js/view/mxCellEditor.js @@ -0,0 +1,522 @@ +/** + * $Id: mxCellEditor.js,v 1.62 2012-12-11 16:59:31 gaudenz Exp $ + * Copyright (c) 2006-2010, JGraph Ltd + */ +/** + * Class: mxCellEditor + * + * In-place editor for the graph. To control this editor, use + * , and + * . If is true then + * ctrl-enter or shift-enter can be used to create a linefeed. The F2 and + * escape keys can always be used to stop editing. To customize the location + * of the textbox in the graph, override as follows: + * + * (code) + * graph.cellEditor.getEditorBounds = function(state) + * { + * var result = mxCellEditor.prototype.getEditorBounds.apply(this, arguments); + * + * if (this.graph.getModel().isEdge(state.cell)) + * { + * result.x = state.getCenterX() - result.width / 2; + * result.y = state.getCenterY() - result.height / 2; + * } + * + * return result; + * }; + * (end) + * + * The textarea uses the mxCellEditor CSS class. You can modify this class in + * your custom CSS. Note: You should modify the CSS after loading the client + * in the page. + * + * Example: + * + * To only allow numeric input in the in-place editor, use the following code. + * + * (code) + * var text = graph.cellEditor.textarea; + * + * mxEvent.addListener(text, 'keydown', function (evt) + * { + * if (!(evt.keyCode >= 48 && evt.keyCode <= 57) && + * !(evt.keyCode >= 96 && evt.keyCode <= 105)) + * { + * mxEvent.consume(evt); + * } + * }); + * (end) + * + * Initial values: + * + * To implement an initial value for cells without a label, use the + * variable. + * + * Resize in Chrome: + * + * Resize of the textarea is disabled by default. If you want to enable + * this feature extend and set this.textarea.style.resize = ''. + * + * Constructor: mxCellEditor + * + * Constructs a new in-place editor for the specified graph. + * + * Parameters: + * + * graph - Reference to the enclosing . + */ +function mxCellEditor(graph) +{ + this.graph = graph; +}; + +/** + * Variable: graph + * + * Reference to the enclosing . + */ +mxCellEditor.prototype.graph = null; + +/** + * Variable: textarea + * + * Holds the input textarea. Note that this may be null before the first + * edit. Instantiated in . + */ +mxCellEditor.prototype.textarea = null; + +/** + * Variable: editingCell + * + * Reference to the that is currently being edited. + */ +mxCellEditor.prototype.editingCell = null; + +/** + * Variable: trigger + * + * Reference to the event that was used to start editing. + */ +mxCellEditor.prototype.trigger = null; + +/** + * Variable: modified + * + * Specifies if the label has been modified. + */ +mxCellEditor.prototype.modified = false; + +/** + * Variable: emptyLabelText + * + * Text to be displayed for empty labels. Default is ''. This can be set + * to eg. "[Type Here]" to easier visualize editing of empty labels. The + * value is only displayed before the first keystroke and is never used + * as the actual editin value. + */ +mxCellEditor.prototype.emptyLabelText = ''; + +/** + * Variable: textNode + * + * Reference to the label DOM node that has been hidden. + */ +mxCellEditor.prototype.textNode = ''; + +/** + * Function: init + * + * Creates the