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

Print this page




 113             // location as -(insets)
 114             Rectangle newBounds = dims.getBounds();
 115             Insets in = dims.getInsets();
 116             if (in != null) {
 117                 newBounds.setLocation(-in.left, -in.top);
 118             }
 119             if (insLog.isLoggable(Level.FINE)) insLog.log(Level.FINE, "Setting content bounds {0}, old bounds {1}",
 120                                                           new Object[] {newBounds, getBounds()});
 121             // Fix for 5023533:
 122             // Change in the size of the content window means, well, change of the size
 123             // Change in the location of the content window means change in insets
 124             boolean needHandleResize = !(newBounds.equals(getBounds()));
 125             reshape(newBounds);
 126             if (needHandleResize) {
 127                 insLog.fine("Sending RESIZED");
 128                 handleResize(newBounds);
 129             }
 130         } finally {
 131             XToolkit.awtUnlock();
 132         }
 133         validateSurface();
 134     }
 135 
 136     // NOTE: This method may be called by privileged threads.
 137     //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
 138     public void handleResize(Rectangle bounds) {
 139         ComponentAccessor.setWidth((Component)target, bounds.width);
 140         ComponentAccessor.setHeight((Component)target, bounds.height);
 141         postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED));
 142     }
 143 
 144 
 145     public void handleExposeEvent(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




 113             // location as -(insets)
 114             Rectangle newBounds = dims.getBounds();
 115             Insets in = dims.getInsets();
 116             if (in != null) {
 117                 newBounds.setLocation(-in.left, -in.top);
 118             }
 119             if (insLog.isLoggable(Level.FINE)) insLog.log(Level.FINE, "Setting content bounds {0}, old bounds {1}",
 120                                                           new Object[] {newBounds, getBounds()});
 121             // Fix for 5023533:
 122             // Change in the size of the content window means, well, change of the size
 123             // Change in the location of the content window means change in insets
 124             boolean needHandleResize = !(newBounds.equals(getBounds()));
 125             reshape(newBounds);
 126             if (needHandleResize) {
 127                 insLog.fine("Sending RESIZED");
 128                 handleResize(newBounds);
 129             }
 130         } finally {
 131             XToolkit.awtUnlock();
 132         }

 133     }
 134 
 135     // NOTE: This method may be called by privileged threads.
 136     //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
 137     public void handleResize(Rectangle bounds) {
 138         ComponentAccessor.setWidth((Component)target, bounds.width);
 139         ComponentAccessor.setHeight((Component)target, bounds.height);
 140         postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED));
 141     }
 142 
 143 
 144     public void handleExposeEvent(Component target, int x, int y, int w, int h) {
 145         // TODO: ?
 146         // get rid of 'istanceof' by subclassing:
 147         // XContentWindow -> XFrameContentWindow
 148 
 149         // Expose event(s) that result from deiconification
 150         // come before a deicinofication notification.
 151         // We reorder these events by saving all expose events
 152         // that come when the frame is iconified. Then we