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

39 lines
785 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';
export default class EMouse extends Group {
constructor(device) {
super();
this.device = device;
this.zlevel = device.zlevel;
this.style = device.style;
this.create();
}
create() {
this.border = new Rect({
silent: true,
zlevel: this.zlevel,
z: 0,
shape: this.device.getBoundingRect(),
style: {
lineDash: this.style.StationStand.mouseOverStyle.borderLineDash,
stroke: this.style.StationStand.mouseOverStyle.borderLineColor,
fill: this.style.transparentColor
}
});
this.border.hide();
this.add(this.border);
}
mouseover(e) {
this.border.show();
}
mouseout(e) {
if (!this.device.model.down) {
this.border.hide();
}
}
}