220 EventQueue.invokeLater(new Runnable() {
221 @Override
222 public void run() {
223 if (copyBufferEnabled) {
224 syncCopyBuffer(false, clip.x, clip.y, clip.width, clip.height);
225 }
226 content.imageUpdated(clip.x, clip.y, clip.width, clip.height);
227 }
228 });
229 } finally {
230 if (!copyBufferEnabled) {
231 content.paintUnlock();
232 }
233 }
234 }
235 @Override
236 protected boolean isPaintingOrigin() {
237 return true;
238 }
239 };
240 contentPane.setLayout(new BorderLayout());
241 contentPane.add(component);
242 setContentPane(contentPane);
243
244 contentPane.addContainerListener(new ContainerListener() {
245 @Override
246 public void componentAdded(ContainerEvent e) {
247 Component c = JLightweightFrame.this.component;
248 if (e.getChild() == c) {
249 c.addPropertyChangeListener("preferredSize", layoutSizeListener);
250 c.addPropertyChangeListener("maximumSize", layoutSizeListener);
251 c.addPropertyChangeListener("minimumSize", layoutSizeListener);
252 }
253 }
254 @Override
255 public void componentRemoved(ContainerEvent e) {
256 Component c = JLightweightFrame.this.component;
257 if (e.getChild() == c) {
258 c.removePropertyChangeListener(layoutSizeListener);
259 }
|
220 EventQueue.invokeLater(new Runnable() {
221 @Override
222 public void run() {
223 if (copyBufferEnabled) {
224 syncCopyBuffer(false, clip.x, clip.y, clip.width, clip.height);
225 }
226 content.imageUpdated(clip.x, clip.y, clip.width, clip.height);
227 }
228 });
229 } finally {
230 if (!copyBufferEnabled) {
231 content.paintUnlock();
232 }
233 }
234 }
235 @Override
236 protected boolean isPaintingOrigin() {
237 return true;
238 }
239 };
240 contentPane.setOpaque(false);
241 contentPane.setLayout(new BorderLayout());
242 contentPane.add(component);
243 setContentPane(contentPane);
244
245 contentPane.addContainerListener(new ContainerListener() {
246 @Override
247 public void componentAdded(ContainerEvent e) {
248 Component c = JLightweightFrame.this.component;
249 if (e.getChild() == c) {
250 c.addPropertyChangeListener("preferredSize", layoutSizeListener);
251 c.addPropertyChangeListener("maximumSize", layoutSizeListener);
252 c.addPropertyChangeListener("minimumSize", layoutSizeListener);
253 }
254 }
255 @Override
256 public void componentRemoved(ContainerEvent e) {
257 Component c = JLightweightFrame.this.component;
258 if (e.getChild() == c) {
259 c.removePropertyChangeListener(layoutSizeListener);
260 }
|