Java Code Examples for sun.awt.AWTAccessor.ComponentAccessor#getWidth()

The following examples show how to use sun.awt.AWTAccessor.ComponentAccessor#getWidth() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XWindow.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void handleExposeEvent(XEvent xev) {
    super.handleExposeEvent(xev);
    XExposeEvent xe = xev.get_xexpose();
    if (isEventDisabled(xev)) {
        return;
    }

    int x = scaleDown(xe.get_x());
    int y = scaleDown(xe.get_y());
    int w = scaleDown(xe.get_width());
    int h = scaleDown(xe.get_height());

    Component target = getEventSource();
    ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();

    if (!compAccessor.getIgnoreRepaint(target)
        && compAccessor.getWidth(target) != 0
        && compAccessor.getHeight(target) != 0)
    {
        postPaintEvent(target, x, y, w, h);
    }
}
 
Example 2
Source File: XWindowPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void repositionSecurityWarning() {
    // NOTE: On KWin if the window/border snapping option is enabled,
    // the Java window may be swinging while it's being moved.
    // This doesn't make the application unusable though looks quite ugly.
    // Probobly we need to find some hint to assign to our Security
    // Warning window in order to exclude it from the snapping option.
    // We are not currently aware of existance of such a property.
    if (warningWindow != null) {
        // We can't use the coordinates stored in the XBaseWindow since
        // they are zeros for decorated frames.
        ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
        int x = compAccessor.getX(target);
        int y = compAccessor.getY(target);
        int width = compAccessor.getWidth(target);
        int height = compAccessor.getHeight(target);
        warningWindow.reposition(x, y, width, height);
    }
}
 
Example 3
Source File: LWWindowPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void repositionSecurityWarning() {
    if (warningWindow != null) {
        ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
        Window target = getTarget();
        int x = compAccessor.getX(target);
        int y = compAccessor.getY(target);
        int width = compAccessor.getWidth(target);
        int height = compAccessor.getHeight(target);
        warningWindow.reposition(x, y, width, height);
    }
}