1/**
2 * Copyright (c) 2006-2017, JGraph Ltd
3 * Copyright (c) 2006-2017, Gaudenz Alder
4 */
5/**
6 * Constructs a new point for the optional x and y coordinates. If no
7 * coordinates are given, then the default values for <x> and <y> are used.
8 * @constructor
9 * @class Implements a basic 2D point. Known subclassers = {@link mxRectangle}.
10 * @param {number} x X-coordinate of the point.
11 * @param {number} y Y-coordinate of the point.
12 */
13StorageLibrary = function(ui, data, title)
14{
15	StorageFile.call(this, ui, data, title);
16};
17
18//Extends mxEventSource
19mxUtils.extend(StorageLibrary, StorageFile);
20
21/**
22 * A differentiator of the stored object type (file or lib)
23 */
24StorageLibrary.prototype.type = 'L';
25
26/**
27 * Translates this point by the given vector.
28 *
29 * @param {number} dx X-coordinate of the translation.
30 * @param {number} dy Y-coordinate of the translation.
31 */
32StorageLibrary.prototype.isAutosave = function()
33{
34	return true;
35};
36
37/**
38 * Overridden to avoid updating data with current file.
39 */
40StorageLibrary.prototype.saveAs = function(title, success, error)
41{
42	this.saveFile(title, false, success, error);
43};
44
45/**
46 * Translates this point by the given vector.
47 *
48 * @param {number} dx X-coordinate of the translation.
49 * @param {number} dy Y-coordinate of the translation.
50 */
51StorageLibrary.prototype.getHash = function()
52{
53	return 'L' + encodeURIComponent(this.title);
54};
55
56/**
57 * Translates this point by the given vector.
58 *
59 * @param {number} dx X-coordinate of the translation.
60 * @param {number} dy Y-coordinate of the translation.
61 */
62StorageLibrary.prototype.getTitle = function()
63{
64	return (this.title == '.scratchpad') ? mxResources.get('scratchpad') : this.title;
65};
66
67/**
68 * Overridden to avoid updating data with current file.
69 */
70StorageLibrary.prototype.isRenamable = function(title, success, error)
71{
72	return this.title != '.scratchpad';
73};
74
75/**
76 * Returns the location as a new object.
77 * @type mx.Point
78 */
79StorageLibrary.prototype.open = function()
80{
81	// Do nothing - this should never be called
82};
83