Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {Graph} from "./graph";
import {SerializableItem} from "../helper/serializableitem";
export class GraphElement extends SerializableItem {
protected isNode: boolean;
protected isLink: boolean;
protected graph: Graph;
constructor(graph: Graph) {
super();
this.graph = graph;
this.isNode = false;
this.isLink = false;
}
/**
* Removes element from its parent graph.
* @returns True, if successful.
*/
public delete(): boolean {
throw new Error("Function \"delete()\" has not been implemented.");
}
/**
* Adds the element to the given graph.
* @param graph Graph to add element to.
* @returns True, if successful.
*/
public add(graph: Graph = this.graph): boolean {
throw new Error("Function \"add(graph)\" has not been implemented.");
}
/**
* Needs to be implemented to create a filtered version for storing in the data history.
* @returns Filtered object.
*/
public getCleanInstance(): any {
throw new Error("Function \"getCleanInstance()\" has not been implemented.");
}
}