public void dispatchMouseMovedEvent(Point2D point, MouseEvent e) { double x = point.getX(); double y = point.getY(); ChartEntity entity = this.info.getEntityCollection().getEntity(x, y); ChartMouseEventFX event = new ChartMouseEventFX(this.chart, e, entity); for (ChartMouseListenerFX listener : this.chartMouseListeners) { listener.chartMouseMoved(event); } }
public void dispatchMouseClickedEvent(Point2D point, MouseEvent e) { double x = point.getX(); double y = point.getY(); ChartEntity entity = this.info.getEntityCollection().getEntity(x, y); ChartMouseEventFX event = new ChartMouseEventFX(this.chart, e, entity); for (ChartMouseListenerFX listener : this.chartMouseListeners) { listener.chartMouseClicked(event); } }
@Override public void chartMouseClicked(ChartMouseEventFX event) { // relay the event from the canvas to our registered listeners for (ChartMouseListenerFX listener: this.chartMouseListeners) { listener.chartMouseClicked(event); } }
@Override public void chartMouseMoved(ChartMouseEventFX event) { // relay the event from the canvas to our registered listeners for (ChartMouseListenerFX listener: this.chartMouseListeners) { listener.chartMouseMoved(event); } }
/** * Returns a (newly created) list containing the listeners currently * registered with the canvas. * * @return A list of listeners (possibly empty but never {@code null}). */ public List<ChartMouseListenerFX> getChartMouseListeners() { return new ArrayList<>(this.chartMouseListeners); }
/** * Registers a listener to receive {@link ChartMouseEvent} notifications. * * @param listener the listener ({@code null} not permitted). */ public void addChartMouseListener(ChartMouseListenerFX listener) { Args.nullNotPermitted(listener, "listener"); this.chartMouseListeners.add(listener); }
/** * Removes a listener from the list of objects listening for chart mouse * events. * * @param listener the listener. */ public void removeChartMouseListener(ChartMouseListenerFX listener) { this.chartMouseListeners.remove(listener); }
/** * Registers a listener to receive {@link ChartMouseEvent} notifications * from the canvas embedded in this viewer. * * @param listener the listener ({@code null} not permitted). */ public void addChartMouseListener(ChartMouseListenerFX listener) { Args.nullNotPermitted(listener, "listener"); this.canvas.addChartMouseListener(listener); }
/** * Removes a listener from the list of objects listening for chart mouse * events. * * @param listener the listener. */ public void removeChartMouseListener(ChartMouseListenerFX listener) { Args.nullNotPermitted(listener, "listener"); this.canvas.removeChartMouseListener(listener); }
/** * Registers a listener to receive {@link ChartMouseEvent} notifications * from the chart viewer. * * @param listener the listener ({@code null} not permitted). */ public void addChartMouseListener(ChartMouseListenerFX listener) { ParamChecks.nullNotPermitted(listener, "listener"); this.canvas.addChartMouseListener(listener); }
/** * Removes a listener from the list of objects listening for chart mouse * events. * * @param listener the listener. */ public void removeChartMouseListener(ChartMouseListenerFX listener) { this.canvas.removeChartMouseListener(listener); }
/** * Registers a listener to receive {@link ChartMouseEvent} notifications. * * @param listener the listener ({@code null} not permitted). */ public void addChartMouseListener(ChartMouseListenerFX listener) { ParamChecks.nullNotPermitted(listener, "listener"); this.chartMouseListeners.add(listener); }
/** * Registers a listener to receive {@link ChartMouseEvent} notifications * from this viewer. * * @param listener the listener ({@code null} not permitted). */ public void addChartMouseListener(ChartMouseListenerFX listener) { ParamChecks.nullNotPermitted(listener, "listener"); this.chartMouseListeners.add(listener); }
/** * Removes a listener from the list of objects listening for chart mouse * events. * * @param listener the listener. */ public void removeChartMouseListener(ChartMouseListenerFX listener) { ParamChecks.nullNotPermitted(listener, "listener"); this.chartMouseListeners.remove(listener); }