mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-10-23 00:28:03 +00:00
Implement style switching functionality. Add default, night, and high contrast styles.
This commit is contained in:
1 parent
dee5d4c4ea
commit
6f5fb0fc9c
30 files changed
+661
-63
No files matched your search
@@ -18,8 +18,8 @@ function GraphFullStyle(redrawCallback)
|
||||
this.backgroundCommonStyle = DefaultCommonBackgroundStyle();
|
||||
this.isBackgroundCommonStyleCustom = false;
|
||||
|
||||
this.defaultVertexSize = null;
|
||||
this.defaultEdgeWidth = null;
|
||||
this.defaultVertexSize = 30;
|
||||
this.defaultEdgeWidth = 3;
|
||||
this.redrawCallback = redrawCallback;
|
||||
}
|
||||
|
||||
@@ -238,6 +238,63 @@ function OldGraphFullStyle()
|
||||
this.vertexSelectedVertexStyles = FullArrayCopy(OldSelectedGraphStyles);
|
||||
|
||||
this.backgroundCommonStyle = GetWhiteBackgroundStyle();
|
||||
|
||||
this.defaultVertexSize = 30;
|
||||
this.defaultEdgeWidth = 4;
|
||||
}
|
||||
|
||||
OldGraphFullStyle.prototype = Object.create(GraphFullStyle.prototype);
|
||||
OldGraphFullStyle.prototype = Object.create(GraphFullStyle.prototype);
|
||||
|
||||
function NightGraphFullStyle()
|
||||
{
|
||||
GraphFullStyle.apply(this, arguments);
|
||||
|
||||
this.version = 1;
|
||||
this.edgeCommonStyle = GetNightCommonEdgeStyle();
|
||||
this.edgeSelectedStyles = FullArrayCopy(NightSelectedEdgeStyles);
|
||||
|
||||
this.vertexCommonStyle = GetNightCommonVertexStyle();
|
||||
this.vertexSelectedVertexStyles = FullArrayCopy(NightSelectedGraphStyles);
|
||||
|
||||
this.backgroundCommonStyle = GetNightBackgroundStyle();
|
||||
|
||||
this.defaultVertexSize = 30;
|
||||
this.defaultEdgeWidth = 3;
|
||||
|
||||
this.isEdgeCommonStyleCustom = true;
|
||||
this.isEdgeSelectedStylesCustom = true;
|
||||
|
||||
this.isVertexCommonStyleCustom = true;
|
||||
this.isVertexSelectedVertexStylesCustom = true;
|
||||
|
||||
this.isBackgroundCommonStyleCustom = true;
|
||||
}
|
||||
|
||||
NightGraphFullStyle.prototype = Object.create(GraphFullStyle.prototype);
|
||||
|
||||
function ContrastGraphFullStyle()
|
||||
{
|
||||
GraphFullStyle.apply(this, arguments);
|
||||
|
||||
this.version = 1;
|
||||
this.edgeCommonStyle = GetContrastCommonEdgeStyle();
|
||||
this.edgeSelectedStyles = FullArrayCopy(ContrastSelectedEdgeStyles);
|
||||
|
||||
this.vertexCommonStyle = GetContrastCommonVertexStyle();
|
||||
this.vertexSelectedVertexStyles = FullArrayCopy(ContrastSelectedGraphStyles);
|
||||
|
||||
this.backgroundCommonStyle = GetWhiteBackgroundStyle();
|
||||
|
||||
this.defaultVertexSize = 36;
|
||||
this.defaultEdgeWidth = 4;
|
||||
|
||||
this.isEdgeCommonStyleCustom = true;
|
||||
this.isEdgeSelectedStylesCustom = true;
|
||||
|
||||
this.isVertexCommonStyleCustom = true;
|
||||
this.isVertexSelectedVertexStylesCustom = true;
|
||||
|
||||
this.isBackgroundCommonStyleCustom = true;
|
||||
}
|
||||
|
||||
ContrastGraphFullStyle.prototype = Object.create(GraphFullStyle.prototype);
|
||||
Reference in new issue
Block a user