< prev index next >

src/java.desktop/share/classes/sun/swing/JLightweightFrame.java

Print this page




 224     public void grabFocus() {
 225         if (content != null) content.focusGrabbed();
 226     }
 227 
 228     /**
 229      * {@inheritDoc}
 230      *
 231      * @see LightweightContent#focusUngrabbed()
 232      */
 233     @Override
 234     public void ungrabFocus() {
 235         if (content != null) content.focusUngrabbed();
 236     }
 237 
 238     @Override
 239     public int getScaleFactor() {
 240         return scaleFactor;
 241     }
 242 
 243     @Override

 244     public void notifyDisplayChanged(final int scaleFactor) {
 245         if (scaleFactor != this.scaleFactor) {
 246             if (!copyBufferEnabled) content.paintLock();
 247             try {
 248                 if (bbImage != null) {
 249                     resizeBuffer(getWidth(), getHeight(), scaleFactor);
 250                 }
 251             } finally {
 252                 if (!copyBufferEnabled) content.paintUnlock();
 253             }
 254             this.scaleFactor = scaleFactor;
 255         }
 256         if (getPeer() instanceof DisplayChangedListener) {
 257             ((DisplayChangedListener)getPeer()).displayChanged();
 258         }
 259         repaint();
 260     }
 261 
 262     @Override

 263     public void addNotify() {
 264         super.addNotify();
 265         if (getPeer() instanceof DisplayChangedListener) {
 266             ((DisplayChangedListener)getPeer()).displayChanged();
 267         }
 268     }
 269 
 270     private void syncCopyBuffer(boolean reset, int x, int y, int w, int h, int scale) {
 271         content.paintLock();
 272         try {
 273             int[] srcBuffer = ((DataBufferInt)bbImage.getRaster().getDataBuffer()).getData();
 274             if (reset) {
 275                 copyBuffer = new int[srcBuffer.length];
 276             }
 277             int linestride = bbImage.getWidth();
 278 
 279             x *= scale;
 280             y *= scale;
 281             w *= scale;
 282             h *= scale;




 224     public void grabFocus() {
 225         if (content != null) content.focusGrabbed();
 226     }
 227 
 228     /**
 229      * {@inheritDoc}
 230      *
 231      * @see LightweightContent#focusUngrabbed()
 232      */
 233     @Override
 234     public void ungrabFocus() {
 235         if (content != null) content.focusUngrabbed();
 236     }
 237 
 238     @Override
 239     public int getScaleFactor() {
 240         return scaleFactor;
 241     }
 242 
 243     @Override
 244     @SuppressWarnings("deprecation")
 245     public void notifyDisplayChanged(final int scaleFactor) {
 246         if (scaleFactor != this.scaleFactor) {
 247             if (!copyBufferEnabled) content.paintLock();
 248             try {
 249                 if (bbImage != null) {
 250                     resizeBuffer(getWidth(), getHeight(), scaleFactor);
 251                 }
 252             } finally {
 253                 if (!copyBufferEnabled) content.paintUnlock();
 254             }
 255             this.scaleFactor = scaleFactor;
 256         }
 257         if (getPeer() instanceof DisplayChangedListener) {
 258             ((DisplayChangedListener)getPeer()).displayChanged();
 259         }
 260         repaint();
 261     }
 262 
 263     @Override
 264     @SuppressWarnings("deprecation")
 265     public void addNotify() {
 266         super.addNotify();
 267         if (getPeer() instanceof DisplayChangedListener) {
 268             ((DisplayChangedListener)getPeer()).displayChanged();
 269         }
 270     }
 271 
 272     private void syncCopyBuffer(boolean reset, int x, int y, int w, int h, int scale) {
 273         content.paintLock();
 274         try {
 275             int[] srcBuffer = ((DataBufferInt)bbImage.getRaster().getDataBuffer()).getData();
 276             if (reset) {
 277                 copyBuffer = new int[srcBuffer.length];
 278             }
 279             int linestride = bbImage.getWidth();
 280 
 281             x *= scale;
 282             y *= scale;
 283             w *= scale;
 284             h *= scale;


< prev index next >