mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-04-09 01:06:09 +00:00
Implement style switching functionality. Add default, night, and high contrast styles.
This commit is contained in:
47
script/features/draw_graph/model/VertexContrastStyle.js
Normal file
47
script/features/draw_graph/model/VertexContrastStyle.js
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Contrast vertex style.
|
||||
*/
|
||||
|
||||
// Common style of Graphs.
|
||||
function ContrastCommonVertexStyle()
|
||||
{
|
||||
BaseVertexStyle.apply(this, arguments);
|
||||
|
||||
this.lineWidth = 4;
|
||||
this.strokeStyle = '#000000';
|
||||
this.fillStyle = '#ffffff';
|
||||
this.mainTextColor = '#000000';
|
||||
this.shape = VertexCircleShape;
|
||||
this.upTextColor = '#000000';
|
||||
this.commonTextPosition = CommonTextCenter;
|
||||
this.mainTextFontSize = 16;
|
||||
|
||||
this.baseStyles = [];
|
||||
}
|
||||
|
||||
ContrastCommonVertexStyle.prototype = Object.create(BaseVertexStyle.prototype);
|
||||
|
||||
// Selected style of Graphs.
|
||||
|
||||
function ContrastSelectedVertexStyle0()
|
||||
{
|
||||
BaseVertexStyle.apply(this, arguments);
|
||||
|
||||
this.strokeStyle = '#000000';
|
||||
this.mainTextColor = '#ffffff';
|
||||
this.fillStyle = '#000000';
|
||||
this.upTextColor = '#ffffff';
|
||||
|
||||
this.baseStyles.push("common");
|
||||
}
|
||||
|
||||
ContrastSelectedVertexStyle0.prototype = Object.create(BaseVertexStyle.prototype);
|
||||
|
||||
function GetContrastCommonVertexStyle()
|
||||
{
|
||||
return new ContrastCommonVertexStyle();
|
||||
}
|
||||
|
||||
var ContrastSelectedGraphStyles = [new ContrastSelectedVertexStyle0(), new ContrastSelectedVertexStyle0(),
|
||||
new ContrastSelectedVertexStyle0(), new ContrastSelectedVertexStyle0(), new ContrastSelectedVertexStyle0()];
|
||||
|
||||
Reference in New Issue
Block a user