javafx.scene.input.ScrollEvent#isAltDown ( )源码实例Demo

下面列出了javafx.scene.input.ScrollEvent#isAltDown ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: oim-fx   文件: WebViewEventDispatcher.java
private void processScrollEvent(ScrollEvent ev) {
    if (page == null) {
        return;
    }
    double dx = - ev.getDeltaX() * webView.getFontScale() * webView.getScaleX();
    double dy = - ev.getDeltaY() * webView.getFontScale() * webView.getScaleY();
    WCMouseWheelEvent wheelEvent =
            new WCMouseWheelEvent((int)ev.getX(), (int)ev.getY(),
                (int)ev.getScreenX(), (int)ev.getScreenY(),
                System.currentTimeMillis(),
                ev.isShiftDown(), ev.isControlDown(), ev.isAltDown(),
                ev.isMetaDown(), (float)dx, (float)dy);
    page.dispatchMouseWheelEvent(wheelEvent);
    ev.consume();
}
 
源代码2 项目: gef   文件: PanOrZoomOnScrollHandler.java
/**
 * Returns <code>true</code> if the given {@link ScrollEvent} should trigger
 * panning. Otherwise returns <code>false</code>.
 *
 * @param event
 *            The {@link ScrollEvent} in question.
 * @return <code>true</code> to indicate that the given {@link ScrollEvent}
 *         should trigger panning, otherwise <code>false</code>.
 */
protected boolean isPan(ScrollEvent event) {
	// Do not scroll when a modifier key (<Alt>, <Control>, <Meta>) is
	// pressed.
	return !(event.isAltDown() || event.isControlDown()
			|| event.isMetaDown());
}
 
源代码3 项目: gef   文件: PanOrZoomOnScrollHandler.java
/**
 * Returns <code>true</code> if the given {@link ScrollEvent} should trigger
 * zooming. Otherwise returns <code>false</code>. Per default, either
 * <code>&lt;Control&gt;</code> or <code>&lt;Alt&gt;</code> has to be
 * pressed so that <code>true</code> is returned.
 *
 * @param event
 *            The {@link ScrollEvent} in question.
 * @return <code>true</code> if the given {@link ScrollEvent} should trigger
 *         zooming, otherwise <code>false</code>.
 */
protected boolean isZoom(ScrollEvent event) {
	return event.isControlDown() || event.isAltDown();
}