jdk/src/java.desktop/share/classes/sun/awt/SunHints.java
author prr
Sat, 19 Sep 2015 15:45:59 -0700
changeset 32865 f9cb6e427f9e
parent 32682 6f1200d8999d
permissions -rw-r--r--
8136783: Run blessed-modifier-order script on java.desktop Reviewed-by: martin, serb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
     2
 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
2
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
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
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
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
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;
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
    29
import java.lang.annotation.Native;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * This class contains rendering hints that can be used by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * {@link java.awt.Graphics2D} class, and classes that implement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * {@link java.awt.image.BufferedImageOp} and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * {@link java.awt.image.Raster}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
public class SunHints {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
     * Defines the type of all keys used to control various
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
     * aspects of the rendering and imaging pipelines.  Instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
     * of this class are immutable and unique which means that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     * tests for matches can be made using the == operator instead
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     * of the more expensive equals() method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    public static class Key extends RenderingHints.Key {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        String description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
         * Construct a key using the indicated private key.  Each
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
         * subclass of Key maintains its own unique domain of integer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
         * keys.  No two objects with the same integer key and of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
         * same specific subclass can be constructed.  An exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
         * will be thrown if an attempt is made to construct another
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
         * object of a given class with the same integer key as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
         * pre-existing instance of that subclass of Key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        public Key(int privatekey, String description) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
            super(privatekey);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
            this.description = description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
         * Returns the numeric index associated with this Key.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
         * is useful for use in switch statements and quick lookups
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
         * of the setting of a particular key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        public final int getIndex() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
            return intKey();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
         * Returns a string representation of the Key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        public final String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
            return description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
         * Returns true if the specified object is a valid value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
         * for this Key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        public boolean isCompatibleValue(Object val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
            if (val instanceof Value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                return ((Value)val).isCompatibleKey(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
            return false;
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
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * Defines the type of all "enumerative" values used to control
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * various aspects of the rendering and imaging pipelines.  Instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * of this class are immutable and unique which means that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * tests for matches can be made using the == operator instead
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * of the more expensive equals() method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    public static class Value {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        private SunHints.Key myKey;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        private int index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        private String description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        private static Value[][] ValueObjects =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            new Value[NUM_KEYS][VALS_PER_KEY];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
32865
f9cb6e427f9e 8136783: Run blessed-modifier-order script on java.desktop
prr
parents: 32682
diff changeset
   105
        private static synchronized void register(SunHints.Key key,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                                                  Value value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
            int kindex = key.getIndex();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            int vindex = value.getIndex();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            if (ValueObjects[kindex][vindex] != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                throw new InternalError("duplicate index: "+vindex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            ValueObjects[kindex][vindex] = value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        public static Value get(int keyindex, int valueindex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            return ValueObjects[keyindex][valueindex];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
         * Construct a value using the indicated private index.  Each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
         * subclass of Value maintains its own unique domain of integer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
         * indices.  Enforcing the uniqueness of the integer indices
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
         * is left to the subclass.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        public Value(SunHints.Key key, int index, String description) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            this.myKey = key;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
            this.index = index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            this.description = description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            register(key, this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
         * Returns the numeric index associated with this Key.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
         * is useful for use in switch statements and quick lookups
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
         * of the setting of a particular key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        public final int getIndex() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            return index;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
         * Returns a string representation of this Value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        public final String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            return description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
         * Returns true if the specified object is a valid Key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
         * for this Value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        public final boolean isCompatibleKey(Key k) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            return myKey == k;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
         * The hash code for all SunHints.Value objects will be the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
         * as the system identity code of the object as defined by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
         * System.identityHashCode() method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        public final int hashCode() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            return System.identityHashCode(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
         * The equals method for all SunHints.Value objects will return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
         * the same result as the equality operator '=='.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        public final boolean equals(Object o) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            return this == o;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
23256
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   175
    private static final int NUM_KEYS = 10;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    private static final int VALS_PER_KEY = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * Rendering hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     */
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   181
    @Native public static final int INTKEY_RENDERING = 0;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   182
    @Native public static final int INTVAL_RENDER_DEFAULT = 0;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   183
    @Native public static final int INTVAL_RENDER_SPEED = 1;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   184
    @Native public static final int INTVAL_RENDER_QUALITY = 2;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * Antialiasing hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     */
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   189
    @Native public static final int INTKEY_ANTIALIASING = 1;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   190
    @Native public static final int INTVAL_ANTIALIAS_DEFAULT = 0;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   191
    @Native public static final int INTVAL_ANTIALIAS_OFF = 1;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   192
    @Native public static final int INTVAL_ANTIALIAS_ON = 2;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * Text antialiasing hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     */
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   197
    @Native public static final int INTKEY_TEXT_ANTIALIASING = 2;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   198
    @Native public static final int INTVAL_TEXT_ANTIALIAS_DEFAULT = 0;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   199
    @Native public static final int INTVAL_TEXT_ANTIALIAS_OFF = 1;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   200
    @Native public static final int INTVAL_TEXT_ANTIALIAS_ON = 2;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   201
    @Native public static final int INTVAL_TEXT_ANTIALIAS_GASP = 3;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   202
    @Native public static final int INTVAL_TEXT_ANTIALIAS_LCD_HRGB = 4;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   203
    @Native public static final int INTVAL_TEXT_ANTIALIAS_LCD_HBGR = 5;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   204
    @Native public static final int INTVAL_TEXT_ANTIALIAS_LCD_VRGB = 6;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   205
    @Native public static final int INTVAL_TEXT_ANTIALIAS_LCD_VBGR = 7;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * Font fractional metrics hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     */
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   210
    @Native public static final int INTKEY_FRACTIONALMETRICS = 3;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   211
    @Native public static final int INTVAL_FRACTIONALMETRICS_DEFAULT = 0;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   212
    @Native public static final int INTVAL_FRACTIONALMETRICS_OFF = 1;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   213
    @Native public static final int INTVAL_FRACTIONALMETRICS_ON = 2;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * Dithering hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     */
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   218
    @Native public static final int INTKEY_DITHERING = 4;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   219
    @Native public static final int INTVAL_DITHER_DEFAULT = 0;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   220
    @Native public static final int INTVAL_DITHER_DISABLE = 1;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   221
    @Native public static final int INTVAL_DITHER_ENABLE = 2;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * Interpolation hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     */
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   226
    @Native public static final int INTKEY_INTERPOLATION = 5;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   227
    @Native public static final int INTVAL_INTERPOLATION_NEAREST_NEIGHBOR = 0;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   228
    @Native public static final int INTVAL_INTERPOLATION_BILINEAR = 1;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   229
    @Native public static final int INTVAL_INTERPOLATION_BICUBIC = 2;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * Alpha interpolation hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     */
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   234
    @Native public static final int INTKEY_ALPHA_INTERPOLATION = 6;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   235
    @Native public static final int INTVAL_ALPHA_INTERPOLATION_DEFAULT = 0;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   236
    @Native public static final int INTVAL_ALPHA_INTERPOLATION_SPEED = 1;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   237
    @Native public static final int INTVAL_ALPHA_INTERPOLATION_QUALITY = 2;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * Color rendering hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     */
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   242
    @Native public static final int INTKEY_COLOR_RENDERING = 7;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   243
    @Native public static final int INTVAL_COLOR_RENDER_DEFAULT = 0;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   244
    @Native public static final int INTVAL_COLOR_RENDER_SPEED = 1;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   245
    @Native public static final int INTVAL_COLOR_RENDER_QUALITY = 2;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * Stroke normalization control hint key and values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     */
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   250
    @Native public static final int INTKEY_STROKE_CONTROL = 8;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   251
    @Native public static final int INTVAL_STROKE_DEFAULT = 0;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   252
    @Native public static final int INTVAL_STROKE_NORMALIZE = 1;
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   253
    @Native public static final int INTVAL_STROKE_PURE = 2;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    /**
23256
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   256
     * Image scaling hint key and values
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   257
     */
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   258
    @Native public static final int INTKEY_RESOLUTION_VARIANT = 9;
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   259
    @Native public static final int INTVAL_RESOLUTION_VARIANT_DEFAULT = 0;
32682
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   260
    @Native public static final int INTVAL_RESOLUTION_VARIANT_BASE = 1;
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   261
    @Native public static final int INTVAL_RESOLUTION_VARIANT_SIZE_FIT = 2;
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   262
    @Native public static final int INTVAL_RESOLUTION_VARIANT_DPI_FIT = 3;
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   263
23256
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   264
    /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * LCD text contrast control hint key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * Value is "100" to make discontiguous with the others which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * are all enumerative and are of a different class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     */
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
   269
    @Native public static final int INTKEY_AATEXT_LCD_CONTRAST = 100;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * Rendering hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
    public static final Key KEY_RENDERING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
        new SunHints.Key(SunHints.INTKEY_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
                         "Global rendering quality key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    public static final Object VALUE_RENDER_SPEED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        new SunHints.Value(KEY_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                           SunHints.INTVAL_RENDER_SPEED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
                           "Fastest rendering methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    public static final Object VALUE_RENDER_QUALITY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        new SunHints.Value(KEY_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
                           SunHints.INTVAL_RENDER_QUALITY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
                           "Highest quality rendering methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    public static final Object VALUE_RENDER_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        new SunHints.Value(KEY_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
                           SunHints.INTVAL_RENDER_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
                           "Default rendering methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * Antialiasing hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    public static final Key KEY_ANTIALIASING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
        new SunHints.Key(SunHints.INTKEY_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
                         "Global antialiasing enable key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    public static final Object VALUE_ANTIALIAS_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
        new SunHints.Value(KEY_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
                           SunHints.INTVAL_ANTIALIAS_ON,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
                           "Antialiased rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    public static final Object VALUE_ANTIALIAS_OFF =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        new SunHints.Value(KEY_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
                           SunHints.INTVAL_ANTIALIAS_OFF,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
                           "Nonantialiased rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    public static final Object VALUE_ANTIALIAS_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
        new SunHints.Value(KEY_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
                           SunHints.INTVAL_ANTIALIAS_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
                           "Default antialiasing rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * Text antialiasing hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
    public static final Key KEY_TEXT_ANTIALIASING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
        new SunHints.Key(SunHints.INTKEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
                         "Text-specific antialiasing enable key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
    public static final Object VALUE_TEXT_ANTIALIAS_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
                           SunHints.INTVAL_TEXT_ANTIALIAS_ON,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
                           "Antialiased text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    public static final Object VALUE_TEXT_ANTIALIAS_OFF =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
                           SunHints.INTVAL_TEXT_ANTIALIAS_OFF,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
                           "Nonantialiased text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    public static final Object VALUE_TEXT_ANTIALIAS_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
                           SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
                           "Default antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    public static final Object VALUE_TEXT_ANTIALIAS_GASP =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
                           SunHints.INTVAL_TEXT_ANTIALIAS_GASP,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
                           "gasp antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
    public static final Object VALUE_TEXT_ANTIALIAS_LCD_HRGB =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
                           SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HRGB,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
                           "LCD HRGB antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    public static final Object VALUE_TEXT_ANTIALIAS_LCD_HBGR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
                           SunHints.INTVAL_TEXT_ANTIALIAS_LCD_HBGR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
                           "LCD HBGR antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    public static final Object VALUE_TEXT_ANTIALIAS_LCD_VRGB =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
                           SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VRGB,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
                           "LCD VRGB antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
    public static final Object VALUE_TEXT_ANTIALIAS_LCD_VBGR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
        new SunHints.Value(KEY_TEXT_ANTIALIASING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
                           SunHints.INTVAL_TEXT_ANTIALIAS_LCD_VBGR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
                           "LCD VBGR antialiasing text mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * Font fractional metrics hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
    public static final Key KEY_FRACTIONALMETRICS =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
        new SunHints.Key(SunHints.INTKEY_FRACTIONALMETRICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
                         "Fractional metrics enable key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    public static final Object VALUE_FRACTIONALMETRICS_ON =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        new SunHints.Value(KEY_FRACTIONALMETRICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
                           SunHints.INTVAL_FRACTIONALMETRICS_ON,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
                           "Fractional text metrics mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
    public static final Object VALUE_FRACTIONALMETRICS_OFF =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
        new SunHints.Value(KEY_FRACTIONALMETRICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
                           SunHints.INTVAL_FRACTIONALMETRICS_OFF,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
                           "Integer text metrics mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    public static final Object VALUE_FRACTIONALMETRICS_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
        new SunHints.Value(KEY_FRACTIONALMETRICS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
                           SunHints.INTVAL_FRACTIONALMETRICS_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
                           "Default fractional text metrics mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * Dithering hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    public static final Key KEY_DITHERING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        new SunHints.Key(SunHints.INTKEY_DITHERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
                         "Dithering quality key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    public static final Object VALUE_DITHER_ENABLE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
        new SunHints.Value(KEY_DITHERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
                           SunHints.INTVAL_DITHER_ENABLE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
                           "Dithered rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
    public static final Object VALUE_DITHER_DISABLE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
        new SunHints.Value(KEY_DITHERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
                           SunHints.INTVAL_DITHER_DISABLE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
                           "Nondithered rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    public static final Object VALUE_DITHER_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
        new SunHints.Value(KEY_DITHERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
                           SunHints.INTVAL_DITHER_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
                           "Default dithering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * Interpolation hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    public static final Key KEY_INTERPOLATION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
        new SunHints.Key(SunHints.INTKEY_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
                         "Image interpolation method key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    public static final Object VALUE_INTERPOLATION_NEAREST_NEIGHBOR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
        new SunHints.Value(KEY_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
                           SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
                           "Nearest Neighbor image interpolation mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
    public static final Object VALUE_INTERPOLATION_BILINEAR =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
        new SunHints.Value(KEY_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
                           SunHints.INTVAL_INTERPOLATION_BILINEAR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
                           "Bilinear image interpolation mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    public static final Object VALUE_INTERPOLATION_BICUBIC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
        new SunHints.Value(KEY_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
                           SunHints.INTVAL_INTERPOLATION_BICUBIC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
                           "Bicubic image interpolation mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * Alpha interpolation hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
    public static final Key KEY_ALPHA_INTERPOLATION =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
        new SunHints.Key(SunHints.INTKEY_ALPHA_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
                         "Alpha blending interpolation method key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
    public static final Object VALUE_ALPHA_INTERPOLATION_SPEED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
        new SunHints.Value(KEY_ALPHA_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
                           SunHints.INTVAL_ALPHA_INTERPOLATION_SPEED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
                           "Fastest alpha blending methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
    public static final Object VALUE_ALPHA_INTERPOLATION_QUALITY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
        new SunHints.Value(KEY_ALPHA_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
                           SunHints.INTVAL_ALPHA_INTERPOLATION_QUALITY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
                           "Highest quality alpha blending methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    public static final Object VALUE_ALPHA_INTERPOLATION_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
        new SunHints.Value(KEY_ALPHA_INTERPOLATION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
                           SunHints.INTVAL_ALPHA_INTERPOLATION_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
                           "Default alpha blending methods");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * Color rendering hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
    public static final Key KEY_COLOR_RENDERING =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
        new SunHints.Key(SunHints.INTKEY_COLOR_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
                         "Color rendering quality key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
    public static final Object VALUE_COLOR_RENDER_SPEED =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
        new SunHints.Value(KEY_COLOR_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
                           SunHints.INTVAL_COLOR_RENDER_SPEED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
                           "Fastest color rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
    public static final Object VALUE_COLOR_RENDER_QUALITY =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
        new SunHints.Value(KEY_COLOR_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
                           SunHints.INTVAL_COLOR_RENDER_QUALITY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
                           "Highest quality color rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    public static final Object VALUE_COLOR_RENDER_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
        new SunHints.Value(KEY_COLOR_RENDERING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
                           SunHints.INTVAL_COLOR_RENDER_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
                           "Default color rendering mode");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * Stroke normalization control hint key and value objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
    public static final Key KEY_STROKE_CONTROL =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
        new SunHints.Key(SunHints.INTKEY_STROKE_CONTROL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
                         "Stroke normalization control key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
    public static final Object VALUE_STROKE_DEFAULT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
        new SunHints.Value(KEY_STROKE_CONTROL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
                           SunHints.INTVAL_STROKE_DEFAULT,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
                           "Default stroke normalization");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    public static final Object VALUE_STROKE_NORMALIZE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
        new SunHints.Value(KEY_STROKE_CONTROL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
                           SunHints.INTVAL_STROKE_NORMALIZE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
                           "Normalize strokes for consistent rendering");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
    public static final Object VALUE_STROKE_PURE =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
        new SunHints.Value(KEY_STROKE_CONTROL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
                           SunHints.INTVAL_STROKE_PURE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
                           "Pure stroke conversion for accurate paths");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
23256
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   462
    /**
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   463
     * Image resolution variant hint key and value objects
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   464
     */
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   465
    public static final Key KEY_RESOLUTION_VARIANT =
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   466
        new SunHints.Key(SunHints.INTKEY_RESOLUTION_VARIANT,
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   467
                         "Global image resolution variant key");
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   468
    public static final Object VALUE_RESOLUTION_VARIANT_DEFAULT =
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   469
        new SunHints.Value(KEY_RESOLUTION_VARIANT,
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   470
                           SunHints.INTVAL_RESOLUTION_VARIANT_DEFAULT,
32682
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   471
                           "Choose image resolutions based on a default"
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   472
                                   + "heuristic");
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   473
    public static final Object VALUE_RESOLUTION_VARIANT_BASE =
23256
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   474
        new SunHints.Value(KEY_RESOLUTION_VARIANT,
32682
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   475
                           SunHints.INTVAL_RESOLUTION_VARIANT_BASE,
23256
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   476
                           "Use only the standard resolution of an image");
32682
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   477
    public static final Object VALUE_RESOLUTION_VARIANT_SIZE_FIT =
23256
d71287a532f8 8011059: [macosx] Support automatic @2x images loading on Mac OS X
alexsch
parents: 16734
diff changeset
   478
        new SunHints.Value(KEY_RESOLUTION_VARIANT,
32682
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   479
                           SunHints.INTVAL_RESOLUTION_VARIANT_SIZE_FIT,
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   480
                           "Choose image resolutions based on the DPI"
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   481
                                   + "of the screen and transform"
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   482
                                   + "in the Graphics2D context");
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   483
    public static final Object VALUE_RESOLUTION_VARIANT_DPI_FIT =
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   484
        new SunHints.Value(KEY_RESOLUTION_VARIANT,
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   485
                           SunHints.INTVAL_RESOLUTION_VARIANT_DPI_FIT,
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   486
                           "Choose image resolutions based only on the DPI"
6f1200d8999d 8029339: Custom MultiResolution image support on HiDPI displays
alexsch
parents: 25859
diff changeset
   487
                                   + " of the screen");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
    public static class LCDContrastKey extends Key {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
        public LCDContrastKey(int privatekey, String description) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
            super(privatekey, description);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
         * Returns true if the specified object is a valid value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
         * for this Key. The allowable range is 100 to 250.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
        public final boolean isCompatibleValue(Object val) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
            if (val instanceof Integer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
                int ival = ((Integer)val).intValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
                return ival >= 100 && ival <= 250;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * LCD text contrast hint key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
    public static final RenderingHints.Key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
        KEY_TEXT_ANTIALIAS_LCD_CONTRAST =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
        new LCDContrastKey(SunHints.INTKEY_AATEXT_LCD_CONTRAST,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
                           "Text-specific LCD contrast key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
}