javax.imageio.event.IIOWriteWarningListener Java Examples

The following examples show how to use javax.imageio.event.IIOWriteWarningListener. 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: ImageWriter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #2
Source File: ImageWriter.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Removes an {@code IIOWriteWarningListener} from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if {@code listener} is
 * {@code null}, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an {@code IIOWriteWarningListener} to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #3
Source File: ImageWriter.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * {@code IIOWriteWarningListener}s by calling their
 * {@code warningOccurred} method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if {@code warning}
 * is {@code null}.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #4
Source File: ImageWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * {@code IIOWriteWarningListener}s by calling their
 * {@code warningOccurred} method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if {@code warning}
 * is {@code null}.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #5
Source File: ImageWriter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #6
Source File: ImageWriter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #7
Source File: ImageWriter.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #8
Source File: ImageWriter.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #9
Source File: ImageWriter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #10
Source File: ImageWriter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #11
Source File: ImageWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an {@code IIOWriteWarningListener} from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if {@code listener} is
 * {@code null}, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an {@code IIOWriteWarningListener} to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #12
Source File: ImageWriter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #13
Source File: ImageWriter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #14
Source File: ImageWriter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #15
Source File: ImageWriter.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #16
Source File: ImageWriter.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #17
Source File: ImageWriter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #18
Source File: ImageWriter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #19
Source File: ImageWriter.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #20
Source File: ImageWriter.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #21
Source File: ImageWriter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #22
Source File: ImageWriter.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #23
Source File: ImageWriter.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #24
Source File: ImageWriter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #25
Source File: ImageWriter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #26
Source File: ImageWriter.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #27
Source File: ImageWriter.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #28
Source File: ImageWriter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}
 
Example #29
Source File: ImageWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Broadcasts a warning message to all registered
 * <code>IIOWriteWarningListener</code>s by calling their
 * <code>warningOccurred</code> method.  Subclasses may use this
 * method as a convenience.
 *
 * @param imageIndex the index of the image on which the warning
 * occurred.
 * @param warning the warning message.
 *
 * @exception IllegalArgumentException if <code>warning</code>
 * is <code>null</code>.
 */
protected void processWarningOccurred(int imageIndex,
                                      String warning) {
    if (warningListeners == null) {
        return;
    }
    if (warning == null) {
        throw new IllegalArgumentException("warning == null!");
    }
    int numListeners = warningListeners.size();
    for (int i = 0; i < numListeners; i++) {
        IIOWriteWarningListener listener =
            (IIOWriteWarningListener)warningListeners.get(i);

        listener.warningOccurred(this, imageIndex, warning);
    }
}
 
Example #30
Source File: ImageWriter.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Removes an <code>IIOWriteWarningListener</code> from the list
 * of registered warning listeners.  If the listener was not
 * previously registered, or if <code>listener</code> is
 * <code>null</code>, no exception will be thrown and no action
 * will be taken.
 *
 * @param listener an <code>IIOWriteWarningListener</code> to be
 * deregistered.
 *
 * @see #addIIOWriteWarningListener
 */
public
    void removeIIOWriteWarningListener(IIOWriteWarningListener listener) {
    if (listener == null || warningListeners == null) {
        return;
    }
    int index = warningListeners.indexOf(listener);
    if (index != -1) {
        warningListeners.remove(index);
        warningLocales.remove(index);
        if (warningListeners.size() == 0) {
            warningListeners = null;
            warningLocales = null;
        }
    }
}