src/share/classes/sun/java2d/SunGraphics2D.java

Print this page
rev 9629 : 8038644: Fix raw and unchecked warnings in sun.java2d.*
Reviewed-by:


1413             } else {
1414                 this.hints.putAll(hints);
1415             }
1416         }
1417     }
1418 
1419     /**
1420      * Gets the preferences for the rendering algorithms.
1421      * Hint categories include controls for rendering quality and
1422      * overall time/quality trade-off in the rendering process.
1423      * @see RenderingHints
1424      */
1425     public RenderingHints getRenderingHints() {
1426         if (hints == null) {
1427             return makeHints(null);
1428         } else {
1429             return (RenderingHints) hints.clone();
1430         }
1431     }
1432 
1433     RenderingHints makeHints(Map hints) {
1434         RenderingHints model = new RenderingHints(hints);

1435         model.put(SunHints.KEY_RENDERING,
1436                   SunHints.Value.get(SunHints.INTKEY_RENDERING,
1437                                      renderHint));
1438         model.put(SunHints.KEY_ANTIALIASING,
1439                   SunHints.Value.get(SunHints.INTKEY_ANTIALIASING,
1440                                      antialiasHint));
1441         model.put(SunHints.KEY_TEXT_ANTIALIASING,
1442                   SunHints.Value.get(SunHints.INTKEY_TEXT_ANTIALIASING,
1443                                      textAntialiasHint));
1444         model.put(SunHints.KEY_FRACTIONALMETRICS,
1445                   SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
1446                                      fractionalMetricsHint));
1447         model.put(SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST,
1448                   Integer.valueOf(lcdTextContrast));
1449         Object value;
1450         switch (interpolationHint) {
1451         case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
1452             value = SunHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
1453             break;
1454         case SunHints.INTVAL_INTERPOLATION_BILINEAR:




1413             } else {
1414                 this.hints.putAll(hints);
1415             }
1416         }
1417     }
1418 
1419     /**
1420      * Gets the preferences for the rendering algorithms.
1421      * Hint categories include controls for rendering quality and
1422      * overall time/quality trade-off in the rendering process.
1423      * @see RenderingHints
1424      */
1425     public RenderingHints getRenderingHints() {
1426         if (hints == null) {
1427             return makeHints(null);
1428         } else {
1429             return (RenderingHints) hints.clone();
1430         }
1431     }
1432 
1433     RenderingHints makeHints(Map<?,?> hints) {
1434         RenderingHints model = new RenderingHints(null);
1435         model.putAll(hints);
1436         model.put(SunHints.KEY_RENDERING,
1437                   SunHints.Value.get(SunHints.INTKEY_RENDERING,
1438                                      renderHint));
1439         model.put(SunHints.KEY_ANTIALIASING,
1440                   SunHints.Value.get(SunHints.INTKEY_ANTIALIASING,
1441                                      antialiasHint));
1442         model.put(SunHints.KEY_TEXT_ANTIALIASING,
1443                   SunHints.Value.get(SunHints.INTKEY_TEXT_ANTIALIASING,
1444                                      textAntialiasHint));
1445         model.put(SunHints.KEY_FRACTIONALMETRICS,
1446                   SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
1447                                      fractionalMetricsHint));
1448         model.put(SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST,
1449                   Integer.valueOf(lcdTextContrast));
1450         Object value;
1451         switch (interpolationHint) {
1452         case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
1453             value = SunHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR;
1454             break;
1455         case SunHints.INTVAL_INTERPOLATION_BILINEAR: