mxTerminalChangeCodec.js 935 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * Copyright (c) 2006-2015, JGraph Ltd
  3. * Copyright (c) 2006-2015, Gaudenz Alder
  4. */
  5. mxCodecRegistry.register(function()
  6. {
  7. /**
  8. * Class: mxTerminalChangeCodec
  9. *
  10. * Codec for <mxTerminalChange>s. This class is created and registered
  11. * dynamically at load time and used implicitly via <mxCodec> and
  12. * the <mxCodecRegistry>.
  13. *
  14. * Transient Fields:
  15. *
  16. * - model
  17. * - previous
  18. *
  19. * Reference Fields:
  20. *
  21. * - cell
  22. * - terminal
  23. */
  24. var codec = new mxObjectCodec(new mxTerminalChange(),
  25. ['model', 'previous'], ['cell', 'terminal']);
  26. /**
  27. * Function: afterDecode
  28. *
  29. * Restores the state by assigning the previous value.
  30. */
  31. codec.afterDecode = function(dec, node, obj)
  32. {
  33. obj.previous = obj.terminal;
  34. return obj;
  35. };
  36. // Returns the codec into the registry
  37. return codec;
  38. }());
  39. __mxOutput.mxTerminalChangeCodec = typeof mxTerminalChangeCodec !== 'undefined' ? mxTerminalChangeCodec : undefined;