de.jreality.ui.viewerapp
Class ViewerAppMenu

java.lang.Object
  extended by de.jreality.ui.viewerapp.ViewerAppMenu

public class ViewerAppMenu
extends java.lang.Object

Creates the viewerApp's menu bar and contains static fields for names of menus and actions.

Author:
msommer

Field Summary
static java.lang.String ADD_TOOL
           
static java.lang.String APPEARANCE
           
static java.lang.String ASSIGN_FACE_AABBTREE
           
static java.lang.String CAMERA_MENU
          Deprecated. removed from menu
static java.lang.String CREATE_APPEARANCE
           
static java.lang.String DECREASE_EYE_SEPARATION
           
static java.lang.String DECREASE_FIELD_OF_VIEW
           
static java.lang.String DECREASE_FOCUS
           
static java.lang.String EDIT_MENU
           
static java.lang.String EXPORT
           
static java.lang.String EXPORT_OBJ
           
static java.lang.String FILE_MENU
           
static java.lang.String GEOMETRY
           
static java.lang.String INCREASE_EYE_SEPARATION
           
static java.lang.String INCREASE_FIELD_OF_VIEW
           
static java.lang.String INCREASE_FOCUS
           
static java.lang.String LOAD_CAMERA_PREFERENCES
           
static java.lang.String LOAD_FILE
           
static java.lang.String LOAD_FILE_MERGED
           
static java.lang.String LOAD_FILE_TO_NODE
           
static java.lang.String LOAD_REFLECTIONMAP
           
static java.lang.String LOAD_SCENE
           
static java.lang.String LOAD_SKYBOX
           
static java.lang.String LOAD_TEXTURE
           
static java.lang.String MAXIMIZE
           
static java.lang.String QUIT
           
static java.lang.String REFLECTIONMAP
           
static java.lang.String REMOVE
           
static java.lang.String RENAME
           
static java.lang.String RESTORE
           
static java.lang.String ROTATE_REFLECTIONMAP_SIDES
           
static java.lang.String ROTATE_SKYBOX_SIDES
           
static java.lang.String SAVE_CAMERA_PREFERENCES
           
static java.lang.String SAVE_SCENE
           
static java.lang.String SAVE_SELECTED
           
static java.lang.String SET_BACKGROUND_COLOR
           
static java.lang.String SET_VIEWER_SIZE
           
static java.lang.String SKYBOX
           
static java.lang.String TOGGLE_BEANSHELL
           
static java.lang.String TOGGLE_CURSOR
           
static java.lang.String TOGGLE_EDGE_DRAWING
           
static java.lang.String TOGGLE_EXTERNAL_BEANSHELL
           
static java.lang.String TOGGLE_EXTERNAL_NAVIGATOR
           
static java.lang.String TOGGLE_FACE_DRAWING
           
static java.lang.String TOGGLE_MENU
           
static java.lang.String TOGGLE_NAVIGATOR
           
static java.lang.String TOGGLE_PERSPECTIVE
           
static java.lang.String TOGGLE_PICKABLE
           
static java.lang.String TOGGLE_RENDER_SELECTION
           
static java.lang.String TOGGLE_STEREO
           
static java.lang.String TOGGLE_VERTEX_DRAWING
           
static java.lang.String TOGGLE_VIEWER_FULL_SCREEN
           
static java.lang.String TOGGLE_VISIBILITY
           
static java.lang.String VIEW_MENU
           
 
Method Summary
 boolean addAction(javax.swing.Action a, java.lang.String menuName)
          Add an action to the end of the menu with the specified name.
 boolean addAction(javax.swing.Action a, java.lang.String menuName, int index)
          Add an action to the menu with the specified name at the specified index.
 void addMenu(javax.swing.JMenu menu)
          Add a menu to the end of the menu bar.
 void addMenu(javax.swing.JMenu menu, int index)
          Add a menu to the menu bar at the specified index.
 boolean addMenuItem(javax.swing.JMenuItem item, java.lang.String menuName)
          Add a menu item to the end of the menu with the specified name.
 boolean addMenuItem(javax.swing.JMenuItem item, java.lang.String menuName, int index)
          Add a menu item to the menu with the specified name at the specified index.
 boolean addSeparator(java.lang.String menuName)
          Add a separator to the end of the menu with the specified name.
 boolean addSeparator(java.lang.String menuName, int index)
          Add a separator to the menu with the specified name at the specified index.
 javax.swing.JMenu getMenu(java.lang.String menuName)
          Get a menu specified by its name.
 javax.swing.JMenuBar getMenuBar()
          Get the menu bar.
 boolean isShowMenuBar()
           
 boolean removeMenu(java.lang.String menuName)
          Remove the menu with the specified name.
 boolean removeMenuItem(java.lang.String menuName, int index)
          Remove the menu item at given position of the menu with the specified name.
 void showMenu(java.lang.String menuName, boolean show)
          Show or hide the menu with the specified name.
 void showMenuBar(boolean show)
          Show or hide the menu bar.
When hiding the menu bar, the visibility of all contained menus is set to false (defined keystrokes for actions are still working then).
 void update()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_MENU

public static java.lang.String FILE_MENU

EDIT_MENU

public static java.lang.String EDIT_MENU

CAMERA_MENU

public static java.lang.String CAMERA_MENU
Deprecated. removed from menu

VIEW_MENU

public static java.lang.String VIEW_MENU

LOAD_FILE

public static java.lang.String LOAD_FILE

LOAD_FILE_MERGED

public static java.lang.String LOAD_FILE_MERGED

LOAD_SCENE

public static java.lang.String LOAD_SCENE

SAVE_SCENE

public static java.lang.String SAVE_SCENE

EXPORT

public static java.lang.String EXPORT

QUIT

public static java.lang.String QUIT

SAVE_SELECTED

public static java.lang.String SAVE_SELECTED

LOAD_FILE_TO_NODE

public static java.lang.String LOAD_FILE_TO_NODE

REMOVE

public static java.lang.String REMOVE

RENAME

public static java.lang.String RENAME

TOGGLE_VISIBILITY

public static java.lang.String TOGGLE_VISIBILITY

ASSIGN_FACE_AABBTREE

public static java.lang.String ASSIGN_FACE_AABBTREE

APPEARANCE

public static java.lang.String APPEARANCE

CREATE_APPEARANCE

public static java.lang.String CREATE_APPEARANCE

TOGGLE_VERTEX_DRAWING

public static java.lang.String TOGGLE_VERTEX_DRAWING

TOGGLE_EDGE_DRAWING

public static java.lang.String TOGGLE_EDGE_DRAWING

TOGGLE_FACE_DRAWING

public static java.lang.String TOGGLE_FACE_DRAWING

LOAD_TEXTURE

public static java.lang.String LOAD_TEXTURE

REFLECTIONMAP

public static java.lang.String REFLECTIONMAP

LOAD_REFLECTIONMAP

public static java.lang.String LOAD_REFLECTIONMAP

ROTATE_REFLECTIONMAP_SIDES

public static java.lang.String ROTATE_REFLECTIONMAP_SIDES

GEOMETRY

public static java.lang.String GEOMETRY

EXPORT_OBJ

public static java.lang.String EXPORT_OBJ

TOGGLE_PICKABLE

public static java.lang.String TOGGLE_PICKABLE

ADD_TOOL

public static java.lang.String ADD_TOOL

DECREASE_FIELD_OF_VIEW

public static java.lang.String DECREASE_FIELD_OF_VIEW

INCREASE_FIELD_OF_VIEW

public static java.lang.String INCREASE_FIELD_OF_VIEW

DECREASE_FOCUS

public static java.lang.String DECREASE_FOCUS

INCREASE_FOCUS

public static java.lang.String INCREASE_FOCUS

DECREASE_EYE_SEPARATION

public static java.lang.String DECREASE_EYE_SEPARATION

INCREASE_EYE_SEPARATION

public static java.lang.String INCREASE_EYE_SEPARATION

TOGGLE_PERSPECTIVE

public static java.lang.String TOGGLE_PERSPECTIVE

TOGGLE_STEREO

public static java.lang.String TOGGLE_STEREO

TOGGLE_CURSOR

public static java.lang.String TOGGLE_CURSOR

LOAD_CAMERA_PREFERENCES

public static java.lang.String LOAD_CAMERA_PREFERENCES

SAVE_CAMERA_PREFERENCES

public static java.lang.String SAVE_CAMERA_PREFERENCES

TOGGLE_NAVIGATOR

public static java.lang.String TOGGLE_NAVIGATOR

TOGGLE_EXTERNAL_NAVIGATOR

public static java.lang.String TOGGLE_EXTERNAL_NAVIGATOR

TOGGLE_BEANSHELL

public static java.lang.String TOGGLE_BEANSHELL

TOGGLE_EXTERNAL_BEANSHELL

public static java.lang.String TOGGLE_EXTERNAL_BEANSHELL

TOGGLE_RENDER_SELECTION

public static java.lang.String TOGGLE_RENDER_SELECTION

TOGGLE_MENU

public static java.lang.String TOGGLE_MENU

SET_BACKGROUND_COLOR

public static java.lang.String SET_BACKGROUND_COLOR

SKYBOX

public static java.lang.String SKYBOX

LOAD_SKYBOX

public static java.lang.String LOAD_SKYBOX

ROTATE_SKYBOX_SIDES

