de.jreality.plugin
Class JRViewer

java.lang.Object
  extended by de.jreality.plugin.JRViewer

public class JRViewer
extends Object


Nested Class Summary
static class JRViewer.ContentType
           
 
Constructor Summary
JRViewer()
          Create a JRViewer with default scene and lights.
JRViewer(boolean addLights)
          Create a JRViewer with default scene.
JRViewer(JrScene s)
          create a JRViewer with a custom scene.
 
Method Summary
 void addAudioSupport()
          Audio plug-ins.
 void addBasicUI()
          Basic UI support like scene graph inspector, bean shell, background color, export menu, camera settings menu...
 void addContentSupport(JRViewer.ContentType type)
          Registers one of the predefined content plug-ins
 void addContentUI()
          Registers advanced content tools.
 void addVRSupport()
          Virtual reality support.
static Viewer display(SceneGraphNode node)
          Quick display method with encompass
 void encompassEuclidean()
          Call after startup.
 SimpleController getController()
          Returns the controller of this JRViewer which is a SimpleController
static JRViewer getLastJRViewer()
          Returns the last created instance of JRViewer
<T extends Plugin>
T
getPlugin(Class<T> clazz)
          Returns a previously registered plug in instance
static void main(String[] args)
          Starts the default plug-in viewer
 void registerCustomContent(Content contentPlugin)
          Registers a custom Content plug-in which is an implementation of the abstract class Content
 void registerPlugin(Plugin p)
          Adds a plug-in to this JTViewer's registered plug-ins.
 void registerPlugins(Set<Plugin> pSet)
          Registered a set of plug-ins at once
 void setContent(SceneGraphNode node)
          Sets a content node.
 void setPropertiesFile(File file)
          Sets the properties File of this JRViewer's controller
 void setPropertiesFile(String filename)
          Sets the properties File of this JRViewer's controller
 void setPropertiesInputStream(InputStream in)
          Sets the properties InputStream of this JRViewer's controller
 void setShowMenuBar(boolean show)
          Show or hide the menu bar
 void setShowPanelSlots(boolean left, boolean right, boolean top, boolean bottom)
          Configures the visibility of the shrink panels slots
 void setShowToolBar(boolean show)
          Show or hide the tool bar
 void startup()
          Starts this JRViewer's controller and installs all registered plug-ins.
 JRootPane startupLocal()
          Starts this JRViewer's controller and installs all registered plug-ins.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRViewer

public JRViewer()
Create a JRViewer with default scene and lights.


JRViewer

public JRViewer(boolean addLights)
Create a JRViewer with default scene. Flag indicates whether to add the standard lights (plugin Lights) or not.

Parameters:
addLights - if true, standard lights are added.

JRViewer

public JRViewer(JrScene s)
create a JRViewer with a custom scene.

Parameters:
s - the scene
Method Detail

getLastJRViewer

public static JRViewer getLastJRViewer()
Returns the last created instance of JRViewer

Returns:
a JRViewer or null

registerPlugin

public void registerPlugin(Plugin p)
Adds a plug-in to this JTViewer's registered plug-ins. The viewer application is then assembled on startup by these plug-ins.

Parameters:
p -

registerPlugins

public void registerPlugins(Set<Plugin> pSet)
Registered a set of plug-ins at once

Parameters:
pSet - a set of plug-ins

getPlugin

public <T extends Plugin> T getPlugin(Class<T> clazz)
Returns a previously registered plug in instance

Type Parameters:
T -
Parameters:
clazz - the class of the plug-in
Returns:
a plug-in instance or null if no such plug-in was registered

setContent

public void setContent(SceneGraphNode node)
Sets a content node. The content node will be added to the scene graph on startup

Parameters:
node -

setPropertiesFile

public void setPropertiesFile(String filename)
Sets the properties File of this JRViewer's controller

Parameters:
filename - a file name

setPropertiesFile

public void setPropertiesFile(File file)
Sets the properties File of this JRViewer's controller

Parameters:
filename - a file name

setPropertiesInputStream

public void setPropertiesInputStream(InputStream in)
Sets the properties InputStream of this JRViewer's controller

Parameters:
in - An InputStream

getController

public SimpleController getController()
Returns the controller of this JRViewer which is a SimpleController

Returns:
the SimpleController

startup

public void startup()
Starts this JRViewer's controller and installs all registered plug-ins. Not registered but dependent plug-ins will be added automatically.


startupLocal

public JRootPane startupLocal()
Starts this JRViewer's controller and installs all registered plug-ins. Not registered but dependent plug-ins will be added automatically. This method does not open the main window. Instead it returns the root pane.

Returns:

setShowPanelSlots

public void setShowPanelSlots(boolean left,
                              boolean right,
                              boolean top,
                              boolean bottom)
Configures the visibility of the shrink panels slots

Parameters:
left -
right -
top -
bottom -

setShowMenuBar

public void setShowMenuBar(boolean show)
Show or hide the menu bar

Parameters:
show -

setShowToolBar

public void setShowToolBar(boolean show)
Show or hide the tool bar

Parameters:
show -

registerCustomContent

public void registerCustomContent(Content contentPlugin)
Registers a custom Content plug-in which is an implementation of the abstract class Content

Parameters:
contentPlugin - a content plug-in

addContentSupport

public void addContentSupport(JRViewer.ContentType type)
Registers one of the predefined content plug-ins

Parameters:
type - a content enumeration type

addContentUI

public void addContentUI()
Registers advanced content tools. Includes an appearance inspector, transformation tools, and file loaders


addBasicUI

public void addBasicUI()
Basic UI support like scene graph inspector, bean shell, background color, export menu, camera settings menu...


addVRSupport

public void addVRSupport()
Virtual reality support. A sky box and environment map, a terrain and a movable avatar


addAudioSupport

public void addAudioSupport()
Audio plug-ins. An options panel and audio preferences.


display

public static Viewer display(SceneGraphNode node)
Quick display method with encompass

Parameters:
node -

encompassEuclidean

public void encompassEuclidean()
Call after startup. Encompasses the view


main

public static void main(String[] args)
Starts the default plug-in viewer

Parameters:
args - no arguments are read