|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jreality.ui.viewerapp.ViewerApp
public class ViewerApp
Factory class for jReality Viewer applications, which display a JrScene
.
The scene is created from a given SceneGraphComponent or geometry, an existing scene graph or JrScene.
There are several constructors for this purpose.
Note that when using the default JrScene, some tools may already be included in the scene.
To avoid this use the appropriate constructors or static methods.
The application's properties can be set the following way:
Editing the ViewerApp's default menu can be achieved via the appropriate menu methods:
ViewerApp va = new ViewerApp(...);
va.setAttachNavigator(true);
va.setExternalNavigator(false);
va.setAttachBeanShell(false);
va.setCreateMenu(true);
va.setShowMenu(false);
[setting more properties]
After setting properties always call
ViewerAppMenu menu = va.getMenu();
menu.removeMenu(ViewerAppMenu.APP_MENU);
menu.addAction(ViewerAppMenu.FILE_MENU, action);
[...]
update()
!
To display the scene call display()
.
There are static methods to display a geometry or an existing scene graph easily.
To create your own viewer application use the factory to set up the viewer and additional features
and extract needed components for use in a different context.
Field Summary | |
---|---|
static Color[] |
defaultBackgroundColor
|
Constructor Summary | |
---|---|
ViewerApp(JrScene scene)
Use this constructor to display an existing JrScene. |
|
ViewerApp(SceneGraphComponent root,
SceneGraphPath cameraPath,
SceneGraphPath emptyPick,
SceneGraphPath avatar)
Use this constructor to display an existing scene graph by creating a new JrScene with given parameters. |
|
ViewerApp(SceneGraphNode node)
Use this constructor to display a SceneGraphComponent or Geometry using the ViewerApp's default JrScene. Note that the default scene already includes some standard tools. |
|
ViewerApp(Viewer[] vs)
|
Method Summary | |
---|---|
void |
addAccessory(Component c)
|
void |
addAccessory(Component c,
String title)
|
void |
addAccessory(Component c,
String title,
boolean scrolling)
|
JFrame |
display()
Display the scene in a JFrame. |
static ViewerApp |
display(SceneGraphComponent root,
SceneGraphPath cameraPath,
SceneGraphPath emptyPick,
SceneGraphPath avatar)
Displays an existing scene graph by creating a new JrScene with given parameters. |
static ViewerApp |
display(SceneGraphNode node)
Displays a specified SceneGraphComponent or Geometry using the jReality viewer and the ViewerApp's default JrScene. |
void |
dispose()
|
Component |
getBeanShell()
Get the bean shell. |
Component |
getComponent()
Deprecated. renamed to getContent() |
Component |
getContent()
Get the ViewerApp frame's content. |
Viewer |
getCurrentViewer()
It's useful to get a hold of the active backend. |
JFrame |
getFrame()
Get current frame displaying the scene. |
JrScene |
getJrScene()
Get the scene displayed. |
ViewerAppMenu |
getMenu()
Use this method to edit the ViewerApp's menu bar (add/remove menus, add/remove items or actions to special menus). |
Component |
getNavigator()
Get the navigator. |
Component |
getNavigatorWithAccessories()
Add accessory components as tabs to navigator component. |
SceneGraphComponent |
getSceneRoot()
Get the scene's root node. |
SelectionManagerInterface |
getSelectionManager()
Get the SelectionManager managing selections in the ViewerApp. |
ToolSystem |
getToolSystem()
|
Viewer |
getViewer()
Deprecated. Use getViewerSwitch() getCurrentViewer() . |
ViewerSwitch |
getViewerSwitch()
|
Component |
getViewingComponent()
Get the viewing component only. |
boolean |
isAttachBeanShell()
Returns true iff a bean shell is attached to the viewer. |
boolean |
isAttachNavigator()
Returns true iff a navigator is attached to the viewer. |
boolean |
isCreateMenu()
|
boolean |
isExternalBeanShell()
|
boolean |
isExternalNavigator()
|
boolean |
isIncludeMenu()
Deprecated. renamed into isCreateMenu() |
boolean |
isShowMenu()
|
static void |
main(String[] args)
|
void |
removeAccessory(Component c)
|
void |
setAttachBeanShell(boolean b)
Use to attach a bean shell to the viewer. |
void |
setAttachNavigator(boolean b)
Use to attach a navigator (sceneTree and inspector) to the viewer. |
void |
setBackgroundColor(Color... colors)
Sets the scene root's background color. |
void |
setCreateMenu(boolean b)
Specify whether to create a menu bar for the ViewerApp's frame. |
void |
setExternalBeanShell(boolean externalBeanShell)
Specify whether to display the bean shell in the viewerApp's frame or in an external frame. |
void |
setExternalNavigator(boolean externalNavigator)
Specify whether to display the navigator in the viewerApp's frame or in an external frame. |
void |
setFirstAccessory(Component c)
|
void |
setIncludeMenu(boolean b)
Deprecated. renamed into setCreateMenu(boolean) |
void |
setShowMenu(boolean b)
Specify whether to show or to hide the ViewerApp's menu bar. |
void |
showExternalBeanShell(boolean show)
|
void |
showExternalNavigator(boolean show)
|
void |
update()
Update the viewer application factory. Needs to be invoked before calling display, menu or getter methods. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Color[] defaultBackgroundColor
Constructor Detail |
---|
public ViewerApp(SceneGraphNode node)
node
- the SceneGraphNode (SceneGraphComponent or Geometry) to be displayed with the viewerpublic ViewerApp(SceneGraphComponent root, SceneGraphPath cameraPath, SceneGraphPath emptyPick, SceneGraphPath avatar)
root
- the scene's rootcameraPath
- the scene's camera pathemptyPick
- the scene's empty pick pathavatar
- the scene's avatar pathpublic ViewerApp(JrScene scene)
scene
- the scene to be displayed with the viewerpublic ViewerApp(Viewer[] vs)
Method Detail |
---|
public static void main(String[] args) throws IOException
IOException
public JFrame display()
public static ViewerApp display(SceneGraphNode node)
node
- the SceneGraphNode (SceneGraphComponent or Geometry) to be displayed in the viewer
public static ViewerApp display(SceneGraphComponent root, SceneGraphPath cameraPath, SceneGraphPath emptyPick, SceneGraphPath avatar)
root
- the scene's rootcameraPath
- the scene's camera pathemptyPick
- the scene's empty pick pathavatar
- the scene's avatar path
public void update()
public void showExternalNavigator(boolean show)
public void showExternalBeanShell(boolean show)
public void setAttachNavigator(boolean b)
b
- true iff navigator is to be attachedpublic void setAttachBeanShell(boolean b)
b
- true iff bean shell is to be attachedpublic JFrame getFrame()
public Component getComponent()
getContent()
public Component getContent()
getViewingComponent()
public SelectionManagerInterface getSelectionManager()
public Component getNavigator()
public Component getBeanShell()
public Component getNavigatorWithAccessories()
addAccessory(Component, String)
public Viewer getViewer()
getViewerSwitch()
getCurrentViewer()
.
getViewerSwitch()
.public Viewer getCurrentViewer()
public ViewerSwitch getViewerSwitch()
public ToolSystem getToolSystem()
public Component getViewingComponent()
getContent()
public JrScene getJrScene()
public SceneGraphComponent getSceneRoot()
public boolean isAttachBeanShell()
public boolean isAttachNavigator()
public void setIncludeMenu(boolean b)
setCreateMenu(boolean)
public boolean isIncludeMenu()
isCreateMenu()
public void setCreateMenu(boolean b)
b
- true iff menu is to be createdsetShowMenu(boolean)
public boolean isCreateMenu()
public void setShowMenu(boolean b)
b
- true iff menu bar is to be shownsetCreateMenu(boolean)
public boolean isShowMenu()
public ViewerAppMenu getMenu()
public void addAccessory(Component c)
public void addAccessory(Component c, String title)
public void addAccessory(Component c, String title, boolean scrolling)
public void setFirstAccessory(Component c)
public void removeAccessory(Component c)
public boolean isExternalNavigator()
public void setExternalNavigator(boolean externalNavigator)
externalBeanShell
- true iff navigator is to be displayed in an external framepublic boolean isExternalBeanShell()
public void setExternalBeanShell(boolean externalBeanShell)
externalBeanShell
- true iff bean shell is to be displayed in an external framepublic void setBackgroundColor(Color... colors)
colors
- list of colors with length = 1 or 4public void dispose()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |