Class PrintDpiMenu


  • public final class PrintDpiMenu
    extends java.lang.Object
    Author:
    Tilman Hausherr A singleton class that provides the print dpi menu.
    • 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.
      void changeDpiSelection​(int selection)
      Set the dpi selection.
      static int getDpiSelection()
      Tell the current dpi scale.
      static PrintDpiMenu getInstance()
      Provides the DpiMenu instance.
      javax.swing.JMenu getMenu()
      Provide the JMenu instance of the ZoomMenu.
      void setEnableMenu​(boolean isEnable)
      Set if the menu should be enabled or disabled.
      protected void setMenu​(javax.swing.JMenu menu)  
      • Methods inherited from class java.lang.Object

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

      • getInstance

        public static PrintDpiMenu getInstance()
        Provides the DpiMenu instance.
        Returns:
        DpiMenu instance.
      • changeDpiSelection

        public void changeDpiSelection​(int selection)
        Set the dpi selection.
        Parameters:
        selection -
        Throws:
        java.lang.IllegalArgumentException - if the parameter doesn't belong to a dpi menu item.
      • getDpiSelection

        public static int getDpiSelection()
        Tell the current dpi scale.
        Returns:
        the current dpi scale.
        Throws:
        java.lang.IllegalStateException - if no dpi menu item is selected.
      • setMenu

        protected void setMenu​(javax.swing.JMenu menu)
      • 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.