Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.awt
Class RenderingHints  view RenderingHints download RenderingHints.java

java.lang.Object
  extended byjava.awt.RenderingHints
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map

public class RenderingHints
extends java.lang.Object
implements java.util.Map, java.lang.Cloneable

A collection of (key, value) items that provide 'hints' for the Graphics2D rendering pipeline. Because these items are hints only, they may be ignored by a particular Graphics2D implementation.


Nested Class Summary
static class RenderingHints.Key
          The base class used to represent keys.
private static class RenderingHints.KeyImpl
           
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
private  java.util.HashMap hintMap
           
static RenderingHints.Key KEY_ALPHA_INTERPOLATION
          A key for the 'alpha interpolation' hint.
static RenderingHints.Key KEY_ANTIALIASING
          A key for the 'antialiasing' hint.
static RenderingHints.Key KEY_COLOR_RENDERING
          A key for the 'color rendering' hint.
static RenderingHints.Key KEY_DITHERING
          A key for the 'dithering' hint.
static RenderingHints.Key KEY_FRACTIONALMETRICS
          A key for the 'fractional metrics' hint.
static RenderingHints.Key KEY_INTERPOLATION
          A key for the 'interpolation' hint.
static RenderingHints.Key KEY_RENDERING
          A key for the 'rendering' hint.
static RenderingHints.Key KEY_STROKE_CONTROL
          A key for the 'stroke control' hint.
static RenderingHints.Key KEY_TEXT_ANTIALIASING
          A key for the 'text antialiasing' hint.
static java.lang.Object VALUE_ALPHA_INTERPOLATION_DEFAULT
          This value is for use with the KEY_ALPHA_INTERPOLATION 55 key.
static java.lang.Object VALUE_ALPHA_INTERPOLATION_QUALITY
          This value is for use with the KEY_ALPHA_INTERPOLATION 55 key.
static java.lang.Object VALUE_ALPHA_INTERPOLATION_SPEED
          This value is for use with the KEY_ALPHA_INTERPOLATION 55 key.
static java.lang.Object VALUE_ANTIALIAS_DEFAULT
          This value is for use with the KEY_ANTIALIASING 55 key.
static java.lang.Object VALUE_ANTIALIAS_OFF
          This value is for use with the KEY_ANTIALIASING 55 key.
static java.lang.Object VALUE_ANTIALIAS_ON
          This value is for use with the KEY_ANTIALIASING 55 key.
static java.lang.Object VALUE_COLOR_RENDER_DEFAULT
          This value is for use with the KEY_COLOR_RENDERING 55 key.
static java.lang.Object VALUE_COLOR_RENDER_QUALITY
          This value is for use with the KEY_COLOR_RENDERING 55 key.
static java.lang.Object VALUE_COLOR_RENDER_SPEED
          This value is for use with the KEY_COLOR_RENDERING 55 key.
static java.lang.Object VALUE_DITHER_DEFAULT
          This value is for use with the KEY_DITHERING 55 key.
static java.lang.Object VALUE_DITHER_DISABLE
          This value is for use with the KEY_DITHERING 55 key.
static java.lang.Object VALUE_DITHER_ENABLE
          This value is for use with the KEY_DITHERING 55 key.
static java.lang.Object VALUE_FRACTIONALMETRICS_DEFAULT
          This value is for use with the KEY_FRACTIONALMETRICS 55 key.
static java.lang.Object VALUE_FRACTIONALMETRICS_OFF
          This value is for use with the KEY_FRACTIONALMETRICS 55 key.
static java.lang.Object VALUE_FRACTIONALMETRICS_ON
          This value is for use with the KEY_FRACTIONALMETRICS 55 key.
static java.lang.Object VALUE_INTERPOLATION_BICUBIC
          This value is for use with the KEY_INTERPOLATION 55 key.
static java.lang.Object VALUE_INTERPOLATION_BILINEAR
          This value is for use with the KEY_INTERPOLATION 55 key.
static java.lang.Object VALUE_INTERPOLATION_NEAREST_NEIGHBOR
          This value is for use with the KEY_INTERPOLATION 55 key.
static java.lang.Object VALUE_RENDER_DEFAULT
          This value is for use with the KEY_RENDERING 55 key.
static java.lang.Object VALUE_RENDER_QUALITY
          This value is for use with the KEY_RENDERING 55 key.
static java.lang.Object VALUE_RENDER_SPEED
          This value is for use with the KEY_RENDERING 55 key.
static java.lang.Object VALUE_STROKE_DEFAULT
          This value is for use with the KEY_STROKE_CONTROL 55 key.
