mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2025-01-23 10:25:10 +01:00
43 lines
782 B
TypeScript
43 lines
782 B
TypeScript
export default class Edge {
|
|
protected COLOR: string;
|
|
|
|
protected STYLE: string;
|
|
|
|
protected WIDTH: string;
|
|
|
|
getColor(): string {
|
|
return this.COLOR;
|
|
}
|
|
|
|
getStyle(): string {
|
|
return this.STYLE;
|
|
}
|
|
|
|
getWidth(): string {
|
|
return this.WIDTH;
|
|
}
|
|
|
|
setColor(value: string): void {
|
|
this.COLOR = value;
|
|
}
|
|
|
|
setStyle(value: string): void {
|
|
this.STYLE = value;
|
|
}
|
|
|
|
setWidth(value: string): void {
|
|
this.WIDTH = value;
|
|
}
|
|
|
|
toXml(document: Document): HTMLElement {
|
|
// Set node attributes
|
|
const edgeElem = document.createElement('edge');
|
|
|
|
edgeElem.setAttribute('COLOR', this.COLOR);
|
|
if (this.STYLE) edgeElem.setAttribute('STYLE', this.STYLE);
|
|
if (this.WIDTH) edgeElem.setAttribute('WIDTH', this.WIDTH);
|
|
|
|
return edgeElem;
|
|
}
|
|
}
|