Fields Summary |
---|
HashMap | hintmap |
public static final Key | KEY_ANTIALIASINGAntialiasing hint key. |
public static final Object | VALUE_ANTIALIAS_ONAntialiasing hint values -- rendering is done with antialiasing. |
public static final Object | VALUE_ANTIALIAS_OFFAntialiasing hint values -- rendering is done without antialiasing. |
public static final Object | VALUE_ANTIALIAS_DEFAULTAntialiasing hint values -- rendering is done with the platform
default antialiasing mode. |
public static final Key | KEY_RENDERINGRendering hint key. |
public static final Object | VALUE_RENDER_SPEEDRendering hint values -- Appropriate rendering algorithms are chosen
with a preference for output speed. |
public static final Object | VALUE_RENDER_QUALITYRendering hint values -- Appropriate rendering algorithms are chosen
with a preference for output quality. |
public static final Object | VALUE_RENDER_DEFAULTRendering hint values -- The platform default rendering algorithms
are chosen. |
public static final Key | KEY_DITHERINGDithering hint key. |
public static final Object | VALUE_DITHER_DISABLEDithering hint values -- do not dither when rendering. |
public static final Object | VALUE_DITHER_ENABLEDithering hint values -- dither when rendering, if needed. |
public static final Object | VALUE_DITHER_DEFAULTDithering hint values -- use the platform default for dithering. |
public static final Key | KEY_TEXT_ANTIALIASINGText antialiasing hint key. |
public static final Object | VALUE_TEXT_ANTIALIAS_ONText antialiasing hint value -- text rendering is done with
antialiasing. |
public static final Object | VALUE_TEXT_ANTIALIAS_OFFText antialiasing hint value -- text rendering is done without
antialiasing. |
public static final Object | VALUE_TEXT_ANTIALIAS_DEFAULTText antialiasing hint value -- text rendering is done using the
platform default text antialiasing mode. |
public static final Key | KEY_FRACTIONALMETRICSFont fractional metrics hint key. |
public static final Object | VALUE_FRACTIONALMETRICS_OFFFont fractional metrics hint values -- fractional metrics disabled. |
public static final Object | VALUE_FRACTIONALMETRICS_ONFont fractional metrics hint values -- fractional metrics enabled. |
public static final Object | VALUE_FRACTIONALMETRICS_DEFAULTFont fractional metrics hint values -- use the platform default for
fractional metrics. |
public static final Key | KEY_INTERPOLATIONInterpolation hint key. |
public static final Object | VALUE_INTERPOLATION_NEAREST_NEIGHBORInterpolation hint value -- INTERPOLATION_NEAREST_NEIGHBOR. |
public static final Object | VALUE_INTERPOLATION_BILINEARInterpolation hint value -- INTERPOLATION_BILINEAR. |
public static final Object | VALUE_INTERPOLATION_BICUBICInterpolation hint value -- INTERPOLATION_BICUBIC. |
public static final Key | KEY_ALPHA_INTERPOLATIONAlpha interpolation hint key. |
public static final Object | VALUE_ALPHA_INTERPOLATION_SPEEDAlpha interpolation hint value -- ALPHA_INTERPOLATION_SPEED. |
public static final Object | VALUE_ALPHA_INTERPOLATION_QUALITYAlpha interpolation hint value -- ALPHA_INTERPOLATION_QUALITY. |
public static final Object | VALUE_ALPHA_INTERPOLATION_DEFAULTAlpha interpolation hint value -- ALPHA_INTERPOLATION_DEFAULT. |
public static final Key | KEY_COLOR_RENDERINGColor rendering hint key. |
public static final Object | VALUE_COLOR_RENDER_SPEEDColor rendering hint value -- COLOR_RENDER_SPEED. |
public static final Object | VALUE_COLOR_RENDER_QUALITYColor rendering hint value -- COLOR_RENDER_QUALITY. |
public static final Object | VALUE_COLOR_RENDER_DEFAULTColor rendering hint value -- COLOR_RENDER_DEFAULT. |
public static final Key | KEY_STROKE_CONTROLStroke normalization control hint key. |
public static final Object | VALUE_STROKE_DEFAULTStroke normalization control hint value -- STROKE_DEFAULT. |
public static final Object | VALUE_STROKE_NORMALIZEStroke normalization control hint value -- STROKE_NORMALIZE. |
public static final Object | VALUE_STROKE_PUREStroke normalization control hint value -- STROKE_PURE. |
Methods Summary |
---|
public void | add(java.awt.RenderingHints hints)Adds all of the keys and corresponding values from the specified
RenderingHints object to this
RenderingHints object. Keys that are present in
this RenderingHints object, but not in the specified
RenderingHints object are not affected.
hintmap.putAll(hints.hintmap);
|
public void | clear()Clears this RenderingHints object of all key/value
pairs.
hintmap.clear();
|
public java.lang.Object | clone()Creates a clone of this RenderingHints object
that has the same contents as this RenderingHints
object.
RenderingHints rh;
try {
rh = (RenderingHints) super.clone();
if (hintmap != null) {
rh.hintmap = (HashMap) hintmap.clone();
}
} catch (CloneNotSupportedException e) {
// this shouldn't happen, since we are Cloneable
throw new InternalError();
}
return rh;
|
public boolean | containsKey(java.lang.Object key)Returns true if this RenderingHints
contains a mapping for the specified key.
return hintmap.containsKey((Key) key);
|
public boolean | containsValue(java.lang.Object value)Returns true if this RenderingHints maps one or more keys to the
specified value.
More formally, returns true if and only
if this RenderingHints
contains at least one mapping to a value v such that
(value==null ? v==null : value.equals(v))
.
This operation will probably require time linear in the
RenderingHints size for most implementations
of RenderingHints .
return hintmap.containsValue(value);
|
public java.util.Set | entrySet()Returns a Set view of the mappings contained
in this RenderingHints . Each element in the
returned Set is a Map.Entry .
The Set is backed by the RenderingHints ,
so changes to the RenderingHints are reflected
in the Set , and vice-versa. If the
RenderingHints is modified while
while an iteration over the Set is in progress,
the results of the iteration are undefined.
The entrySet returned from a RenderingHints object
is not modifiable.
return Collections.unmodifiableMap(hintmap).entrySet();
|
public boolean | equals(java.lang.Object o)Compares the specified Object with this
RenderingHints for equality.
Returns true if the specified object is also a
Map and the two Map objects represent
the same mappings. More formally, two Map objects
t1 and t2 represent the same mappings
if t1.keySet().equals(t2.keySet()) and for every
key k in t1.keySet() ,
(t1.get(k)==null ? t2.get(k)==null : t1.get(k).equals(t2.get(k)))
.
This ensures that the equals method works properly across
different implementations of the Map interface.
if (o instanceof RenderingHints) {
return hintmap.equals(((RenderingHints) o).hintmap);
} else if (o instanceof Map) {
return hintmap.equals(o);
}
return false;
|
public java.lang.Object | get(java.lang.Object key)Returns the value to which the specified key is mapped.
return hintmap.get((Key) key);
|
public int | hashCode()Returns the hash code value for this RenderingHints .
The hash code of a RenderingHints is defined to be
the sum of the hashCodes of each Entry in the
RenderingHints object's entrySet view. This ensures that
t1.equals(t2) implies that
t1.hashCode()==t2.hashCode() for any two Map
objects t1 and t2 , as required by the general
contract of Object.hashCode .
return hintmap.hashCode();
|
public boolean | isEmpty()Returns true if this
RenderingHints contains no key-value mappings.
return hintmap.isEmpty();
|
public java.util.Set | keySet()Returns a Set view of the Keys contained in this
RenderingHints . The Set is backed by the
RenderingHints , so changes to the
RenderingHints are reflected in the Set ,
and vice-versa. If the RenderingHints is modified
while an iteration over the Set is in progress,
the results of the iteration are undefined. The Set
supports element removal, which removes the corresponding
mapping from the RenderingHints , via the
Iterator.remove , Set.remove ,
removeAll retainAll , and
clear operations. It does not support
the add or addAll operations.
return hintmap.keySet();
|
public java.lang.Object | put(java.lang.Object key, java.lang.Object value)Maps the specified key to the specified
value in this RenderingHints object.
Neither the key nor the value can be null .
The value can be retrieved by calling the get method
with a key that is equal to the original key.
if (!((Key) key).isCompatibleValue(value)) {
throw new IllegalArgumentException(value+
" incompatible with "+
key);
}
return hintmap.put((Key) key, value);
|
public void | putAll(java.util.Map m)Copies all of the mappings from the specified Map
to this RenderingHints . These mappings replace
any mappings that this RenderingHints had for any
of the keys currently in the specified Map .
// ## javac bug?
//if (m instanceof RenderingHints) {
if (RenderingHints.class.isInstance(m)) {
//hintmap.putAll(((RenderingHints) m).hintmap);
for (Map.Entry<?,?> entry : m.entrySet())
hintmap.put(entry.getKey(), entry.getValue());
} else {
// Funnel each key/value pair through our protected put method
for (Map.Entry<?,?> entry : m.entrySet())
put(entry.getKey(), entry.getValue());
}
|
public java.lang.Object | remove(java.lang.Object key)Removes the key and its corresponding value from this
RenderingHints object. This method does nothing if the
key is not in this RenderingHints object.
return hintmap.remove((Key) key);
|
public int | size()Returns the number of key-value mappings in this
RenderingHints .
return hintmap.size();
|
public java.lang.String | toString()Returns a rather long string representation of the hashmap
which contains the mappings of keys to values for this
RenderingHints object.
if (hintmap == null) {
return getClass().getName() + "@" +
Integer.toHexString(hashCode()) +
" (0 hints)";
}
return hintmap.toString();
|
public java.util.Collection | values()Returns a Collection view of the values
contained in this RenderinHints .
The Collection is backed by the
RenderingHints , so changes to
the RenderingHints are reflected in
the Collection , and vice-versa.
If the RenderingHints is modified while
an iteration over the Collection is
in progress, the results of the iteration are undefined.
The Collection supports element removal,
which removes the corresponding mapping from the
RenderingHints , via the
Iterator.remove ,
Collection.remove , removeAll ,
retainAll and clear operations.
It does not support the add or
addAll operations.
return hintmap.values();
|