use of com.cburch.logisim.tools.ToolTipMaker in project logisim-evolution by reds-heig.
the class Canvas method getToolTipText.
@Override
public String getToolTipText(MouseEvent event) {
boolean showTips = AppPreferences.COMPONENT_TIPS.getBoolean();
if (showTips) {
Canvas.snapToGrid(event);
Location loc = Location.create(event.getX(), event.getY());
ComponentUserEvent e = null;
for (Component comp : getCircuit().getAllContaining(loc)) {
Object makerObj = comp.getFeature(ToolTipMaker.class);
if (makerObj != null && makerObj instanceof ToolTipMaker) {
ToolTipMaker maker = (ToolTipMaker) makerObj;
if (e == null) {
e = new ComponentUserEvent(this, loc.getX(), loc.getY());
}
String ret = maker.getToolTip(e);
if (ret != null) {
unrepairMouseEvent(event);
return ret;
}
}
}
}
return null;
}
Aggregations