src/share/classes/sun/awt/SunHints.java

Print this page




 155         }
 156 
 157         /**
 158          * The hash code for all SunHints.Value objects will be the same
 159          * as the system identity code of the object as defined by the
 160          * System.identityHashCode() method.
 161          */
 162         public final int hashCode() {
 163             return System.identityHashCode(this);
 164         }
 165 
 166         /**
 167          * The equals method for all SunHints.Value objects will return
 168          * the same result as the equality operator '=='.
 169          */
 170         public final boolean equals(Object o) {
 171             return this == o;
 172         }
 173     }
 174 
 175     private static final int NUM_KEYS = 9;
 176     private static final int VALS_PER_KEY = 8;
 177 
 178     /**
 179      * Rendering hint key and values
 180      */
 181     @Native public static final int INTKEY_RENDERING = 0;
 182     @Native public static final int INTVAL_RENDER_DEFAULT = 0;
 183     @Native public static final int INTVAL_RENDER_SPEED = 1;
 184     @Native public static final int INTVAL_RENDER_QUALITY = 2;
 185 
 186     /**
 187      * Antialiasing hint key and values
 188      */
 189     @Native public static final int INTKEY_ANTIALIASING = 1;
 190     @Native public static final int INTVAL_ANTIALIAS_DEFAULT = 0;
 191     @Native public static final int INTVAL_ANTIALIAS_OFF = 1;
 192     @Native public static final int INTVAL_ANTIALIAS_ON = 2;
 193 
 194     /**
 195      * Text antialiasing hint key and values


 236     @Native public static final int INTVAL_ALPHA_INTERPOLATION_SPEED = 1;
 237     @Native public static final int INTVAL_ALPHA_INTERPOLATION_QUALITY = 2;
 238 
 239     /**
 240      * Color rendering hint key and values
 241      */
 242     @Native public static final int INTKEY_COLOR_RENDERING = 7;
 243     @Native public static final int INTVAL_COLOR_RENDER_DEFAULT = 0;
 244     @Native public static final int INTVAL_COLOR_RENDER_SPEED = 1;
 245     @Native public static final int INTVAL_COLOR_RENDER_QUALITY = 2;
 246 
 247     /**
 248      * Stroke normalization control hint key and values
 249      */
 250     @Native public static final int INTKEY_STROKE_CONTROL = 8;
 251     @Native public static final int INTVAL_STROKE_DEFAULT = 0;
 252     @Native public static final int INTVAL_STROKE_NORMALIZE = 1;
 253     @Native public static final int INTVAL_STROKE_PURE = 2;
 254 
 255     /**







 256      * LCD text contrast control hint key.
 257      * Value is "100" to make discontiguous with the others which
 258      * are all enumerative and are of a different class.
 259      */
 260     @Native public static final int INTKEY_AATEXT_LCD_CONTRAST = 100;
 261 
 262     /**
 263      * Rendering hint key and value objects
 264      */
 265     public static final Key KEY_RENDERING =
 266         new SunHints.Key(SunHints.INTKEY_RENDERING,
 267                          "Global rendering quality key");
 268     public static final Object VALUE_RENDER_SPEED =
 269         new SunHints.Value(KEY_RENDERING,
 270                            SunHints.INTVAL_RENDER_SPEED,
 271                            "Fastest rendering methods");
 272     public static final Object VALUE_RENDER_QUALITY =
 273         new SunHints.Value(KEY_RENDERING,
 274                            SunHints.INTVAL_RENDER_QUALITY,
 275                            "Highest quality rendering methods");


 433 
 434     /**
 435      * Stroke normalization control hint key and value objects
 436      */
 437     public static final Key KEY_STROKE_CONTROL =
 438         new SunHints.Key(SunHints.INTKEY_STROKE_CONTROL,
 439                          "Stroke normalization control key");
 440     public static final Object VALUE_STROKE_DEFAULT =
 441         new SunHints.Value(KEY_STROKE_CONTROL,
 442                            SunHints.INTVAL_STROKE_DEFAULT,
 443                            "Default stroke normalization");
 444     public static final Object VALUE_STROKE_NORMALIZE =
 445         new SunHints.Value(KEY_STROKE_CONTROL,
 446                            SunHints.INTVAL_STROKE_NORMALIZE,
 447                            "Normalize strokes for consistent rendering");
 448     public static final Object VALUE_STROKE_PURE =
 449         new SunHints.Value(KEY_STROKE_CONTROL,
 450                            SunHints.INTVAL_STROKE_PURE,
 451                            "Pure stroke conversion for accurate paths");
 452 


















 453 
 454     public static class LCDContrastKey extends Key {
 455 
 456         public LCDContrastKey(int privatekey, String description) {
 457             super(privatekey, description);
 458         }
 459 
 460         /**
 461          * Returns true if the specified object is a valid value
 462          * for this Key. The allowable range is 100 to 250.
 463          */
 464         public final boolean isCompatibleValue(Object val) {
 465             if (val instanceof Integer) {
 466                 int ival = ((Integer)val).intValue();
 467                 return ival >= 100 && ival <= 250;
 468             }
 469             return false;
 470         }
 471 
 472     }


 155         }
 156 
 157         /**
 158          * The hash code for all SunHints.Value objects will be the same
 159          * as the system identity code of the object as defined by the
 160          * System.identityHashCode() method.
 161          */
 162         public final int hashCode() {
 163             return System.identityHashCode(this);
 164         }
 165 
 166         /**
 167          * The equals method for all SunHints.Value objects will return
 168          * the same result as the equality operator '=='.
 169          */
 170         public final boolean equals(Object o) {
 171             return this == o;
 172         }
 173     }
 174 
 175     private static final int NUM_KEYS = 10;
 176     private static final int VALS_PER_KEY = 8;
 177 
 178     /**
 179      * Rendering hint key and values
 180      */
 181     @Native public static final int INTKEY_RENDERING = 0;
 182     @Native public static final int INTVAL_RENDER_DEFAULT = 0;
 183     @Native public static final int INTVAL_RENDER_SPEED = 1;
 184     @Native public static final int INTVAL_RENDER_QUALITY = 2;
 185 
 186     /**
 187      * Antialiasing hint key and values
 188      */
 189     @Native public static final int INTKEY_ANTIALIASING = 1;
 190     @Native public static final int INTVAL_ANTIALIAS_DEFAULT = 0;
 191     @Native public static final int INTVAL_ANTIALIAS_OFF = 1;
 192     @Native public static final int INTVAL_ANTIALIAS_ON = 2;
 193 
 194     /**
 195      * Text antialiasing hint key and values


 236     @Native public static final int INTVAL_ALPHA_INTERPOLATION_SPEED = 1;
 237     @Native public static final int INTVAL_ALPHA_INTERPOLATION_QUALITY = 2;
 238 
 239     /**
 240      * Color rendering hint key and values
 241      */
 242     @Native public static final int INTKEY_COLOR_RENDERING = 7;
 243     @Native public static final int INTVAL_COLOR_RENDER_DEFAULT = 0;
 244     @Native public static final int INTVAL_COLOR_RENDER_SPEED = 1;
 245     @Native public static final int INTVAL_COLOR_RENDER_QUALITY = 2;
 246 
 247     /**
 248      * Stroke normalization control hint key and values
 249      */
 250     @Native public static final int INTKEY_STROKE_CONTROL = 8;
 251     @Native public static final int INTVAL_STROKE_DEFAULT = 0;
 252     @Native public static final int INTVAL_STROKE_NORMALIZE = 1;
 253     @Native public static final int INTVAL_STROKE_PURE = 2;
 254 
 255     /**
 256      * Image scaling hint key and values
 257      */
 258     @Native public static final int INTKEY_RESOLUTION_VARIANT = 9;
 259     @Native public static final int INTVAL_RESOLUTION_VARIANT_DEFAULT = 0;
 260     @Native public static final int INTVAL_RESOLUTION_VARIANT_OFF = 1;
 261     @Native public static final int INTVAL_RESOLUTION_VARIANT_ON = 2;
 262     /**
 263      * LCD text contrast control hint key.
 264      * Value is "100" to make discontiguous with the others which
 265      * are all enumerative and are of a different class.
 266      */
 267     @Native public static final int INTKEY_AATEXT_LCD_CONTRAST = 100;
 268 
 269     /**
 270      * Rendering hint key and value objects
 271      */
 272     public static final Key KEY_RENDERING =
 273         new SunHints.Key(SunHints.INTKEY_RENDERING,
 274                          "Global rendering quality key");
 275     public static final Object VALUE_RENDER_SPEED =
 276         new SunHints.Value(KEY_RENDERING,
 277                            SunHints.INTVAL_RENDER_SPEED,
 278                            "Fastest rendering methods");
 279     public static final Object VALUE_RENDER_QUALITY =
 280         new SunHints.Value(KEY_RENDERING,
 281                            SunHints.INTVAL_RENDER_QUALITY,
 282                            "Highest quality rendering methods");


 440 
 441     /**
 442      * Stroke normalization control hint key and value objects
 443      */
 444     public static final Key KEY_STROKE_CONTROL =
 445         new SunHints.Key(SunHints.INTKEY_STROKE_CONTROL,
 446                          "Stroke normalization control key");
 447     public static final Object VALUE_STROKE_DEFAULT =
 448         new SunHints.Value(KEY_STROKE_CONTROL,
 449                            SunHints.INTVAL_STROKE_DEFAULT,
 450                            "Default stroke normalization");
 451     public static final Object VALUE_STROKE_NORMALIZE =
 452         new SunHints.Value(KEY_STROKE_CONTROL,
 453                            SunHints.INTVAL_STROKE_NORMALIZE,
 454                            "Normalize strokes for consistent rendering");
 455     public static final Object VALUE_STROKE_PURE =
 456         new SunHints.Value(KEY_STROKE_CONTROL,
 457                            SunHints.INTVAL_STROKE_PURE,
 458                            "Pure stroke conversion for accurate paths");
 459 
 460     /**
 461      * Image resolution variant hint key and value objects
 462      */
 463     public static final Key KEY_RESOLUTION_VARIANT =
 464         new SunHints.Key(SunHints.INTKEY_RESOLUTION_VARIANT,
 465                          "Global image resolution variant key");
 466     public static final Object VALUE_RESOLUTION_VARIANT_DEFAULT =
 467         new SunHints.Value(KEY_RESOLUTION_VARIANT,
 468                            SunHints.INTVAL_RESOLUTION_VARIANT_DEFAULT,
 469                            "Default resolution variant usage");
 470     public static final Object VALUE_RESOLUTION_VARIANT_OFF =
 471         new SunHints.Value(KEY_RESOLUTION_VARIANT,
 472                            SunHints.INTVAL_RESOLUTION_VARIANT_OFF,
 473                            "Use only default resolution variants of images");
 474     public static final Object VALUE_RESOLUTION_VARIANT_ON =
 475         new SunHints.Value(KEY_RESOLUTION_VARIANT,
 476                            SunHints.INTVAL_RESOLUTION_VARIANT_ON,
 477                            "Use resolution variants of images");
 478 
 479     public static class LCDContrastKey extends Key {
 480 
 481         public LCDContrastKey(int privatekey, String description) {
 482             super(privatekey, description);
 483         }
 484 
 485         /**
 486          * Returns true if the specified object is a valid value
 487          * for this Key. The allowable range is 100 to 250.
 488          */
 489         public final boolean isCompatibleValue(Object val) {
 490             if (val instanceof Integer) {
 491                 int ival = ((Integer)val).intValue();
 492                 return ival >= 100 && ival <= 250;
 493             }
 494             return false;
 495         }
 496 
 497     }