java.awt

Class RenderingHints

  • java.lang.Object
    • java.awt.RenderingHints
  • All Implemented Interfaces:
    java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>
    public class RenderingHints extends java.lang.Object implements java.util.Map<java.lang.Object,java.lang.Object>, java.lang.Cloneable
    The RenderingHints class defines and manages collections of keys and associated values which allow an application to provide input into the choice of algorithms used by other classes which perform rendering and image manipulation services. The Graphics2D class, and classes that implement BufferedImageOp and RasterOp all provide methods to get and possibly to set individual or groups of RenderingHints keys and their associated values. When those implementations perform any rendering or image manipulation operations they should examine the values of any RenderingHints that were requested by the caller and tailor the algorithms used accordingly and to the best of their ability.

    Note that since these keys and values are hints, there is no requirement that a given implementation supports all possible choices indicated below or that it can respond to requests to modify its choice of algorithm. The values of the various hint keys may also interact such that while all variants of a given key are supported in one situation, the implementation may be more restricted when the values associated with other keys are modified. For example, some implementations may be able to provide several types of dithering when the antialiasing hint is turned off, but have little control over dithering when antialiasing is on. The full set of supported keys and hints may also vary by destination since runtimes may use different underlying modules to render to the screen, or to BufferedImage objects, or while printing.

    Implementations are free to ignore the hints completely, but should try to use an implementation algorithm that is as close as possible to the request. If an implementation supports a given algorithm when any value is used for an associated hint key, then minimally it must do so when the value for that key is the exact value that specifies the algorithm.

    The keys used to control the hints are all special values that subclass the associated RenderingHints.Key class. Many common hints are expressed below as static constants in this class, but the list is not meant to be exhaustive. Other hints may be created by other packages by defining new objects which subclass the Key class and defining the associated values.

    • Nested Classes 
      Modifier and Type Class and Description
      Inherited member indicator util.Map.Entry<K,V> Reveal DetailHide Detail
      A map entry (key-value pair).
      Ordinary member indicator Key Reveal DetailHide Detail
      Defines the base type of all keys used along with the RenderingHints class to control various algorithm choices in the rendering and imaging pipelines.
    • Fields 
      Modifier and Type Field and Description
      Ordinary member indicator KEY_ALPHA_INTERPOLATION Reveal DetailHide Detail
      Alpha interpolation hint key.
      Ordinary member indicator KEY_ANTIALIASING Reveal DetailHide Detail
      Antialiasing hint key.
      Ordinary member indicator KEY_COLOR_RENDERING Reveal DetailHide Detail
      Color rendering hint key.
      Ordinary member indicator KEY_DITHERING Reveal DetailHide Detail
      Dithering hint key.
      Ordinary member indicator KEY_FRACTIONALMETRICS Reveal DetailHide Detail
      Font fractional metrics hint key.
      Ordinary member indicator KEY_INTERPOLATION Reveal DetailHide Detail
      Interpolation hint key.
      Ordinary member indicator KEY_RENDERING Reveal DetailHide Detail
      Rendering hint key.
      Ordinary member indicator KEY_STROKE_CONTROL Reveal DetailHide Detail
      Stroke normalization control hint key.
      Ordinary member indicator KEY_TEXT_ANTIALIASING Reveal DetailHide Detail
      Text antialiasing hint key.
      Ordinary member indicator KEY_TEXT_LCD_CONTRAST Reveal DetailHide Detail
      LCD text contrast rendering hint key.
      Ordinary member indicator VALUE_ALPHA_INTERPOLATION_DEFAULT Reveal DetailHide Detail
      Alpha interpolation hint value -- alpha blending algorithms are chosen by the implementation for a good tradeoff of performance vs.
      Ordinary member indicator VALUE_ALPHA_INTERPOLATION_QUALITY Reveal DetailHide Detail
      Alpha interpolation hint value -- alpha blending algorithms are chosen with a preference for precision and visual quality.
      Ordinary member indicator VALUE_ALPHA_INTERPOLATION_SPEED Reveal DetailHide Detail
      Alpha interpolation hint value -- alpha blending algorithms are chosen with a preference for calculation speed.
      Ordinary member indicator VALUE_ANTIALIAS_DEFAULT Reveal DetailHide Detail
      Antialiasing hint value -- rendering is done with a default antialiasing mode chosen by the implementation.
      Ordinary member indicator VALUE_ANTIALIAS_OFF Reveal DetailHide Detail
      Antialiasing hint value -- rendering is done without antialiasing.
      Ordinary member indicator VALUE_ANTIALIAS_ON Reveal DetailHide Detail
      Antialiasing hint value -- rendering is done with antialiasing.
      Ordinary member indicator VALUE_COLOR_RENDER_DEFAULT Reveal DetailHide Detail
      Color rendering hint value -- perform color conversion calculations as chosen by the implementation to represent the best available tradeoff between performance and accuracy.
      Ordinary member indicator VALUE_COLOR_RENDER_QUALITY Reveal DetailHide Detail
      Color rendering hint value -- perform the color conversion calculations with the highest accuracy and visual quality.
      Ordinary member indicator VALUE_COLOR_RENDER_SPEED Reveal DetailHide Detail
      Color rendering hint value -- perform the fastest color conversion to the format of the output device.
      Ordinary member indicator VALUE_DITHER_DEFAULT Reveal DetailHide Detail
      Dithering hint value -- use a default for dithering chosen by the implementation.
      Ordinary member indicator VALUE_DITHER_DISABLE Reveal DetailHide Detail
      Dithering hint value -- do not dither when rendering geometry.
      Ordinary member indicator VALUE_DITHER_ENABLE Reveal DetailHide Detail
      Dithering hint value -- dither when rendering geometry, if needed.
      Ordinary member indicator VALUE_FRACTIONALMETRICS_DEFAULT Reveal DetailHide Detail
      Font fractional metrics hint value -- character glyphs are positioned with accuracy chosen by the implementation.
      Ordinary member indicator VALUE_FRACTIONALMETRICS_OFF Reveal DetailHide Detail
      Font fractional metrics hint value -- character glyphs are positioned with advance widths rounded to pixel boundaries.
      Ordinary member indicator VALUE_FRACTIONALMETRICS_ON Reveal DetailHide Detail
      Font fractional metrics hint value -- character glyphs are positioned with sub-pixel accuracy.
      Ordinary member indicator VALUE_INTERPOLATION_BICUBIC Reveal DetailHide Detail
      Interpolation hint value -- the color samples of 9 nearby integer coordinate samples in the image are interpolated using a cubic function in both X and Y to produce a color sample.
      Ordinary member indicator VALUE_INTERPOLATION_BILINEAR Reveal DetailHide Detail
      Interpolation hint value -- the color samples of the 4 nearest neighboring integer coordinate samples in the image are interpolated linearly to produce a color sample.
      Ordinary member indicator VALUE_INTERPOLATION_NEAREST_NEIGHBOR Reveal DetailHide Detail
      Interpolation hint value -- the color sample of the nearest neighboring integer coordinate sample in the image is used.
      Ordinary member indicator VALUE_RENDER_DEFAULT Reveal DetailHide Detail
      Rendering hint value -- rendering algorithms are chosen by the implementation for a good tradeoff of performance vs.
      Ordinary member indicator VALUE_RENDER_QUALITY Reveal DetailHide Detail
      Rendering hint value -- rendering algorithms are chosen with a preference for output quality.
      Ordinary member indicator VALUE_RENDER_SPEED Reveal DetailHide Detail
      Rendering hint value -- rendering algorithms are chosen with a preference for output speed.
      Ordinary member indicator VALUE_STROKE_DEFAULT Reveal DetailHide Detail
      Stroke normalization control hint value -- geometry may be modified or left pure depending on the tradeoffs in a given implementation.
      Ordinary member indicator VALUE_STROKE_NORMALIZE Reveal DetailHide Detail
      Stroke normalization control hint value -- geometry should be normalized to improve uniformity or spacing of lines and overall aesthetics.
      Ordinary member indicator VALUE_STROKE_PURE Reveal DetailHide Detail
      Stroke normalization control hint value -- geometry should be left unmodified and rendered with sub-pixel accuracy.
      Ordinary member indicator VALUE_TEXT_ANTIALIAS_DEFAULT Reveal DetailHide Detail
      Text antialiasing hint value -- text rendering is done according to the KEY_ANTIALIASING hint or a default chosen by the implementation.
      Ordinary member indicator VALUE_TEXT_ANTIALIAS_GASP Reveal DetailHide Detail
      Text antialiasing hint value -- text rendering is requested to use information in the font resource which specifies for each point size whether to apply VALUE_TEXT_ANTIALIAS_ON or VALUE_TEXT_ANTIALIAS_OFF.
      Ordinary member indicator VALUE_TEXT_ANTIALIAS_LCD_HBGR Reveal DetailHide Detail
      Text antialiasing hint value -- request that text be displayed optimised for an LCD display with subpixels in order from display left to right of B,G,R such that the horizontal subpixel resolution is three times that of the full pixel horizontal resolution (HBGR).
      Ordinary member indicator VALUE_TEXT_ANTIALIAS_LCD_HRGB Reveal DetailHide Detail
      Text antialiasing hint value -- request that text be displayed optimised for an LCD display with subpixels in order from display left to right of R,G,B such that the horizontal subpixel resolution is three times that of the full pixel horizontal resolution (HRGB).
      Ordinary member indicator VALUE_TEXT_ANTIALIAS_LCD_VBGR Reveal DetailHide Detail
      Text antialiasing hint value -- request that text be displayed optimised for an LCD display with subpixel organisation from display top to bottom of B,G,R such that the vertical subpixel resolution is three times that of the full pixel vertical resolution (VBGR).
      Ordinary member indicator VALUE_TEXT_ANTIALIAS_LCD_VRGB Reveal DetailHide Detail
      Text antialiasing hint value -- request that text be displayed optimised for an LCD display with subpixel organisation from display top to bottom of R,G,B such that the vertical subpixel resolution is three times that of the full pixel vertical resolution (VRGB).
      Ordinary member indicator VALUE_TEXT_ANTIALIAS_OFF Reveal DetailHide Detail
      Text antialiasing hint value -- text rendering is done without any form of antialiasing.
      Ordinary member indicator VALUE_TEXT_ANTIALIAS_ON Reveal DetailHide Detail
      Text antialiasing hint value -- text rendering is done with some form of antialiasing.
    • Constructors 
      Constructor and Description
      Ordinary member indicator RenderingHints Reveal DetailHide Detail
      Constructs a new object with keys and values initialized from the specified Map object which may be null.
      Ordinary member indicator RenderingHints Reveal DetailHide Detail
      Constructs a new object with the specified key/value pair.
    • Methods 
      Modifier and Type Method and Description
      Ordinary member indicator add Reveal DetailHide Detail
      Adds all of the keys and corresponding values from the specified RenderingHints object to this RenderingHints object.
      Ordinary member indicator clear Reveal DetailHide Detail
      Clears this RenderingHints object of all key/value pairs.
      Overridden member indicator clone Reveal DetailHide Detail
      Creates a clone of this RenderingHints object that has the same contents as this RenderingHints object.
      Ordinary member indicator containsKey Reveal DetailHide Detail
      Returns true if this RenderingHints contains a mapping for the specified key.
      Ordinary member indicator containsValue Reveal DetailHide Detail
      Returns true if this RenderingHints maps one or more keys to the specified value.
      Ordinary member indicator entrySet Reveal DetailHide Detail
      Returns a Set view of the mappings contained in this RenderingHints.
      Overridden member indicator equals Reveal DetailHide Detail
      Compares the specified Object with this RenderingHints for equality.
      Ordinary member indicator get Reveal DetailHide Detail
      Returns the value to which the specified key is mapped.
      Overridden member indicator hashCode Reveal DetailHide Detail
      Returns the hash code value for this RenderingHints.
      Ordinary member indicator isEmpty Reveal DetailHide Detail
      Returns true if this RenderingHints contains no key-value mappings.
      Ordinary member indicator keySet Reveal DetailHide Detail
      Returns a Set view of the Keys contained in this RenderingHints.
      Ordinary member indicator put Reveal DetailHide Detail
      Maps the specified key to the specified value in this RenderingHints object.
      Ordinary member indicator putAll Reveal DetailHide Detail
      Copies all of the mappings from the specified Map to this RenderingHints.
      Ordinary member indicator remove Reveal DetailHide Detail
      Removes the key and its corresponding value from this RenderingHints object.
      Ordinary member indicator size Reveal DetailHide Detail
      Returns the number of key-value mappings in this RenderingHints.
      Overridden member indicator toString Reveal DetailHide Detail
      Returns a rather long string representation of the hashmap which contains the mappings of keys to values for this RenderingHints object.
      Ordinary member indicator values Reveal DetailHide Detail
      Returns a Collection view of the values contained in this RenderinHints.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge