类javafx.scene.input.ScrollEvent源码实例Demo

下面列出了怎么用javafx.scene.input.ScrollEvent的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: openstock   文件: ScrollHandlerFX.java
/**
 * Handle the case where a plot implements the {@link Zoomable} interface.
 *
 * @param zoomable  the zoomable plot.
 * @param e  the mouse wheel event.
 */
private void handleZoomable(ChartCanvas canvas, Zoomable zoomable, 
        ScrollEvent e) {
    // don't zoom unless the mouse pointer is in the plot's data area
    ChartRenderingInfo info = canvas.getRenderingInfo();
    PlotRenderingInfo pinfo = info.getPlotInfo();
    Point2D p = new Point2D.Double(e.getX(), e.getY());
    if (pinfo.getDataArea().contains(p)) {
        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
        boolean notifyState = plot.isNotify();
        plot.setNotify(false);
        int clicks = (int) e.getDeltaY();
        double zf = 1.0 + this.zoomFactor;
        if (clicks < 0) {
            zf = 1.0 / zf;
        }
        if (true) { //this.chartPanel.isDomainZoomable()) {
            zoomable.zoomDomainAxes(zf, pinfo, p, true);
        }
        if (true) { //this.chartPanel.isRangeZoomable()) {
            zoomable.zoomRangeAxes(zf, pinfo, p, true);
        }
        plot.setNotify(notifyState);  // this generates the change event too
    } 
}
 
源代码2 项目: ECG-Viewer   文件: ScrollHandlerFX.java
/**
 * Handle the case where a plot implements the {@link Zoomable} interface.
 *
 * @param zoomable  the zoomable plot.
 * @param e  the mouse wheel event.
 */
private void handleZoomable(ChartCanvas canvas, Zoomable zoomable, 
        ScrollEvent e) {
    // don't zoom unless the mouse pointer is in the plot's data area
    ChartRenderingInfo info = canvas.getRenderingInfo();
    PlotRenderingInfo pinfo = info.getPlotInfo();
    Point2D p = new Point2D.Double(e.getX(), e.getY());
    if (pinfo.getDataArea().contains(p)) {
        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
        boolean notifyState = plot.isNotify();
        plot.setNotify(false);
        int clicks = (int) e.getDeltaY();
        double zf = 1.0 + this.zoomFactor;
        if (clicks < 0) {
            zf = 1.0 / zf;
        }
        if (true) { //this.chartPanel.isDomainZoomable()) {
            zoomable.zoomDomainAxes(zf, pinfo, p, true);
        }
        if (true) { //this.chartPanel.isRangeZoomable()) {
            zoomable.zoomRangeAxes(zf, pinfo, p, true);
        }
        plot.setNotify(notifyState);  // this generates the change event too
    } 
}
 
源代码3 项目: mzmine3   文件: Fx3DStageController.java
/**
 * @param event Zooms in and out when the mouse is scrolled.
 */
public void onScrollHandler(ScrollEvent event) {
  double delta = 1.2;
  double scale = (plot.getScaleX());

  if (event.getDeltaY() < 0) {
    scale /= delta;
  } else {
    scale *= delta;
  }

  scale = clamp(scale, MIN_SCALE, MAX_SCALE);

  plot.setScaleX(scale);
  plot.setScaleY(scale);

  event.consume();
}
 
源代码4 项目: buffer_bci   文件: ScrollHandlerFX.java
/**
 * Handle the case where a plot implements the {@link Zoomable} interface.
 *
 * @param zoomable  the zoomable plot.
 * @param e  the mouse wheel event.
 */
private void handleZoomable(ChartCanvas canvas, Zoomable zoomable, 
        ScrollEvent e) {
    // don't zoom unless the mouse pointer is in the plot's data area
    ChartRenderingInfo info = canvas.getRenderingInfo();
    PlotRenderingInfo pinfo = info.getPlotInfo();
    Point2D p = new Point2D.Double(e.getX(), e.getY());
    if (pinfo.getDataArea().contains(p)) {
        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
        boolean notifyState = plot.isNotify();
        plot.setNotify(false);
        int clicks = (int) e.getDeltaY();
        double zf = 1.0 + this.zoomFactor;
        if (clicks < 0) {
            zf = 1.0 / zf;
        }
        if (true) { //this.chartPanel.isDomainZoomable()) {
            zoomable.zoomDomainAxes(zf, pinfo, p, true);
        }
        if (true) { //this.chartPanel.isRangeZoomable()) {
            zoomable.zoomRangeAxes(zf, pinfo, p, true);
        }
        plot.setNotify(notifyState);  // this generates the change event too
    } 
}
 
源代码5 项目: mzmine2   文件: Fx3DStageController.java
/**
 * @param event
 *            Zooms in and out when the mouse is scrolled.
 */
public void onScrollHandler(ScrollEvent event) {
    double delta = 1.2;
    double scale = (plot.getScaleX());

    if (event.getDeltaY() < 0) {
        scale /= delta;
    } else {
        scale *= delta;
    }

    scale = clamp(scale, MIN_SCALE, MAX_SCALE);

    plot.setScaleX(scale);
    plot.setScaleY(scale);

    event.consume();
}
 
源代码6 项目: jfreechart-fx   文件: ScrollHandlerFX.java
@Override
public void handleScroll(ChartCanvas canvas, ScrollEvent e) {
    JFreeChart chart = canvas.getChart();
    if (chart == null) {
        return;
    }
    Plot plot = chart.getPlot();
    if (plot instanceof Zoomable) {
        Zoomable zoomable = (Zoomable) plot;
        handleZoomable(canvas, zoomable, e);
    }
    else if (plot instanceof PiePlot) {
        PiePlot pp = (PiePlot) plot;
        pp.handleMouseWheelRotation((int) e.getDeltaY());
    }
}
 
源代码7 项目: phoebus   文件: PlotCanvasBase.java
/** Zoom in/out triggered by mouse wheel
 *  @param event Scroll event
 */
protected void wheelZoom(final ScrollEvent event)
{
    // Invoked by mouse scroll wheel.
    // Only allow zoom (with control), not pan.
    if (! event.isControlDown())
        return;

    if (event.getDeltaY() > 0)
        zoomInOut(event.getX(), event.getY(), 1.0/ZOOM_FACTOR);
    else if (event.getDeltaY() < 0)
        zoomInOut(event.getX(), event.getY(), ZOOM_FACTOR);
    else
        return;
    event.consume();
}
 
源代码8 项目: Flowless   文件: CellListManager.java
private C cellForItem(T item) {
    C cell = cellPool.getCell(item);

    // apply CSS when the cell is first added to the scene
    Node node = cell.getNode();
    EventStreams.nonNullValuesOf(node.sceneProperty())
            .subscribeForOne(scene -> {
                node.applyCss();
            });

    // Make cell initially invisible.
    // It will be made visible when it is positioned.
    node.setVisible(false);

    if (cell.isReusable()) {
        // if cell is reused i think adding event handler
        // would cause resource leakage.
        node.setOnScroll(this::pushScrollEvent);
        node.setOnScrollStarted(this::pushScrollEvent);
        node.setOnScrollFinished(this::pushScrollEvent);
    } else {
        node.addEventHandler(ScrollEvent.ANY, this::pushScrollEvent);
    }

    return cell;
}
 
源代码9 项目: TAcharting   文件: TaScrollHandlerFX.java
/**
 * Handle the case where a plot implements the {@link Zoomable} interface.
 *
 * @param zoomable  the zoomable plot.
 * @param e  the mouse wheel event.
 */
private void handleZoomable(TaChartCanvas canvas, Zoomable zoomable,
                            ScrollEvent e) {
    // don't zoom unless the mouse pointer is in the plot's org.sjwimmer.tacharting.data area
    ChartRenderingInfo info = canvas.getRenderingInfo();
    PlotRenderingInfo pinfo = info.getPlotInfo();
    Point2D p = new Point2D.Double(e.getX(), e.getY());
    if (pinfo.getDataArea().contains(p)) {
        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
        boolean notifyState = plot.isNotify();
        plot.setNotify(false);
        int clicks = (int) e.getDeltaY();
        double zf = 1.0 + this.zoomFactor;
        if (clicks < 0) {
            zf = 1.0 / zf;
        }
        if (canvas.isDomainZoomable()) {
            zoomable.zoomDomainAxes(zf, pinfo, p, true);
        }
        if (canvas.isRangeZoomable()) {
            zoomable.zoomRangeAxes(zf, pinfo, p, true);
        }
        plot.setNotify(notifyState);  // this generates the change event too
    }
}
 
源代码10 项目: charts   文件: World.java
private void registerListeners() {
    widthProperty().addListener(o -> resize());
    heightProperty().addListener(o -> resize());
    sceneProperty().addListener(o -> {
        if (!locations.isEmpty()) { addShapesToScene(locations.values()); }
        if (isZoomEnabled()) { getScene().addEventFilter( ScrollEvent.ANY, new WeakEventHandler<>(_scrollEventHandler)); }

        locations.addListener((MapChangeListener<Location, Shape>) CHANGE -> {
            if (CHANGE.wasAdded()) {
                addShapesToScene(CHANGE.getValueAdded());
            } else if(CHANGE.wasRemoved()) {
                Platform.runLater(() -> pane.getChildren().remove(CHANGE.getValueRemoved()));
            }
        });
    });
}
 
源代码11 项目: DeskChan   文件: MouseEventNotificator.java
/**
 * Enables handling of scroll and mouse wheel events for the node.
 * This type of events has a peculiarity on Windows. See the javadoc of notifyScrollEvents for more information.
 * @see #notifyScrollEvent
 * @param intersectionTestFunc a function that takes an event object and must return boolean
 * @return itself to let you use a chain of calls
 */
public MouseEventNotificator setOnScrollListener(Function<NativeMouseWheelEvent, Boolean> intersectionTestFunc) {
    if (SystemUtils.IS_OS_WINDOWS) {
        if (!GlobalScreen.isNativeHookRegistered()) {
            try {
                GlobalScreen.registerNativeHook();
            } catch (NativeHookException | UnsatisfiedLinkError e) {
                e.printStackTrace();
                Main.log("Failed to initialize the native hooking. Rolling back to using JavaFX events...");
                sender.addEventFilter(ScrollEvent.SCROLL, this::notifyScrollEvent);
                return this;
            }
        }
        mouseWheelListener = event -> notifyScrollEvent(event, intersectionTestFunc);
        GlobalScreen.addNativeMouseWheelListener(mouseWheelListener);
    } else {
        sender.addEventFilter(ScrollEvent.SCROLL, this::notifyScrollEvent);
    }

    return this;
}
 
源代码12 项目: ccu-historian   文件: ScrollHandlerFX.java
/**
 * Handle the case where a plot implements the {@link Zoomable} interface.
 *
 * @param zoomable  the zoomable plot.
 * @param e  the mouse wheel event.
 */
private void handleZoomable(ChartCanvas canvas, Zoomable zoomable, 
        ScrollEvent e) {
    // don't zoom unless the mouse pointer is in the plot's data area
    ChartRenderingInfo info = canvas.getRenderingInfo();
    PlotRenderingInfo pinfo = info.getPlotInfo();
    Point2D p = new Point2D.Double(e.getX(), e.getY());
    if (pinfo.getDataArea().contains(p)) {
        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
        boolean notifyState = plot.isNotify();
        plot.setNotify(false);
        int clicks = (int) e.getDeltaY();
        double zf = 1.0 + this.zoomFactor;
        if (clicks < 0) {
            zf = 1.0 / zf;
        }
        if (true) { //this.chartPanel.isDomainZoomable()) {
            zoomable.zoomDomainAxes(zf, pinfo, p, true);
        }
        if (true) { //this.chartPanel.isRangeZoomable()) {
            zoomable.zoomRangeAxes(zf, pinfo, p, true);
        }
        plot.setNotify(notifyState);  // this generates the change event too
    } 
}
 
