/**
* Serialize the RenderingHintsState.
*/
private void writeObject(ObjectOutputStream out) throws IOException {
// -- Create a serializable form of the RenderingHints object. --
RenderingHints hints = (RenderingHints)theObject;
// Create an empty Hashtable.
Hashtable table = new Hashtable();
// If there are hints, add them to the table.
if (hints != null && !hints.isEmpty()) {
// Get a view of the hints' keys.
Set keySet = hints.keySet();
// Proceed if the key set is non-empty.
if (!keySet.isEmpty()) {
// Get an iterator for the key set.
Iterator keyIterator = keySet.iterator();
// Get the cached hint table.
Hashtable hintTable = getHintTable();
// Get the suppressed key Vector.
Vector suppressedKeys = getSuppressedKeys();
// Loop over the keys.
while (keyIterator.hasNext()) {
// Get the next key.
Object key = keyIterator.next();
// Skip this element if the key is suppressed.
if (suppressedKeys != null &&
suppressedKeys.indexOf(key) != -1) {
continue;
}
// Get the field of the key.
Object keyElement = SerializerFactory.getState(key, null);
// If the key was not in the table it is not a public
// static field in one of the KEY_CLASSES so skip it.
if (keyElement == null) {
continue;
}
// Get the next value.
Object value = hints.get(key);
// Pack the key/value pair in a Hashtable entry.
HintElement valueElement = null;
try {
// Try to create a HintElement from the value directly.