You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** Add double-click for auto-ranging. If user double-clicks the x-axis, only that axis will be reset. Likewise for y-axis */publicstaticvoidaddDoubleClickAutoRange(finalScatterChart<?, ?> sc) {
sc.addEventHandler(MouseEvent.MOUSE_CLICKED, ev -> {
if (ev.getClickCount() == 2) {
resetRange(sc, ev);
ev.consume();
}
});
}
/** Reset AutoRanging for one or both axes, depending on where user clicked. * x-axis only? y-axis only? chart --> both. */publicstaticvoidresetRange(finalScatterChart<?, ?> sc, MouseEventev) {
XYChartInfoi = newXYChartInfo(sc);
if (!i.getXAxisArea().contains(ev.getX(), ev.getY())) sc.getYAxis().setAutoRanging(true);
if (!i.getYAxisArea().contains(ev.getX(), ev.getY())) sc.getXAxis().setAutoRanging(true);
}
I will add similar functionality but use XYChart type and anonymous classes instead of Lambdas since jfxutils supports Java 7. Thanks for the code suggestions @gforman44!
The text was updated successfully, but these errors were encountered:
Requested by @gforman44 with some suggested code:
I will add similar functionality but use XYChart type and anonymous classes instead of Lambdas since jfxutils supports Java 7. Thanks for the code suggestions @gforman44!
The text was updated successfully, but these errors were encountered: