Class TreeViewMenu


  • public final class TreeViewMenu
    extends java.lang.Object
    A singleton class that provides tree view menu which can be used to switch the kind of tree view. To act upon the menu item selection user of the class must add ActionListener which will check for the action command and act accordingly.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addMenuListeners​(java.awt.event.ActionListener listener)
      Add the ActionListener for the menu items.
      static TreeViewMenu getInstance()
      Provides the TreeViewMenu instance.
      javax.swing.JMenu getMenu()
      Provide the JMenu instance of the ZoomMenu.
      java.lang.String getTreeViewSelection()
      Provide the current tree view selection.
      static boolean isValidViewMode​(java.lang.String viewMode)
      Checks if the given viewMode value is a valid one.
      void setEnableMenu​(boolean isEnable)
      Set if the menu should be enabled or disabled.
      void setTreeViewSelection​(java.lang.String selection)
      Set the tree view selection.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static TreeViewMenu getInstance()
        Provides the TreeViewMenu instance.
        Returns:
        TreeViewMenu instance.
      • setTreeViewSelection

        public void setTreeViewSelection​(java.lang.String selection)
        Set the tree view selection.
        Parameters:
        selection - String instance.
      • getTreeViewSelection

        public java.lang.String getTreeViewSelection()
        Provide the current tree view selection.
        Returns:
        the selection String instance
      • isValidViewMode

        public static boolean isValidViewMode​(java.lang.String viewMode)
        Checks if the given viewMode value is a valid one.
        Parameters:
        viewMode - the view mode to be checked
        Returns:
        true if the given value is a valid view mode, otherwise false
      • getMenu

        public javax.swing.JMenu getMenu()
        Provide the JMenu instance of the ZoomMenu.
        Returns:
        JMenu instance.
      • setEnableMenu

        public void setEnableMenu​(boolean isEnable)
        Set if the menu should be enabled or disabled.
        Parameters:
        isEnable - boolean instance.
      • addMenuListeners

        public void addMenuListeners​(java.awt.event.ActionListener listener)
        Add the ActionListener for the menu items.
        Parameters:
        listener - ActionListener.