40 lines
689 B
JavaScript
40 lines
689 B
JavaScript
|
import Group from 'zrender/src/container/Group';
|
||
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
||
|
|
||
|
class ESafeStand extends Group {
|
||
|
constructor(model) {
|
||
|
super();
|
||
|
this.model = model;
|
||
|
this.create();
|
||
|
}
|
||
|
|
||
|
create() {
|
||
|
const model = this.model;
|
||
|
const style = this.model.style;
|
||
|
|
||
|
this.stand = new Rect({
|
||
|
zlevel: model.zlevel,
|
||
|
z: model.z,
|
||
|
shape: {
|
||
|
x: model.x,
|
||
|
y: model.y,
|
||
|
width: model.width,
|
||
|
height: model.height
|
||
|
},
|
||
|
style: {
|
||
|
lineWidth: 0,
|
||
|
stroke: style.sidelineColor,
|
||
|
fill: style.StationStand.stand.spareColor
|
||
|
}
|
||
|
});
|
||
|
|
||
|
this.add(this.stand);
|
||
|
}
|
||
|
|
||
|
setColor(color) {
|
||
|
this.stand.setStyle('fill', color);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default ESafeStand;
|