KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwt > awt > RenderingHints


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9
10    $Log: RenderingHints.java,v $
11    Revision 1.2 2004/04/20 16:35:50 bobintetley
12    Code cleanup
13
14    Revision 1.1 2004/01/15 15:20:29 bobintetley
15    Java2D work
16
17
18 */

19
20 package swingwt.awt;
21
22 import java.util.*;
23
24 public class RenderingHints implements Map {
25
26     HashMap hintmap = new HashMap();
27
28     public static final Object JavaDoc KEY_ANTIALIASING =
29         "VALUE_ANTIALIASING";
30     public static final Object JavaDoc VALUE_ANTIALIAS_ON =
31         "VALUE_ANTIALIAS_ON";
32     public static final Object JavaDoc VALUE_ANTIALIAS_OFF =
33     "VALUE_ANTIALIAS_OFF";
34     public static final Object JavaDoc VALUE_ANTIALIAS_DEFAULT =
35      "VALUE_ANTIALIAS_DEFAULT";
36     public static final Object JavaDoc KEY_RENDERING =
37      "KEY_RENDERING";
38     public static final Object JavaDoc VALUE_RENDER_SPEED =
39      "VALUE_RENDER_SPEED";
40     public static final Object JavaDoc VALUE_RENDER_QUALITY =
41      "VALUE_RENDER_QUALITY";
42     public static final Object JavaDoc VALUE_RENDER_DEFAULT =
43      "VALUE_RENDER_DEFAULT";
44     public static final Object JavaDoc KEY_DITHERING =
45      "KEY_DITHERING";
46     public static final Object JavaDoc VALUE_DITHER_DISABLE =
47      "VALUE_DITHER_DISABLE";
48     public static final Object JavaDoc VALUE_DITHER_ENABLE =
49      "VALUE_DITHER_ENABLE";
50     public static final Object JavaDoc VALUE_DITHER_DEFAULT =
51      "VALUE_DITHER_DEFAULT";
52     public static final Object JavaDoc KEY_TEXT_ANTIALIASING =
53      "KEY_TEXT_ANTIALIASING";
54     public static final Object JavaDoc VALUE_TEXT_ANTIALIAS_ON =
55      "VALUE_TEXT_ANTIALIAS_ON";
56     public static final Object JavaDoc VALUE_TEXT_ANTIALIAS_OFF =
57      "VALUE_TEXT_ANTIALIAS_OFF";
58     public static final Object JavaDoc VALUE_TEXT_ANTIALIAS_DEFAULT =
59      "VALUE_TEXT_ANTIALIAS_DEFAULT";
60     public static final Object JavaDoc KEY_FRACTIONALMETRICS =
61      "KEY_FRACTIONALMETRICS";
62     public static final Object JavaDoc VALUE_FRACTIONALMETRICS_OFF =
63      "VALUE_FRACTIONALMETRICS_OFF";
64     public static final Object JavaDoc VALUE_FRACTIONALMETRICS_ON =
65      "VALUE_FRACTIONALMETRICS_ON";
66     public static final Object JavaDoc VALUE_FRACTIONALMETRICS_DEFAULT =
67      "VALUE_FRACTIONALMETRICS_DEFAULT";
68     public static final Object JavaDoc KEY_INTERPOLATION =
69      "KEY_INTERPOLATION";
70     public static final Object JavaDoc VALUE_INTERPOLATION_NEAREST_NEIGHBOR =
71      "VALUE_INTERPOLATION_NEAREST_NEIGHBOR";
72     public static final Object JavaDoc VALUE_INTERPOLATION_BILINEAR =
73      "VALUE_INTERPOLATION_BILINEAR";
74     public static final Object JavaDoc VALUE_INTERPOLATION_BICUBIC =
75      "VALUE_INTERPOLATION_BICUBIC";
76     public static final Object JavaDoc KEY_ALPHA_INTERPOLATION =
77      "KEY_ALPHA_INTERPOLATION";
78     public static final Object JavaDoc VALUE_ALPHA_INTERPOLATION_SPEED =
79      "VALUE_ALPHA_INTERPOLATION_SPEED";
80     public static final Object JavaDoc VALUE_ALPHA_INTERPOLATION_QUALITY =
81      "VALUE_ALPHA_INTERPOLATION_QUALITY";
82     public static final Object JavaDoc VALUE_ALPHA_INTERPOLATION_DEFAULT =
83      "VALUE_ALPHA_INTERPOLATION_DEFAULT";
84     public static final Object JavaDoc KEY_COLOR_RENDERING =
85      "KEY_COLOR_RENDERING";
86     public static final Object JavaDoc VALUE_COLOR_RENDER_SPEED =
87      "VALUE_COLOR_RENDER_SPEED";
88     public static final Object JavaDoc VALUE_COLOR_RENDER_QUALITY =
89      "VALUE_COLOR_RENDER_QUALITY";
90     public static final Object JavaDoc VALUE_COLOR_RENDER_DEFAULT =
91      "VALUE_COLOR_RENDER_DEFAULT";
92     public static final Object JavaDoc KEY_STROKE_CONTROL =
93     "KEY_STROKE_CONTROL";
94     public static final Object JavaDoc VALUE_STROKE_DEFAULT =
95     "VALUE_STROKE_DEFAULT";
96     public static final Object JavaDoc VALUE_STROKE_NORMALIZE =
97     "VALUE_STROKE_NORMALIZE";
98     public static final Object JavaDoc VALUE_STROKE_PURE =
99     "VALUE_STROKE_PURE";
100     public RenderingHints(Map init) {
101     if (init != null) {
102         hintmap.putAll(init);
103     }
104     }
105     public RenderingHints(Object JavaDoc key, Object JavaDoc value) {
106     hintmap.put(key, value);
107     }
108     public int size() {
109     return hintmap.size();
110     }
111     public boolean isEmpty() {
112     return hintmap.isEmpty();
113     }
114     public boolean containsKey(Object JavaDoc key) {
115     return hintmap.containsKey(key);
116     }
117     public boolean containsValue(Object JavaDoc value) {
118     return hintmap.containsValue(value);
119     }
120     public Object JavaDoc get(Object JavaDoc key) {
121     return hintmap.get(key);
122     }
123     public Object JavaDoc put(Object JavaDoc key, Object JavaDoc value) {
124         return hintmap.put(key, value);
125     }
126     public void add(RenderingHints hints) {
127     hintmap.putAll(hints.hintmap);
128     }
129     public void clear() {
130     hintmap.clear();
131     }
132     public Object JavaDoc remove(Object JavaDoc key) {
133     return hintmap.remove(key);
134     }
135     public void putAll(Map m) {
136     if (m instanceof RenderingHints) {
137         hintmap.putAll(((RenderingHints) m).hintmap);
138     } else {
139         Iterator iter = m.entrySet().iterator();
140         while (iter.hasNext()) {
141         Map.Entry entry = (Map.Entry) iter.next();
142         put(entry.getKey(), entry.getValue());
143         }
144     }
145     }
146     public Set keySet() {
147     return hintmap.keySet();
148     }
149     public Collection values() {
150     return hintmap.values();
151     }
152     public Set entrySet() {
153     return Collections.unmodifiableMap(hintmap).entrySet();
154     }
155     public int hashCode() {
156     return hintmap.hashCode();
157     }
158 }
159
160
Popular Tags