static java.lang.Object VALUE_STROKE_NORMALIZE
          This value is for use with the KEY_STROKE_CONTROL 55 key.
static java.lang.Object VALUE_STROKE_PURE
          This value is for use with the KEY_STROKE_CONTROL 55 key.
static java.lang.Object VALUE_TEXT_ANTIALIAS_DEFAULT
          This value is for use with the KEY_TEXT_ANTIALIASING 55 key.
static java.lang.Object VALUE_TEXT_ANTIALIAS_OFF
          This value is for use with the KEY_TEXT_ANTIALIASING 55 key.
static java.lang.Object VALUE_TEXT_ANTIALIAS_ON
          This value is for use with the KEY_TEXT_ANTIALIASING 55 key.
 
Constructor Summary
RenderingHints(java.util.Map init)
          Creates a new collection of hints containing all the (key, value) pairs in the specified map.
RenderingHints(RenderingHints.Key key, java.lang.Object value)
          Creates a new collection containing a single (key, value) pair.
 
Method Summary
 void add(RenderingHints hints)
          Adds all the hints from a collection to this collection.
 void clear()
          Clears all the hints from this collection.
 java.lang.Object clone()
          Creates a clone of this instance.
 boolean containsKey(java.lang.Object key)
          Returns true if the collection of hints contains the specified key, and false otherwise.
 boolean containsValue(java.lang.Object value)
          Returns true if the collection of hints contains the specified value, and false otherwise.
 java.util.Set entrySet()
          Returns a set of entries from the collection.
 boolean equals(java.lang.Object o)
          Checks this collection for equality with an arbitrary object.
 java.lang.Object get(java.lang.Object key)
          Returns the value associated with the specified key, or null if there is no value defined for the key.
 int hashCode()
          Returns a hash code for the collection of hints.
 boolean isEmpty()
          Returns true if there are no hints in the collection, and false otherwise.
 java.util.Set keySet()
          Returns a set containing the keys from this collection.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Adds a (key, value) pair to the collection of hints (if the collection already contains the specified key, then the value is updated).
 void putAll(java.util.Map m)
          Adds a collection of (key, value) pairs to the collection.
 java.lang.Object remove(java.lang.Object key)
          Removes a hint from the collection.
 int size()
          Returns the number of hints in the collection.
 java.lang.String toString()
          Returns a string representation of this instance.
 java.util.Collection values()
          Returns a collection of the values from this hint collection.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

hintMap

private java.util.HashMap hintMap

KEY_ANTIALIASING

public static final RenderingHints.Key KEY_ANTIALIASING
A key for the 'antialiasing' hint. Permitted values are:

VALUE_ANTIALIAS_OFF 55 Render without antialiasing (better speed).
VALUE_ANTIALIAS_ON 55 Render with antialiasing (better quality).
VALUE_ANTIALIAS_DEFAULT 55 Use the default value for antialiasing.


VALUE_ANTIALIAS_ON

public static final java.lang.Object VALUE_ANTIALIAS_ON
This value is for use with the KEY_ANTIALIASING 55 key.


VALUE_ANTIALIAS_OFF

public static final java.lang.Object VALUE_ANTIALIAS_OFF
This value is for use with the KEY_ANTIALIASING 55 key.


VALUE_ANTIALIAS_DEFAULT

public static final java.lang.Object VALUE_ANTIALIAS_DEFAULT
This value is for use with the KEY_ANTIALIASING 55 key.


KEY_RENDERING

public static final RenderingHints.Key KEY_RENDERING
A key for the 'rendering' hint. Permitted values are:

VALUE_RENDER_SPEED 55 Prefer speed over quality when rendering.
VALUE_RENDER_QUALITY 55 Prefer quality over speed when rendering.
VALUE_RENDER_DEFAULT 55 Use the default value for quality vs. speed when rendering.


VALUE_RENDER_SPEED

public static final java.lang.Object VALUE_RENDER_SPEED
This value is for use with the KEY_RENDERING 55 key.


VALUE_RENDER_QUALITY

public static final java.lang.Object VALUE_RENDER_QUALITY
This value is for use with the KEY_RENDERING 55 key.


VALUE_RENDER_DEFAULT

public static final java.lang.Object VALUE_RENDER_DEFAULT
This value is for use with the KEY_RENDERING 55 key.


KEY_DITHERING

public static final RenderingHints.Key KEY_DITHERING
A key for the 'dithering' hint. Permitted values are:

VALUE_DITHER_DISABLE 55 Disable dithering.
VALUE_DITHER_ENABLE 55 Enable dithering.
VALUE_DITHER_DEFAULT 55 Use the default value for dithering.


