List of usage examples for java.awt PointerInfo getDevice
public GraphicsDevice getDevice()
From source file:com.haulmont.cuba.desktop.sys.DesktopToolTipManager.java
protected Point getToolTipLocation(PointerInfo pointerInfo, String text) { Point mouseLocation = pointerInfo.getLocation(); Rectangle bounds = getDeviceBounds(pointerInfo.getDevice()); // Location on the current screen (suitable if there is more than one screen) Point currentScreenMouseLocation = getCurrentScreenMouseLocation(mouseLocation, bounds); // Location to display tooltip Point location = new Point(mouseLocation); Dimension dimension = DesktopComponentsHelper.measureHtmlText(text); location.x += getIndentation(bounds.width, dimension.width, currentScreenMouseLocation.x, DEFAULT_HORIZONTAL_INDENTATION); location.y += getIndentation(bounds.height, dimension.height, currentScreenMouseLocation.y, DEFAULT_VERTICAL_INDENTATION); return location; }