This is the mail archive of the mauve-patches@sources.redhat.com mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RenderingHints.java


Please find attached some tests for the java.awt.RenderingHints class. 
These tests highlight several bugs which I have fixed and submitted to
Classpath (see patch 3301).

With these tests, Sun's JDK 1.4 has the following errors, which I
consider to be bugs in their implementation (but someone else might want
to check them over):

dgilbert@linux42:~/workspace/mauve> java14 gnu.testlet.SimpleTestHarness
-file CurrentTests.txt -debug
FAIL: gnu.testlet.java.awt.RenderingHints.constructors:
RenderingHints(Key, Object) (number 1)
FAIL: gnu.testlet.java.awt.RenderingHints.constructors:
RenderingHints(Key, Object) (number 2)
FAIL: gnu.testlet.java.awt.RenderingHints.containsKey (number 4)
3 of 310 tests failed

Regards,

Dave Gilbert


/* RenderingHints.java --
   Copyright (C) 2000, 2001, 2002  Free Software Foundation

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  An independent module is a module which is not derived from
or based on this library.  If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so.  If you do not wish to do so, delete this
exception statement from your version. */


package java.awt;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * A collection of (key, value) items that provide 'hints' for the 
 * {@link java.awt.Graphics2D} rendering pipeline.  Because these
 * items are hints only, they may be ignored by a particular
 * {@link java.awt.Graphics2D} implementation.
 *
 * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
 * @author Eric Blake <ebb9@email.byu.edu>
 */
public class RenderingHints implements Map, Cloneable
{
  /**
   * The base class used to represent keys.
   */
  public abstract static class Key
  {
    private final int key;

    /**
     * Creates a new key.
     * 
     * @param privateKey  the private key.
     */
    protected Key(int privateKey)
    {
      key = privateKey;
    }

    /**
     * Returns <code>true</code> if the specified value is compatible with
     * this key, and <code>false</code> otherwise.
     * 
     * @param value  the value (<code>null</code> permitted).
     * 
     * @return A boolean.
     */
    public abstract boolean isCompatibleValue(Object value);

    /**
     * Returns the private key for this instance.
     * 
     * @return The private key.
     */
    protected final int intKey()
    {
      return key;
    }

    /**
     * Returns a hash code for the key.
     * 
     * @return A hash code.
     */
    public final int hashCode()
    {
      return System.identityHashCode(this);
    }

    /**
     * Checks this key for equality with an arbitrary object.
     * 
     * @param other  the object (<code>null</code> permitted)
     * 
     * @return A boolean.
     */
    public final boolean equals(Object other)
    {
      return this == other;
    }
  } // class Key

  private static final class KeyImpl extends Key
  {
    final String description;
    final Object v1;
    final Object v2;
    final Object v3;

    KeyImpl(int privateKey, String description,
            Object v1, Object v2, Object v3)
    {
      super(privateKey);
      this.description = description;
      this.v1 = v1;
      this.v2 = v2;
      this.v3 = v3;
    }

    /**
     * Returns <code>true</code> if the specified value is compatible with
     * this key, and <code>false</code> otherwise.
     * 
     * @param value  the value (<code>null</code> permitted).
     * 
     * @return A boolean.
     */
    public boolean isCompatibleValue(Object value)
    {
      return value == v1 || value == v2 || value == v3;
    }

    /**
     * Returns a string representation of the key.
     * 
     * @return A string.
     */
    public String toString()
    {
      return description;
    }
  } // class KeyImpl

  private HashMap hintMap = new HashMap();

  /**
   * A key for the 'antialiasing' hint.  Permitted values are:
   * <p>
   * <table>
   * <tr>
   *   <td>{@link #VALUE_ANTIALIAS_OFF}</td>
   *   <td>Render without antialiasing (better speed).</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_ANTIALIAS_ON}</td>
   *   <td>Render with antialiasing (better quality).</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_ANTIALIAS_DEFAULT}</td>
   *   <td>Use the default value for antialiasing.</td>
   * </tr>
   * </table>
   */
  public static final Key KEY_ANTIALIASING;

  /**
   * This value is for use with the {@link #KEY_ANTIALIASING} key.
   */
  public static final Object VALUE_ANTIALIAS_ON
    = "Antialiased rendering mode";

  /**
   * This value is for use with the {@link #KEY_ANTIALIASING} key.
   */
  public static final Object VALUE_ANTIALIAS_OFF
    = "Nonantialiased rendering mode";

  /**
   * This value is for use with the {@link #KEY_ANTIALIASING} key.
   */
  public static final Object VALUE_ANTIALIAS_DEFAULT
    = "Default antialiasing rendering mode";

  /**
   * A key for the 'rendering' hint.  Permitted values are:
   * <p>
   * <table>
   * <tr>
   *   <td>{@link #VALUE_RENDER_SPEED}</td>
   *   <td>Prefer speed over quality when rendering.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_RENDER_QUALITY}</td>
   *   <td>Prefer quality over speed when rendering.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_RENDER_DEFAULT}</td>
   *   <td>Use the default value for quality vs. speed when rendering.</td>
   * </tr>
   * </table>
   */
  public static final Key KEY_RENDERING;

  /**
   * This value is for use with the {@link #KEY_RENDERING} key.
   */
  public static final Object VALUE_RENDER_SPEED
    = "Fastest rendering methods";

  /**
   * This value is for use with the {@link #KEY_RENDERING} key.
   */
  public static final Object VALUE_RENDER_QUALITY
    = "Highest quality rendering methods";

  /**
   * This value is for use with the {@link #KEY_RENDERING} key.
   */
  public static final Object VALUE_RENDER_DEFAULT
    = "Default rendering methods";

  /**
   * A key for the 'dithering' hint.  Permitted values are:
   * <p>
   * <table>
   * <tr>
   *   <td>{@link #VALUE_DITHER_DISABLE}</td>
   *   <td>Disable dithering.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_DITHER_ENABLE}</td>
   *   <td>Enable dithering.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_DITHER_DEFAULT}</td>
   *   <td>Use the default value for dithering.</td>
   * </tr>
   * </table>
   */
  public static final Key KEY_DITHERING;

  /**
   * This value is for use with the {@link #KEY_DITHERING} key.
   */
  public static final Object VALUE_DITHER_DISABLE
    = "Nondithered rendering mode";

  /**
   * This value is for use with the {@link #KEY_DITHERING} key.
   */
  public static final Object VALUE_DITHER_ENABLE
    = "Dithered rendering mode";

  /**
   * This value is for use with the {@link #KEY_DITHERING} key.
   */
  public static final Object VALUE_DITHER_DEFAULT
    = "Default dithering mode";

  /**
   * A key for the 'text antialiasing' hint.  Permitted values are:
   * <p>
   * <table>
   * <tr>
   *   <td>{@link #VALUE_TEXT_ANTIALIAS_ON}</td>
   *   <td>Render text with antialiasing (better quality usually).</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_TEXT_ANTIALIAS_OFF}</td>
   *   <td>Render test without antialiasing (better speed).</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_TEXT_ANTIALIAS_DEFAULT}</td>
   *   <td>Use the default value for text antialiasing.</td>
   * </tr>
   * </table>
   */
  public static final Key KEY_TEXT_ANTIALIASING;

  /**
   * This value is for use with the {@link #KEY_TEXT_ANTIALIASING} key.
   */
  public static final Object VALUE_TEXT_ANTIALIAS_ON
    = "Antialiased text mode";

  /**
   * This value is for use with the {@link #KEY_TEXT_ANTIALIASING} key.
   */
  public static final Object VALUE_TEXT_ANTIALIAS_OFF
    = "Nonantialiased text mode";

  /**
   * This value is for use with the {@link #KEY_TEXT_ANTIALIASING} key.
   */
  public static final Object VALUE_TEXT_ANTIALIAS_DEFAULT
    = "Default antialiasing text mode";

  /**
   * A key for the 'fractional metrics' hint.  Permitted values are:
   * <p>
   * <table>
   * <tr>
   *   <td>{@link #VALUE_FRACTIONALMETRICS_OFF}</td>
   *   <td>Render text with fractional metrics off.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_FRACTIONALMETRICS_ON}</td>
   *   <td>Render text with fractional metrics on.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_FRACTIONALMETRICS_DEFAULT}</td>
   *   <td>Use the default value for fractional metrics.</td>
   * </tr>
   * </table>
   */
  public static final Key KEY_FRACTIONALMETRICS;

  /**
   * This value is for use with the {@link #KEY_FRACTIONALMETRICS} key.
   */
  public static final Object VALUE_FRACTIONALMETRICS_OFF
    = "Integer text metrics mode";

  /**
   * This value is for use with the {@link #KEY_FRACTIONALMETRICS} key.
   */
  public static final Object VALUE_FRACTIONALMETRICS_ON
    = "Fractional text metrics mode";

