org.jdesktop.wonderland.client.jme.artimport
Class LoaderManager

java.lang.Object
  extended by org.jdesktop.wonderland.client.jme.artimport.LoaderManager

public class LoaderManager
extends java.lang.Object

Manage the various loaders available to the system

Author:
paulby

Method Summary
 void activateLoader(ModelLoaderFactory loader)
          Activate a particular loader, and deactivate any loader that was previously registered for the same file type
 void addLoaderListener(LoaderListener listener)
          Add a LoaderListener
 void deactivateLoader(ModelLoaderFactory loader)
          Deactivate a particular loader.
 ModelLoader getLoader(DeployedModel model)
           
 ModelLoader getLoader(java.lang.String fileextension)
           
 ModelLoader getLoader(java.net.URL url)
           
 java.lang.String[] getLoaderExtensions()
          Return the set of file extensions that can be loaded
 DeployedModel getLoaderFromDeployment(java.net.URL url)
          Load the specified deployment file (.dep) and return the DeployedModel object which includes the model loader.
 java.util.Collection<LoaderListener> getLoaderListeners()
          Return the collection of listeners.
static LoaderManager getLoaderManager()
           
 void registerLoader(ModelLoaderFactory loader)
          Register the supplied loader with the system.
 boolean removeLoaderListener(LoaderListener listener)
          Remove the supplied LoaderListener.
 void unregisterLoader(ModelLoaderFactory loader)
          Unregister a loader from the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLoaderManager

public static LoaderManager getLoaderManager()

registerLoader

public void registerLoader(ModelLoaderFactory loader)
Register the supplied loader with the system. Loaders must be separately activated to start working.

Parameters:
loader - the loader to register

unregisterLoader

public void unregisterLoader(ModelLoaderFactory loader)
Unregister a loader from the system. If the loader is active, it will also be deactivated.

Parameters:
loader - the loader to unregister

activateLoader

public void activateLoader(ModelLoaderFactory loader)
Activate a particular loader, and deactivate any loader that was previously registered for the same file type

Parameters:
loader - the loader to activate

deactivateLoader

public void deactivateLoader(ModelLoaderFactory loader)
Deactivate a particular loader.

Parameters:
loader - the loader to deactivate

getLoader

public ModelLoader getLoader(java.net.URL url)

getLoader

public ModelLoader getLoader(DeployedModel model)

getLoader

public ModelLoader getLoader(java.lang.String fileextension)

getLoaderFromDeployment

public DeployedModel getLoaderFromDeployment(java.net.URL url)
                                      throws java.io.IOException
Load the specified deployment file (.dep) and return the DeployedModel object which includes the model loader.

Parameters:
url - url of .dep file
Returns:
DeployedModel, or null
Throws:
java.io.IOException

getLoaderExtensions

public java.lang.String[] getLoaderExtensions()
Return the set of file extensions that can be loaded

Returns:

addLoaderListener

public void addLoaderListener(LoaderListener listener)
Add a LoaderListener

Parameters:
listener -

removeLoaderListener

public boolean removeLoaderListener(LoaderListener listener)
Remove the supplied LoaderListener. Return false if the listener was not actually present in the list of listeners, true if it was.

Parameters:
listener -
Returns:

getLoaderListeners

public java.util.Collection<LoaderListener> getLoaderListeners()
Return the collection of listeners. The collection is a clone of the internal structure, so this call is thread safe.

Returns:


Open Wonderland - http://openwonderland.org