当前位置: 首页>>代码示例>>Java>>正文


Java Point.addVector方法代码示例

本文整理汇总了Java中com.musala.atmosphere.commons.geometry.Point.addVector方法的典型用法代码示例。如果您正苦于以下问题:Java Point.addVector方法的具体用法?Java Point.addVector怎么用?Java Point.addVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.musala.atmosphere.commons.geometry.Point的用法示例。


在下文中一共展示了Point.addVector方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tap

import com.musala.atmosphere.commons.geometry.Point; //导入方法依赖的package包/类
private boolean tap(UiElementPropertiesContainer element) {
    Bounds elementBounds = element.getBounds();
    Point centerPoint = elementBounds.getCenter();
    Point point = elementBounds.getRelativePoint(centerPoint);
    Point tapPoint = elementBounds.getUpperLeftCorner();
    tapPoint.addVector(point);

    boolean tapSuccessful = false;
    if (elementBounds.contains(tapPoint)) {
        tapSuccessful = gestureEntity.tapScreenLocation(tapPoint);
        finalizeUiElementOperation();
    }  else {
        String message = String.format("Point %s not in element bounds.", point.toString());
        LOGGER.error(message);
        throw new IllegalArgumentException(message);
    }

    return tapSuccessful;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-agent,代码行数:20,代码来源:GpsLocationEntity.java

示例2: tap

import com.musala.atmosphere.commons.geometry.Point; //导入方法依赖的package包/类
/**
 * Simulates tapping on a relative point in the current UI element.
 *
 * @param point
 *        - the relative point that will be added to the upper left corner's coordinates
 * @return <code>true</code> if the tapping is successful, <code>false</code> if it fails
 * @throws StaleElementReferenceException
 *         if the element has become stale before executing this method
 */
public boolean tap(Point point) {
    revalidateThrowing();
    Bounds elementBounds = propertiesContainer.getBounds();
    Point tapPoint = elementBounds.getUpperLeftCorner();
    tapPoint.addVector(point);

    if (elementBounds.contains(tapPoint)) {
        boolean isElementTapped = (boolean) communicator.sendAction(RoutingAction.GESTURE_TAP, tapPoint);
        finalizeUiElementOperation();
        return isElementTapped;
    } else {
        String message = String.format("Point %s not in element bounds.", point.toString());
        LOGGER.error(message);
        throw new IllegalArgumentException(message);
    }
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-client,代码行数:26,代码来源:UiElement.java

示例3: doubleTap

import com.musala.atmosphere.commons.geometry.Point; //导入方法依赖的package包/类
/**
 * Simulates double-tapping on a point in this UiElement.
 *
 * @param point
 *        - a {@link Point} object, representing the relative coordinates of the point to tap inside this UiElement.
 *        <i><b><u>Note</u></b>: the point with relative coordinates (0,0) denotes the upper-left corner of the
 *        UiElement</i>
 * @return <code>true</code> if the double tapping is successful, <code>false</code> if it fails
 * @throws StaleElementReferenceException
 *         if the element has become stale before executing this method
 */
public boolean doubleTap(Point point) {
    revalidateThrowing();
    Bounds elementBounds = propertiesContainer.getBounds();
    Point tapPoint = elementBounds.getUpperLeftCorner();
    tapPoint.addVector(point);

    if (elementBounds.contains(tapPoint)) {
        boolean isElementTapped = (boolean) communicator.sendAction(RoutingAction.GESTURE_DOUBLE_TAP, tapPoint);
        finalizeUiElementOperation();
        return isElementTapped;
    } else {
        String message = String.format("Point %s not in element bounds.", point.toString());
        LOGGER.error(message);
        throw new IllegalArgumentException(message);
    }
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-client,代码行数:28,代码来源:UiElement.java

示例4: longPress

import com.musala.atmosphere.commons.geometry.Point; //导入方法依赖的package包/类
/**
 * Simulates long press on given point inside the current {@link UiElement uielement} for given time.
 *
 * @param innerPoint
 *        - point, representing the relative coordinates of the point for long press, inside the element's bounds
 * @param timeout
 *        - time in ms for which the element should be held
 * @return true, if operation is successful, and false otherwise
 * @throws StaleElementReferenceException
 *         if the element has become stale before executing this method
 */
public boolean longPress(Point innerPoint, int timeout) {
    revalidateThrowing();
    Bounds elementBounds = propertiesContainer.getBounds();
    Point longPressPoint = elementBounds.getUpperLeftCorner();
    longPressPoint.addVector(innerPoint);

    if (elementBounds.contains(longPressPoint)) {
        boolean isElementTapped = (boolean) communicator.sendAction(RoutingAction.GESTURE_LONG_PRESS, longPressPoint, timeout);
        finalizeUiElementOperation();
        return isElementTapped;
    } else {
        String message = String.format("Point %s not in element bounds.", innerPoint.toString());
        LOGGER.error(message);
        throw new IllegalArgumentException(message);
    }
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-client,代码行数:28,代码来源:UiElement.java


注:本文中的com.musala.atmosphere.commons.geometry.Point.addVector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。