类sun.awt.DisplayChangedListener源码实例Demo

下面列出了怎么用sun.awt.DisplayChangedListener的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: JLightweightFrame.java
@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();
}
 
源代码2 项目: dragonwell8_jdk   文件: WToolkit.java
static public void displayChanged() {
    final Runnable runnable = () -> {
        Object lge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        if (lge instanceof DisplayChangedListener) {
            ((DisplayChangedListener) lge).displayChanged();
        }
    };
    if (AppContext.getAppContext() != null) {
        // Common case, standalone application
        EventQueue.invokeLater(runnable);
    } else {
        if (displayChangeExecutor == null) {
            // No synchronization, called on the Toolkit thread only
            displayChangeExecutor = Executors.newFixedThreadPool(1, r -> {
                Thread t = Executors.defaultThreadFactory().newThread(r);
                t.setDaemon(true);
                return t;
            });
        }
        displayChangeExecutor.submit(runnable);
    }
}
 
源代码3 项目: TencentKona-8   文件: JLightweightFrame.java
@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();
}
 
源代码4 项目: TencentKona-8   文件: WToolkit.java
static public void displayChanged() {
    final Runnable runnable = () -> {
        Object lge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        if (lge instanceof DisplayChangedListener) {
            ((DisplayChangedListener) lge).displayChanged();
        }
    };
    if (AppContext.getAppContext() != null) {
        // Common case, standalone application
        EventQueue.invokeLater(runnable);
    } else {
        if (displayChangeExecutor == null) {
            // No synchronization, called on the Toolkit thread only
            displayChangeExecutor = Executors.newFixedThreadPool(1, r -> {
                Thread t = Executors.defaultThreadFactory().newThread(r);
                t.setDaemon(true);
                return t;
            });
        }
        displayChangeExecutor.submit(runnable);
    }
}
 
源代码5 项目: jdk8u60   文件: JLightweightFrame.java
@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();
}
 
源代码6 项目: openjdk-jdk8u   文件: JLightweightFrame.java
@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();
}
 
源代码7 项目: openjdk-jdk8u   文件: WToolkit.java
static public void displayChanged() {
    final Runnable runnable = () -> {
        Object lge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        if (lge instanceof DisplayChangedListener) {
            ((DisplayChangedListener) lge).displayChanged();
        }
    };
    if (AppContext.getAppContext() != null) {
        // Common case, standalone application
        EventQueue.invokeLater(runnable);
    } else {
        if (displayChangeExecutor == null) {
            // No synchronization, called on the Toolkit thread only
            displayChangeExecutor = Executors.newFixedThreadPool(1, r -> {
                Thread t = Executors.defaultThreadFactory().newThread(r);
                t.setDaemon(true);
                return t;
            });
        }
        displayChangeExecutor.submit(runnable);
    }
}
 
源代码8 项目: openjdk-jdk8u-backup   文件: JLightweightFrame.java
@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();
}
 
源代码9 项目: jdk8u-jdk   文件: JLightweightFrame.java
@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();
}
 
源代码10 项目: hottub   文件: JLightweightFrame.java
@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();
}
 
源代码11 项目: jdk8u_jdk   文件: JLightweightFrame.java
@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();
}
 
源代码12 项目: jdk8u_jdk   文件: WToolkit.java
static public void displayChanged() {
    final Runnable runnable = () -> {
        Object lge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        if (lge instanceof DisplayChangedListener) {
            ((DisplayChangedListener) lge).displayChanged();
        }
    };
    if (AppContext.getAppContext() != null) {
        // Common case, standalone application
        EventQueue.invokeLater(runnable);
    } else {
        if (displayChangeExecutor == null) {
            // No synchronization, called on the Toolkit thread only
            displayChangeExecutor = Executors.newFixedThreadPool(1, r -> {
                Thread t = Executors.defaultThreadFactory().newThread(r);
                t.setDaemon(true);
                return t;
            });
        }
        displayChangeExecutor.submit(runnable);
    }
}
 
源代码13 项目: jdk8u-jdk   文件: JLightweightFrame.java
@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();
}
 
源代码14 项目: jdk8u-dev-jdk   文件: JLightweightFrame.java
@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();
}
 
源代码15 项目: dragonwell8_jdk   文件: SunGraphicsEnvironment.java
/**
 * 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();
}
 
源代码16 项目: dragonwell8_jdk   文件: JLightweightFrame.java
@Override
public void addNotify() {
    super.addNotify();
    if (getPeer() instanceof DisplayChangedListener) {
        ((DisplayChangedListener)getPeer()).displayChanged();
    }
}
 
源代码17 项目: dragonwell8_jdk   文件: DisplayChangesException.java
private static void testGE() {
    Object ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!(ge instanceof DisplayChangedListener)) {
        return;
    }
    ((DisplayChangedListener) ge).displayChanged();
}
 
源代码18 项目: TencentKona-8   文件: SunGraphicsEnvironment.java
/**
 * 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();
}
 
源代码19 项目: TencentKona-8   文件: JLightweightFrame.java
@Override
public void addNotify() {
    super.addNotify();
    if (getPeer() instanceof DisplayChangedListener) {
        ((DisplayChangedListener)getPeer()).displayChanged();
    }
}
 
源代码20 项目: TencentKona-8   文件: DisplayChangesException.java
private static void testGE() {
    Object ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!(ge instanceof DisplayChangedListener)) {
        return;
    }
    ((DisplayChangedListener) ge).displayChanged();
}
 
源代码21 项目: jdk8u60   文件: SunGraphicsEnvironment.java
/**
 * 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();
}
 
源代码22 项目: jdk8u60   文件: JLightweightFrame.java
@Override
public void addNotify() {
    super.addNotify();
    if (getPeer() instanceof DisplayChangedListener) {
        ((DisplayChangedListener)getPeer()).displayChanged();
    }
}
 
源代码23 项目: openjdk-jdk8u   文件: SunGraphicsEnvironment.java
/**
 * 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();
}
 
源代码24 项目: openjdk-jdk8u   文件: JLightweightFrame.java
@Override
public void addNotify() {
    super.addNotify();
    if (getPeer() instanceof DisplayChangedListener) {
        ((DisplayChangedListener)getPeer()).displayChanged();
    }
}
 
源代码25 项目: openjdk-jdk8u   文件: DisplayChangesException.java
private static void testGE() {
    Object ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (!(ge instanceof DisplayChangedListener)) {
        return;
    }
    ((DisplayChangedListener) ge).displayChanged();
}
 
/**
 * 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();
}
 
源代码27 项目: openjdk-jdk8u-backup   文件: JLightweightFrame.java
@Override
public void addNotify() {
    super.addNotify();
    if (getPeer() instanceof DisplayChangedListener) {
        ((DisplayChangedListener)getPeer()).displayChanged();
    }
}
 
源代码28 项目: Bytecoder   文件: SunGraphicsEnvironment.java
/**
 * 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();
}
 
源代码29 项目: Bytecoder   文件: JLightweightFrame.java
@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();
        }
    }
}
 
源代码30 项目: Bytecoder   文件: JLightweightFrame.java
@Override
public void addNotify() {
    super.addNotify();
    final Object peer = AWTAccessor.getComponentAccessor().getPeer(this);
    if (peer instanceof DisplayChangedListener) {
        ((DisplayChangedListener) peer).displayChanged();
    }
}
 
 类所在包
 类方法
 同包方法