jdk/src/share/classes/sun/awt/SunHints.java
changeset 16734 da1901d79073
parent 12813 c10ab96dcf41
child 23256 d71287a532f8
equal deleted inserted replaced
16733:9267ec7004a1 16734:da1901d79073
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    24  */
    24  */
    25 
    25 
    26 package sun.awt;
    26 package sun.awt;
    27 
    27 
    28 import java.awt.RenderingHints;
    28 import java.awt.RenderingHints;
    29 import javax.tools.annotation.GenerateNativeHeader;
    29 import java.lang.annotation.Native;
    30 
    30 
    31 /**
    31 /**
    32  * This class contains rendering hints that can be used by the
    32  * This class contains rendering hints that can be used by the
    33  * {@link java.awt.Graphics2D} class, and classes that implement
    33  * {@link java.awt.Graphics2D} class, and classes that implement
    34  * {@link java.awt.image.BufferedImageOp} and
    34  * {@link java.awt.image.BufferedImageOp} and
    35  * {@link java.awt.image.Raster}.
    35  * {@link java.awt.image.Raster}.
    36  */
    36  */
    37 /* No native methods here, but the constants are needed in the supporting JNI code */
       
    38 @GenerateNativeHeader
       
    39 public class SunHints {
    37 public class SunHints {
    40     /**
    38     /**
    41      * Defines the type of all keys used to control various
    39      * Defines the type of all keys used to control various
    42      * aspects of the rendering and imaging pipelines.  Instances
    40      * aspects of the rendering and imaging pipelines.  Instances
    43      * of this class are immutable and unique which means that
    41      * of this class are immutable and unique which means that
   178     private static final int VALS_PER_KEY = 8;
   176     private static final int VALS_PER_KEY = 8;
   179 
   177 
   180     /**
   178     /**
   181      * Rendering hint key and values
   179      * Rendering hint key and values
   182      */
   180      */
   183     public static final int INTKEY_RENDERING = 0;
   181     @Native public static final int INTKEY_RENDERING = 0;
   184     public static final int INTVAL_RENDER_DEFAULT = 0;
   182     @Native public static final int INTVAL_RENDER_DEFAULT = 0;
   185     public static final int INTVAL_RENDER_SPEED = 1;
   183     @Native public static final int INTVAL_RENDER_SPEED = 1;
   186     public static final int INTVAL_RENDER_QUALITY = 2;
   184     @Native public static final int INTVAL_RENDER_QUALITY = 2;
   187 
   185 
   188     /**
   186     /**
   189      * Antialiasing hint key and values
   187      * Antialiasing hint key and values
   190      */
   188      */
   191     public static final int INTKEY_ANTIALIASING = 1;
   189     @Native public static final int INTKEY_ANTIALIASING = 1;
   192     public static final int INTVAL_ANTIALIAS_DEFAULT = 0;
   190     @Native public static final int INTVAL_ANTIALIAS_DEFAULT = 0;
   193     public static final int INTVAL_ANTIALIAS_OFF = 1;
   191     @Native public static final int INTVAL_ANTIALIAS_OFF = 1;
   194     public static final int INTVAL_ANTIALIAS_ON = 2;
   192     @Native public static final int INTVAL_ANTIALIAS_ON = 2;
   195 
   193 
   196     /**
   194     /**
   197      * Text antialiasing hint key and values
   195      * Text antialiasing hint key and values
   198      */
   196      */
   199     public static final int INTKEY_TEXT_ANTIALIASING = 2;
   197     @Native public static final int INTKEY_TEXT_ANTIALIASING = 2;
   200     public static final int INTVAL_TEXT_ANTIALIAS_DEFAULT = 0;
   198     @Native public static final int INTVAL_TEXT_ANTIALIAS_DEFAULT = 0;
   201     public static final int INTVAL_TEXT_ANTIALIAS_OFF = 1;
   199     @Native public static final int INTVAL_TEXT_ANTIALIAS_OFF = 1;
   202     public static final int INTVAL_TEXT_ANTIALIAS_ON = 2;
   200     @Native public static final int INTVAL_TEXT_ANTIALIAS_ON = 2;
   203     public static final int INTVAL_TEXT_ANTIALIAS_GASP = 3;
   201     @Native public static final int INTVAL_TEXT_ANTIALIAS_GASP = 3;
   204     public static final int INTVAL_TEXT_ANTIALIAS_LCD_HRGB = 4;
   202     @Native public static final int INTVAL_TEXT_ANTIALIAS_LCD_HRGB = 4;
   205     public static final int INTVAL_TEXT_ANTIALIAS_LCD_HBGR = 5;
   203     @Native public static final int INTVAL_TEXT_ANTIALIAS_LCD_HBGR = 5;
   206     public static final int INTVAL_TEXT_ANTIALIAS_LCD_VRGB = 6;
   204     @Native public static final int INTVAL_TEXT_ANTIALIAS_LCD_VRGB = 6;
   207     public static final int INTVAL_TEXT_ANTIALIAS_LCD_VBGR = 7;
   205     @Native public static final int INTVAL_TEXT_ANTIALIAS_LCD_VBGR = 7;
   208 
   206 
   209     /**
   207     /**
   210      * Font fractional metrics hint key and values
   208      * Font fractional metrics hint key and values
   211      */
   209      */
   212     public static final int INTKEY_FRACTIONALMETRICS = 3;
   210     @Native public static final int INTKEY_FRACTIONALMETRICS = 3;
   213     public static final int INTVAL_FRACTIONALMETRICS_DEFAULT = 0;
   211     @Native public static final int INTVAL_FRACTIONALMETRICS_DEFAULT = 0;
   214     public static final int INTVAL_FRACTIONALMETRICS_OFF = 1;
   212     @Native public static final int INTVAL_FRACTIONALMETRICS_OFF = 1;
   215     public static final int INTVAL_FRACTIONALMETRICS_ON = 2;
   213     @Native public static final int INTVAL_FRACTIONALMETRICS_ON = 2;
   216 
   214 
   217     /**
   215     /**
   218      * Dithering hint key and values
   216      * Dithering hint key and values
   219      */
   217      */
   220     public static final int INTKEY_DITHERING = 4;
   218     @Native public static final int INTKEY_DITHERING = 4;
   221     public static final int INTVAL_DITHER_DEFAULT = 0;
   219     @Native public static final int INTVAL_DITHER_DEFAULT = 0;
   222     public static final int INTVAL_DITHER_DISABLE = 1;
   220     @Native public static final int INTVAL_DITHER_DISABLE = 1;
   223     public static final int INTVAL_DITHER_ENABLE = 2;
   221     @Native public static final int INTVAL_DITHER_ENABLE = 2;
   224 
   222 
   225     /**
   223     /**
   226      * Interpolation hint key and values
   224      * Interpolation hint key and values
   227      */
   225      */
   228     public static final int INTKEY_INTERPOLATION = 5;
   226     @Native public static final int INTKEY_INTERPOLATION = 5;
   229     public static final int INTVAL_INTERPOLATION_NEAREST_NEIGHBOR = 0;
   227     @Native public static final int INTVAL_INTERPOLATION_NEAREST_NEIGHBOR = 0;
   230     public static final int INTVAL_INTERPOLATION_BILINEAR = 1;
   228     @Native public static final int INTVAL_INTERPOLATION_BILINEAR = 1;
   231     public static final int INTVAL_INTERPOLATION_BICUBIC = 2;
   229     @Native public static final int INTVAL_INTERPOLATION_BICUBIC = 2;
   232 
   230 
   233     /**
   231     /**
   234      * Alpha interpolation hint key and values
   232      * Alpha interpolation hint key and values
   235      */
   233      */
   236     public static final int INTKEY_ALPHA_INTERPOLATION = 6;
   234     @Native public static final int INTKEY_ALPHA_INTERPOLATION = 6;
   237     public static final int INTVAL_ALPHA_INTERPOLATION_DEFAULT = 0;
   235     @Native public static final int INTVAL_ALPHA_INTERPOLATION_DEFAULT = 0;
   238     public static final int INTVAL_ALPHA_INTERPOLATION_SPEED = 1;
   236     @Native public static final int INTVAL_ALPHA_INTERPOLATION_SPEED = 1;
   239     public static final int INTVAL_ALPHA_INTERPOLATION_QUALITY = 2;
   237     @Native public static final int INTVAL_ALPHA_INTERPOLATION_QUALITY = 2;
   240 
   238 
   241     /**
   239     /**
   242      * Color rendering hint key and values
   240      * Color rendering hint key and values
   243      */
   241      */
   244     public static final int INTKEY_COLOR_RENDERING = 7;
   242     @Native public static final int INTKEY_COLOR_RENDERING = 7;
   245     public static final int INTVAL_COLOR_RENDER_DEFAULT = 0;
   243     @Native public static final int INTVAL_COLOR_RENDER_DEFAULT = 0;
   246     public static final int INTVAL_COLOR_RENDER_SPEED = 1;
   244     @Native public static final int INTVAL_COLOR_RENDER_SPEED = 1;
   247     public static final int INTVAL_COLOR_RENDER_QUALITY = 2;
   245     @Native public static final int INTVAL_COLOR_RENDER_QUALITY = 2;
   248 
   246 
   249     /**
   247     /**
   250      * Stroke normalization control hint key and values
   248      * Stroke normalization control hint key and values
   251      */
   249      */
   252     public static final int INTKEY_STROKE_CONTROL = 8;
   250     @Native public static final int INTKEY_STROKE_CONTROL = 8;
   253     public static final int INTVAL_STROKE_DEFAULT = 0;
   251     @Native public static final int INTVAL_STROKE_DEFAULT = 0;
   254     public static final int INTVAL_STROKE_NORMALIZE = 1;
   252     @Native public static final int INTVAL_STROKE_NORMALIZE = 1;
   255     public static final int INTVAL_STROKE_PURE = 2;
   253     @Native public static final int INTVAL_STROKE_PURE = 2;
   256 
   254 
   257     /**
   255     /**
   258      * LCD text contrast control hint key.
   256      * LCD text contrast control hint key.
   259      * Value is "100" to make discontiguous with the others which
   257      * Value is "100" to make discontiguous with the others which
   260      * are all enumerative and are of a different class.
   258      * are all enumerative and are of a different class.
   261      */
   259      */
   262     public static final int INTKEY_AATEXT_LCD_CONTRAST = 100;
   260     @Native public static final int INTKEY_AATEXT_LCD_CONTRAST = 100;
   263 
   261 
   264     /**
   262     /**
   265      * Rendering hint key and value objects
   263      * Rendering hint key and value objects
   266      */
   264      */
   267     public static final Key KEY_RENDERING =
   265     public static final Key KEY_RENDERING =