-/*\r
- * Copyright (C) 2001, 2002 The Mir-coders group\r
- *\r
- * This file is part of Mir.\r
- *\r
- * Mir is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * Mir is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with Mir; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
- *\r
- * In addition, as a special exception, The Mir-coders gives permission to link\r
- * the code of this program with any library licensed under the Apache Software License,\r
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library\r
- * (or with modified versions of the above that use the same license as the above),\r
- * and distribute linked combinations including the two. You must obey the\r
- * GNU General Public License in all respects for all of the code used other than\r
- * the above mentioned libraries. If you modify this file, you may extend this\r
- * exception to your version of the file, but you are not obligated to do so.\r
- * If you do not wish to do so, delete this exception statement from your version.\r
- */\r
-package mircoders.localizer.basic;\r
-\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-\r
-import mir.media.MediaHandler;\r
-import mir.config.*;\r
-import mircoders.localizer.MirLocalizerExc;\r
-import mircoders.localizer.MirLocalizerFailure;\r
-import mircoders.localizer.MirMediaLocalizer;\r
-import mircoders.media.*;\r
-\r
-/**\r
- * <p>Title: </p>\r
- * <p>Description: </p>\r
- * <p>Copyright: Copyright (c) 2003</p>\r
- * <p>Company: </p>\r
- * @author not attributable\r
- * @version 1.0\r
- */\r
-\r
-public class MirBasicMediaLocalizer implements MirMediaLocalizer {\r
- private Map mediaHandlers;\r
-\r
- /**\r
- *\r
- * @throws MirLocalizerExc\r
- * @throws MirLocalizerFailure\r
- */\r
- public MirBasicMediaLocalizer() throws MirLocalizerExc, MirLocalizerFailure {\r
- MirPropertiesConfiguration configuration;\r
-\r
- try {\r
- configuration = MirPropertiesConfiguration.instance();\r
- }\r
- catch (Throwable t) {\r
- throw new MirLocalizerFailure("Can't get configuration", t);\r
- }\r
-\r
- mediaHandlers = new HashMap();\r
-\r
-\r
- registerMediaHandler("Audio", new MediaHandlerAudio());\r
- registerMediaHandler("Generic", new MediaHandlerGeneric());\r
- registerMediaHandler("ImagesExtern", new MediaHandlerImagesExtern());\r
- registerMediaHandler("ImagesJpeg", new MediaHandlerImagesJpeg());\r
- registerMediaHandler("ImagesPng", new MediaHandlerImagesPng());\r
- registerMediaHandler("Mp3", new MediaHandlerMp3());\r
- registerMediaHandler("Ogg", new MediaHandlerOgg());\r
- registerMediaHandler("RealAudio", new MediaHandlerRealAudio());\r
- registerMediaHandler("RealVideo", new MediaHandlerRealVideo());\r
- registerMediaHandler("Video", new MediaHandlerVideo());\r
-\r
- registerMediaHandler("VideoUrl", new URLMediaHandler(\r
- configuration.getString("Producer.Icon.BigVideo"),\r
- configuration.getString("Producer.Icon.TinyVideo"),\r
- "Video Url"));\r
-\r
- registerMediaHandler("AudioUrl", new URLMediaHandler(\r
- configuration.getString("Producer.Icon.BigAudio"),\r
- configuration.getString("Producer.Icon.TinyAudio"),\r
- "Audio Url"));\r
-\r
- registerMediaHandler("ImageUrl", new URLMediaHandler(\r
- configuration.getString("Producer.Icon.BigImage"),\r
- configuration.getString("Producer.Icon.TinyImage"),\r
- "Image Url"));\r
-\r
- registerMediaHandler("OtherUrl", new URLMediaHandler(\r
- configuration.getString("Producer.Icon.BigAudio"),\r
- configuration.getString("Producer.Icon.TinyAudio"),\r
- "Url"));\r
- }\r
-\r
- /** returns the {@link MediaHandler} associated with name <code>aName</code> by way of\r
- * an internal <code>Map</code>. This <code>Map</code> can be manipulated by calling\r
- * <code>registerMediaHandler</code> and <code>unregisterMediaHandler</code>\r
- */\r
- public MediaHandler getHandler(String aName) {\r
- synchronized (mediaHandlers) {\r
- return (MediaHandler) mediaHandlers.get(aName);\r
- }\r
- }\r
-\r
- /** adds a media handler to the registry */\r
- public void registerMediaHandler(String aName, MediaHandler aHandler) {\r
- synchronized (mediaHandlers) {\r
- mediaHandlers.put(aName, aHandler);\r
- }\r
- }\r
-\r
- /** removes a media handler from the registry*/\r
- public void unregisterMediaHandler(String aName) {\r
- synchronized (mediaHandlers) {\r
- mediaHandlers.remove(aName);\r
- }\r
- }\r
+/*
+ * Copyright (C) 2001, 2002 The Mir-coders group
+ *
+ * This file is part of Mir.
+ *
+ * Mir is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Mir 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Mir; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * In addition, as a special exception, The Mir-coders gives permission to link
+ * the code of this program with any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two. You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries. If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
+ */
+package mircoders.localizer.basic;
+
+import mir.config.MirPropertiesConfiguration;
+import mir.media.MediaHandler;
+import mircoders.localizer.MirLocalizerFailure;
+import mircoders.localizer.MirMediaLocalizer;
+import mircoders.media.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class MirBasicMediaLocalizer implements MirMediaLocalizer {
+ private final Map mediaHandlers = new HashMap();
+
+ public MirBasicMediaLocalizer() throws MirLocalizerFailure {
+ MirPropertiesConfiguration configuration;
+
+ try {
+ configuration = MirPropertiesConfiguration.instance();
+ }
+ catch (Throwable t) {
+ throw new MirLocalizerFailure("Can't get configuration", t);
+ }
+
+ registerMediaHandler("Audio", new MediaHandlerAudio());
+ registerMediaHandler("Generic", new MediaHandlerGeneric());
+ registerMediaHandler("ImagesExtern", new MediaHandlerImagesExtern());
+ registerMediaHandler("ImagesExternScaling", new MediaHandlerImagesExternScaling());
+ registerMediaHandler("ImagesJpeg", new MediaHandlerImagesJpeg());
+ registerMediaHandler("ImagesPng", new MediaHandlerImagesPng());
+ registerMediaHandler("Mp3", new MediaHandlerMp3());
+ registerMediaHandler("Ogg", new MediaHandlerOgg());
+ registerMediaHandler("RealAudio", new MediaHandlerRealAudio());
+ registerMediaHandler("RealVideo", new MediaHandlerRealVideo());
+ registerMediaHandler("Video", new MediaHandlerVideo());
+
+ registerMediaHandler("VideoUrl", new URLMediaHandler(
+ configuration.getString("Producer.Icon.BigVideo"),
+ configuration.getString("Producer.Icon.TinyVideo"),
+ "Video Url"));
+
+ registerMediaHandler("AudioUrl", new URLMediaHandler(
+ configuration.getString("Producer.Icon.BigAudio"),
+ configuration.getString("Producer.Icon.TinyAudio"),
+ "Audio Url"));
+
+ registerMediaHandler("ImageUrl", new URLMediaHandler(
+ configuration.getString("Producer.Icon.BigImage"),
+ configuration.getString("Producer.Icon.TinyImage"),
+ "Image Url"));
+
+ registerMediaHandler("OtherUrl", new URLMediaHandler(
+ configuration.getString("Producer.Icon.BigAudio"),
+ configuration.getString("Producer.Icon.TinyAudio"),
+ "Url"));
+ }
+
+ /** returns the {@link MediaHandler} associated with name <code>aName</code> by way of
+ * an internal <code>Map</code>. This <code>Map</code> can be manipulated by calling
+ * <code>registerMediaHandler</code> and <code>unregisterMediaHandler</code>
+ */
+ public MediaHandler getHandler(String aName) {
+ synchronized (mediaHandlers) {
+ return (MediaHandler) mediaHandlers.get(aName);
+ }
+ }
+
+ /** adds a media handler to the registry */
+ public void registerMediaHandler(String aName, MediaHandler aHandler) {
+ synchronized (mediaHandlers) {
+ mediaHandlers.put(aName, aHandler);
+ }
+ }
+
+ /** removes a media handler from the registry*/
+ public void unregisterMediaHandler(String aName) {
+ synchronized (mediaHandlers) {
+ mediaHandlers.remove(aName);
+ }
+ }
}
\ No newline at end of file