91 void setContentBounds(WindowDimensions dims) {
92 XToolkit.awtLock();
93 try {
94 // Bounds of content window are of the same size as bounds of Java window and with
95 // location as -(insets)
96 Rectangle newBounds = dims.getBounds();
97 Insets in = dims.getInsets();
98 if (in != null) {
99 newBounds.setLocation(-in.left, -in.top);
100 }
101 if (insLog.isLoggable(Level.FINE)) {
102 insLog.log(Level.FINE, "Setting content bounds {0}, old bounds {1}",
103 new Object[] {String.valueOf(newBounds), String.valueOf(getBounds())});
104 }
105 // Fix for 5023533:
106 // Change in the size of the content window means, well, change of the size
107 // Change in the location of the content window means change in insets
108 boolean needHandleResize = !(newBounds.equals(getBounds()));
109 reshape(newBounds);
110 if (needHandleResize) {
111 insLog.fine("Sending RESIZED");
112 handleResize(newBounds);
113 }
114 } finally {
115 XToolkit.awtUnlock();
116 }
117 validateSurface();
118 }
119
120 // NOTE: This method may be called by privileged threads.
121 // DO NOT INVOKE CLIENT CODE ON THIS THREAD!
122 public void handleResize(Rectangle bounds) {
123 ComponentAccessor.setWidth((Component)target, bounds.width);
124 ComponentAccessor.setHeight((Component)target, bounds.height);
125 postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED));
126 }
127
128
129 public void postPaintEvent(Component target, int x, int y, int w, int h) {
130 // TODO: ?
131 // get rid of 'istanceof' by subclassing:
|
91 void setContentBounds(WindowDimensions dims) {
92 XToolkit.awtLock();
93 try {
94 // Bounds of content window are of the same size as bounds of Java window and with
95 // location as -(insets)
96 Rectangle newBounds = dims.getBounds();
97 Insets in = dims.getInsets();
98 if (in != null) {
99 newBounds.setLocation(-in.left, -in.top);
100 }
101 if (insLog.isLoggable(Level.FINE)) {
102 insLog.log(Level.FINE, "Setting content bounds {0}, old bounds {1}",
103 new Object[] {String.valueOf(newBounds), String.valueOf(getBounds())});
104 }
105 // Fix for 5023533:
106 // Change in the size of the content window means, well, change of the size
107 // Change in the location of the content window means change in insets
108 boolean needHandleResize = !(newBounds.equals(getBounds()));
109 reshape(newBounds);
110 if (needHandleResize) {
111 if (insLog.isLoggable(Level.FINE)) {
112 insLog.fine("Sending RESIZED");
113 }
114 handleResize(newBounds);
115 }
116 } finally {
117 XToolkit.awtUnlock();
118 }
119 validateSurface();
120 }
121
122 // NOTE: This method may be called by privileged threads.
123 // DO NOT INVOKE CLIENT CODE ON THIS THREAD!
124 public void handleResize(Rectangle bounds) {
125 ComponentAccessor.setWidth((Component)target, bounds.width);
126 ComponentAccessor.setHeight((Component)target, bounds.height);
127 postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED));
128 }
129
130
131 public void postPaintEvent(Component target, int x, int y, int w, int h) {
132 // TODO: ?
133 // get rid of 'istanceof' by subclassing:
|