  /**
   * This value is for use with the {@link #KEY_FRACTIONALMETRICS} key.
   */
  public static final Object VALUE_FRACTIONALMETRICS_DEFAULT
    = "Default fractional text metrics mode";

  /**
   * A key for the 'interpolation' hint.  Permitted values are:
   * <p>
   * <table>
   * <tr>
   *   <td>{@link #VALUE_INTERPOLATION_NEAREST_NEIGHBOR}</td>
   *   <td>Use nearest neighbour interpolation.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_INTERPOLATION_BILINEAR}</td>
   *   <td>Use bilinear interpolation.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_INTERPOLATION_BICUBIC}</td>
   *   <td>Use bicubic interpolation.</td>
   * </tr>
   * </table>
   */
  public static final Key KEY_INTERPOLATION;

  /**
   * This value is for use with the {@link #KEY_INTERPOLATION} key.
   */
  public static final Object VALUE_INTERPOLATION_NEAREST_NEIGHBOR
    = "Nearest Neighbor image interpolation mode";

  /**
   * This value is for use with the {@link #KEY_INTERPOLATION} key.
   */
  public static final Object VALUE_INTERPOLATION_BILINEAR
    = "Bilinear image interpolation mode";

  /**
   * This value is for use with the {@link #KEY_INTERPOLATION} key.
   */
  public static final Object VALUE_INTERPOLATION_BICUBIC
    = "Bicubic image interpolation mode";

  /**
   * A key for the 'alpha interpolation' hint.  Permitted values are:
   * <p>
   * <table>
   * <tr>
   *   <td>{@link #VALUE_ALPHA_INTERPOLATION_SPEED}</td>
   *   <td>Prefer speed over quality.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_ALPHA_INTERPOLATION_QUALITY}</td>
   *   <td>Prefer quality over speed.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_ALPHA_INTERPOLATION_DEFAULT}</td>
   *   <td>Use the default setting.</td>
   * </tr>
   * </table>
   */
  public static final Key KEY_ALPHA_INTERPOLATION;

  /**
   * This value is for use with the {@link #KEY_ALPHA_INTERPOLATION} key.
   */
  public static final Object VALUE_ALPHA_INTERPOLATION_SPEED
    = "Fastest alpha blending methods";

  /**
   * This value is for use with the {@link #KEY_ALPHA_INTERPOLATION} key.
   */
  public static final Object VALUE_ALPHA_INTERPOLATION_QUALITY
    = "Highest quality alpha blending methods";

  /**
   * This value is for use with the {@link #KEY_ALPHA_INTERPOLATION} key.
   */
  public static final Object VALUE_ALPHA_INTERPOLATION_DEFAULT
    = "Default alpha blending methods";

  /**
   * A key for the 'color rendering' hint.  Permitted values are:
   * <p>
   * <table>
   * <tr>
   *   <td>{@link #VALUE_COLOR_RENDER_SPEED}</td>
   *   <td>Prefer speed over quality.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_COLOR_RENDER_QUALITY}</td>
   *   <td>Prefer quality over speed.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_COLOR_RENDER_DEFAULT}</td>
   *   <td>Use the default setting.</td>
   * </tr>
   * </table>
   */
  public static final Key KEY_COLOR_RENDERING;

  /**
   * This value is for use with the {@link #KEY_COLOR_RENDERING} key.
   */
  public static final Object VALUE_COLOR_RENDER_SPEED
    = "Fastest color rendering mode";

  /**
   * This value is for use with the {@link #KEY_COLOR_RENDERING} key.
   */
  public static final Object VALUE_COLOR_RENDER_QUALITY
    = "Highest quality color rendering mode";

  /**
   * This value is for use with the {@link #KEY_COLOR_RENDERING} key.
   */
  public static final Object VALUE_COLOR_RENDER_DEFAULT
    = "Default color rendering mode";

  /**
   * A key for the '' hint (permitted values for this
   * hint are <code></code>, 
   * <code></code>
   * and <code></code>).
   */
  /**
   * A key for the 'stroke control' hint.  Permitted values are:
   * <p>
   * <table>
   * <tr>
   *   <td>{@link #VALUE_STROKE_DEFAULT}</td>
   *   <td>Use the default setting.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_STROKE_NORMALIZE}</td>
   *   <td>???.</td>
   * </tr>
   * <tr>
   *   <td>{@link #VALUE_STROKE_PURE}</td>
   *   <td>???.</td>
   * </tr>
   * </table>
   */
  public static final Key KEY_STROKE_CONTROL;

