XWindowPeer.java 文件源码

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

项目:openjdk-jdk10 作者:
public void setBounds(int x, int y, int width, int height, int op) {
    XToolkit.awtLock();
    try {
        Rectangle oldBounds = getBounds();

        super.setBounds(x, y, width, height, op);

        Rectangle bounds = getBounds();

        XSizeHints hints = getHints();
        setSizeHints(hints.get_flags() | XUtilConstants.PPosition | XUtilConstants.PSize,
                         bounds.x, bounds.y, bounds.width, bounds.height);
        XWM.setMotifDecor(this, false, 0, 0);

        boolean isResized = !bounds.getSize().equals(oldBounds.getSize());
        boolean isMoved = !bounds.getLocation().equals(oldBounds.getLocation());
        if (isMoved || isResized) {
            repositionSecurityWarning();
        }
        if (isResized) {
            postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_RESIZED));
        }
        if (isMoved) {
            postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_MOVED));
        }
    } finally {
        XToolkit.awtUnlock();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号