VALUE_DITHER_DISABLE

public static final java.lang.Object VALUE_DITHER_DISABLE
This value is for use with the KEY_DITHERING 55 key.


VALUE_DITHER_ENABLE

public static final java.lang.Object VALUE_DITHER_ENABLE
This value is for use with the KEY_DITHERING 55 key.


VALUE_DITHER_DEFAULT

public static final java.lang.Object VALUE_DITHER_DEFAULT
This value is for use with the KEY_DITHERING 55 key.


KEY_TEXT_ANTIALIASING

public static final RenderingHints.Key KEY_TEXT_ANTIALIASING
A key for the 'text antialiasing' hint. Permitted values are:

VALUE_TEXT_ANTIALIAS_ON 55 Render text with antialiasing (better quality usually).
VALUE_TEXT_ANTIALIAS_OFF 55 Render test without antialiasing (better speed).
VALUE_TEXT_ANTIALIAS_DEFAULT 55 Use the default value for text antialiasing.


VALUE_TEXT_ANTIALIAS_ON

public static final java.lang.Object VALUE_TEXT_ANTIALIAS_ON
This value is for use with the KEY_TEXT_ANTIALIASING 55 key.


VALUE_TEXT_ANTIALIAS_OFF

public static final java.lang.Object VALUE_TEXT_ANTIALIAS_OFF
This value is for use with the KEY_TEXT_ANTIALIASING 55 key.


VALUE_TEXT_ANTIALIAS_DEFAULT

public static final java.lang.Object VALUE_TEXT_ANTIALIAS_DEFAULT
This value is for use with the KEY_TEXT_ANTIALIASING 55 key.


KEY_FRACTIONALMETRICS

public static final RenderingHints.Key KEY_FRACTIONALMETRICS
A key for the 'fractional metrics' hint. Permitted values are:

VALUE_FRACTIONALMETRICS_OFF 55 Render text with fractional metrics off.
VALUE_FRACTIONALMETRICS_ON 55 Render text with fractional metrics on.
VALUE_FRACTIONALMETRICS_DEFAULT 55 Use the default value for fractional metrics.


VALUE_FRACTIONALMETRICS_OFF

public static final java.lang.Object VALUE_FRACTIONALMETRICS_OFF
This value is for use with the KEY_FRACTIONALMETRICS 55 key.


VALUE_FRACTIONALMETRICS_ON

public static final java.lang.Object VALUE_FRACTIONALMETRICS_ON
This value is for use with the KEY_FRACTIONALMETRICS 55 key.


VALUE_FRACTIONALMETRICS_DEFAULT

public static final java.lang.Object VALUE_FRACTIONALMETRICS_DEFAULT
This value is for use with the KEY_FRACTIONALMETRICS 55 key.


KEY_INTERPOLATION

public static final RenderingHints.Key KEY_INTERPOLATION
A key for the 'interpolation' hint. Permitted values are:

VALUE_INTERPOLATION_NEAREST_NEIGHBOR 55 Use nearest neighbour interpolation.
VALUE_INTERPOLATION_BILINEAR 55 Use bilinear interpolation.
VALUE_INTERPOLATION_BICUBIC 55 Use bicubic interpolation.


VALUE_INTERPOLATION_NEAREST_NEIGHBOR

public static final java.lang.Object VALUE_INTERPOLATION_NEAREST_NEIGHBOR
This value is for use with the KEY_INTERPOLATION 55 key.


VALUE_INTERPOLATION_BILINEAR

public static final java.lang.Object VALUE_INTERPOLATION_BILINEAR
This value is for use with the KEY_INTERPOLATION 55 key.


VALUE_INTERPOLATION_BICUBIC

public static final java.lang.Object VALUE_INTERPOLATION_BICUBIC
This value is for use with the KEY_INTERPOLATION 55 key.


KEY_ALPHA_INTERPOLATION

public static final RenderingHints.Key KEY_ALPHA_INTERPOLATION
A key for the 'alpha interpolation' hint. Permitted values are:

VALUE_ALPHA_INTERPOLATION_SPEED 55 Prefer speed over quality.
VALUE_ALPHA_INTERPOLATION_QUALITY 55 Prefer quality over speed.
VALUE_ALPHA_INTERPOLATION_DEFAULT 55 Use the default setting.


VALUE_ALPHA_INTERPOLATION_SPEED

public static final java.lang.Object VALUE_ALPHA_INTERPOLATION_SPEED
This value is for use with the KEY_ALPHA_INTERPOLATION 55 key.


VALUE_ALPHA_INTERPOLATION_QUALITY