public static java.lang.String ROTATE_SKYBOX_SIDES

TOGGLE_VIEWER_FULL_SCREEN

public static java.lang.String TOGGLE_VIEWER_FULL_SCREEN

MAXIMIZE

public static java.lang.String MAXIMIZE

RESTORE

public static java.lang.String RESTORE

SET_VIEWER_SIZE

public static java.lang.String SET_VIEWER_SIZE
Method Detail

update

public void update()

getMenuBar

public javax.swing.JMenuBar getMenuBar()
Get the menu bar.

Returns:
the menu bar

addMenu

public void addMenu(javax.swing.JMenu menu)
Add a menu to the end of the menu bar.

Parameters:
menu - the menu to add
See Also:
ViewerApp#addMenu(JMenu, int)

addMenu

public void addMenu(javax.swing.JMenu menu,
                    int index)
Add a menu to the menu bar at the specified index.

Parameters:
menu - the menu to add
index - the menu's position in the menu bar
Throws:
java.lang.IllegalArgumentException - if an invalid index is specified

removeMenu

public boolean removeMenu(java.lang.String menuName)
Remove the menu with the specified name.

Parameters:
menuName - the menu's name (use static fields of ViewerAppMenu)
Returns:
false iff the specified menu is not contained in the menu bar

getMenu

public javax.swing.JMenu getMenu(java.lang.String menuName)
Get a menu specified by its name.

Parameters:
menuName - the menu's name (use static fields of ViewerAppMenu)
Returns:
the menu or null if the specified menu doesn't exist

addMenuItem

public boolean addMenuItem(javax.swing.JMenuItem item,
                           java.lang.String menuName)
Add a menu item to the end of the menu with the specified name.

Parameters:
item - the menu item to add
menuName - the menu's name (use static fields of ViewerAppMenu)
Returns:
false iff the specified menu is not contained in the menu bar
See Also:
ViewerApp#addMenuItem(JMenuItem, String, int)

addMenuItem

public boolean addMenuItem(javax.swing.JMenuItem item,
                           java.lang.String menuName,
                           int index)
Add a menu item to the menu with the specified name at the specified index.

Parameters:
item - the menu item to add
menuName - the menu's name (use static fields of ViewerAppMenu)
index - the menu item's position in the menu (note that separators are also components of the menu)
Returns:
false iff the specified menu is not contained in the menu bar
Throws:
java.lang.IllegalArgumentException - if an invalid index is specified

removeMenuItem

public boolean removeMenuItem(java.lang.String menuName,
                              int index)
Remove the menu item at given position of the menu with the specified name.

Parameters:
menuName - the menu's name (use static fields of ViewerAppMenu)
index - the menu item's position
Returns:
false iff the specified menu is not contained in the menu bar
Throws:
java.lang.IllegalArgumentException - if an invalid index is specified

addAction

public boolean addAction(javax.swing.Action a,
                         java.lang.String menuName)
Add an action to the end of the menu with the specified name.

Parameters:
a - the action to add
menuName - the menu's name (use static fields of ViewerAppMenu)
Returns:
false iff the specified menu is not contained in the menu bar
See Also:
ViewerApp#addAction(Action, String, int)

addAction

public boolean addAction(javax.swing.Action a,
                         java.lang.String menuName,
                         int index)
Add an action to the menu with the specified name at the specified index.

Parameters:
a - the action to add
menuName - the menu's name (use static fields of ViewerAppMenu)
index - the action's position in the menu
Returns:
false iff the specified menu is not contained in the menu bar
Throws:
java.lang.IllegalArgumentException - if an invalid index is specified

addSeparator

public boolean addSeparator(java.lang.String menuName)
Add a separator to the end of the menu with the specified name.

Parameters:
menuName - the menu's name (use static fields of ViewerAppMenu)
Returns:
false iff the specified menu is not contained in the menu bar
See Also:
ViewerApp#addSeparator(String, int)

addSeparator

public boolean addSeparator(java.lang.String menuName,
                            int index)
Add a separator to the menu with the specified name at the specified index.

Parameters:
menuName - the menu's name (use static fields of ViewerAppMenu)
index - the separators's position in the menu
Returns:
false iff the specified menu is not contained in the menu bar
Throws:
java.lang.IllegalArgumentException - if an invalid index is specified

showMenuBar

public void showMenuBar(boolean show)
Show or hide the menu bar.
When hiding the menu bar, the visibility of all contained menus is set to false (defined keystrokes for actions are still working then).


isShowMenuBar

public boolean isShowMenuBar()

showMenu

public void showMenu(java.lang.String menuName,
                     boolean show)
Show or hide the menu with the specified name.

Parameters:
menuName - the menu's name (use static fields of ViewerAppMenu)
show - true iff specified menu should be visible