DriveLibrary.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // $Id = DriveFile.js,v 1.12 2010-01-02 09 =45 =14 gaudenz Exp $
  2. // Copyright (c) 2006-2014, JGraph Ltd
  3. /**
  4. * Constructs a new point for the optional x and y coordinates. If no
  5. * coordinates are given, then the default values for <x> and <y> are used.
  6. * @constructor
  7. * @class Implements a basic 2D point. Known subclassers = {@link mxRectangle}.
  8. * @param {number} x X-coordinate of the point.
  9. * @param {number} y Y-coordinate of the point.
  10. */
  11. DriveLibrary = function(ui, data, desc)
  12. {
  13. DriveFile.call(this, ui, data);
  14. this.desc = desc;
  15. };
  16. //Extends mxEventSource
  17. mxUtils.extend(DriveLibrary, DriveFile);
  18. /**
  19. * Translates this point by the given vector.
  20. *
  21. * @param {number} dx X-coordinate of the translation.
  22. * @param {number} dy Y-coordinate of the translation.
  23. */
  24. DriveLibrary.prototype.isAutosave = function()
  25. {
  26. return false;
  27. };
  28. /**
  29. * Translates this point by the given vector.
  30. *
  31. * @param {number} dx X-coordinate of the translation.
  32. * @param {number} dy Y-coordinate of the translation.
  33. */
  34. DriveLibrary.prototype.save = function(revision, success, error)
  35. {
  36. this.ui.drive.saveFile(this, revision, mxUtils.bind(this, function(resp)
  37. {
  38. this.desc = resp;
  39. if (success != null)
  40. {
  41. success(resp);
  42. }
  43. }), error);
  44. };
  45. /**
  46. * Returns the location as a new object.
  47. * @type mx.Point
  48. */
  49. DriveLibrary.prototype.open = function()
  50. {
  51. // Do nothing - this should never be called
  52. };