Lines 29-35
Link Here
|
29 |
*/ |
29 |
*/ |
30 |
final class ColorUtil { |
30 |
final class ColorUtil { |
31 |
private static Map gpCache = null; |
31 |
private static Map gpCache = null; |
32 |
private static HashMap hintsMap = null; |
32 |
private static Map hintsMap = null; |
33 |
private static final boolean noGpCache = Boolean.getBoolean( |
33 |
private static final boolean noGpCache = Boolean.getBoolean( |
34 |
"netbeans.winsys.nogpcache"); //NOI18N |
34 |
"netbeans.winsys.nogpcache"); //NOI18N |
35 |
private static final boolean noAntialias = |
35 |
private static final boolean noAntialias = |
Lines 159-178
Link Here
|
159 |
return result; |
159 |
return result; |
160 |
} |
160 |
} |
161 |
|
161 |
|
162 |
private static Map getHints() { |
162 |
static final Map getHints() { |
|
|
163 |
//XXX We REALLY need to put this in a graphics utils lib |
163 |
if (hintsMap == null) { |
164 |
if (hintsMap == null) { |
164 |
hintsMap = new HashMap(); |
165 |
//Thanks to Phil Race for making this possible |
165 |
hintsMap.put(RenderingHints.KEY_TEXT_ANTIALIASING, |
166 |
hintsMap = (Map)(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints")); //NOI18N |
166 |
RenderingHints.VALUE_TEXT_ANTIALIAS_ON); |
167 |
if (hintsMap == null) { |
167 |
hintsMap.put(RenderingHints.KEY_ANTIALIASING, |
168 |
hintsMap = new HashMap(); |
168 |
RenderingHints.VALUE_ANTIALIAS_ON); |
169 |
hintsMap.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); |
|
|
170 |
} |
169 |
} |
171 |
} |
170 |
return hintsMap; |
172 |
return hintsMap; |
171 |
} |
173 |
} |
172 |
|
174 |
|
173 |
public static final void setupAntialiasing(Graphics g) { |
175 |
public static final void setupAntialiasing(Graphics g, boolean lines) { |
174 |
if (noAntialias) return; |
176 |
if (noAntialias) return; |
175 |
((Graphics2D) g).addRenderingHints(getHints()); |
177 |
Graphics2D g2d = (Graphics2D) g; |
|
|
178 |
g2d.addRenderingHints(getHints()); |
179 |
if (lines) { |
180 |
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, |
181 |
RenderingHints.VALUE_ANTIALIAS_ON); |
182 |
} |
176 |
} |
183 |
} |
177 |
|
184 |
|
178 |
private static final boolean antialias = Boolean.getBoolean( |
185 |
private static final boolean antialias = Boolean.getBoolean( |