javax.swing.event.SwingPropertyChangeSupport Java Examples

The following examples show how to use javax.swing.event.SwingPropertyChangeSupport. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UIManager.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #2
Source File: ImageCoordSystem.java    From osp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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();
}
 
Example #3
Source File: VideoClip.java    From osp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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;
}
 
Example #4
Source File: UIManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #5
Source File: UIManager.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #6
Source File: UIManager.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #7
Source File: UIManager.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #8
Source File: UIManager.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #9
Source File: UIManager.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #10
Source File: UIManager.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #11
Source File: UIManager.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #12
Source File: UIManager.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #13
Source File: UIManager.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #14
Source File: UIManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #15
Source File: UIManager.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #16
Source File: UIManager.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #17
Source File: UIManager.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #18
Source File: UIManager.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #19
Source File: UIManager.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #20
Source File: TaskExecutor.java    From chipster with MIT License 4 votes vote down vote up
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);
}
 
Example #21
Source File: TaskExecutor.java    From chipster with MIT License 4 votes vote down vote up
/**
 * For unit testing, constructs partially incomplete object.
 */
protected TaskExecutor(DataManager manager) throws JMSException {
	this.manager = manager;
	this.jobExecutorStateChangeSupport = new SwingPropertyChangeSupport(this);
}
 
Example #22
Source File: VideoAdapter.java    From osp with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Initialize this video.
 */
protected void initialize() {
  support = new SwingPropertyChangeSupport(this);
  filterStack.addPropertyChangeListener(this);
}
 
Example #23
Source File: CheckTreeSelectionModel.java    From osp with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Constructor.
 *
 * @param model a TreeModel
 */
public CheckTreeSelectionModel(TreeModel model) {
  this.model = model;
  setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
  support = new SwingPropertyChangeSupport(this);
}
 
Example #24
Source File: DataClip.java    From osp with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Constructs a DataClip.
 *
 * @param dataLength the number of data elements in the Data object
 */
public DataClip() {
  support = new SwingPropertyChangeSupport(this);
}
 
Example #25
Source File: ClipControl.java    From osp with GNU General Public License v3.0 2 votes vote down vote up
/**
 * 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);
}