From d1e9b04c7997135fba4aa5a7d29afb342e1a0e37 Mon Sep 17 00:00:00 2001 From: endolf Date: Thu, 16 Jun 2005 16:32:59 +0000 Subject: If the default plugin is not in the classpath, an exception gets thrown. This should only happen if it's also not in the plugins directory. git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@100 e343933a-64c8-49c5-92b1-88f2ce3e89e8 --- .../net/java/games/input/DefaultControllerEnvironment.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java b/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java index 92b9673..3ef7903 100644 --- a/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java +++ b/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java @@ -118,11 +118,11 @@ class DefaultControllerEnvironment extends ControllerEnvironment { if(!System.getProperty("jinput.useDefaultPlugin", "true").toLowerCase().trim().equals("false") && !System.getProperty("net.java.games.input.useDefaultPlugin", "true").toLowerCase().trim().equals("false")) { String osName = System.getProperty("os.name", "").trim(); if(osName.equals("Linux")) { - pluginClasses = pluginClasses + "net.java.games.input.LinuxEnvironmentPlugin"; + pluginClasses = pluginClasses + " net.java.games.input.LinuxEnvironmentPlugin"; } else if(osName.equals("Mac OS X")) { - pluginClasses = pluginClasses + "net.java.games.input.OSXEnvironmentPlugin"; + pluginClasses = pluginClasses + " net.java.games.input.OSXEnvironmentPlugin"; } else if(osName.equals("Windows 98") || osName.equals("Windows 2000") || osName.equals("Windows XP")) { - pluginClasses = pluginClasses + "net.java.games.input.DirectInputEnvironmentPlugin"; + pluginClasses = pluginClasses + " net.java.games.input.DirectInputEnvironmentPlugin"; } else { System.out.println("Trying to use default plugin, OS name " + osName +" not recognised"); } @@ -133,8 +133,8 @@ class DefaultControllerEnvironment extends ControllerEnvironment { while(pluginClassTok.hasMoreTokens()) { String className = pluginClassTok.nextToken(); try { - Class ceClass = Class.forName(className); - if(!loadedPlugins.contains(ceClass)) { + if(!loadedPlugins.contains(className)) { + Class ceClass = Class.forName(className); ControllerEnvironment ce = (ControllerEnvironment) ceClass.newInstance(); addControllers(ce.getControllers()); } @@ -226,7 +226,7 @@ class DefaultControllerEnvironment extends ControllerEnvironment { ControllerEnvironment ce = (ControllerEnvironment) envClasses[i].newInstance(); addControllers(ce.getControllers()); - loadedPlugins.add(ce.getClass()); + loadedPlugins.add(ce.getClass().getName()); } catch (Exception e) { e.printStackTrace(); } -- cgit v1.2.3