Class Main

  • All Implemented Interfaces:
    Runnable, net.sourceforge.uiq3.calculator.IMain

    public final class Main
    extends net.sourceforge.uiq3.calculator.Main
    Main class for an HP45 calculator.
    Author:
    "Martin Krischik" «krischik@users.sourceforge.net»
    • Nested Class Summary

      • Nested classes/interfaces inherited from class net.sourceforge.uiq3.calculator.Main

        net.sourceforge.uiq3.calculator.Main.Companion
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private @Nullable net.sourceforge.uiq3.hp45.Desktop_Calculator calculator
      The calculator engine with debug capability.
      private @Nullable Calculator_Canvas canvas
      Calculator_Canvas displaying the calculator
      private @Nullable Calculator_Frame frame
      Main window frame
      private static int Half_A_Second  
      private static AtomicBoolean LAF_Initialized  
      private static Logger logger
      class logger instance
      private static @Nullable Main self
      reference to protect instance from garbage collector.
      private static @NotNull String TAG
      class logger tag.
      • Fields inherited from class net.sourceforge.uiq3.calculator.Main

        Companion, LOOK_AND_FEEL_CHANGED
    • Constructor Summary

      Constructors 
      Constructor Description
      Main()
      init main
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void about()
      General info dialog; fed to the OSXAdapter as the method to call when "About OSXAdapter" is selected from the application menu
      protected net.sourceforge.uiq3.calculator.ICalculator Create_Calculator()  
      protected net.sourceforge.uiq3.ui.ICalculatorCanvas createCanvas()  
      (package private) @Nullable net.sourceforge.uiq3.hp45.Desktop_Calculator getCalculator()  
      (package private) @Nullable Calculator_Canvas getCanvas()  
      (package private) @Nullable Calculator_Frame getFrame()  
      static void initializeLAF()
      To make widget classes compatible with GUI designer they must be instantiatable from there default constructor.
      boolean isRunning()  
      void loadFile​(File Filename)
      load a file
      static void main​(String[] args)
      main method.
      void pauseApp()
      Signals the MIDlet to enter the Paused state.
      void preferences()
      General preferences dialog; fed to the OSXAdapter as the method to call when "About OSXAdapter" is selected from the application menu
      boolean quit()
      General quit handler; fed to the OSXAdapter as the method to call when a system quit event occurs A quit event is triggered by Cmd-Q, selecting Quit from the application or Dock menu, or logging out
      static void registerFonts()  
      @NotNull String toString()  
      • Methods inherited from class net.sourceforge.uiq3.calculator.Main

        fatalError, getPropertyChangeSupport, initializeLAF, registerLAF, run, Setup_Logging, startApp
    • Field Detail

      • logger

        @NotNull
        private static final Logger logger
        class logger instance
      • self

        @Nullable
        private static @Nullable Main self
        reference to protect instance from garbage collector.
      • TAG

        @NotNull
        private static final @NotNull String TAG
        class logger tag.
      • LAF_Initialized

        private static final AtomicBoolean LAF_Initialized
      • canvas

        @Nullable
        private @Nullable Calculator_Canvas canvas
        Calculator_Canvas displaying the calculator
      • calculator

        @Nullable
        private @Nullable net.sourceforge.uiq3.hp45.Desktop_Calculator calculator
        The calculator engine with debug capability.
    • Constructor Detail

      • Main

        Main()
        init main
    • Method Detail

      • main

        public static void main​(String[] args)
        main method.
        Parameters:
        args - not used
      • getCalculator

        @TestOnly
        @Nullable
        @Nullable net.sourceforge.uiq3.hp45.Desktop_Calculator getCalculator()
      • initializeLAF

        public static void initializeLAF()
        To make widget classes compatible with GUI designer they must be instantiatable from there default constructor. This means that each widget must initialize the LAF in there default constructor.
      • registerFonts

        public static void registerFonts()
      • about

        public void about()
        General info dialog; fed to the OSXAdapter as the method to call when "About OSXAdapter" is selected from the application menu
        Specified by:
        about in class net.sourceforge.uiq3.calculator.Main
        See Also:
        Main.about()
      • Create_Calculator

        protected net.sourceforge.uiq3.calculator.ICalculator Create_Calculator()
                                                                         throws IOException
        Specified by:
        Create_Calculator in class net.sourceforge.uiq3.calculator.Main
        Returns:
        A new calculator engine
        Throws:
        IOException
        See Also:
        Main.Create_Calculator()
      • createCanvas

        protected net.sourceforge.uiq3.ui.ICalculatorCanvas createCanvas()
                                                                  throws IOException
        Specified by:
        createCanvas in class net.sourceforge.uiq3.calculator.Main
        Returns:
        A new Calculator Swing_Canvas.
        Throws:
        IOException
        See Also:
        Main.createCanvas()
      • isRunning

        public boolean isRunning()
        Returns:
        true when paused
      • loadFile

        public void loadFile​(File Filename)
        load a file
        Specified by:
        loadFile in class net.sourceforge.uiq3.calculator.Main
        Parameters:
        Filename - filename to load
      • pauseApp

        public void pauseApp()
        Signals the MIDlet to enter the Paused state.
        Specified by:
        pauseApp in interface net.sourceforge.uiq3.calculator.IMain
        Overrides:
        pauseApp in class net.sourceforge.uiq3.calculator.Main
      • preferences

        public void preferences()
        General preferences dialog; fed to the OSXAdapter as the method to call when "About OSXAdapter" is selected from the application menu
        Specified by:
        preferences in class net.sourceforge.uiq3.calculator.Main
        See Also:
        Main.preferences()
      • quit

        public boolean quit()
        General quit handler; fed to the OSXAdapter as the method to call when a system quit event occurs A quit event is triggered by Cmd-Q, selecting Quit from the application or Dock menu, or logging out
        Returns:
        true for quit
      • toString

        @TestOnly
        @NotNull
        public @NotNull String toString()
        Overrides:
        toString in class net.sourceforge.uiq3.calculator.Main