1 /* Copyright (C) 2000, 2001, 2002 Free Software Foundation
3 This file is part of GNU Classpath.
5 GNU Classpath is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
10 GNU Classpath is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNU Classpath; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 Linking this library statically or dynamically with other modules is
21 making a combined work based on this library. Thus, the terms and
22 conditions of the GNU General Public License cover the whole
25 As a special exception, the copyright holders of this library give you
26 permission to link this library with independent modules to produce an
27 executable, regardless of the license terms of these independent
28 modules, and to copy and distribute the resulting executable under
29 terms of your choice, provided that you also meet, for each linked
30 independent module, the terms and conditions of the license of that
31 module. An independent module is a module which is not derived from
32 or based on this library. If you modify this library, you may extend
33 this exception to your version of the library, but you are not
34 obligated to do so. If you do not wish to do so, delete this
35 exception statement from your version. */
40 * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
42 public class RenderingHints implements
47 public abstract static class Key
51 protected Key(int privateKey)
56 public abstract boolean isCompatibleValue(Object value);
58 protected final int intKey()
63 public final int hashCode()
65 return System.identityHashCode(this);
68 public final boolean equals(Object other)
70 return (this == other);
74 private static class KeyImpl extends Key
79 KeyImpl(int privateKey, String description,
80 Object v1, Object v2, Object v3)
83 this.description = description;
89 public boolean isCompatibleValue(Object value)
91 return (value == v1) || (value == v2) || (value == v3);
94 public String toString()
101 //java.util.HashMap hintMap;
103 public static final Key KEY_ANTIALIASING;
104 public static final Object
105 VALUE_ANTIALIAS_ON = "Antialiased rendering mode",
106 VALUE_ANTIALIAS_DEFAULT = "Default antialiasing rendering mode";
110 KEY_ANTIALIASING = new KeyImpl(1, "Global antialiasing enable key",
112 VALUE_ANTIALIAS_DEFAULT,
113 VALUE_ANTIALIAS_DEFAULT);
116 public static final Key KEY_RENDERING;
117 public static final Object
118 VALUE_RENDER_SPEED = "Fastest rendering methods",
119 VALUE_RENDER_QUALITY = "Highest quality rendering methods",
120 VALUE_RENDER_DEFAULT = "Default rendering methods";
124 KEY_RENDERING = new KeyImpl(2, "Global rendering quality key",
126 VALUE_RENDER_QUALITY,
127 VALUE_RENDER_DEFAULT);
130 public static final Key KEY_DITHERING;
131 public static final Object
132 VALUE_DITHER_DISABLE = "Nondithered rendering mode",
133 VALUE_DITHER_ENABLE = "Dithered rendering mode",
134 VALUE_DITHER_DEFAULT = "Default dithering mode";
138 KEY_DITHERING = new KeyImpl(3, "Dithering quality key",
139 VALUE_DITHER_DISABLE,
141 VALUE_DITHER_DEFAULT);
144 public static final Key KEY_TEXT_ANTIALIASING;
145 public static final Object
146 VALUE_TEXT_ANTIALIAS_ON = "Antialiased text mode",
147 VALUE_TEXT_ANTIALIAS_OFF = "Nonantialiased text mode",
148 VALUE_TEXT_ANTIALIAS_DEFAULT = "Default antialiasing text mode";
152 KEY_TEXT_ANTIALIASING = new KeyImpl(4, "Text-specific antialiasing enable key",
153 VALUE_TEXT_ANTIALIAS_ON,
154 VALUE_TEXT_ANTIALIAS_OFF,
155 VALUE_TEXT_ANTIALIAS_DEFAULT);
158 public static final Key KEY_FRACTIONALMETRICS;
159 public static final Object
160 VALUE_FRACTIONALMETRICS_OFF = "Integer text metrics mode",
161 VALUE_FRACTIONALMETRICS_ON = "Fractional text metrics mode",
162 VALUE_FRACTIONALMETRICS_DEFAULT = "Default fractional text metrics mode";
166 KEY_FRACTIONALMETRICS = new KeyImpl(5, "Fractional metrics enable key",
167 VALUE_FRACTIONALMETRICS_OFF,
168 VALUE_FRACTIONALMETRICS_ON,
169 VALUE_FRACTIONALMETRICS_DEFAULT);
172 public static final Key KEY_INTERPOLATION;
173 public static final Object
174 VALUE_INTERPOLATION_NEAREST_NEIGHBOR = "Nearest Neighbor image interpolation mode",
175 VALUE_INTERPOLATION_BILINEAR = "Bilinear image interpolation mode",
176 VALUE_INTERPOLATION_BICUBIC = "Bicubic image interpolation mode";
180 KEY_INTERPOLATION = new KeyImpl(6, "Image interpolation method key",
181 VALUE_INTERPOLATION_NEAREST_NEIGHBOR,
182 VALUE_INTERPOLATION_BILINEAR,
183 VALUE_INTERPOLATION_BICUBIC);
186 public static final Key KEY_ALPHA_INTERPOLATION;
187 public static final Object
188 VALUE_ALPHA_INTERPOLATION_SPEED = "Fastest alpha blending methods",
189 VALUE_ALPHA_INTERPOLATION_QUALITY = "Highest quality alpha blending methods",
190 VALUE_ALPHA_INTERPOLATION_DEFAULT = "Default alpha blending methods";
194 KEY_ALPHA_INTERPOLATION = new KeyImpl(7, "Alpha blending interpolation method key",
195 VALUE_ALPHA_INTERPOLATION_SPEED,
196 VALUE_ALPHA_INTERPOLATION_QUALITY,
197 VALUE_ALPHA_INTERPOLATION_DEFAULT);
200 public static final Key KEY_COLOR_RENDERING;
201 public static final Object
202 VALUE_COLOR_RENDER_SPEED = "Fastest color rendering mode",
203 VALUE_COLOR_RENDER_QUALITY = "Highest quality color rendering mode",
204 VALUE_COLOR_RENDER_DEFAULT = "Default color rendering mode";
208 KEY_COLOR_RENDERING = new KeyImpl(8, "Color rendering quality key",
209 VALUE_COLOR_RENDER_SPEED,
210 VALUE_COLOR_RENDER_QUALITY,
211 VALUE_COLOR_RENDER_DEFAULT);
214 public static final Key KEY_STROKE_CONTROL;
215 public static final Object
216 VALUE_STROKE_DEFAULT = "Default stroke control mode",
217 VALUE_STROKE_NORMALIZE = "Normalize stroke control mode",
218 VALUE_STROKE_PURE = "Pure stroke control mode";
222 KEY_STROKE_CONTROL = new KeyImpl(9, "Stroke normalization control key",
223 VALUE_STROKE_DEFAULT,
224 VALUE_STROKE_NORMALIZE,
228 //public RenderingHints(Map init);
230 public RenderingHints(Key key, Object value)
232 throw new UnsupportedOperationException("FIXME, not implemented yet");
237 throw new UnsupportedOperationException("FIXME, not implemented yet");
240 public boolean isEmpty()
242 throw new UnsupportedOperationException("FIXME, not implemented yet");
245 public boolean containsKey(Object key)
247 throw new UnsupportedOperationException("FIXME, not implemented yet");
250 public boolean containsValue(Object value)
252 throw new UnsupportedOperationException("FIXME, not implemented yet");
255 public Object get(Object key)
257 throw new UnsupportedOperationException("FIXME, not implemented yet");
260 public Object put(Object key, Object value)
262 throw new UnsupportedOperationException("FIXME, not implemented yet");
265 public void add(RenderingHints hints)
267 throw new UnsupportedOperationException("FIXME, not implemented yet");
272 throw new UnsupportedOperationException("FIXME, not implemented yet");
275 public Object remove(Object key)
277 throw new UnsupportedOperationException("FIXME, not implemented yet");
281 public void putAll(Map m)
283 throw new UnsupportedOperationException("FIXME, not implemented yet");
290 throw new UnsupportedOperationException("FIXME, not implemented yet");
295 public Collection values()
297 throw new UnsupportedOperationException("FIXME, not implemented yet");
302 public Set entrySet()
304 throw new UnsupportedOperationException("FIXME, not implemented yet");
308 public boolean equals(Object o)
310 throw new UnsupportedOperationException("FIXME, not implemented yet");
313 public int hashCode()
315 throw new UnsupportedOperationException("FIXME, not implemented yet");
318 public Object clone()
320 throw new UnsupportedOperationException("FIXME, not implemented yet");
323 public String toString()
325 throw new UnsupportedOperationException("FIXME, not implemented yet");