de.jreality.plugin.experimental
Class ManagedContent

java.lang.Object
  extended by Plugin
      extended by de.jreality.plugin.experimental.ManagedContent

public class ManagedContent
extends Plugin

A managed content that handles its content with a context map.

Author:
Stefan Sechelmann

Nested Class Summary
static class ManagedContent.ContentAdapter
           
static interface ManagedContent.ContentListener
           
 
Constructor Summary
ManagedContent()
           
 
Method Summary
 void addContent(Class<?> context, SceneGraphComponent c)
          Adds a component to the scene graph under the given context.
 boolean addContentListener(ManagedContent.ContentListener l)
           
 void addContentUnique(Class<?> context, SceneGraphComponent c)
          Adds a component to the scene graph if it is not already a child of the context root.
 void addTool(Class<?> context, Tool tool)
          Adds a tool to the given context root
 void addToolUnique(Class<?> context, Tool tool)
          Adds a tool to the given context root if it is not already a child of the context root
 void clearContent()
          Removes all content components of all contexts
 SceneGraphComponent getContextRoot(Class<?> context)
           
 PluginInfo getPluginInfo()
           
 void install(Controller c)
           
 void removeAll(Class<?> context)
          Removes all content components of a given context
 void removeAllContentListener()
           
 void removeContent(Class<?> context, SceneGraphComponent c)
          Removes a scene component from the scene graph and the given context
 boolean removeContentListener(ManagedContent.ContentListener l)
           
 void removeTool(Class<?> context, Tool tool)
          Removes a tool from the scene graph at the given context root.
 void setContent(Class<?> context, SceneGraphComponent c)
          Sets a content for a given context class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedContent

public ManagedContent()
Method Detail

getContextRoot

public SceneGraphComponent getContextRoot(Class<?> context)

setContent

public void setContent(Class<?> context,
                       SceneGraphComponent c)
Sets a content for a given context class. This is equivalent to first invoking removeAll(context) and then addContent(context, c);

Parameters:
context -
c -

addContent

public void addContent(Class<?> context,
                       SceneGraphComponent c)
Adds a component to the scene graph under the given context.

Parameters:
context -
c -

addContentUnique

public void addContentUnique(Class<?> context,
                             SceneGraphComponent c)
Adds a component to the scene graph if it is not already a child of the context root.

Parameters:
context -
c -

removeContent

public void removeContent(Class<?> context,
                          SceneGraphComponent c)
Removes a scene component from the scene graph and the given context

Parameters:
context -
c -

removeAll

public void removeAll(Class<?> context)
Removes all content components of a given context

Parameters:
context -

clearContent

public void clearContent()
Removes all content components of all contexts


addTool

public void addTool(Class<?> context,
                    Tool tool)
Adds a tool to the given context root

Parameters:
context -
tool -

addToolUnique

public void addToolUnique(Class<?> context,
                          Tool tool)
Adds a tool to the given context root if it is not already a child of the context root

Parameters:
context -
tool -

removeTool

public void removeTool(Class<?> context,
                       Tool tool)
Removes a tool from the scene graph at the given context root.

Parameters:
context -
tool -

getPluginInfo

public PluginInfo getPluginInfo()

install

public void install(Controller c)
             throws Exception
Throws:
Exception

addContentListener

public boolean addContentListener(ManagedContent.ContentListener l)

removeContentListener

public boolean removeContentListener(ManagedContent.ContentListener l)

removeAllContentListener

public void removeAllContentListener()