jdk/src/share/classes/sun/awt/SunHints.java
author mchung
Tue, 29 Sep 2009 16:03:03 -0700
changeset 3938 ef327bd847c0
parent 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
6879044: Eliminate the dependency on logging from the AWT/2D/Swing classes Summary: Replace calls to Logger with sun.util.logging.PlatformLogger Reviewed-by: prr, art, alexp, dcherepanov, igor, dav, anthony
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1998-2005 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.awt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.RenderingHints;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * This class contains rendering hints that can be used by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * {@link java.awt.Graphics2D} class, and classes that implement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * {@link java.awt.image.BufferedImageOp} and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * {@link java.awt.image.Raster}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
public class SunHints {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
     * Defines the type of all keys used to control various
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
     * aspects of the rendering and imaging pipelines.  Instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
     * of this class are immutable and unique which means that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
     * tests for matches can be made using the == operator instead
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     * of the more expensive equals() method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    public static class Key extends RenderingHints.Key {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        String description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
         * Construct a key using the indicated private key.  Each
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
         * subclass of Key maintains its own unique domain of integer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
         * keys.  No two objects with the same integer key and of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
         * same specific subclass can be constructed.  An exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
         * will be thrown if an attempt is made to construct another
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
         * object of a given class with the same integer key as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
         * pre-existing instance of that subclass of Key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        public Key(int privatekey, String description) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            super(privatekey);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
            this.description = description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
         * Returns the numeric index associated with this Key.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
         * is useful for use in switch statements and quick lookups
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
         * of the setting of a particular key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        public final int getIndex() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
            return intKey();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
         * Returns a string representation of the Key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        public final String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
            return description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
         * Returns true if the specified object is a valid value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
         * for this Key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        public boolean isCompatibleValue(Object val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
            if (val instanceof Value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                return ((Value)val).isCompatibleKey(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * Defines the type of all "enumerative" values used to control
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * various aspects of the rendering and imaging pipelines.  Instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * of this class are immutable and unique which means that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * tests for matches can be made using the == operator instead
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * of the more expensive equals() method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    public static class Value {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        private SunHints.Key myKey;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        private int index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        private String description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        private static Value[][] ValueObjects =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            new Value[NUM_KEYS][VALS_PER_KEY];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        private synchronized static void register(SunHints.Key key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                                                  Value value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
            int kindex = key.getIndex();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
            int vindex = value.getIndex();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            if (ValueObjects[kindex][vindex] != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                throw new InternalError("duplicate index: "+vindex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            ValueObjects[kindex][vindex] = value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        public static Value get(int keyindex, int valueindex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            return ValueObjects[keyindex][valueindex];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
         * Construct a value using the indicated private index.  Each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
         * subclass of Value maintains its own unique domain of integer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
         * indices.  Enforcing the uniqueness of the integer indices
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
         * is left to the subclass.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        public Value(SunHints.Key key, int index, String description) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            this.myKey = key;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            this.index = index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
            this.description = description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            register(key, this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
         * Returns the numeric index associated with this Key.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
         * is useful for use in switch statements and quick lookups
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
         * of the setting of a particular key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        public final int getIndex() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            return index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
         * Returns a string representation of this Value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        public final String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            return description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
         * Returns true if the specified object is a valid Key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
         * for this Value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        public final boolean isCompatibleKey(Key k) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            return myKey == k;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
         * The hash code for all SunHints.Value objects will be the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
         * as the system identity code of the object as defined by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
         * System.identityHashCode() method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        public final int hashCode() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            return System.identityHashCode(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
         * The equals method for all SunHints.Value objects will return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
         * the same result as the equality operator '=='.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        public final boolean equals(Object o) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            return this == o;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    private static final int NUM_KEYS = 9;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    private static final int VALS_PER_KEY = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * Rendering hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    public static final int INTKEY_RENDERING = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    public static final int INTVAL_RENDER_DEFAULT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    public static final int INTVAL_RENDER_SPEED = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    public static final int INTVAL_RENDER_QUALITY = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * Antialiasing hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    public static final int INTKEY_ANTIALIASING = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    public static final int INTVAL_ANTIALIAS_DEFAULT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    public static final int INTVAL_ANTIALIAS_OFF = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    public static final int INTVAL_ANTIALIAS_ON = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * Text antialiasing hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    public static final int INTKEY_TEXT_ANTIALIASING = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    public static final int INTVAL_TEXT_ANTIALIAS_DEFAULT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    public static final int INTVAL_TEXT_ANTIALIAS_OFF = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    public static final int INTVAL_TEXT_ANTIALIAS_ON = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    public static final int INTVAL_TEXT_ANTIALIAS_GASP = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    public static final int INTVAL_TEXT_ANTIALIAS_LCD_HRGB = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    public static final int INTVAL_TEXT_ANTIALIAS_LCD_HBGR = 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    public static final int INTVAL_TEXT_ANTIALIAS_LCD_VRGB = 6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    public static final int INTVAL_TEXT_ANTIALIAS_LCD_VBGR = 7;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * Font fractional metrics hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    public static final int INTKEY_FRACTIONALMETRICS = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    public static final int INTVAL_FRACTIONALMETRICS_DEFAULT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    public static final int INTVAL_FRACTIONALMETRICS_OFF = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    public static final int INTVAL_FRACTIONALMETRICS_ON = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * Dithering hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    public static final int INTKEY_DITHERING = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    public static final int INTVAL_DITHER_DEFAULT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    public static final int INTVAL_DITHER_DISABLE = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    public static final int INTVAL_DITHER_ENABLE = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * Interpolation hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    public static final int INTKEY_INTERPOLATION = 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    public static final int INTVAL_INTERPOLATION_NEAREST_NEIGHBOR = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    public static final int INTVAL_INTERPOLATION_BILINEAR = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    public static final int INTVAL_INTERPOLATION_BICUBIC = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * Alpha interpolation hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    public static final int INTKEY_ALPHA_INTERPOLATION = 6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    public static final int INTVAL_ALPHA_INTERPOLATION_DEFAULT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    public static final int INTVAL_ALPHA_INTERPOLATION_SPEED = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    public static final int INTVAL_ALPHA_INTERPOLATION_QUALITY = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * Color rendering hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    public static final int INTKEY_COLOR_RENDERING = 7;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    public static final int INTVAL_COLOR_RENDER_DEFAULT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    public static final int INTVAL_COLOR_RENDER_SPEED = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    public static final int INTVAL_COLOR_RENDER_QUALITY = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * Stroke normalization control hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    public static final int INTKEY_STROKE_CONTROL = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    public static final int INTVAL_STROKE_DEFAULT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    public static final int INTVAL_STROKE_NORMALIZE = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    public static final int INTVAL_STROKE_PURE = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * LCD text contrast control hint key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * Value is "100" to make discontiguous with the others which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * are all enumerative and are of a different class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    public static final int INTKEY_AATEXT_LCD_CONTRAST = 100;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * Rendering hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    public static final Key KEY_RENDERING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        new SunHints.Key(SunHints.INTKEY_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
                         "Global rendering quality key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    public static final Object VALUE_RENDER_SPEED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
        new SunHints.Value(KEY_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
                           SunHints.INTVAL_RENDER_SPEED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
                           "Fastest rendering methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    public static final Object VALUE_RENDER_QUALITY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        new SunHints.Value(KEY_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
                           SunHints.INTVAL_RENDER_QUALITY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
                           "Highest quality rendering methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    public static final Object VALUE_RENDER_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        new SunHints.Value(KEY_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                           SunHints.INTVAL_RENDER_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
                           "Default rendering methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * Antialiasing hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    public static final Key KEY_ANTIALIASING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        new SunHints.Key(SunHints.INTKEY_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
                         "Global antialiasing enable key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    public static final Object VALUE_ANTIALIAS_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        new SunHints.Value(KEY_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
                           SunHints.INTVAL_ANTIALIAS_ON,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
                           "Antialiased rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    public static final Object VALUE_ANTIALIAS_OFF =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
        new SunHints.Value(KEY_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
                           SunHints.INTVAL_ANTIALIAS_OFF,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
                           "Nonantialiased rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    public static final Object VALUE_ANTIALIAS_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
        new SunHints.Value(KEY_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
                           SunHints.INTVAL_ANTIALIAS_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
                           "Default antialiasing rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * Text antialiasing hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    public static final Key KEY_TEXT_ANTIALIASING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
        new SunHints.Key(SunHints.INTKEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
                         "Text-specific antialiasing enable key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    public static final Object VALUE_TEXT_ANTIALIAS_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
                           SunHints.INTVAL_TEXT_ANTIALIAS_ON,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
                           "Antialiased text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
    public static final Object VALUE_TEXT_ANTIALIAS_OFF =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
                           SunHints.INTVAL_TEXT_ANTIALIAS_OFF,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
                           "Nonantialiased text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
    public static final Object VALUE_TEXT_ANTIALIAS_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
                           SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
                           "Default antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
    public static final Object VALUE_TEXT_ANTIALIAS_GASP =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
                           SunHints.INTVAL_TEXT_ANTIALIAS_GASP,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
                           "gasp antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    public static final Object VALUE_TEXT_ANTIALIAS_LCD_HRGB =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
                           SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
                           "LCD HRGB antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    public static final Object VALUE_TEXT_ANTIALIAS_LCD_HBGR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
                           SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HBGR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
                           "LCD HBGR antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    public static final Object VALUE_TEXT_ANTIALIAS_LCD_VRGB =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
                           SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
                           "LCD VRGB antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
    public static final Object VALUE_TEXT_ANTIALIAS_LCD_VBGR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
                           SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VBGR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
                           "LCD VBGR antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * Font fractional metrics hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    public static final Key KEY_FRACTIONALMETRICS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        new SunHints.Key(SunHints.INTKEY_FRACTIONALMETRICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
                         "Fractional metrics enable key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    public static final Object VALUE_FRACTIONALMETRICS_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        new SunHints.Value(KEY_FRACTIONALMETRICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
                           SunHints.INTVAL_FRACTIONALMETRICS_ON,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
                           "Fractional text metrics mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
    public static final Object VALUE_FRACTIONALMETRICS_OFF =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        new SunHints.Value(KEY_FRACTIONALMETRICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
                           SunHints.INTVAL_FRACTIONALMETRICS_OFF,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
                           "Integer text metrics mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
    public static final Object VALUE_FRACTIONALMETRICS_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
        new SunHints.Value(KEY_FRACTIONALMETRICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
                           SunHints.INTVAL_FRACTIONALMETRICS_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
                           "Default fractional text metrics mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * Dithering hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    public static final Key KEY_DITHERING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
        new SunHints.Key(SunHints.INTKEY_DITHERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
                         "Dithering quality key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
    public static final Object VALUE_DITHER_ENABLE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
        new SunHints.Value(KEY_DITHERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
                           SunHints.INTVAL_DITHER_ENABLE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
                           "Dithered rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    public static final Object VALUE_DITHER_DISABLE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
        new SunHints.Value(KEY_DITHERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
                           SunHints.INTVAL_DITHER_DISABLE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
                           "Nondithered rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    public static final Object VALUE_DITHER_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
        new SunHints.Value(KEY_DITHERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
                           SunHints.INTVAL_DITHER_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
                           "Default dithering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * Interpolation hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
    public static final Key KEY_INTERPOLATION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
        new SunHints.Key(SunHints.INTKEY_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
                         "Image interpolation method key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    public static final Object VALUE_INTERPOLATION_NEAREST_NEIGHBOR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
        new SunHints.Value(KEY_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
                           SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
                           "Nearest Neighbor image interpolation mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    public static final Object VALUE_INTERPOLATION_BILINEAR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
        new SunHints.Value(KEY_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
                           SunHints.INTVAL_INTERPOLATION_BILINEAR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
                           "Bilinear image interpolation mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    public static final Object VALUE_INTERPOLATION_BICUBIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        new SunHints.Value(KEY_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
                           SunHints.INTVAL_INTERPOLATION_BICUBIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
                           "Bicubic image interpolation mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * Alpha interpolation hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    public static final Key KEY_ALPHA_INTERPOLATION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
        new SunHints.Key(SunHints.INTKEY_ALPHA_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
                         "Alpha blending interpolation method key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    public static final Object VALUE_ALPHA_INTERPOLATION_SPEED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
        new SunHints.Value(KEY_ALPHA_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
                           SunHints.INTVAL_ALPHA_INTERPOLATION_SPEED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
                           "Fastest alpha blending methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    public static final Object VALUE_ALPHA_INTERPOLATION_QUALITY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
        new SunHints.Value(KEY_ALPHA_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
                           SunHints.INTVAL_ALPHA_INTERPOLATION_QUALITY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
                           "Highest quality alpha blending methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    public static final Object VALUE_ALPHA_INTERPOLATION_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
        new SunHints.Value(KEY_ALPHA_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
                           SunHints.INTVAL_ALPHA_INTERPOLATION_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
                           "Default alpha blending methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * Color rendering hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    public static final Key KEY_COLOR_RENDERING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
        new SunHints.Key(SunHints.INTKEY_COLOR_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
                         "Color rendering quality key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    public static final Object VALUE_COLOR_RENDER_SPEED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
        new SunHints.Value(KEY_COLOR_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
                           SunHints.INTVAL_COLOR_RENDER_SPEED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
                           "Fastest color rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
    public static final Object VALUE_COLOR_RENDER_QUALITY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
        new SunHints.Value(KEY_COLOR_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
                           SunHints.INTVAL_COLOR_RENDER_QUALITY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
                           "Highest quality color rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
    public static final Object VALUE_COLOR_RENDER_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
        new SunHints.Value(KEY_COLOR_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
                           SunHints.INTVAL_COLOR_RENDER_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
                           "Default color rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * Stroke normalization control hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
    public static final Key KEY_STROKE_CONTROL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
        new SunHints.Key(SunHints.INTKEY_STROKE_CONTROL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
                         "Stroke normalization control key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
    public static final Object VALUE_STROKE_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
        new SunHints.Value(KEY_STROKE_CONTROL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
                           SunHints.INTVAL_STROKE_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
                           "Default stroke normalization");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    public static final Object VALUE_STROKE_NORMALIZE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
        new SunHints.Value(KEY_STROKE_CONTROL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
                           SunHints.INTVAL_STROKE_NORMALIZE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
                           "Normalize strokes for consistent rendering");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
    public static final Object VALUE_STROKE_PURE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
        new SunHints.Value(KEY_STROKE_CONTROL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
                           SunHints.INTVAL_STROKE_PURE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
                           "Pure stroke conversion for accurate paths");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    public static class LCDContrastKey extends Key {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
        public LCDContrastKey(int privatekey, String description) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
            super(privatekey, description);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
         * Returns true if the specified object is a valid value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
         * for this Key. The allowable range is 100 to 250.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
        public final boolean isCompatibleValue(Object val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
            if (val instanceof Integer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
                int ival = ((Integer)val).intValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
                return ival >= 100 && ival <= 250;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * LCD text contrast hint key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
    public static final RenderingHints.Key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
        KEY_TEXT_ANTIALIAS_LCD_CONTRAST =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
        new LCDContrastKey(SunHints.INTKEY_AATEXT_LCD_CONTRAST,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
                           "Text-specific LCD contrast key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
}