public class ViewerAppMenu extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
addAction(Action a,
String menuName)
Add an action to the end of the menu with the specified name.
|
boolean |
addAction(Action a,
String menuName,
int index)
Add an action to the menu with the specified name at the specified index.
|
void |
addMenu(JMenu menu)
Add a menu to the end of the menu bar.
|
void |
addMenu(JMenu menu,
int index)
Add a menu to the menu bar at the specified index.
|
boolean |
addMenuItem(JMenuItem item,
String menuName)
Add a menu item to the end of the menu with the specified name.
|
boolean |
addMenuItem(JMenuItem item,
String menuName,
int index)
Add a menu item to the menu with the specified name at the specified index.
|
boolean |
addSeparator(String menuName)
Add a separator to the end of the menu with the specified name.
|
boolean |
addSeparator(String menuName,
int index)
Add a separator to the menu with the specified name at the specified index.
|
JMenu |
getMenu(String menuName)
Get a menu specified by its name.
|
JMenuBar |
getMenuBar()
Get the menu bar.
|
boolean |
isShowMenuBar() |
boolean |
removeMenu(String menuName)
Remove the menu with the specified name.
|
boolean |
removeMenuItem(String menuName,
int index)
Remove the menu item at given position of the menu with the specified name.
|
void |
showMenu(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() |
public static String FILE_MENU
public static String EDIT_MENU
public static String CAMERA_MENU
public static String VIEW_MENU
public static String LOAD_FILE
public static String LOAD_FILE_MERGED
public static String LOAD_SCENE
public static String SAVE_SCENE
public static String EXPORT
public static String QUIT
public static String SAVE_SELECTED
public static String LOAD_FILE_TO_NODE
public static String REMOVE
public static String RENAME
public static String TOGGLE_VISIBILITY
public static String ASSIGN_FACE_AABBTREE
public static String APPEARANCE
public static String CREATE_APPEARANCE
public static String TOGGLE_VERTEX_DRAWING
public static String TOGGLE_EDGE_DRAWING
public static String TOGGLE_FACE_DRAWING
public static String LOAD_TEXTURE
public static String REFLECTIONMAP
public static String LOAD_REFLECTIONMAP
public static String ROTATE_REFLECTIONMAP_SIDES
public static String GEOMETRY
public static String EXPORT_OBJ
public static String EXPORT_VRML
public static String EXPORT_STL
public static String TOGGLE_PICKABLE
public static String ADD_TOOL
public static String DECREASE_FIELD_OF_VIEW
public static String INCREASE_FIELD_OF_VIEW
public static String DECREASE_FOCUS
public static String INCREASE_FOCUS
public static String DECREASE_EYE_SEPARATION
public static String INCREASE_EYE_SEPARATION
public static String TOGGLE_PERSPECTIVE
public static String TOGGLE_STEREO
public static String TOGGLE_CURSOR
public static String LOAD_CAMERA_PREFERENCES
public static String SAVE_CAMERA_PREFERENCES
public static String TOGGLE_NAVIGATOR
public static String TOGGLE_EXTERNAL_NAVIGATOR
public static String TOGGLE_BEANSHELL
public static String TOGGLE_EXTERNAL_BEANSHELL
public static String TOGGLE_RENDER_SELECTION
public static String TOGGLE_MENU
public static String SET_BACKGROUND_COLOR
public static String SKYBOX
public static String LOAD_SKYBOX
public static String ROTATE_SKYBOX_SIDES
public static String TOGGLE_VIEWER_FULL_SCREEN
public static String MAXIMIZE
public static String RESTORE
public static String SET_VIEWER_SIZE
public void update()
public JMenuBar getMenuBar()
public void addMenu(JMenu menu)
menu
- the menu to addViewerApp#addMenu(JMenu, int)
public void addMenu(JMenu menu, int index)
menu
- the menu to addindex
- the menu's position in the menu barIllegalArgumentException
- if an invalid index is specifiedpublic boolean removeMenu(String menuName)
menuName
- the menu's name (use static fields of ViewerAppMenu
)public JMenu getMenu(String menuName)
menuName
- the menu's name (use static fields of ViewerAppMenu
)public boolean addMenuItem(JMenuItem item, String menuName)
item
- the menu item to addmenuName
- the menu's name (use static fields of ViewerAppMenu
)ViewerApp#addMenuItem(JMenuItem, String, int)
public boolean addMenuItem(JMenuItem item, String menuName, int index)
item
- the menu item to addmenuName
- 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)IllegalArgumentException
- if an invalid index is specifiedpublic boolean removeMenuItem(String menuName, int index)
menuName
- the menu's name (use static fields of ViewerAppMenu
)index
- the menu item's positionIllegalArgumentException
- if an invalid index is specifiedpublic boolean addAction(Action a, String menuName)
a
- the action to addmenuName
- the menu's name (use static fields of ViewerAppMenu
)ViewerApp#addAction(Action, String, int)
public boolean addAction(Action a, String menuName, int index)
a
- the action to addmenuName
- the menu's name (use static fields of ViewerAppMenu
)index
- the action's position in the menuIllegalArgumentException
- if an invalid index is specifiedpublic boolean addSeparator(String menuName)
menuName
- the menu's name (use static fields of ViewerAppMenu
)ViewerApp#addSeparator(String, int)
public boolean addSeparator(String menuName, int index)
menuName
- the menu's name (use static fields of ViewerAppMenu
)index
- the separators's position in the menuIllegalArgumentException
- if an invalid index is specifiedpublic void showMenuBar(boolean show)
public boolean isShowMenuBar()
public void showMenu(String menuName, boolean show)
menuName
- the menu's name (use static fields of ViewerAppMenu
)show
- true iff specified menu should be visible