2019-11-29 12:51:58 +08:00
|
|
|
import Group from 'zrender/src/container/Group';
|
|
|
|
import Rect from 'zrender/src/graphic/shape/Rect';
|
|
|
|
|
|
|
|
class ESafeStand extends Group {
|
2019-12-11 17:07:29 +08:00
|
|
|
constructor(model) {
|
|
|
|
super();
|
|
|
|
this.model = model;
|
|
|
|
this.create();
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2019-12-11 17:07:29 +08:00
|
|
|
create() {
|
|
|
|
const model = this.model;
|
|
|
|
const style = this.model.style;
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2019-12-11 17:07:29 +08:00
|
|
|
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
|
|
|
|
}
|
|
|
|
});
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2019-12-11 17:07:29 +08:00
|
|
|
this.add(this.stand);
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
|
2019-12-11 17:07:29 +08:00
|
|
|
setColor(color) {
|
|
|
|
this.stand.setStyle('fill', color);
|
|
|
|
}
|
2019-11-29 12:51:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default ESafeStand;
|