Package gov.nih.mipav.view
Class ViewMenuBar
java.lang.Object
gov.nih.mipav.view.ViewMenuBar
Build the menus for an image loaded into MIPAV.
- Version:
- 1.0 July 12, 2004
- Author:
- Evan McCreedy
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JMenuThe menu listing image and overlay commandsprotected ViewMenuBuilderMenu and menu item generator.protected JMenuThe menu listing installed plugins in the user's home directory.protected static final JSeparatorSeparator that can be added in between menu items.protected ViewUserInterfaceThe user interface for MIPAV.protected JMenuThe menu listing voi commands. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidEnable all items in a menubar.protected voidfinalize()Clean up memory used by this class.Returns the menu that contains all image and overlay commandsgetMenuBar(ActionListener listener, int numberOfDimensions, int type, boolean isDicomImage) Creates general menus based on dimensionality and data type (byte, short, argb, etc) of image and attaches them to a menu bar.Return the menu containing the list of installed plugins.Return the menu containing the list VOI commands.static booleanisMenuCommand(Component[] menuComponents, String command) determines if there is a matching action commandstatic booleanisMenuCommand(JMenu menu, String command) determines if there is a matching action commandConstruct the algorithms menu.makeCaptureMenu(boolean isAnImageOpen) Create the image capture/print File submenu.makeCustomMenu(String customMenuName, Vector<CustomUIBuilder.UIParams> paramVector) Creates a custom menu with a given Vector of UIParamsCreate the Dicom File submenu.Create the Diffusion Tensor File submenu.makeFileMenu(boolean isAnImageOpen) Construct the file menu.Construct the help menu.makeImageMenu(boolean isDicomImage) Construct the image menu.makeLoadBMenu(boolean isAnImageOpen) Create the Load image B File submenu.Construct the LUT menu.Create the Scripting menu.Construct the toolbar menu.Construct the utilities menu.Construct the VOI menu.voidsetEnabledMenuItems(int numberOfDimensions, int type) Enable or disable items in a menubar based on the image dimensionality and storage type.voidsetPlugInMenu(JMenu menu) Sets the menu containing the list of installed plugins.
-
Field Details
-
separator
Separator that can be added in between menu items. -
plugInMenu
The menu listing installed plugins in the user's home directory. -
voiMenu
The menu listing voi commands. -
imageMenu
The menu listing image and overlay commands -
userInterface
The user interface for MIPAV.
-
-
Constructor Details
-
ViewMenuBar
Set up the menu bar builder.- Parameters:
menuObj- the helper class used to make the menus and menu items
-
-
Method Details
-
finalize
protected void finalize()Clean up memory used by this class. -
getMenuBar
public JMenuBar getMenuBar(ActionListener listener, int numberOfDimensions, int type, boolean isDicomImage) Creates general menus based on dimensionality and data type (byte, short, argb, etc) of image and attaches them to a menu bar.- Parameters:
listener- The class that wants to listen to plugin menu actions.numberOfDimensions- Dimensionality of image (2D, 3D, 4D...)type- Data type fromModelStorageBase, byte, short, argb, etc.isDicomImage- Whether the image this menu bar is for is a dicom image.- Returns:
- Menu bar with the menus attached.
-
getPlugInMenu
Return the menu containing the list of installed plugins.- Returns:
- the plugin menu
-
getImageMenu
Returns the menu that contains all image and overlay commands -
getVOIMenu
Return the menu containing the list VOI commands.- Returns:
- the VOI menu
-
setPlugInMenu
Sets the menu containing the list of installed plugins.- Parameters:
menu- the new plugin menu
-
makeAlgorithmsMenu
Construct the algorithms menu.- Returns:
- the algorithms menu
-
makeCaptureMenu
Create the image capture/print File submenu.- Parameters:
isAnImageOpen- Whether MIPAV has an image open (determines whether the menu is enabled).- Returns:
- The new submenu
- See Also:
-
makeCustomMenu
Creates a custom menu with a given Vector of UIParams- Parameters:
customMenuName- the name of the menuparamVector- a vector of UIParams objects (can be lifted from CustomUIBuilder- Returns:
- the custom menu
-
makeDicomMenu
Create the Dicom File submenu.- Returns:
- The new submenu
- See Also:
-
makeDiffusionTensorMenu
Create the Diffusion Tensor File submenu.- Returns:
- The new submenu
- See Also:
-
makeFileMenu
Construct the file menu.- Parameters:
isAnImageOpen- indicates whether an image has been opened in MIPAV yet (false if calling from ViewUserInterface, true otherwise)- Returns:
- the file menu
-
makeHelpMenu
Construct the help menu.- Returns:
- the help menu
-
makeSystemsAnalysisMenu
-
makeImageMenu
Construct the image menu.- Parameters:
isDicomImage- Whether the image this menu is attached to is a dicom image.- Returns:
- the image menu
-
makeLoadBMenu
Create the Load image B File submenu.- Parameters:
isAnImageOpen- Whether MIPAV has an image open (determines whether the menu is enabled).- Returns:
- The new submenu
- See Also:
-
makeLUTMenu
Construct the LUT menu.- Returns:
- the LUT menu
-
makeScriptingMenu
Create the Scripting menu.- Returns:
- The new scripting menu
-
makeToolbarsMenu
Construct the toolbar menu.- Returns:
- the toolbar menu
-
makeUtilitiesMenu
Construct the utilities menu.- Returns:
- the utilities menu
-
makeVOIMenu
Construct the VOI menu.- Returns:
- the VOI menu
-
isMenuCommand
determines if there is a matching action command- Parameters:
menu-command-- Returns:
-
isMenuCommand
determines if there is a matching action command- Parameters:
menuComponents-command-- Returns:
-
setEnabledMenuItems
public void setEnabledMenuItems(int numberOfDimensions, int type) Enable or disable items in a menubar based on the image dimensionality and storage type.- Parameters:
numberOfDimensions- Dimensionality of image (2D, 3D, 4D...)type- Data type fromModelStorageBase, byte, short, argb, etc.
-
enableAllMenuItems
protected void enableAllMenuItems()Enable all items in a menubar.
-