  /**
   * This value is for use with the {@link #KEY_STROKE_CONTROL} key.
   */
  public static final Object VALUE_STROKE_DEFAULT
    = "Default stroke normalization";

  /**
   * This value is for use with the {@link #KEY_STROKE_CONTROL} key.
   */
  public static final Object VALUE_STROKE_NORMALIZE
    = "Normalize strokes for consistent rendering";

  /**
   * This value is for use with the {@link #KEY_STROKE_CONTROL} key.
   */
  public static final Object VALUE_STROKE_PURE
    = "Pure stroke conversion for accurate paths";

  static
  {
    KEY_ANTIALIASING = new KeyImpl(1, "Global antialiasing enable key",
                                   VALUE_ANTIALIAS_ON,
                                   VALUE_ANTIALIAS_OFF,
                                   VALUE_ANTIALIAS_DEFAULT);
    KEY_RENDERING = new KeyImpl(2, "Global rendering quality key",
                                VALUE_RENDER_SPEED,
                                VALUE_RENDER_QUALITY,
                                VALUE_RENDER_DEFAULT);
    KEY_DITHERING = new KeyImpl(3, "Dithering quality key",
                                VALUE_DITHER_DISABLE,
                                VALUE_DITHER_ENABLE,
                                VALUE_DITHER_DEFAULT);
    KEY_TEXT_ANTIALIASING
      = new KeyImpl(4, "Text-specific antialiasing enable key",
                    VALUE_TEXT_ANTIALIAS_ON,
                    VALUE_TEXT_ANTIALIAS_OFF,
                    VALUE_TEXT_ANTIALIAS_DEFAULT);
    KEY_FRACTIONALMETRICS = new KeyImpl(5, "Fractional metrics enable key",
                                        VALUE_FRACTIONALMETRICS_OFF,
                                        VALUE_FRACTIONALMETRICS_ON,
                                        VALUE_FRACTIONALMETRICS_DEFAULT);
    KEY_INTERPOLATION = new KeyImpl(6, "Image interpolation method key",
                                    VALUE_INTERPOLATION_NEAREST_NEIGHBOR,
                                    VALUE_INTERPOLATION_BILINEAR,
                                    VALUE_INTERPOLATION_BICUBIC);
    KEY_ALPHA_INTERPOLATION
      = new KeyImpl(7, "Alpha blending interpolation method key",
                    VALUE_ALPHA_INTERPOLATION_SPEED,
                    VALUE_ALPHA_INTERPOLATION_QUALITY,
                    VALUE_ALPHA_INTERPOLATION_DEFAULT);
    KEY_COLOR_RENDERING = new KeyImpl(8, "Color rendering quality key",
                                      VALUE_COLOR_RENDER_SPEED,
                                      VALUE_COLOR_RENDER_QUALITY,
                                      VALUE_COLOR_RENDER_DEFAULT);
    KEY_STROKE_CONTROL = new KeyImpl(9, "Stroke normalization control key",
                                     VALUE_STROKE_DEFAULT,
                                     VALUE_STROKE_NORMALIZE,
                                     VALUE_STROKE_PURE);
  }

  /**
   * Creates a new collection of hints containing all the (key, value) pairs
   * in the specified map.
   * 
   * @param init  a map containing a collection of hints (<code>null</code> 
   *              permitted).
   */
  public RenderingHints(Map init)
  {
    if (init != null)
      putAll(init);
  }

  /**
   * Creates a new collection containing a single (key, value) pair.
   * 
   * @param key  the key.
   * @param value  the value.
   */
  public RenderingHints(Key key, Object value)
  {
    put(key, value);
  }

  /**
   * Returns the number of hints in the collection.
   * 
   * @return The number of hints.
   */
  public int size()
  {
    return hintMap.size();
  }

  /**
   * Returns <code>true</code> if there are no hints in the collection,
   * and <code>false</code> otherwise.
   * 
   * @return A boolean.
   */
  public boolean isEmpty()
  {
    return hintMap.isEmpty();
  }

  /**
   * Returns <code>true</code> if the collection of hints contains the
   * specified key, and <code>false</code> otherwise.
   * 
   * @param key  the key.
   * 
   * @return A boolean.
   */
  public boolean containsKey(Object key)
  {
    if (key == null)
      throw new NullPointerException();
    return hintMap.containsKey((Key) key);
  }

  /**
   * Returns <code>true</code> if the collection of hints contains the
   * specified value, and <code>false</code> otherwise.
   * 
   * @param value  the value.
   * 
   * @return A boolean.
   */
  public boolean containsValue(Object value)
  {
    return hintMap.containsValue(value);
  }

