类javax.swing.event.SwingPropertyChangeSupport源码实例Demo

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

源代码1 项目: jdk1.8-source-analysis   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码2 项目: dragonwell8_jdk   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码3 项目: TencentKona-8   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码4 项目: jdk8u60   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码5 项目: JDKSourceCode1.8   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码6 项目: openjdk-jdk8u   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码7 项目: openjdk-jdk8u-backup   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码8 项目: Bytecoder   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码9 项目: openjdk-jdk9   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码10 项目: jdk8u-jdk   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码11 项目: Java8CN   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码12 项目: hottub   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码13 项目: openjdk-8-source   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码14 项目: openjdk-8   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码15 项目: jdk8u_jdk   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码16 项目: jdk8u-jdk   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码17 项目: jdk8u-dev-jdk   文件: UIManager.java
/**
 * Sets the current look and feel to {@code newLookAndFeel}.
 * If the current look and feel is {@code non-null} {@code
 * uninitialize} is invoked on it. If {@code newLookAndFeel} is
 * {@code non-null}, {@code initialize} is invoked on it followed
 * by {@code getDefaults}. The defaults returned from {@code
 * newLookAndFeel.getDefaults()} replace those of the defaults
 * from the previous look and feel. If the {@code newLookAndFeel} is
 * {@code null}, the look and feel defaults are set to {@code null}.
 * <p>
 * A value of {@code null} can be used to set the look and feel
 * to {@code null}. As the {@code LookAndFeel} is required for
 * most of Swing to function, setting the {@code LookAndFeel} to
 * {@code null} is strongly discouraged.
 * <p>
 * This is a JavaBeans bound property.
 *
 * @param newLookAndFeel {@code LookAndFeel} to install
 * @throws UnsupportedLookAndFeelException if
 *          {@code newLookAndFeel} is {@code non-null} and
 *          {@code newLookAndFeel.isSupportedLookAndFeel()} returns
 *          {@code false}
 * @see #getLookAndFeel
 */
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
    throws UnsupportedLookAndFeelException
{
    if ((newLookAndFeel != null) && !newLookAndFeel.isSupportedLookAndFeel()) {
        String s = newLookAndFeel.toString() + " not supported on this platform";
        throw new UnsupportedLookAndFeelException(s);
    }

    LAFState lafState = getLAFState();
    LookAndFeel oldLookAndFeel = lafState.lookAndFeel;
    if (oldLookAndFeel != null) {
        oldLookAndFeel.uninitialize();
    }

    lafState.lookAndFeel = newLookAndFeel;
    if (newLookAndFeel != null) {
        sun.swing.DefaultLookup.setDefaultLookup(null);
        newLookAndFeel.initialize();
        lafState.setLookAndFeelDefaults(newLookAndFeel.getDefaults());
    }
    else {
        lafState.setLookAndFeelDefaults(null);
    }

    SwingPropertyChangeSupport changeSupport = lafState.
                                     getPropertyChangeSupport(false);
    if (changeSupport != null) {
        changeSupport.firePropertyChange("lookAndFeel", oldLookAndFeel,
                                         newLookAndFeel);
    }
}
 
源代码18 项目: osp   文件: VideoClip.java
/**
 * Constructs a VideoClip.
 *
 * @param video the video
 */
public VideoClip(Video video) {
  support = new SwingPropertyChangeSupport(this);
  this.video = video;
  if(video!=null) {
    video.setProperty("videoclip", this); //$NON-NLS-1$
    setStartFrameNumber(video.getStartFrameNumber());
    if(video.getFrameCount()>1) {
      setStepCount(video.getEndFrameNumber()-startFrame+1);
    }
  }
  updateArray();
  isDefaultState = true;
}
 
源代码19 项目: osp   文件: ImageCoordSystem.java
/**
 * Constructs an ImageCoordSystem with a specified initial array length.
 *
 * @param length the initial length
 */
public ImageCoordSystem(int length) {
  this.length = length;
  toImage = new TransformArray(length);
  toWorld = new TransformArray(length);
  scaleX = new DoubleArray(length, 1);
  scaleY = new DoubleArray(length, 1);
  originX = new DoubleArray(length, 0);
  originY = new DoubleArray(length, 0);
  cosine = new DoubleArray(length, 1);
  sine = new DoubleArray(length, 0);
  support = new SwingPropertyChangeSupport(this);
  updateAllTransforms();
}
 
源代码20 项目: chipster   文件: TaskExecutor.java
public TaskExecutor(MessagingEndpoint endpoint, DataManager manager) throws Exception {
	this.manager = manager;
	this.requestTopic = endpoint.createTopic(Topics.Name.REQUEST_TOPIC, AccessMode.WRITE);
	this.jobExecutorStateChangeSupport = new SwingPropertyChangeSupport(this);
}
 
源代码21 项目: chipster   文件: TaskExecutor.java
/**
 * For unit testing, constructs partially incomplete object.
 */
protected TaskExecutor(DataManager manager) throws JMSException {
	this.manager = manager;
	this.jobExecutorStateChangeSupport = new SwingPropertyChangeSupport(this);
}
 
源代码22 项目: osp   文件: VideoAdapter.java
/**
 * Initialize this video.
 */
protected void initialize() {
  support = new SwingPropertyChangeSupport(this);
  filterStack.addPropertyChangeListener(this);
}
 
源代码23 项目: osp   文件: CheckTreeSelectionModel.java
/**
 * Constructor.
 *
 * @param model a TreeModel
 */
public CheckTreeSelectionModel(TreeModel model) {
  this.model = model;
  setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
  support = new SwingPropertyChangeSupport(this);
}
 
源代码24 项目: osp   文件: DataClip.java
/**
 * Constructs a DataClip.
 *
 * @param dataLength the number of data elements in the Data object
 */
public DataClip() {
  support = new SwingPropertyChangeSupport(this);
}
 
源代码25 项目: osp   文件: ClipControl.java
/**
 * Constructs a ClipControl object. This is an abstract class that
 * cannot be instantiated directly.
 *
 * @param videoClip the video clip
 */
protected ClipControl(VideoClip videoClip) {
  clip = videoClip;
  video = clip.getVideo();
  support = new SwingPropertyChangeSupport(this);
}
 
 类所在包
 同包方法