001: /*
002: * @(#) $Header: /cvs/jai-operators/src/main/ca/forklabs/media/jai/opimage/Resources.java,v 1.3 2007/06/05 20:27:19 forklabs Exp $
003: *
004: * Copyright (C) 2007 Forklabs Daniel Léonard
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
019: */
020:
021: package ca.forklabs.media.jai.opimage;
022:
023: import java.text.MessageFormat;
024: import java.util.ResourceBundle;
025:
026: /**
027: * Class {@code Resources} is the default bundle for the resources used by
028: * classes in the {@link ca.forklabs.media.jai.operator} package.
029: *
030: * @author <a href="mailto:forklabs at dev.java.net?subject=ca.forklabs.media.jai.opimage.Resources">Daniel Léonard</a>
031: * @version $Revision: 1.3 $
032: */
033: @SuppressWarnings("nls")
034: class Resources {
035: // TODO : with many packages, merge all the resource files together ?
036: //---------------------------
037: // Class variables
038: //---------------------------
039:
040: /** Key for the message saying that the data type is unknown. */
041: public static final String UNKNOWN_DATA_TYPE = "unknown.data.type";
042: /** Key for the message saying that the data nature is unknown. */
043: public static final String UNKNOWN_DATA_NATURE = "unknown.data.nature";
044: /** Key for the message saying that the image is neither a rendered nor a renderable image. */
045: public static final String NEITHER_RENDERED_NOR_RENDERABLE = "neither.rendered.nor.renderable";
046:
047: /** Key for the message saying that the data type is neither float nor double. */
048: public static final String DFT3D_BAD_DATA_TYPE = "dft3d.bad.data.type";
049:
050: //---------------------------
051: // Constructor
052: //---------------------------
053:
054: /**
055: * Let no one instanciate this class.
056: */
057: private Resources() {
058: // nothing
059: }
060:
061: //---------------------------
062: // Class method
063: //---------------------------
064:
065: /**
066: * Gets the resource bundle itself.
067: * @return the resource bundle.
068: */
069: public static ResourceBundle getResourceBundle() {
070: String name = Resources.class.getName();
071: ResourceBundle bundle = ResourceBundle.getBundle(name);
072: return bundle;
073: }
074:
075: /**
076: * Gets and formats the specified localized string from the menu resource
077: * bundle.
078: * @param key the key.
079: * @param arguments the arguments to format the string.
080: * @return the value.
081: */
082: public static String getLocalizedString(String key,
083: Object... arguments) {
084: ResourceBundle bundle = Resources.getResourceBundle();
085: String pattern = bundle.getString(key);
086: String message = MessageFormat.format(pattern, arguments);
087: return message;
088: }
089:
090: }
091:
092: /*
093: * $Log: Resources.java,v $
094: * Revision 1.3 2007/06/05 20:27:19 forklabs
095: * Resources for periodicshift3d.
096: *
097: * Revision 1.2 2007/06/05 02:34:15 forklabs
098: * Operators dft3d and idft3d
099: *
100: * Revision 1.1 2007/05/03 18:32:29 forklabs
101: * Initial commit for the unaryfunction operator.
102: *
103: */
|