use of com.cas.sim.tis.app.control.HintControl in project TeachingInSimulation by ScOrPiOzzy.
the class CircuitState method bindWireEvent.
private void bindWireEvent(Geometry wireMdl, final Wire wire) {
addListener(wireMdl, new MouseEventAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
for (Wire w : wireList) {
Spatial mdl = w.getSpatial();
HintControl control = mdl.getControl(HintControl.class);
boolean enable = w == wire;
if (control != null) {
mdl.removeControl(control);
} else if (enable) {
control = new HintControl();
mdl.addControl(control);
}
}
super.mouseClicked(e);
}
@Override
public void mouseRightClicked(MouseEvent e) {
// 选中显示导线菜单
IContent content = SpringUtil.getBean(PageController.class).getIContent();
if (content instanceof TypicalCase3D) {
Platform.runLater(() -> {
((TypicalCase3D) content).showPopupMenu(wire);
});
}
super.mouseRightClicked(e);
}
});
}
Aggregations