Class ConsoleInterface

  • All Implemented Interfaces:
    UserInterface

    public class ConsoleInterface
    extends java.lang.Object
    implements UserInterface
    Basic console implementation of a user interface.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private float invP  
      private int lastP  
      private int max  
      private int min  
      private java.lang.String task  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void print​(UI.Module m, UI.PrintLevel level, java.lang.String s)
      Displays some information to the user from the specified module with the specified print level.
      void taskStart​(java.lang.String s, int min, int max)
      Prepare a progress bar representing a lengthy task.
      void taskStop()
      Closes the current progress bar to indicate the task is over
      void taskUpdate​(int current)
      Updates the current progress bar to a value between the current min and max.
      • Methods inherited from class java.lang.Object

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

      • min

        private int min
      • max

        private int max
      • invP

        private float invP
      • task

        private java.lang.String task
      • lastP

        private int lastP
    • Constructor Detail

      • ConsoleInterface

        public ConsoleInterface()
    • Method Detail

      • print

        public void print​(UI.Module m,
                          UI.PrintLevel level,
                          java.lang.String s)
        Description copied from interface: UserInterface
        Displays some information to the user from the specified module with the specified print level. A user interface is free to show or ignore any message. Level filtering is done in the core and shouldn't be re-implemented by the user interface. All messages will be short enough to fit on one line.
        Specified by:
        print in interface UserInterface
        Parameters:
        m - module the message came from
        level - seriousness of the message
        s - string to display
      • taskStart

        public void taskStart​(java.lang.String s,
                              int min,
                              int max)
        Description copied from interface: UserInterface
        Prepare a progress bar representing a lengthy task. The actual progress is first shown by the call to update and closed when update is closed with the max value. It is currently not possible to nest calls to setTask, so only one task needs to be tracked at a time.
        Specified by:
        taskStart in interface UserInterface
        Parameters:
        s - desriptive string
        min - minimum value of the task
        max - maximum value of the task
      • taskUpdate

        public void taskUpdate​(int current)
        Description copied from interface: UserInterface
        Updates the current progress bar to a value between the current min and max. When min or max are passed the progressed bar is shown or hidden respectively.
        Specified by:
        taskUpdate in interface UserInterface
        Parameters:
        current - current value of the task in progress.
      • taskStop

        public void taskStop()
        Description copied from interface: UserInterface
        Closes the current progress bar to indicate the task is over
        Specified by:
        taskStop in interface UserInterface