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


Java WinDef.POINT属性代码示例

本文整理汇总了Java中com.sun.jna.platform.win32.WinDef.POINT属性的典型用法代码示例。如果您正苦于以下问题:Java WinDef.POINT属性的具体用法?Java WinDef.POINT怎么用?Java WinDef.POINT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.sun.jna.platform.win32.WinDef的用法示例。


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

示例1: run

public void run() {
    UIAutomation automation = UIAutomation.getInstance();

    do {
        this.rest();

        Point p = MouseInfo.getPointerInfo().getLocation();

        logger.info(p.getX() + " - " + p.getY());

        WinDef.POINT point = new WinDef.POINT();
        point.x = (int) p.getX();
        point.y = (int) p.getY();

        try {
            AutomationElement elementUnder = automation.getElementFromPoint(point);

            logger.info("From point = " + elementUnder.getName());

            AutomationElement elementFocus = automation.getFocusedElement();
            logger.info("From focus = " + elementFocus.getName());

        } catch (Exception ex) {
            logger.info(ex.getStackTrace());
        }
    } while (true);
}
 
开发者ID:mmarquee,项目名称:ui-automation,代码行数:27,代码来源:DemoPointOver.java

示例2: getClickablePoint

/**
 * Gets the clickable point for the control.
 *
 * @return The clickable point.
 * @throws AutomationException Call to Automation API failed.
 */
public WinDef.POINT getClickablePoint() throws AutomationException {
    WinDef.POINT.ByReference pbr = new WinDef.POINT.ByReference();

    WinDef.BOOLByReference br = new WinDef.BOOLByReference();

    final int res = this.element.getClickablePoint(pbr, br);
    if (res != 0) {
        throw new AutomationException(res);
    }

    return new WinDef.POINT(pbr.x, pbr.y);
}
 
开发者ID:mmarquee,项目名称:ui-automation,代码行数:18,代码来源:AutomationElement.java

示例3: testGetClickablePointForDesktop

@Test
public void testGetClickablePointForDesktop() throws AutomationException {
	AutomationElement root = instance.getRootElement();

	WinDef.POINT empty = new WinDef.POINT(0, 0);

	assertTrue("root:" + root.getClickablePoint(), root.getClickablePoint().dataEquals(empty));
}
 
开发者ID:mmarquee,项目名称:ui-automation,代码行数:8,代码来源:AutomationElementTest.java

示例4: getCoord

public List<Integer> getCoord()
{
    if(!available || libuser32 == null)
        return null;
    WinDef.POINT point = new WinDef.POINT(0,0);
    if(libuser32.ClientToScreen(libuser32.FindWindowW(null, name.toCharArray()), point))
    {
        List<Integer> coord = new ArrayList<>(); 
        coord.add(point.x);
        coord.add(point.y);
        return coord;
    }
    else
        return null;
}
 
开发者ID:thatdude624,项目名称:Spark-Reader,代码行数:15,代码来源:WindowHook.java

示例5: click

/**
 * <p>
 * Invokes the click event for this control.
 * </p>
 * <p>
 * Actually manufactures the click, as the toolbar buttons do
 * not seem behave properly
 * </p>
 * @throws AutomationException Automation library error.
 */
public void click() throws AutomationException {
    WinDef.POINT point = this.element.getClickablePoint();

    AutomationMouse mouse = AutomationMouse.getInstance();
    mouse.setLocation(point.x, point.y);
    mouse.leftClick();
}
 
开发者ID:mmarquee,项目名称:ui-automation,代码行数:17,代码来源:AutomationToolBarButton.java

示例6: testGetClickablePoint_Throws_Exception_When_Automation_Returns_False

@Test(expected = AutomationException.class)
public void testGetClickablePoint_Throws_Exception_When_Automation_Returns_False() throws AutomationException {
	IUIAutomationElement mocked = Mockito.mock(IUIAutomationElement.class);

	when(mocked.getClickablePoint(isA(WinDef.POINT.ByReference.class), isA(WinDef.BOOLByReference.class)))
			.thenReturn(-1);

	WinDef.POINT point = new WinDef.POINT();

	AutomationElement element = new AutomationElement(mocked);

	element.getClickablePoint();
}
 
开发者ID:mmarquee,项目名称:ui-automation,代码行数:13,代码来源:AutomationElementTest.java

示例7: getClickablePoint

/**
 * Gets a clickable point for the control.
 *
 * This is manufactured by getting the bounding rect and finding the middle point.
 *
 * @return The clickable point.
 * @throws AutomationException Error in automation library.
 */
public WinDef.POINT getClickablePoint() throws AutomationException {
    return this.element.getClickablePoint();
}
 
开发者ID:mmarquee,项目名称:ui-automation,代码行数:11,代码来源:AutomationBase.java

示例8: setLocation

/**
 * Moves the mouse pointer to a given screen point.
 *
 * @param point The point to move to.
 */
public void setLocation(final WinDef.POINT point) {
    robot.mouseMove(point.x, point.y);
}
 
开发者ID:mmarquee,项目名称:ui-automation,代码行数:8,代码来源:AutomationMouse.java

示例9: elementFromPoint

int elementFromPoint(WinDef.POINT pt, PointerByReference element); 
开发者ID:mmarquee,项目名称:ui-automation,代码行数:1,代码来源:IUIAutomation.java

示例10: ClientToScreen

boolean ClientToScreen(Pointer hWnd, WinDef.POINT point); 
开发者ID:thatdude624,项目名称:Spark-Reader,代码行数:1,代码来源:User32.java

示例11: ClientToScreen

public WinDef.BOOL ClientToScreen(WinDef.HWND hWnd, WinDef.POINT lpPoint); 
开发者ID:vanjadardic,项目名称:KiTTY2,代码行数:1,代码来源:User32.java


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