diff options
author | endolf <[email protected]> | 2005-06-16 16:32:59 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2005-06-16 16:32:59 +0000 |
commit | d1e9b04c7997135fba4aa5a7d29afb342e1a0e37 (patch) | |
tree | 627f8995f3617d16426c952efb7bc8cd12f6b52b | |
parent | ff30372cd6ad1943cd1b3772391c4ddf11deff74 (diff) |
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
-rw-r--r-- | coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java | 12 |
1 files 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(); } |