源代码13 项目: neural-style-gui   文件: MovingImageView.java
private void setupListeners() {
    ObjectProperty<Point2D> mouseDown = new SimpleObjectProperty<>();

    EventStreams.eventsOf(imageView, MouseEvent.MOUSE_PRESSED).subscribe(e -> {
        Point2D mousePress = imageViewToImage(new Point2D(e.getX(), e.getY()));
        mouseDown.set(mousePress);
    });

    EventStreams.eventsOf(imageView, MouseEvent.MOUSE_DRAGGED).subscribe(e -> {
        Point2D dragPoint = imageViewToImage(new Point2D(e.getX(), e.getY()));
        shift(dragPoint.subtract(mouseDown.get()));
        mouseDown.set(imageViewToImage(new Point2D(e.getX(), e.getY())));
    });

    EventStream<ScrollEvent> scrollEvents = EventStreams.eventsOf(imageView, ScrollEvent.SCROLL);
    EventStream<ScrollEvent> scrollEventsUp = scrollEvents.filter(scrollEvent -> scrollEvent.getDeltaY() < 0);
    EventStream<ScrollEvent> scrollEventsDown = scrollEvents.filter(scrollEvent -> scrollEvent.getDeltaY() > 0);
    scrollEventsUp.subscribe(scrollEvent -> scale = Math.min(scale + 0.25, 3));
    scrollEventsDown.subscribe(scrollEvent -> scale = Math.max(scale - 0.25, 0.25));
    EventStreams.merge(scrollEventsUp, scrollEventsDown).subscribe(scrollEvent -> scaleImageViewport(scale));

    EventStreams.eventsOf(imageView, MouseEvent.MOUSE_CLICKED)
            .filter(mouseEvent -> mouseEvent.getClickCount() == 2)
            .subscribe(mouseEvent -> fitToView());
}
 
源代码14 项目: gef   文件: ScrollGesture.java
/**
 *
 * @param viewer
 *            The {@link IViewer}
 * @return An {@link EventHandler} for {@link ScrollEvent}.
 */
protected EventHandler<ScrollEvent> createScrollFilter(
		final IViewer viewer) {
	return new EventHandler<ScrollEvent>() {
		@Override
		public void handle(ScrollEvent event) {
			if (!(event.getTarget() instanceof Node)
					|| PartUtils.retrieveViewer(getDomain(),
							(Node) event.getTarget()) != viewer) {
				return;
			}
			playFinishDelayTransition(viewer);
			if (!inScroll.contains(viewer)) {
				inScroll.add(viewer);
				scrollStarted(viewer, event);
			} else {
				scroll(viewer, event);
			}
		}
	};
}
 
源代码15 项目: SIMVA-SoS   文件: ScrollHandlerFX.java
/**
 * Handle the case where a plot implements the {@link Zoomable} interface.
 *
 * @param zoomable  the zoomable plot.
 * @param e  the mouse wheel event.
 */
private void handleZoomable(ChartCanvas canvas, Zoomable zoomable, 
        ScrollEvent e) {
    // don't zoom unless the mouse pointer is in the plot's data area
    ChartRenderingInfo info = canvas.getRenderingInfo();
    PlotRenderingInfo pinfo = info.getPlotInfo();
    Point2D p = new Point2D.Double(e.getX(), e.getY());
    if (pinfo.getDataArea().contains(p)) {
        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
        boolean notifyState = plot.isNotify();
        plot.setNotify(false);
        int clicks = (int) e.getDeltaY();
        double zf = 1.0 + this.zoomFactor;
        if (clicks < 0) {
            zf = 1.0 / zf;
        }
        if (true) { //this.chartPanel.isDomainZoomable()) {
            zoomable.zoomDomainAxes(zf, pinfo, p, true);
        }
        if (true) { //this.chartPanel.isRangeZoomable()) {
            zoomable.zoomRangeAxes(zf, pinfo, p, true);
        }
        plot.setNotify(notifyState);  // this generates the change event too
    } 
}
 
源代码16 项目: openstock   文件: ChartCanvas.java
/**
 * Handles a scroll event by passing it on to the registered handlers.
 * 
 * @param e  the scroll event.
 */
protected void handleScroll(ScrollEvent e) {
    if (this.liveHandler != null && this.liveHandler.isEnabled()) {
        this.liveHandler.handleScroll(this, e);
    }
    for (MouseHandlerFX handler: this.auxiliaryMouseHandlers) {
        if (handler.isEnabled()) {
            handler.handleScroll(this, e);
        }
    }
}
 
源代码17 项目: mzmine3   文件: ChartGestureMouseAdapterFX.java
/**
 * Handles a scroll event. This implementation does nothing, override the method if required.
 * 
 * @param canvas the canvas ({@code null} not permitted).
 * @param e the event ({@code null} not permitted).
 */
