Class Printer

  • All Implemented Interfaces:
    net.sourceforge.uiq3.IPropertyNotifier, IPrinter

    public abstract class Printer
    extends Interface
    implements IPrinter, net.sourceforge.uiq3.IPropertyNotifier
    Simulation of the some calculator interface.
    Author:
    "Martin Krischik" «krischik@users.sourceforge.net»
    • Field Detail

      • Line_Length

        private static final int Line_Length
        Length of an FP-10 line
        See Also:
        Constant Field Values
      • Logger

        private static final Logger Logger

        Class logger instance.

      • TAG

        private static final String TAG

        Class logger tag.

      • New_Line

        public static final String New_Line
        New line string
      • Owner

        @NotNull
        private final @NotNull Calculator Owner
        Calculator to which the interface is connected to
      • propertyChangeSupport

        private final PropertyChangeSupport propertyChangeSupport
        Handle property changes.
    • Constructor Detail

      • Printer

        protected Printer​(@NotNull
                          @NotNull Calculator Owner)
        Parameters:
        Owner - Calculator to which the interface is connected to
    • Method Detail

      • addPropertyChangeListener

        public void addPropertyChangeListener​(PropertyChangeListener listener)
        Add a PropertyChangeListener to the listener list. The listener is registered for all properties. The same listener object may be added more than once, and will be called as many times as it is added. If listener is null, no exception is thrown and no action is taken.
        Specified by:
        addPropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
        Parameters:
        listener - The PropertyChangeListener to be added
      • addPropertyChangeListener

        public void addPropertyChangeListener​(@NotNull
                                              @NotNull String propertyName,
                                              @NotNull
                                              PropertyChangeListener listener)
        Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property.
        Specified by:
        addPropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
        Parameters:
        propertyName - The name of the property to listen on.
        listener - The PropertyChangeListener to be added
        Since:
        1.2
      • removePropertyChangeListener

        public void removePropertyChangeListener​(@NotNull
                                                 PropertyChangeListener listener)
        Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. If listener was added more than once to the same event source, it will be notified one less time after being removed. If listener is null, or was never added, no exception is thrown and no action is taken.
        Specified by:
        removePropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
        Parameters:
        listener - The PropertyChangeListener to be removed
      • removePropertyChangeListener

        public void removePropertyChangeListener​(@NotNull
                                                 @NotNull String propertyName,
                                                 @NotNull
                                                 PropertyChangeListener listener)
        Remove a PropertyChangeListener for a specific property. If `listener` was added more than once to the same event source for the specified property, it will be notified one less time after being removed.
        Specified by:
        removePropertyChangeListener in interface net.sourceforge.uiq3.IPropertyNotifier
        Parameters:
        propertyName - The name of the property that was listened on.
        listener - The PropertyChangeListener to be removed
        Since:
        1.2
      • Print_Alpha

        public void Print_Alpha()
        Print displayed alpha text to simulated printer (max 40 characters)
        Throws:
        Error - mostly file not found
      • Print_Display

        public void Print_Display()
        Print displayed register to simulated printer.
      • Print_File_Name

        public void Print_File_Name​(@NotNull
                                    @NotNull String Java_File_Name)
        Print filename.
        Parameters:
        Java_File_Name - the java filename 
      • printLine

        public void printLine​(short @NotNull [] Line)
        Print a single line to simulated printer
        Specified by:
        printLine in interface IPrinter
        Parameters:
        Line - line to print
      • Print_M

        public void Print_M​(@NotNull
                            @NotNull String Java_File_Name)
        Writes memory register to simulated cassette interface.
        Parameters:
        Java_File_Name - the java filename
      • Print_Step_Count

        private void Print_Step_Count​(@NotNull
                                      @NotNull StringBuilder Buffer,
                                      int Count)
        Print the ...xxxsteps line.
        Parameters:
        Buffer - buffer to print to
        Count - steps to print
      • Print_Steps

        public void Print_Steps​(@NotNull
                                @NotNull String Java_File_Name)
        Print program steps
        Parameters:
        Java_File_Name - the java filename 
      • getPrintout

        @NotNull
        @TestOnly
        public @NotNull String getPrintout()
        get printout for clipboard
        Specified by:
        getPrintout in interface IPrinter
        Returns:
        all program steps
      • setPrintout

        @TestOnly
        public void setPrintout​(@NotNull
                                @NotNull String Printout)

        set the printout from saved data

        Specified by:
        setPrintout in interface IPrinter
        Parameters:
        Printout - new printout
      • getPrintoutLength

        public int getPrintoutLength()
        get printout for clipboard
        Specified by:
        getPrintoutLength in interface IPrinter
        Returns:
        all program steps