Here you can find the source of getRenderingHints(Graphics2D g2d, RenderingHints hintsToSave, RenderingHints savedHints)
private static RenderingHints getRenderingHints(Graphics2D g2d, RenderingHints hintsToSave, RenderingHints savedHints)
//package com.java2s; import java.awt.*; import java.util.*; public class Main { /**/*w w w. ja va2 s. co m*/ * Get rendering hints from a Graphics instance. "hintsToSave" is a Map of RenderingHint key-values. For each hint * key present in that map, the value of that hint is obtained from the Graphics and stored as the value for the key * in savedHints. */ private static RenderingHints getRenderingHints(Graphics2D g2d, RenderingHints hintsToSave, RenderingHints savedHints) { if (savedHints == null) { savedHints = new RenderingHints(null); } else { savedHints.clear(); } if (hintsToSave == null || hintsToSave.size() == 0) { return savedHints; } /* RenderingHints.keySet() returns Set*/ Set objects = hintsToSave.keySet(); for (Object o : objects) { RenderingHints.Key key = (RenderingHints.Key) o; Object value = g2d.getRenderingHint(key); savedHints.put(key, value); } return savedHints; } }