2016-02-14 07:06:40 +11:00
|
|
|
/**
|
|
|
|
* @file ui_style.js
|
|
|
|
* @author frtk@tetalab
|
|
|
|
*/
|
|
|
|
|
2016-02-14 14:37:31 +11:00
|
|
|
NPGClient.UIStyle = function(o) {
|
|
|
|
/*
|
|
|
|
this.fm = o.fm !== undefined ? o.fm : false;
|
|
|
|
this.fc = o.fc !== undefined ? o.fc : '';
|
|
|
|
this.bm = o.bm !== undefined ? o.bm : false;
|
|
|
|
this.bw = o.bw !== undefined ? o.bw : 0;
|
|
|
|
this.bc = o.bc !== undefined ? o.bc : '';
|
|
|
|
*/
|
2016-02-14 07:06:40 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
NPGClient.UIStyle.prototype = {
|
|
|
|
|
|
|
|
constructor: NPGClient.UIStyle,
|
2016-02-14 14:37:31 +11:00
|
|
|
|
|
|
|
/*
|
2016-02-14 07:06:40 +11:00
|
|
|
borderMode: function() {
|
|
|
|
return this.bm;
|
|
|
|
},
|
|
|
|
|
|
|
|
fillMode: function() {
|
|
|
|
return this.fm;
|
|
|
|
},
|
|
|
|
|
|
|
|
setBorders: function(m, w, c) {
|
|
|
|
this.bm = m;
|
|
|
|
this.bw = w;
|
|
|
|
this.bc = c;
|
|
|
|
},
|
|
|
|
|
|
|
|
setFillStyle: function(m, c) {
|
|
|
|
this.fm = m;
|
|
|
|
this.fc = c;
|
|
|
|
},
|
|
|
|
|
|
|
|
applyStyle: function(ctx) {
|
|
|
|
var self = this;
|
|
|
|
// fill style
|
2016-02-14 14:37:31 +11:00
|
|
|
if (self.fm == true) ctx.fillStyle = self.fc;
|
2016-02-14 07:06:40 +11:00
|
|
|
// border mode
|
|
|
|
if (bm == true) {
|
2016-02-14 14:37:31 +11:00
|
|
|
ctx.lineWidth = self.bw;
|
|
|
|
ctx.strokeStyle = self.bc;
|
2016-02-14 07:06:40 +11:00
|
|
|
}
|
|
|
|
}
|
2016-02-14 14:37:31 +11:00
|
|
|
|
|
|
|
*/
|
2016-02-14 07:06:40 +11:00
|
|
|
};
|
|
|
|
|