Class ViewMenuBar

java.lang.Object
gov.nih.mipav.view.ViewMenuBar

public class ViewMenuBar extends Object
Build the menus for an image loaded into MIPAV.
Version:
1.0 July 12, 2004
Author:
Evan McCreedy
See Also:
  • Field Details

    • separator

      protected static final JSeparator separator
      Separator that can be added in between menu items.
    • plugInMenu

      protected JMenu plugInMenu
      The menu listing installed plugins in the user's home directory.
    • voiMenu

      protected JMenu voiMenu
      The menu listing voi commands.
    • imageMenu

      protected JMenu imageMenu
      The menu listing image and overlay commands
    • userInterface

      protected ViewUserInterface userInterface
      The user interface for MIPAV.
  • Constructor Details

    • ViewMenuBar

      public ViewMenuBar(ViewMenuBuilder menuObj)
      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.
      Overrides:
      finalize in class Object
    • 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 from ModelStorageBase, 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

      public JMenu getPlugInMenu()
      Return the menu containing the list of installed plugins.
      Returns:
      the plugin menu
    • getImageMenu

      public JMenu getImageMenu()
      Returns the menu that contains all image and overlay commands
    • getVOIMenu

      public JMenu getVOIMenu()
      Return the menu containing the list VOI commands.
      Returns:
      the VOI menu
    • setPlugInMenu

      public void setPlugInMenu(JMenu menu)
      Sets the menu containing the list of installed plugins.
      Parameters:
      menu - the new plugin menu
    • makeAlgorithmsMenu

      public JMenu makeAlgorithmsMenu()
      Construct the algorithms menu.
      Returns:
      the algorithms menu
    • makeCaptureMenu

      public JMenu makeCaptureMenu(boolean isAnImageOpen)
      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

      public JMenu makeCustomMenu(String customMenuName, Vector<CustomUIBuilder.UIParams> paramVector)
      Creates a custom menu with a given Vector of UIParams
      Parameters:
      customMenuName - the name of the menu
      paramVector - a vector of UIParams objects (can be lifted from CustomUIBuilder
      Returns:
      the custom menu
    • makeDicomMenu

      public JMenu makeDicomMenu()
      Create the Dicom File submenu.
      Returns:
      The new submenu
      See Also:
    • makeDiffusionTensorMenu

      public JMenu makeDiffusionTensorMenu()
      Create the Diffusion Tensor File submenu.
      Returns:
      The new submenu
      See Also:
    • makeFileMenu

      public JMenu makeFileMenu(boolean isAnImageOpen)
      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

      public JMenu makeHelpMenu()
      Construct the help menu.
      Returns:
      the help menu
    • makeSystemsAnalysisMenu

      public JMenu makeSystemsAnalysisMenu()
    • makeImageMenu

      public JMenu makeImageMenu(boolean isDicomImage)
      Construct the image menu.
      Parameters:
      isDicomImage - Whether the image this menu is attached to is a dicom image.
      Returns:
      the image menu
    • makeLoadBMenu

      public JMenu makeLoadBMenu(boolean isAnImageOpen)
      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

      public JMenu makeLUTMenu()
      Construct the LUT menu.
      Returns:
      the LUT menu
    • makeScriptingMenu

      public JMenu makeScriptingMenu()
      Create the Scripting menu.
      Returns:
      The new scripting menu
    • makeToolbarsMenu

      public JMenu makeToolbarsMenu()
      Construct the toolbar menu.
      Returns:
      the toolbar menu
    • makeUtilitiesMenu

      public JMenu makeUtilitiesMenu()
      Construct the utilities menu.
      Returns:
      the utilities menu
    • makeVOIMenu

      public JMenu makeVOIMenu()
      Construct the VOI menu.
      Returns:
      the VOI menu
    • isMenuCommand

      public static boolean isMenuCommand(JMenu menu, String command)
      determines if there is a matching action command
      Parameters:
      menu -
      command -
      Returns:
    • isMenuCommand

      public static boolean isMenuCommand(Component[] menuComponents, String command)
      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 from ModelStorageBase, byte, short, argb, etc.
    • enableAllMenuItems

      protected void enableAllMenuItems()
      Enable all items in a menubar.