mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-04-06 07:46:04 +00:00
Add edge with parameter for style.
This commit is contained in:
@@ -52,6 +52,7 @@ function Application(document, window)
|
||||
this.selectionRect = null;
|
||||
|
||||
this.defaultVertexSize = null;
|
||||
this.defaultEdgeWidth = null;
|
||||
};
|
||||
|
||||
// List of graph.
|
||||
@@ -1407,7 +1408,11 @@ Application.prototype.SaveUserSettings = function()
|
||||
|
||||
checkValue.push({field: "defaultVertexSize",
|
||||
value: this.defaultVertexSize,
|
||||
check: this.defaultVertexSize != null});
|
||||
check: this.defaultVertexSize != null});
|
||||
|
||||
checkValue.push({field: "defaultEdgeWidth",
|
||||
value: this.defaultEdgeWidth,
|
||||
check: this.defaultEdgeWidth != null});
|
||||
|
||||
//checkValue.push({field: "vertexPrintCommonStyle",
|
||||
// value: this.vertexPrintCommonStyle});
|
||||
@@ -1464,8 +1469,13 @@ Application.prototype.LoadUserSettings = function(json)
|
||||
checkValue.push({field: "defaultVertexSize",
|
||||
value: "defaultVertexSize",
|
||||
check: null,
|
||||
deep: false});
|
||||
|
||||
deep: false});
|
||||
|
||||
checkValue.push({field: "defaultEdgeWidth",
|
||||
value: "defaultEdgeWidth",
|
||||
check: null,
|
||||
deep: false});
|
||||
|
||||
//checkValue.push({field: "vertexPrintCommonStyle",
|
||||
// value: this.vertexPrintCommonStyle});
|
||||
|
||||
@@ -1769,3 +1779,35 @@ Application.prototype.ResetVertexSize = function()
|
||||
this.graph.vertices[i].model.diameter = this.GetDefaultVertexSize();
|
||||
}
|
||||
}
|
||||
|
||||
Application.prototype.SetDefaultEdgeWidth = function(width)
|
||||
{
|
||||
var oldDefaultWidth = this.GetDefaultEdgeWidth();
|
||||
this.defaultEdgeWidth = width;
|
||||
|
||||
for (i = 0; i < this.graph.edges.length; i ++)
|
||||
{
|
||||
if (this.graph.vertices[i].model.width == oldDefaultWidth)
|
||||
{
|
||||
this.graph.vertices[i].model.width = width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Application.prototype.GetDefaultEdgeWidth = function(diameter)
|
||||
{
|
||||
if (this.defaultVertexSize != null)
|
||||
return this.defaultEdgeWidth;
|
||||
else
|
||||
return defaultEdgeWidth;
|
||||
}
|
||||
|
||||
Application.prototype.ResetEdgeWidth = function()
|
||||
{
|
||||
this.defaultVertexSize = null;
|
||||
|
||||
for (i = 0; i < this.graph.edges.length; i ++)
|
||||
{
|
||||
this.graph.edges[i].model.width = this.GetDefaultEdgeWidth();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user