@Override
public void handleScroll(ChartCanvas chartPanel, ScrollEvent eOrig) {
  if (gestureHandlers == null || gestureHandlers.isEmpty() || !listensFor(Event.MOUSE_WHEEL))
    return;

  MouseEventWrapper e = new MouseEventWrapper(eOrig);
  ChartEntity entity = findChartEntity(e);
  ChartGesture.Entity gestureEntity = ChartGesture.getGestureEntity(entity);
  GestureButton button = GestureButton.getButton(e.getButton());

  // handle event
  handleEvent(new ChartGestureEvent(cw, e, entity,
      new ChartGesture(gestureEntity, Event.MOUSE_WHEEL, button)));
}
 
源代码18 项目: mars-sim   文件: SettlersController.java
public void speedUpScroll() {
//    	final IntegerProperty vValueProperty = new SimpleIntegerProperty(0);
//        final int steps = 20;
//
//        scrollPane.vvalueProperty().bind(vValueProperty);
//
//        scrollPane.setOnSwipeDown(new EventHandler<GestureEvent>() {
//
//            public void handle(GestureEvent event) {
//                // calculate the needed value here
//                vValueProperty.set(vValueProperty.get() + steps);
//            }
//        });
        
        scrollPane.setContent(innerVBox);

        innerVBox.setOnScroll(new EventHandler<ScrollEvent>() {
            @Override
            public void handle(ScrollEvent event) {
            	// deltaY makes the scrolling a bit faster
                double deltaY = event.getDeltaY()*150; 
                double width = scrollPane.getContent().getBoundsInLocal().getWidth();
                double vvalue = scrollPane.getVvalue();
                scrollPane.setVvalue(vvalue + -deltaY/width); 
                // deltaY/width to make the scrolling equally fast regardless of the actual width of the component
            }
        });
        
    }
 
源代码19 项目: Flowless   文件: VirtualFlow.java
private VirtualFlow(
        ObservableList<T> items,
        Function<? super T, ? extends C> cellFactory,
        OrientationHelper orientation,
        Gravity gravity) {
    this.getStyleClass().add("virtual-flow");
    this.items = items;
    this.orientation = orientation;
    this.cellListManager = new CellListManager<>(this, items, cellFactory);
    this.gravity.set(gravity);
    MemoizationList<C> cells = cellListManager.getLazyCellList();
    this.sizeTracker = new SizeTracker(orientation, layoutBoundsProperty(), cells);
    this.cellPositioner = new CellPositioner<>(cellListManager, orientation, sizeTracker);
    this.navigator = new Navigator<>(cellListManager, cellPositioner, orientation, this.gravity, sizeTracker);

    getChildren().add(navigator);
    clipProperty().bind(Val.map(
            layoutBoundsProperty(),
            b -> new Rectangle(b.getWidth(), b.getHeight())));

    lengthOffsetEstimate = sizeTracker.lengthOffsetEstimateProperty().asVar(this::setLengthOffset);

    // scroll content by mouse scroll
    this.addEventHandler(ScrollEvent.ANY, se -> {
        scrollXBy(-se.getDeltaX());
        scrollYBy(-se.getDeltaY());
        se.consume();
    });
}
 
源代码20 项目: chart-fx   文件: Zoomer.java
private void registerMouseHandlers() {
    registerInputEventHandler(MouseEvent.MOUSE_PRESSED, zoomInStartHandler);
    registerInputEventHandler(MouseEvent.MOUSE_DRAGGED, zoomInDragHandler);
    registerInputEventHandler(MouseEvent.MOUSE_RELEASED, zoomInEndHandler);
    registerInputEventHandler(MouseEvent.MOUSE_CLICKED, zoomOutHandler);
    registerInputEventHandler(MouseEvent.MOUSE_CLICKED, zoomOriginHandler);
    registerInputEventHandler(ScrollEvent.SCROLL, zoomScrollHandler);
    registerInputEventHandler(MouseEvent.MOUSE_PRESSED, panStartHandler);
    registerInputEventHandler(MouseEvent.MOUSE_DRAGGED, panDragHandler);
    registerInputEventHandler(MouseEvent.MOUSE_RELEASED, panEndHandler);
}
 
