rt-sim-training-client/src/jmapNew/shape/StationStand/ESafeStand.js

40 lines
899 B
JavaScript
Raw Normal View History

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 {
constructor(model) {
super();
this.model = model;
this.create();
}
2019-11-29 12:51:58 +08:00
create() {
const model = this.model;
const style = this.model.style;
2019-11-29 12:51:58 +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
this.add(this.stand);
}
2019-11-29 12:51:58 +08:00
setColor(color) {
this.stand.setStyle('fill', color);
}
2019-11-29 12:51:58 +08:00
}
export default ESafeStand;