package net.sf.jasperreports.engine.util;

import java.awt.GraphicsEnvironment;
import net.sf.jasperreports.engine.JRException;

public class JRGraphEnvInitializer {
  private static boolean isGraphicsEnvironmentInitiliazed = false;
  
  public static void initializeGraphEnv() throws JRException {
    if (!isGraphicsEnvironmentInitiliazed) {
      try {
        GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
      } catch (Exception e) {
        throw new JRException("Error initializing graphic environment.", e);
      } 
      isGraphicsEnvironmentInitiliazed = true;
    } 
  }
}
