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

40 lines
689 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();
}
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;