jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java
changeset 3938 ef327bd847c0
parent 439 3488710b02f8
child 4214 0fa32d38146b
equal deleted inserted replaced
3934:487e1aa949c4 3938:ef327bd847c0
    28 import java.awt.Rectangle;
    28 import java.awt.Rectangle;
    29 import java.awt.Insets;
    29 import java.awt.Insets;
    30 
    30 
    31 import java.awt.event.ComponentEvent;
    31 import java.awt.event.ComponentEvent;
    32 
    32 
    33 import java.util.logging.Level;
    33 import sun.util.logging.PlatformLogger;
    34 import java.util.logging.Logger;
       
    35 
    34 
    36 import sun.awt.ComponentAccessor;
    35 import sun.awt.ComponentAccessor;
    37 
    36 
    38 /**
    37 /**
    39  * This class implements window which serves as content window for decorated frames.
    38  * This class implements window which serves as content window for decorated frames.
    42  *
    41  *
    43  * It should always be located at (- left inset, - top inset) in the associated
    42  * It should always be located at (- left inset, - top inset) in the associated
    44  * decorated window.  So coordinates in it would be the same as java coordinates.
    43  * decorated window.  So coordinates in it would be the same as java coordinates.
    45  */
    44  */
    46 public final class XContentWindow extends XWindow {
    45 public final class XContentWindow extends XWindow {
    47     private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XContentWindow");
    46     private static PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XContentWindow");
    48 
    47 
    49     static XContentWindow createContent(XDecoratedPeer parentFrame) {
    48     static XContentWindow createContent(XDecoratedPeer parentFrame) {
    50         final WindowDimensions dims = parentFrame.getDimensions();
    49         final WindowDimensions dims = parentFrame.getDimensions();
    51         Rectangle rec = dims.getBounds();
    50         Rectangle rec = dims.getBounds();
    52         // Fix for  - set the location of the content window to the (-left inset, -top inset)
    51         // Fix for  - set the location of the content window to the (-left inset, -top inset)
   114             Rectangle newBounds = dims.getBounds();
   113             Rectangle newBounds = dims.getBounds();
   115             Insets in = dims.getInsets();
   114             Insets in = dims.getInsets();
   116             if (in != null) {
   115             if (in != null) {
   117                 newBounds.setLocation(-in.left, -in.top);
   116                 newBounds.setLocation(-in.left, -in.top);
   118             }
   117             }
   119             if (insLog.isLoggable(Level.FINE)) insLog.log(Level.FINE, "Setting content bounds {0}, old bounds {1}",
   118             if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting content bounds {0}, old bounds {1}",
   120                                                           new Object[] {newBounds, getBounds()});
   119                                                                     newBounds, getBounds());
   121             // Fix for 5023533:
   120             // Fix for 5023533:
   122             // Change in the size of the content window means, well, change of the size
   121             // 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
   122             // Change in the location of the content window means change in insets
   124             boolean needHandleResize = !(newBounds.equals(getBounds()));
   123             boolean needHandleResize = !(newBounds.equals(getBounds()));
   125             reshape(newBounds);
   124             reshape(newBounds);