diff src/app/relation-type.js @ 58:3b4046e0cc02 default

Merge from ng2-table branch. d7c947909ab888c013171b8c037e4f9fab30fe57
author casties
date Wed, 29 Mar 2017 17:19:12 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/app/relation-type.js	Wed Mar 29 17:19:12 2017 +0200
@@ -0,0 +1,44 @@
+"use strict";
+exports.invLabelPrefix = '<- ';
+exports.invNamePrefix = '-';
+exports.rawLabelPrefix = '(';
+exports.rawLabelPostfix = ')';
+var RelationType = (function () {
+    function RelationType(relType, isOutgoing, label) {
+        this.outgoing = isOutgoing;
+        this.relType = relType;
+        if (isOutgoing) {
+            this.name = relType;
+        }
+        else {
+            this.name = exports.invNamePrefix + relType;
+        }
+        if (label != null) {
+            this.label = label;
+        }
+        else {
+            // create label using name
+            if (isOutgoing) {
+                this.label = exports.rawLabelPrefix + relType + exports.rawLabelPostfix;
+            }
+            else {
+                this.label = exports.rawLabelPrefix + exports.invLabelPrefix + relType + exports.rawLabelPostfix;
+            }
+        }
+    }
+    RelationType.prototype.getLabel = function () {
+        return this.label;
+    };
+    RelationType.prototype.getName = function () {
+        return this.name;
+    };
+    RelationType.prototype.getRelType = function () {
+        return this.relType;
+    };
+    RelationType.prototype.isOutgoing = function () {
+        return this.outgoing;
+    };
+    return RelationType;
+}());
+exports.RelationType = RelationType;
+//# sourceMappingURL=relation-type.js.map
\ No newline at end of file