src/solaris/classes/sun/awt/X11/XContentWindow.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 120                             newBounds, getBounds());
 121             }
 122             // Fix for 5023533:
 123             // Change in the size of the content window means, well, change of the size
 124             // Change in the location of the content window means change in insets
 125             boolean needHandleResize = !(newBounds.equals(getBounds()));
 126             reshape(newBounds);
 127             if (needHandleResize) {
 128                 insLog.fine("Sending RESIZED");
 129                 handleResize(newBounds);
 130             }
 131         } finally {
 132             XToolkit.awtUnlock();
 133         }
 134         validateSurface();
 135     }
 136 
 137     // NOTE: This method may be called by privileged threads.
 138     //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
 139     public void handleResize(Rectangle bounds) {
 140         AWTAccessor.getComponentAccessor().setSize((Component)target, bounds.width, bounds.height);
 141         postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED));
 142     }
 143 
 144 
 145     public void postPaintEvent(Component target, int x, int y, int w, int h) {
 146         // TODO: ?
 147         // get rid of 'istanceof' by subclassing:
 148         // XContentWindow -> XFrameContentWindow
 149 
 150         // Expose event(s) that result from deiconification
 151         // come before a deicinofication notification.
 152         // We reorder these events by saving all expose events
 153         // that come when the frame is iconified. Then we
 154         // actually handle saved expose events on deiconification.
 155 
 156         if (parentFrame instanceof XFramePeer &&
 157                 (((XFramePeer)parentFrame).getState() & java.awt.Frame.ICONIFIED) != 0) {
 158             // Save expose events if the frame is iconified
 159             // in order to handle them on deiconification.
 160             iconifiedExposeEvents.add(new SavedExposeEvent(target, x, y, w, h));


   1 /*
   2  * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 120                             newBounds, getBounds());
 121             }
 122             // Fix for 5023533:
 123             // Change in the size of the content window means, well, change of the size
 124             // Change in the location of the content window means change in insets
 125             boolean needHandleResize = !(newBounds.equals(getBounds()));
 126             reshape(newBounds);
 127             if (needHandleResize) {
 128                 insLog.fine("Sending RESIZED");
 129                 handleResize(newBounds);
 130             }
 131         } finally {
 132             XToolkit.awtUnlock();
 133         }
 134         validateSurface();
 135     }
 136 
 137     // NOTE: This method may be called by privileged threads.
 138     //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
 139     public void handleResize(Rectangle bounds) {
 140         AWTAccessor.getComponentAccessor().setSize(target, bounds.width, bounds.height);
 141         postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED));
 142     }
 143 
 144 
 145     public void postPaintEvent(Component target, int x, int y, int w, int h) {
 146         // TODO: ?
 147         // get rid of 'istanceof' by subclassing:
 148         // XContentWindow -> XFrameContentWindow
 149 
 150         // Expose event(s) that result from deiconification
 151         // come before a deicinofication notification.
 152         // We reorder these events by saving all expose events
 153         // that come when the frame is iconified. Then we
 154         // actually handle saved expose events on deiconification.
 155 
 156         if (parentFrame instanceof XFramePeer &&
 157                 (((XFramePeer)parentFrame).getState() & java.awt.Frame.ICONIFIED) != 0) {
 158             // Save expose events if the frame is iconified
 159             // in order to handle them on deiconification.
 160             iconifiedExposeEvents.add(new SavedExposeEvent(target, x, y, w, h));