UI.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:mytourbook 作者:
public static Rectangle getDisplayBounds(final Control composite, final Point location) {

        Rectangle displayBounds;
        final Monitor[] allMonitors = composite.getDisplay().getMonitors();

        if (allMonitors.length > 1) {
            // By default present in the monitor of the control
            displayBounds = composite.getMonitor().getBounds();
            final Point p = new Point(location.x, location.y);

            // Search on which monitor the event occurred
            Rectangle tmp;
            for (final Monitor element : allMonitors) {
                tmp = element.getBounds();
                if (tmp.contains(p)) {
                    displayBounds = tmp;
                    break;
                }
            }

        } else {
            displayBounds = composite.getDisplay().getBounds();
        }

        return displayBounds;
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号