public static final java.lang.Object VALUE_ALPHA_INTERPOLATION_QUALITY
This value is for use with the KEY_ALPHA_INTERPOLATION 55 key.


VALUE_ALPHA_INTERPOLATION_DEFAULT

public static final java.lang.Object VALUE_ALPHA_INTERPOLATION_DEFAULT
This value is for use with the KEY_ALPHA_INTERPOLATION 55 key.


KEY_COLOR_RENDERING

public static final RenderingHints.Key KEY_COLOR_RENDERING
A key for the 'color rendering' hint. Permitted values are:

VALUE_COLOR_RENDER_SPEED 55 Prefer speed over quality.
VALUE_COLOR_RENDER_QUALITY 55 Prefer quality over speed.
VALUE_COLOR_RENDER_DEFAULT 55 Use the default setting.


VALUE_COLOR_RENDER_SPEED

public static final java.lang.Object VALUE_COLOR_RENDER_SPEED
This value is for use with the KEY_COLOR_RENDERING 55 key.


VALUE_COLOR_RENDER_QUALITY

public static final java.lang.Object VALUE_COLOR_RENDER_QUALITY
This value is for use with the KEY_COLOR_RENDERING 55 key.


VALUE_COLOR_RENDER_DEFAULT

public static final java.lang.Object VALUE_COLOR_RENDER_DEFAULT
This value is for use with the KEY_COLOR_RENDERING 55 key.


KEY_STROKE_CONTROL

public static final RenderingHints.Key KEY_STROKE_CONTROL
A key for the 'stroke control' hint. Permitted values are:

VALUE_STROKE_DEFAULT 55 Use the default setting.
VALUE_STROKE_NORMALIZE 55 XXX
VALUE_STROKE_PURE 55 XXX


VALUE_STROKE_DEFAULT

public static final java.lang.Object VALUE_STROKE_DEFAULT
This value is for use with the KEY_STROKE_CONTROL 55 key.


VALUE_STROKE_NORMALIZE

public static final java.lang.Object VALUE_STROKE_NORMALIZE
This value is for use with the KEY_STROKE_CONTROL 55 key.


VALUE_STROKE_PURE

public static final java.lang.Object VALUE_STROKE_PURE
This value is for use with the KEY_STROKE_CONTROL 55 key.

Constructor Detail

RenderingHints

public RenderingHints(java.util.Map init)
Creates a new collection of hints containing all the (key, value) pairs in the specified map.


RenderingHints

public RenderingHints(RenderingHints.Key key,
                      java.lang.Object value)
Creates a new collection containing a single (key, value) pair.

Method Detail

size

public int size()
Returns the number of hints in the collection.

Specified by:
size in interface java.util.Map

isEmpty

public boolean isEmpty()
Returns true if there are no hints in the collection, and false otherwise.

Specified by:
isEmpty in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object key)
Returns true if the collection of hints contains the specified key, and false otherwise.

Specified by:
containsKey in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object value)
Returns true if the collection of hints contains the specified value, and false otherwise.

Specified by:
containsValue in interface java.util.Map

get

public java.lang.Object get(java.lang.Object key)
Returns the value associated with the specified key, or null if there is no value defined for the key.

Specified by:
get in interface java.util.Map

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Adds a (key, value) pair to the collection of hints (if the collection already contains the specified key, then the value is updated).

Specified by:
put in interface java.util.Map

add

public void add(RenderingHints hints)
Adds all the hints from a collection to this collection.


clear

public void clear()
Clears all the hints from this collection.

Specified by:
clear in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object key)
Removes a hint from the collection.

Specified by:
remove in interface java.util.Map

putAll

public void putAll(java.util.Map m)
Adds a collection of (key, value) pairs to the collection.

Specified by:
putAll in interface java.util.Map

keySet

public java.util.Set keySet()
Returns a set containing the keys from this collection.

Specified by:
keySet in interface java.util.Map

values

public java.util.Collection values()
Returns a collection of the values from this hint collection. The collection is backed by the RenderingHints instance, so updates to one will affect the other.

Specified by:
values in interface java.util.Map

entrySet

public java.util.Set entrySet()
Returns a set of entries from the collection.

Specified by:
entrySet in interface java.util.Map

equals

public boolean equals(java.lang.Object o)
Checks this collection for equality with an arbitrary object.

Specified by:
equals in interface java.util.Map

hashCode

public int hashCode()
Returns a hash code for the collection of hints.

Specified by:
hashCode in interface java.util.Map

clone

public java.lang.Object clone()
Creates a clone of this instance.


toString

public java.lang.String toString()
Returns a string representation of this instance.