|
@@ -25,7 +25,8 @@ export class GraphFrame {
|
|
private _headerElement: HTMLDivElement;
|
|
private _headerElement: HTMLDivElement;
|
|
private _headerTextElement: HTMLDivElement;
|
|
private _headerTextElement: HTMLDivElement;
|
|
private _headerCollapseElement: HTMLDivElement;
|
|
private _headerCollapseElement: HTMLDivElement;
|
|
- private _headerCloseElement: HTMLDivElement;
|
|
|
|
|
|
+ private _headerCloseElement: HTMLDivElement;
|
|
|
|
+ private _commentsElement: HTMLDivElement;
|
|
private _portContainer: HTMLDivElement;
|
|
private _portContainer: HTMLDivElement;
|
|
private _outputPortContainer: HTMLDivElement;
|
|
private _outputPortContainer: HTMLDivElement;
|
|
private _inputPortContainer: HTMLDivElement;
|
|
private _inputPortContainer: HTMLDivElement;
|
|
@@ -38,6 +39,7 @@ export class GraphFrame {
|
|
private _ports: NodePort[] = [];
|
|
private _ports: NodePort[] = [];
|
|
private _controlledPorts: NodePort[] = [];
|
|
private _controlledPorts: NodePort[] = [];
|
|
private _id: number;
|
|
private _id: number;
|
|
|
|
+ private _comments: string;
|
|
|
|
|
|
public onExpandStateChanged = new Observable<GraphFrame>();
|
|
public onExpandStateChanged = new Observable<GraphFrame>();
|
|
|
|
|
|
@@ -241,6 +243,24 @@ export class GraphFrame {
|
|
this.element.style.height = `${gridAlignedBottom - this._gridAlignedY}px`;
|
|
this.element.style.height = `${gridAlignedBottom - this._gridAlignedY}px`;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public get comments(): string {
|
|
|
|
+ return this._comments;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public set comments(comments: string) {
|
|
|
|
+ if (comments.length > 0) {
|
|
|
|
+ this.element.style.gridTemplateRows = "40px 40px calc(100% - 80px)";
|
|
|
|
+ this._borderElement.style.gridRow = "1 / span 3";
|
|
|
|
+ this._portContainer.style.gridRow = "3";
|
|
|
|
+ this._commentsElement.style.display = "grid";
|
|
|
|
+ this._commentsElement.style.gridRow = "2";
|
|
|
|
+ this._commentsElement.style.gridColumn = "1";
|
|
|
|
+ this._commentsElement.style.paddingLeft = "10px";
|
|
|
|
+ }
|
|
|
|
+ this._comments = comments;
|
|
|
|
+ this._commentsElement.innerText = comments;
|
|
|
|
+ }
|
|
|
|
+
|
|
public constructor(candidate: Nullable<HTMLDivElement>, canvas: GraphCanvasComponent, doNotCaptureNodes = false) {
|
|
public constructor(candidate: Nullable<HTMLDivElement>, canvas: GraphCanvasComponent, doNotCaptureNodes = false) {
|
|
this._id = GraphFrame._FrameCounter++;
|
|
this._id = GraphFrame._FrameCounter++;
|
|
|
|
|
|
@@ -331,8 +351,15 @@ export class GraphFrame {
|
|
} else {
|
|
} else {
|
|
this.element.classList.remove("selected");
|
|
this.element.classList.remove("selected");
|
|
}
|
|
}
|
|
- });
|
|
|
|
-
|
|
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this._commentsElement = document.createElement('div');
|
|
|
|
+ this._commentsElement.className = 'frame-comments';
|
|
|
|
+ this._commentsElement.style.color = 'white';
|
|
|
|
+ this._commentsElement.style.fontSize = '16px';
|
|
|
|
+
|
|
|
|
+ this.element.appendChild(this._commentsElement);
|
|
|
|
+
|
|
// Get nodes
|
|
// Get nodes
|
|
if (!doNotCaptureNodes) {
|
|
if (!doNotCaptureNodes) {
|
|
this.refresh();
|
|
this.refresh();
|
|
@@ -341,7 +368,6 @@ export class GraphFrame {
|
|
|
|
|
|
public refresh() {
|
|
public refresh() {
|
|
this._nodes = [];
|
|
this._nodes = [];
|
|
- this._ownerCanvas.globalState.onFrameCreated.notifyObservers(this);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public addNode(node: GraphNode) {
|
|
public addNode(node: GraphNode) {
|