Implement style switching functionality. Add default, night, and high contrast styles.

This commit is contained in:
Oleg Sh
2026-01-12 19:05:49 +01:00
parent dee5d4c4ea
commit 6f5fb0fc9c
30 changed files with 661 additions and 63 deletions

View File

@@ -0,0 +1,43 @@
/**
* New Contrast edge styles.
*/
function ContrastCommonEdgeStyle()
{
BaseEdgeStyle.apply(this, arguments);
this.strokeStyle = '#000000';
this.weightText = '#000000';
this.fillStyle = '#ffffff';
this.textPadding = 4;
this.textStrokeWidth = 2;
this.lineDash = 0;
this.additionalTextColor = '#000000';
this.weightPosition = WeightTextCenter;
this.mainTextFontSize = 16;
}
ContrastCommonEdgeStyle.prototype = Object.create(BaseEdgeStyle.prototype);
function ContrastSelectedEdgeStyle0()
{
BaseEdgeStyle.apply(this, arguments);
this.strokeStyle = '#000000';
this.weightText = '#000000';
this.fillStyle = '#ffffff';
this.additionalTextColor = '#000000';
this.lineDash = 1
this.baseStyles.push("common");
}
ContrastSelectedEdgeStyle0.prototype = Object.create(BaseEdgeStyle.prototype);
function GetContrastCommonEdgeStyle()
{
return new ContrastCommonEdgeStyle();
}
var ContrastSelectedEdgeStyles = [new ContrastSelectedEdgeStyle0(), new ContrastSelectedEdgeStyle0(),
new ContrastSelectedEdgeStyle0(), new ContrastSelectedEdgeStyle0(), new ContrastSelectedEdgeStyle0()];