@Override public void notifyDisplayChanged(final int scaleFactor) { if (scaleFactor != this.scaleFactor) { if (!copyBufferEnabled) content.paintLock(); try { if (bbImage != null) { resizeBuffer(getWidth(), getHeight(), scaleFactor); } } finally { if (!copyBufferEnabled) content.paintUnlock(); } this.scaleFactor = scaleFactor; } if (getPeer() instanceof DisplayChangedListener) { ((DisplayChangedListener)getPeer()).displayChanged(); } repaint(); }
@Override public void notifyDisplayChanged(final int scaleFactor) { if (scaleFactor != this.scaleFactor) { if (!copyBufferEnabled) content.paintLock(); try { if (bbImage != null) { resizeBuffer(getWidth(), getHeight(), scaleFactor); } } finally { if (!copyBufferEnabled) content.paintUnlock(); } this.scaleFactor = scaleFactor; } final Object peer = AWTAccessor.getComponentAccessor().getPeer(this); if (peer instanceof DisplayChangedListener) { ((DisplayChangedListener) peer).displayChanged(); } repaint(); }
/** * From the DisplayChangedListener interface; called * when the display mode has been changed. */ public void displayChanged() { // notify screens in device array to do display update stuff for (GraphicsDevice gd : getScreenDevices()) { if (gd instanceof DisplayChangedListener) { ((DisplayChangedListener) gd).displayChanged(); } } // notify SunDisplayChanger list (e.g. VolatileSurfaceManagers and // SurfaceDataProxies) about the display change event displayChanger.notifyListeners(); }
@Override public void addNotify() { super.addNotify(); if (getPeer() instanceof DisplayChangedListener) { ((DisplayChangedListener)getPeer()).displayChanged(); } }
@Override public void notifyDisplayChanged(final double scaleFactorX, final double scaleFactorY) { if (Double.compare(scaleFactorX, this.scaleFactorX) != 0 || Double.compare(scaleFactorY, this.scaleFactorY) != 0) { if (!copyBufferEnabled) content.paintLock(); try { if (bbImage != null) { resizeBuffer(getWidth(), getHeight(), scaleFactorX, scaleFactorY); } } finally { if (!copyBufferEnabled) content.paintUnlock(); } this.scaleFactorX = scaleFactorX; this.scaleFactorY = scaleFactorY; if(isVisible()) { final Object peer = AWTAccessor.getComponentAccessor().getPeer(this); if (peer instanceof DisplayChangedListener) { ((DisplayChangedListener) peer).displayChanged(); } repaint(); } } }
@Override public void addNotify() { super.addNotify(); final Object peer = AWTAccessor.getComponentAccessor().getPeer(this); if (peer instanceof DisplayChangedListener) { ((DisplayChangedListener) peer).displayChanged(); } }
/** * Remove a DisplayChangeListener from Win32GraphicsEnvironment */ public void removeDisplayChangedListener(DisplayChangedListener client) { displayChanger.remove(client); }