Add save edge and reuse it.

This commit is contained in:
Oleg Sh
2023-01-07 19:59:48 +02:00
parent 168a851b75
commit b6065ef901
17 changed files with 247 additions and 86 deletions

View File

@@ -9,7 +9,7 @@ function Application(document, window)
{
this.document = document;
this.canvas = this.document.getElementById('canvas');
this.handler = new AddGraphHandler(this);
this.handler = new DefaultHandler(this);
this.savedGraphName = "";
this.currentEnumVerticesType = new BaseEnumVertices(this, 1);//this.enumVerticesTextList[0];
this.findPathReport = 1;
@@ -54,6 +54,9 @@ function Application(document, window)
this.defaultVertexSize = null;
this.defaultEdgeWidth = null;
this.processEmscriptenFunction = null;
this.defaultEdge = null;
this.useDefaultEdge = false;
};
// List of graph.
@@ -894,7 +897,7 @@ Application.prototype.onLoad = function()
{
this.canvas = this.document.getElementById('canvas');
this.handler = new AddGraphHandler(this);
this.SetDefaultHandler();
this.updateMessage();
this.redrawGraph();
@@ -2006,4 +2009,29 @@ Application.prototype.isSupportEmscripten = function ()
Application.prototype.processEmscripten = function (inputData)
{
return this.processEmscriptenFunction(inputData);
}
Application.prototype.setDefaultEdge = function (defaultEdge)
{
this.defaultEdge = defaultEdge;
}
Application.prototype.hasDefaultEdge = function ()
{
return this.defaultEdge != null;
}
Application.prototype.getDefaultEdge = function ()
{
return this.defaultEdge;
}
Application.prototype.setUseDefaultEdge = function (value)
{
this.useDefaultEdge = value;
}
Application.prototype.getUseDefaultEdge = function ()
{
return this.useDefaultEdge;
}