package open.dolphin.project;

import open.dolphin.container.NameValuePair;
import java.awt.Color;
import java.awt.Dimension;
import java.io.InputStream;
import java.util.Map;
import javax.swing.ImageIcon;
import open.dolphin.infomodel.DepartmentModel;
import open.dolphin.infomodel.LicenseModel;

import org.apache.velocity.VelocityContext;
import org.jdesktop.application.ApplicationContext;
import org.jdesktop.application.LocalStorage;
import org.jdesktop.application.ResourceMap;

/**
 *
 * @author  Kazushi Minagawa, Digital Globe, Inc.
 */
public class GlobalConstants {

    private static GlobalConstantsImplement stub;

    public static void createGlobalConstants(ApplicationContext context) {
        stub = new GlobalConstantsImplement(context);
        setApplicationContext(context);
    }

    public static ApplicationContext getApplicationContext() {
        return stub.getApplicationContext();
    }

    private static void setApplicationContext(ApplicationContext ctx) {
        stub.setApplicationContext(ctx);
    }

    public static ResourceMap getResourceMap(Class clazz) {
        return stub.getResourceMap(clazz);
    }

  //  private static ActionMap getActionMap(Object obj) {
  //      return stub.getActionMap(obj);
  //  }

   // private static SessionStorage getSessionStorage() {
  //      return stub.getSessionStorage();
  //  }

    /**
     *
     * @return
     */
    public static LocalStorage getLocalStorage() {
        return stub.getLocalStorage();
    }

    public static VelocityContext getVelocityContext() {
        return stub.getVelocityContext();
    }

    public static boolean isMac() {
        return stub.isMac();
    }

    public static boolean isWin() {
        return stub.isWin();
    }

    public static boolean isLinux() {
        return stub.isLinux();
    }

  //  private static String getVersion() {
   //     return stub.getVersion();
  //  }

  //  private static String getUserDirectory() {
  //      return stub.getLocation("base");
  //  }

    public static String getLocation(String loc) {
        return stub.getLocation(loc);
    }

 //   private static String getBaseDirectory() {
 //      return stub.getBaseDirectory();
 //   }

 //   private static String getSettingDirectory() {
  //     return stub.getSettingDirectory();
 //   }

    /**
     *
     * @return
     */
    public static String getPluginsDirectory() {
        return stub.getPluginsDirectory();
        //      return stub.getLocation("plugins");
    }

    public static String getPluginsTempDirectory() {
        return stub.getLocation("plugins");
    }

//    private static String getSecurityDirectory() {
   //     return stub.getSecurityDirectory();
  //  }

    public static String getLogDirectory() {
        return stub.getLogDirectory();
    }

    public static String getPDFDirectory() {
        return stub.getPDFDirectory();
    }

  //  public static String getUpdateURL() {
  //      return stub.getUpdateURL();
 //   }

    public static InputStream getTemplateAsStream(String name) {
        return stub.getTemplateAsStream(name);
    }

 //   private static URL getMenuBarResource() {
 //      return stub.getMenuBarResource();
  //  }

  //  private static URL getResource(String name) {
  //      return stub.getResource(name);
   // }

  //  private static URL getImageResource(String name) {
  //      return stub.getImageResource(name);
   // }

    /**
     *
     * @param name
     * @return
     */
    public static InputStream getResourceAsStream(String name) {
        return stub.getResourceAsStream(name);
    }

    /**
     *
     * @param name
     * @return
     */
    public static String getString(String name) {
        return stub.getString(name);
    }

 //   public static String[] getStringArray(String name) {
 //      return stub.getStringArray(name);
  //  }

   // public static boolean getBoolean(String name) {
   //     return stub.getBoolean(name);
   // }

   // public static boolean[] getBooleanArray(String name) {
  //      return stub.getBooleanArray(name);
  //  }

  //  public static int getInt(String name) {
 //       return stub.getInt(name);
   // }

    /**
     *
     * @param name
     * @return
     */
    public static int[] getIntArray(String name) {
        return stub.getIntArray(name);
    }

  //  public static long getLong(String name) {
   //     return stub.getLong(name);
  //  }

  //  public static long[] getLongArray(String name) {
   //     return stub.getLongArray(name);
   // }

    /**
     *
     * @param name
     * @return
     */
    public static Color getColor(String name) {
        return stub.getColor(name);
    }

    public static Color[] getColorArray(String name) {
        return stub.getColorArray(name);
    }

    /**
     *
     * @param name
     * @return
     */
    public static ImageIcon getImageIcon(String name) {
        return stub.getImageIcon(name);
    }

    public static String getFrameTitle(String name) {
        return stub.getFrameTitle(name);
    }

    public static Dimension getDimension(String name) {
        return stub.getDimension(name);
    }

    public static Class[] getClassArray(String name) {
        return stub.getClassArray(name);
    }

    public static Map<String, Color> getEventColorTable() {
        return stub.getEventColorTable();
    }

    public static NameValuePair[] getNameValuePair(String key) {
        return stub.getNameValuePair(key);
    }

    public static LicenseModel[] getLicenseModel() {
        return stub.getLicenseModel();
    }

    public static DepartmentModel[] getDepartmentModel() {
        return stub.getDepartmentModel();
    }

  //  private static DiagnosisOutcomeModel[] getDiagnosisOutcomeModel() {
  //      return stub.getDiagnosisOutcomeModel();
  //  }

   // private static DiagnosisCategoryModel[] getDiagnosisCategoryModel() {
   //     return stub.getDiagnosisCategoryModel();
  //  }
}