源代码21 项目: buffer_bci   文件: ChartCanvas.java
/**
 * Handles a scroll event by passing it on to the registered handlers.
 * 
 * @param e  the scroll event.
 */
protected void handleScroll(ScrollEvent e) {
    if (this.liveHandler != null && this.liveHandler.isEnabled()) {
        this.liveHandler.handleScroll(this, e);
    }
    for (MouseHandlerFX handler: this.auxiliaryMouseHandlers) {
        if (handler.isEnabled()) {
            handler.handleScroll(this, e);
        }
    }
}
 
源代码22 项目: jfreechart-fx   文件: ChartCanvas.java
/**
 * Handles a scroll event by passing it on to the registered handlers.
 * 
 * @param e  the scroll event.
 */
protected void handleScroll(ScrollEvent e) {
    if (this.liveHandler != null && this.liveHandler.isEnabled()) {
        this.liveHandler.handleScroll(this, e);
    }
    for (MouseHandlerFX handler: this.auxiliaryMouseHandlers) {
        if (handler.isEnabled()) {
            handler.handleScroll(this, e);
        }
    }
}
 
源代码23 项目: jfreechart-fx   文件: ScrollHandlerFX.java
/**
 * Handle the case where a plot implements the {@link Zoomable} interface.
 *
 * @param canvas  the chart canvas.
 * @param zoomable  the zoomable plot.
 * @param e  the mouse wheel event.
 */
private void handleZoomable(ChartCanvas canvas, Zoomable zoomable, 
        ScrollEvent e) {
	if (canvas.getChart() == null) {
	    return;
	}
    // don't zoom unless the mouse pointer is in the plot's data area
    ChartRenderingInfo info = canvas.getRenderingInfo();
    PlotRenderingInfo pinfo = info.getPlotInfo();
    Point2D p = new Point2D.Double(e.getX(), e.getY());
    if (pinfo.getDataArea().contains(p)) {
        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
        boolean notifyState = plot.isNotify();
        plot.setNotify(false);
        int clicks = (int) e.getDeltaY();
        double zf = 1.0 + this.zoomFactor;
        if (clicks < 0) {
            zf = 1.0 / zf;
        }
        if (canvas.isDomainZoomable()) {
            zoomable.zoomDomainAxes(zf, pinfo, p, true);
        }
        if (canvas.isRangeZoomable()) {
            zoomable.zoomRangeAxes(zf, pinfo, p, true);
        }
        plot.setNotify(notifyState);  // this generates the change event too
    } 
}
 
源代码24 项目: JFoenix   文件: PanningGestures.java
public static <T extends Node & IPannablePane> PanningGestures<T> attachViewPortGestures(T pannableCanvas, boolean configurable) {
    PanningGestures<T> panningGestures = new PanningGestures<>(pannableCanvas);
    if (configurable) {
        panningGestures.useViewportGestures = new SimpleBooleanProperty(true);
        panningGestures.useViewportGestures.addListener((o, oldVal, newVal) -> {
            final Parent parent = pannableCanvas.parentProperty().get();
            if (parent == null) {
                return;
            }
            if (newVal) {
                parent.addEventHandler(MouseEvent.MOUSE_PRESSED, panningGestures.onMousePressedEventHandler);
                parent.addEventHandler(MouseEvent.MOUSE_DRAGGED, panningGestures.onMouseDraggedEventHandler);
                parent.addEventHandler(ScrollEvent.ANY, panningGestures.onScrollEventHandler);
            } else {
                parent.removeEventHandler(MouseEvent.MOUSE_PRESSED, panningGestures.onMousePressedEventHandler);
                parent.removeEventHandler(MouseEvent.MOUSE_DRAGGED, panningGestures.onMouseDraggedEventHandler);
                parent.removeEventHandler(ScrollEvent.ANY, panningGestures.onScrollEventHandler);
            }
        });
    }
    pannableCanvas.parentProperty().addListener((o, oldVal, newVal) -> {
        if (oldVal != null) {
            oldVal.removeEventHandler(MouseEvent.MOUSE_PRESSED, panningGestures.onMousePressedEventHandler);
            oldVal.removeEventHandler(MouseEvent.MOUSE_DRAGGED, panningGestures.onMouseDraggedEventHandler);
            oldVal.removeEventHandler(ScrollEvent.ANY, panningGestures.onScrollEventHandler);
        }
        if (newVal != null) {
            newVal.addEventHandler(MouseEvent.MOUSE_PRESSED, panningGestures.onMousePressedEventHandler);
            newVal.addEventHandler(MouseEvent.MOUSE_DRAGGED, panningGestures.onMouseDraggedEventHandler);
            newVal.addEventHandler(ScrollEvent.ANY, panningGestures.onScrollEventHandler);
        }
    });
    return panningGestures;
}
 