  /**
   * Returns the value associated with the specified key.
   * 
   * @param key  the key.
   * 
   * @return The value.
   */
  public Object get(Object key)
  {
    return hintMap.get((Key) key);
  }

  /**
   * Adds a (key, value) pair to the collection of hints (if the
   * collection already contains the specified key, then the 
   * value is updated).
   * 
   * @param key  the key.
   * @param value  the value.
   * 
   * @return ???
   */
  public Object put(Object key, Object value)
  {
    if (key == null || value == null)
      throw new NullPointerException();
    if (! ((Key) key).isCompatibleValue(value))
      throw new IllegalArgumentException();
    return hintMap.put(key, value);
  }

  /**
   * Adds all the hints from a collection to this collection.
   * 
   * @param hints  the hint collection.
   */
  public void add(RenderingHints hints)
  {
    hintMap.putAll(hints);
  }

  /**
   * Clears all the hints from this collection.
   */
  public void clear()
  {
    hintMap.clear();
  }

  /**
   * Removes a hint from the collection.
   * 
   * @param key  the key.
   * 
   * @return The value that was associated with the key, or <code>null</code> if 
   *         the key was not part of the collection
   * 
   * @throws ClassCastException if the key is not a subclass of 
   *         {@link RenderingHints.Key}.
   */
  public Object remove(Object key)
  {
    // don't remove the (Key) cast, it is necessary to throw the exception
    // required by the spec
    return hintMap.remove((Key) key);  
  }

  /**
   * Adds a collection of (key, value) pairs to the collection.
   * 
   * @param m  a map containing (key, value) items.
   * 
   * @throws ClassCastException if the map contains a key that is not
   *         a subclass of {@link RenderingHints.Key}.
   * @throws IllegalArgumentException if the map contains a value that is
   *         not compatible with its key.
   */
  public void putAll(Map m)
  {
    // preprocess map to generate appropriate exceptions
    Iterator iterator = m.keySet().iterator();
    while (iterator.hasNext()) {
      Key key = (Key) iterator.next();
      if (!key.isCompatibleValue(m.get(key))) {
        throw new IllegalArgumentException();
      }
    }
    // map is OK, update
    hintMap.putAll(m);
  }

  /**
   * Returns a set containing the keys from this collection.
   * 
   * @return A set of keys.
   */
  public Set keySet()
  {
    return hintMap.keySet();
  }

  /**
   * Returns a collection of the values from this hint collection.  The
   * collection is backed by the <code>RenderingHints</code> instance, 
   * so updates to one will affect the other.
   * 
   * @return A collection of values.
   */
  public Collection values()
  {
    return hintMap.values();
  }

  /**
   * Returns a set of entries from the collection.
   * 
   * @return A set of entries.
   */
  public Set entrySet()
  {
    return Collections.unmodifiableSet(hintMap.entrySet());
  }

  /**
   * Checks this collection for equality with an arbitrary object.
   * 
   * @param o  the object (<code>null</code> permitted)
   * 
   * @return A boolean.
   */
  public boolean equals(Object o)
  {
    return hintMap.equals(o);
  }

  /**
   * Returns a hash code for the collection of hints.
   * 
   * @return A hash code.
   */
  public int hashCode()
  {
    return hintMap.hashCode();
  }

  /**
   * Creates a clone of this instance.
   * 
   * @return A clone.
   */
  public Object clone()
  {
    try
      {
        RenderingHints copy = (RenderingHints) super.clone();
        copy.hintMap = (HashMap) hintMap.clone();
        return copy;
      }
    catch (CloneNotSupportedException e)
      {
        throw (Error) new InternalError().initCause(e); // Impossible
      }
  }

  /**
   * Returns a string representation of this instance.
   * 
   * @return A string.
   */
  public String toString()
  {
    return hintMap.toString();
  }
} // class RenderingHints
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some checks for the add() method in the {@link RenderingHints} class.
 */
public class add implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    RenderingHints h2 = new RenderingHints(
      RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON
    );
    h1.add(h2);
    harness.check(h1.size() == 2);
    harness.check(h1.containsKey(RenderingHints.KEY_ANTIALIASING));
  
    boolean pass = false;
    try
    {
      h1.add(null);
    }
    catch (NullPointerException e)  
    {
      pass = true;
    }
    harness.check(pass);
  
  }

}
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some checks for the clear() method in the {@link RenderingHints} class.
 */
public class clear implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    h1.clear();
    harness.check(h1.isEmpty());

  }

}
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some checks for the clone() method in the {@link RenderingHints} class.
 */
public class clone implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    RenderingHints h2 = (RenderingHints) h1.clone();
    harness.check(h2.containsKey(RenderingHints.KEY_TEXT_ANTIALIASING));
    harness.check(h2.get(RenderingHints.KEY_TEXT_ANTIALIASING).equals(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    
    // check that updating h1 doesn't affect h2
    h1.clear();
    harness.check(h2.containsKey(RenderingHints.KEY_TEXT_ANTIALIASING));
    harness.check(h2.get(RenderingHints.KEY_TEXT_ANTIALIASING).equals(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    
  }

}
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some checks for the constructors in the {@link RenderingHints}
 * class.
 */
public class constructors implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
    
    harness.checkPoint("RenderingHints(Map)");
    testConstructor1(harness);  
    
    harness.checkPoint("RenderingHints(Key, Object)");
    testConstructor2(harness);
  }
  
  public void testConstructor1(TestHarness harness) 
  {
    RenderingHints h = new RenderingHints(null);
    harness.check(h.isEmpty());
    harness.check(h.size(), 0);
  }

  public void testConstructor2(TestHarness harness) 
  {
    // it isn't clear from the spec whether a null key is acceptable, but to be
    // consistent with the put(key, value) method it should throw a 
    // NullPointerException
    boolean pass = false;
    try
    {
      RenderingHints h = new RenderingHints(
        null, RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT
      );
    }
    catch (NullPointerException e) 
    {
      pass = true;
    }
    harness.check(pass);
    
    // it isn't clear from the spec whether a null value is acceptable, but to be
    // consistent with the put(key, value) method it should throw a 
    // NullPointerException
    pass = false;
    try 
    {
      RenderingHints h = new RenderingHints(
        RenderingHints.KEY_ALPHA_INTERPOLATION, null
      );
    }
    catch (NullPointerException e) 
    {
      pass = true;
    }
    harness.check(pass);
  }
  
}
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some checks for the containsKey() method in the {@link RenderingHints}
 * class.
 */
public class containsKey implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  
    RenderingHints h = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    harness.check(h.containsKey(RenderingHints.KEY_TEXT_ANTIALIASING));
    harness.check(!h.containsKey(RenderingHints.KEY_ANTIALIASING));
    
    // an argument that is not a RenderingHint.Key should generate
    // a ClassCastException...
    boolean pass = false;
    try
    {
      h.containsKey(new Integer(1));
    }
    catch (ClassCastException e)  
    {
      pass = true;
    }
    harness.check(pass);
    
    // the API spec clearly states that a null argument should generate a
    // NullPointerException...
    pass = false;
    try
    {
      h.containsKey(null);
    }
    catch (NullPointerException e) 
    {
      pass = true;
    }
    harness.check(pass);
  }

}
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some checks for the containsValue() method in the {@link RenderingHints}
 * class.
 */
public class containsValue implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    harness.check(h1.containsValue(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(!h1.containsValue(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
    harness.check(!h1.containsValue(null));
    
  }

}

//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.util.Set;

import java.awt.RenderingHints;

/**
 * Some checks for the entrySet() method in the {@link RenderingHints}
 * class.
 */
public class entrySet implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    Set s = h1.entrySet();
    harness.check(s.size() == 1);
    
    h1.clear();
    s = h1.entrySet();
    harness.check(s.isEmpty());
  }

}

//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.util.HashMap;
import java.util.Map;

import java.awt.RenderingHints;

/**
 * Some checks for the equals() method in the {@link RenderingHints} class.
 */
public class equals implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    RenderingHints h2 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    harness.check(h1.equals(h2));
    harness.check(!h1.equals(null));
    
    Map m = new HashMap();
    m.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
    harness.check(h1.equals(m));
    harness.check(m.equals(h1));
  }

}

//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some checks for the get() method in the {@link RenderingHints} class.
 */
public class get implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    harness.check(h1.get(RenderingHints.KEY_TEXT_ANTIALIASING).equals(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(h1.get(null) == null);
    
    // getting a key that is not a RenderingHints.Key generates a ClassCastException...
    boolean pass = false;
    try
    {
      h1.get(new Integer(1));
    }
    catch (ClassCastException e)  
    {
      pass = true;
    }
    harness.check(pass);
  
  }

}
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some checks for the isEmpty() method in the {@link RenderingHints} class.
 */
public class isEmpty implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    harness.check(!h1.isEmpty());
    h1.clear();
    harness.check(h1.isEmpty());
  }

}

//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.util.Set;

import java.awt.RenderingHints;

/**
 * Some checks for the keySet() method in the {@link RenderingHints} class.
 */
public class keySet implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    Set k = h1.keySet();
    harness.check(k.size() == 1);
  
    h1.clear();
    harness.check(k.isEmpty());
  }

}

//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.util.HashMap;
import java.util.Map;

import java.awt.RenderingHints;

/**
 * Some checks for the putAll() method in the {@link RenderingHints} class.
 */
public class putAll implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(null);
    h1.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
    h1.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

    RenderingHints h2 = new RenderingHints(null);
    h2.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    h2.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
    
    h1.putAll(h2);
    harness.check(h1.size() == 3);
    harness.check(h1.containsKey(RenderingHints.KEY_RENDERING));
    harness.check(h1.get(RenderingHints.KEY_TEXT_ANTIALIASING).equals(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));

    // adding a value that is not compatible with the key generates an 
    // IllegalArgumentException...
    Map m = new HashMap();
    m.put("A", "B");
    boolean pass = false;
    try
    {
      h1.putAll(m);
    }
    catch (IllegalArgumentException e)  
    {
      pass = true;
    }
    catch (ClassCastException e)  
    {
      pass = true;
    }
    harness.check(pass);
  
    // adding a null value for a valid key should generate an 
    // IllegalArgumentException or a NullPointerException depending
    // on the order of the checks...
    m.clear();
    m.put(RenderingHints.KEY_DITHERING, null);
    pass = false;
    try
    {
      h1.putAll(m);
    }
    catch (IllegalArgumentException e)  
    {
      pass = true;
    }
    catch (NullPointerException e) 
    {
      pass = true;
    }
    harness.check(pass);
  
    // adding a key that is not a RenderingHints.Key generates a 
    // ClassCastException (or possibly a NullPointerException if 
    // the second argument is checked first)...
    m.clear();
    m.put(new Integer(1), null);
    pass = false;
    try
    {
      h1.putAll(m);
    }
    catch (ClassCastException e)  
    {
      pass = true;
    }
    catch (NullPointerException e) 
    {
      pass = true;
    }
    harness.check(pass);
    
    // adding a null key generates a NullPointerException...
    pass = false;
    try
    {
      h1.putAll(null);
    }
    catch (NullPointerException e)  
    {
      pass = true;
    }
    harness.check(pass);

  }

}
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some checks for the put() method in the {@link RenderingHints} class.
 */
public class put implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    h1.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    harness.check(h1.size() == 2);
    harness.check(h1.containsKey(RenderingHints.KEY_ANTIALIASING));
    harness.check(h1.get(RenderingHints.KEY_ANTIALIASING).equals(RenderingHints.VALUE_ANTIALIAS_ON));

    // adding a value that is not compatible with the key generates an 
    // IllegalArgumentException...
    boolean pass = false;
    try
    {
      h1.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
    }
    catch (IllegalArgumentException e)  
    {
      pass = true;
    }
    harness.check(pass);
    
    // adding a null value for a valid key should generate an 
    // IllegalArgumentException or a NullPointerException depending
    // on the order of the checks...
    pass = false;
    try
    {
      h1.put(RenderingHints.KEY_ANTIALIASING, null);
    }
    catch (IllegalArgumentException e)  
    {
      pass = true;
    }
    catch (NullPointerException e) 
    {
      pass = true;
    }
    harness.check(pass);
    
    // adding a key that is not a RenderingHints.Key generates a 
    // ClassCastException (or possibly a NullPointerException if 
    // the second argument is checked first)...
    pass = false;
    try
    {
      h1.put(new Integer(1), null);
    }
    catch (ClassCastException e)  
    {
      pass = true;
    }
    catch (NullPointerException e) 
    {
      pass = true;
    }
    harness.check(pass);
    
    // adding a null key generates a NullPointerException...
    pass = false;
    try
    {
      h1.put(null, null);
    }
    catch (NullPointerException e)  
    {
      pass = true;
    }
    harness.check(pass);

  }

}
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import org.jfree.java.awt.RenderingHints;

/**
 * Some checks for the remove() method in the {@link RenderingHints} class.
 */
public class remove implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(null);
    Object result = h1.remove(RenderingHints.KEY_ALPHA_INTERPOLATION);
    harness.check(result == null);
    h1.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
    result = h1.remove(RenderingHints.KEY_RENDERING);
    harness.check(result == RenderingHints.VALUE_RENDER_QUALITY);
    harness.check(h1.isEmpty());
   
    result = h1.remove(null);
    harness.check(result == null);
    
    boolean pass = false;
    try
    {
      h1.remove(new Integer(1));
    }
    catch (ClassCastException e)
    {
      pass = true;
    }
    harness.check(pass);

  }

}
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some checks for the size() method in the {@link RenderingHints} class.
 */
public class size implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(null);
    harness.check(h1.size() == 0);
    h1.put(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE);
    harness.check(h1.size() == 1);
    h1.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
    harness.check(h1.size() == 2);
    h1.clear();
    harness.check(h1.size() == 0);
  
  }

}
//Tags: JDK1.2

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//This file is part of Mauve.

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.util.Collection;

import java.awt.RenderingHints;

/**
 * Some checks for the values() method in the {@link RenderingHints} class.
 */
public class values implements Testlet {

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {

    RenderingHints h1 = new RenderingHints(null);
    Collection v1 = h1.values();
    harness.check(v1.isEmpty());

    h1.put(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE);
    // the values collection is backed by the RenderingHints, so it updates
    harness.check(v1.size() == 1);
    harness.check(v1.contains(RenderingHints.VALUE_DITHER_DISABLE));
    
  }

}
//Tags: JDK1.4

//Copyright (C) 2004 David Gilbert <david.gilbert@object-refinery.com>

//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.

//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING.  If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA.  */

package gnu.testlet.java.awt.RenderingHints.Key;

import gnu.testlet.TestHarness;
import gnu.testlet.Testlet;

import java.awt.RenderingHints;

/**
 * Some (brute force) checks for the isCompatibleValue() method of the 
 * {@link RenderingHints.Key} class.
 */
public class isCompatibleValue implements Testlet 
{

  /**
   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)      
  {
    harness.checkPoint("KEY_ALPHA_INTERPOLATION");
    RenderingHints.Key key = RenderingHints.KEY_ALPHA_INTERPOLATION;
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DISABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_ENABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_NORMALIZE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_PURE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(null));
    
    harness.checkPoint("KEY_ANTIALIASING");
    key = RenderingHints.KEY_ANTIALIASING;
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_DEFAULT));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_OFF));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DISABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_ENABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_NORMALIZE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_PURE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(null));
    
    harness.checkPoint("KEY_COLOR_RENDERING");
    key = RenderingHints.KEY_COLOR_RENDERING;
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_ON));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_DEFAULT));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DISABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_ENABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_NORMALIZE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_PURE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(null));
    
    harness.checkPoint("KEY_DITHERING");
    key = RenderingHints.KEY_DITHERING;
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_SPEED));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_DITHER_DEFAULT));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_DITHER_DISABLE));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_DITHER_ENABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_NORMALIZE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_PURE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(null));
    
    harness.checkPoint("KEY_FRACTIONALMETRICS");
    key = RenderingHints.KEY_FRACTIONALMETRICS;
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DISABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_ENABLE));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_NORMALIZE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_PURE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(null));
    
    harness.checkPoint("KEY_INTERPOLATION");
    key = RenderingHints.KEY_INTERPOLATION;
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DISABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_ENABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_ON));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_NORMALIZE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_PURE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(null));
    
    harness.checkPoint("KEY_RENDERING");
    key = RenderingHints.KEY_RENDERING;
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DISABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_ENABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_RENDER_DEFAULT));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_RENDER_QUALITY));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_NORMALIZE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_PURE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(null));
 
    harness.checkPoint("KEY_STROKE_CONTROL");
    key = RenderingHints.KEY_STROKE_CONTROL;
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DISABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_ENABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_SPEED));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_STROKE_DEFAULT));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_STROKE_NORMALIZE));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_STROKE_PURE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(null));
    
    harness.checkPoint("KEY_TEXT_ANTIALIASING");
    key = RenderingHints.KEY_TEXT_ANTIALIASING;
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_COLOR_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_DISABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_DITHER_ENABLE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_FRACTIONALMETRICS_ON));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BICUBIC));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_QUALITY));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_RENDER_SPEED));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_DEFAULT));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_NORMALIZE));
    harness.check(!key.isCompatibleValue(RenderingHints.VALUE_STROKE_PURE));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
    harness.check(key.isCompatibleValue(RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
    harness.check(!key.isCompatibleValue(null));

  }

}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]