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

项目:dlface    文件:ConnectionSettings.java   
/**
 * Constructor - creates a new ConnectionSettings instance.
 */
public ConnectionSettings() {
    //setProxy("localhost", 8081);
    defaultConnectionLabel = null;//Application.getInstance().getContext().getResourceMap().getString("defaultConnection");
    pcs = new SwingPropertyChangeSupport(this);
    proxyType = Proxy.Type.DIRECT;
}
项目:OpenJSharp    文件: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);
    }
}
项目: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);
    }
}
项目:openjdk-jdk10    文件: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);
    }
}
项目:openjdk9    文件: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);
    }
}
项目: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);
    }
}
项目: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);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件: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);
    }
}
项目:SweetHome3D    文件:ResourceAction.java   
public AbstractDecoratedAction(Action action)
{
    this.action = action;
    this.propertyChangeSupport = new SwingPropertyChangeSupport(this);
    action.addPropertyChangeListener(new PropertyChangeListener()
    {
        public void propertyChange(PropertyChangeEvent ev)
        {
            String propertyName = ev.getPropertyName();
            if ("enabled".equals(propertyName))
            {
                propertyChangeSupport.firePropertyChange(ev);
            }
            else
            {
                Object newValue = getValue(propertyName);
                // In case a property value changes, fire the new value decorated in subclasses
                // unless new value is null (most Swing listeners don't check new value is null !)
                if (newValue != null)
                {
                    propertyChangeSupport.firePropertyChange(
                            new PropertyChangeEvent(ev.getSource(), propertyName, ev.getOldValue(), newValue));
                }
            }
        }
    });
}
项目:infobip-open-jdk-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);
    }
}
项目: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);
    }
}
项目:jdk7-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);
    }
}
项目:openjdk-source-code-learn    文件: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);
    }
}
项目:OLD-OpenJDK8    文件: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);
    }
}
项目:openjdk-jdk7u-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);
    }
}
项目:openjdk-icedtea7    文件: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);
    }
}
项目: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;
}
项目: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();
}
项目:IntelliJ-Key-Promoter-X    文件:SuppressedListModel.java   
public SuppressedListModel() {
    propertyChangeSupport = new SwingPropertyChangeSupport(this);
    myStats.registerPropertyChangeSupport(propertyChangeSupport);
    updateSuppressed();
}
项目:IntelliJ-Key-Promoter-X    文件:SuppressedListModel.java   
public SwingPropertyChangeSupport getPropertyChangeSupport() {
    return propertyChangeSupport;
}
项目:IntelliJ-Key-Promoter-X    文件:StatisticsListModel.java   
public StatisticsListModel() {
    propertyChangeSupport = new SwingPropertyChangeSupport(this);
    myStats.registerPropertyChangeSupport(propertyChangeSupport);
    updateStats();
}
项目:IntelliJ-Key-Promoter-X    文件:StatisticsListModel.java   
public SwingPropertyChangeSupport getPropertyChangeSupport() {
    return propertyChangeSupport;
}
项目:SweetHome3D    文件:HomePane.java   
private ActionAdapter(PluginAction pluginAction)
{
    this.pluginAction = pluginAction;
    this.propertyChangeSupport = new SwingPropertyChangeSupport(this);
    this.pluginAction.addPropertyChangeListener(new PropertyChangeListener()
    {
        public void propertyChange(PropertyChangeEvent ev)
        {
            String propertyName = ev.getPropertyName();
            Object oldValue = ev.getOldValue();
            Object newValue = ev.getNewValue();
            if (PluginAction.Property.ENABLED.name().equals(propertyName))
            {
                propertyChangeSupport.firePropertyChange(
                        new PropertyChangeEvent(ev.getSource(), "enabled", oldValue, newValue));
            }
            else
            {
                // In case a property value changes, fire the new value decorated in subclasses
                // unless new value is null (most Swing listeners don't check new value is null !)
                if (newValue != null)
                {
                    if (PluginAction.Property.NAME.name().equals(propertyName))
                    {
                        propertyChangeSupport.firePropertyChange(
                                new PropertyChangeEvent(ev.getSource(), Action.NAME, oldValue, newValue));
                    }
                    else if (PluginAction.Property.SHORT_DESCRIPTION.name().equals(propertyName))
                    {
                        propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(ev.getSource(),
                                Action.SHORT_DESCRIPTION, oldValue, newValue));
                    }
                    else if (PluginAction.Property.MNEMONIC.name().equals(propertyName))
                    {
                        propertyChangeSupport
                                .firePropertyChange(new PropertyChangeEvent(ev.getSource(), Action.MNEMONIC_KEY,
                                        oldValue != null ? new Integer((Character) oldValue) : null, newValue));
                    }
                    else if (PluginAction.Property.SMALL_ICON.name().equals(propertyName))
                    {
                        propertyChangeSupport
                                .firePropertyChange(
                                        new PropertyChangeEvent(ev.getSource(), Action.SMALL_ICON,
                                                oldValue != null
                                                        ? IconManager.getInstance().getIcon((Content) oldValue,
                                                                DEFAULT_SMALL_ICON_HEIGHT, HomePane.this)
                                                        : null,
                                                newValue));
                    }
                    else
                    {
                        propertyChangeSupport.firePropertyChange(
                                new PropertyChangeEvent(ev.getSource(), propertyName, oldValue, newValue));
                    }
                }
            }
        }
    });
}
项目:viewer    文件:NetworkPanel.java   
public SwingPropertyChangeSupport getSwingPropertyChangeSupport() {
    return pcs;
}
项目:viewer    文件:HGVDesktop.java   
public SwingPropertyChangeSupport getSwingPropertyChangeSupport()
{
    return pcs;
}
项目:ZScriptLanguageSupport    文件:ZScriptParser.java   
public ZScriptParser() {
    support = new SwingPropertyChangeSupport(this);
}
项目: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);
}
项目:chipster    文件:TaskExecutor.java   
/**
 * For unit testing, constructs partially incomplete object.
 */
protected TaskExecutor(DataManager manager) throws JMSException {
    this.manager = manager;
    this.jobExecutorStateChangeSupport = new SwingPropertyChangeSupport(this);
}
项目:osp    文件:VideoAdapter.java   
/**
 * Initialize this video.
 */
protected void initialize() {
  support = new SwingPropertyChangeSupport(this);
  filterStack.addPropertyChangeListener(this);
}
项目:osp    文件:CheckTreeSelectionModel.java   
/**
 * Constructor.
 *
 * @param model a TreeModel
 */
public CheckTreeSelectionModel(TreeModel model) {
  this.model = model;
  setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
  support = new SwingPropertyChangeSupport(this);
}
项目:viewer    文件:HGVKit.java   
/**
 * Bound events are:
 * <ol>
 * <li>NETWORK_CREATED
 * <li>NETWORK_DESTROYED
 * </ol>
 */
public static SwingPropertyChangeSupport getSwingPropertyChangeSupport()
{
    return pcs;
}
项目:lcm    文件:ALabelFormatter.java   
/**
 * Default constructor.
 * <p>
 */
protected ALabelFormatter() {
  this.m_propertyChangeSupport = new SwingPropertyChangeSupport(this);
}
项目:osp    文件:DataClip.java   
/**
 * Constructs a DataClip.
 *
 * @param dataLength the number of data elements in the Data object
 */
public DataClip() {
  support = new SwingPropertyChangeSupport(this);
}
项目: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);
}