源代码25 项目: buffer_bci   文件: ScrollHandlerFX.java
@Override
public void handleScroll(ChartCanvas canvas, ScrollEvent e) {
    JFreeChart chart = canvas.getChart();
    Plot plot = chart.getPlot();
    if (plot instanceof Zoomable) {
        Zoomable zoomable = (Zoomable) plot;
        handleZoomable(canvas, zoomable, e);
    }
    else if (plot instanceof PiePlot) {
        PiePlot pp = (PiePlot) plot;
        pp.handleMouseWheelRotation((int) e.getDeltaY());
    }
}
 
源代码26 项目: DeskChan   文件: MouseEventNotificator.java
/**
 * Removes all event listeners that were set earlier.
 */
public void cleanListeners() {
    // All methods have their own internal checks for the case when a filter is not set and equals null.
    sender.removeEventFilter(MouseEvent.MOUSE_CLICKED, this::notifyClickEvent);
    sender.removeEventFilter(ScrollEvent.SCROLL, this::notifyScrollEvent);
    if (SystemUtils.IS_OS_WINDOWS) {
        GlobalScreen.removeNativeMouseWheelListener(mouseWheelListener);
    }
}
 
源代码27 项目: ccu-historian   文件: ChartCanvas.java
/**
 * Handles a scroll event by passing it on to the registered handlers.
 * 
 * @param e  the scroll event.
 */
protected void handleScroll(ScrollEvent e) {
    if (this.liveHandler != null && this.liveHandler.isEnabled()) {
        this.liveHandler.handleScroll(this, e);
    }
    for (MouseHandlerFX handler: this.auxiliaryMouseHandlers) {
        if (handler.isEnabled()) {
            handler.handleScroll(this, e);
        }
    }
}
 
源代码28 项目: ccu-historian   文件: ScrollHandlerFX.java
@Override
public void handleScroll(ChartCanvas canvas, ScrollEvent e) {
    JFreeChart chart = canvas.getChart();
    Plot plot = chart.getPlot();
    if (plot instanceof Zoomable) {
        Zoomable zoomable = (Zoomable) plot;
        handleZoomable(canvas, zoomable, e);
    }
    else if (plot instanceof PiePlot) {
        PiePlot pp = (PiePlot) plot;
        pp.handleMouseWheelRotation((int) e.getDeltaY());
    }
}
 
源代码29 项目: ECG-Viewer   文件: ScrollHandlerFX.java
@Override
public void handleScroll(ChartCanvas canvas, ScrollEvent e) {
    JFreeChart chart = canvas.getChart();
    Plot plot = chart.getPlot();
    if (plot instanceof Zoomable) {
        Zoomable zoomable = (Zoomable) plot;
        handleZoomable(canvas, zoomable, e);
    }
    else if (plot instanceof PiePlot) {
        PiePlot pp = (PiePlot) plot;
        pp.handleMouseWheelRotation((int) e.getDeltaY());
    }
}
 
源代码30 项目: buffer_bci   文件: ChartCanvas.java
/**
 * Handles a scroll event by passing it on to the registered handlers.
 * 
 * @param e  the scroll event.
 */
protected void handleScroll(ScrollEvent e) {
    if (this.liveHandler != null && this.liveHandler.isEnabled()) {
        this.liveHandler.handleScroll(this, e);
    }
    for (MouseHandlerFX handler: this.auxiliaryMouseHandlers) {
        if (handler.isEnabled()) {
            handler.handleScroll(this, e);
        }
    }
}
 
 类所在包
 同包方法