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

38 lines
1.0 KiB
JavaScript
Raw Normal View History

2019-11-29 12:51:58 +08:00
export default class EMouse {
constructor(device) {
this.device = device;
}
2019-11-29 12:51:58 +08:00
mouseover(e) {
if (this.device.prdType) {
this.device.setVisible(true);
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
instance.mouseEvent.mouseEnter(e);
}
}
}
2019-11-29 12:51:58 +08:00
mouseout(e) {
if (this.device.prdType) {
this.device.setVisible(false);
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
instance.mouseEvent.mouseLeave(e);
}
}
}
2019-11-29 12:51:58 +08:00
2020-09-01 18:09:25 +08:00
mouseEnter() {
if (this.device.prdType) {
this.device.setVisible(true);
}
}
2019-11-29 12:51:58 +08:00
2020-09-01 18:09:25 +08:00
mouseLeave() {
if (this.device.prdType ) {
this.device.setVisible(false);
}
}
2019-11-29 12:51:58 +08:00
}