/*
 This file is part of the software framework JStatCom, 
 a library for building applications for data based analysis.

 Copyright (C) 2000-2005  Markus Kraetzig

 This library is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as
 published by the Free Software Foundation; either version 2.1 of the
 License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 USA
 */

package com.jstatcom.engine.ox;

import java.io.File;

import com.jstatcom.engine.ConfigKeys;

/**
 * Contains all constants that can be changed for the the Ox environment. For
 * every key the respective information is stored in an instance of
 * ConfigHolder.
 * 
 * @author Markus Kraetzig 
 */
public abstract class OxConfigKeys extends ConfigKeys {

	/**
	 * The exact location of the graphics viewer. Only used if graphics files
	 * are to be shown with an external tool. Optional setting.
	 */
	public static final OxConfigKeys GRAPH_VIEWER = new OxConfigKeys(
			"GRAPH_VIEWER") {

		public String isValid(String value) {
			return null;
		}

		public String defaultVal() {
			return "gsview32";
		}
	};

	/**
	 * The exact location of the Ox dll that exports the functions needed to run
	 * Ox code. Mandatory setting.
	 */
	public static final OxConfigKeys OXDLL = new OxConfigKeys("OXDLL") {

		public String isValid(String value) {
			if (value == null || value.length() == 0)
				return toString() + " cannot be empty.";
			File oxdll = new File(value);
			if (!oxdll.isFile())
				return "Ox dll file \"" + oxdll.getAbsolutePath()
						+ "\" does not exist.";
			return null;
		}

		public String defaultVal() {
			return "oxwin.dll";
		}
	};

	/**
	 * OxConfigKeys constructor.
	 * 
	 * @param name
	 *            the name of the new constant
	 */
	OxConfigKeys(String name) {
		super(name);
	}
}
 

Ads help maintain this website.