Interface UserInterface

  • All Known Implementing Classes:
    NullUserInterface, ProgressBarUI

    public interface UserInterface
    This interface represents a UserInterface that shows the user the progress of an action.
    Version:
    1.0, 07.11.2007
    Author:
    unknown (extracted from ReportMerger), Thoralf Rickert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  UserInterface.ClosingListener
      A listener that reacts on WINDOW_CLOSING events of the dialog.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addClosingListener​(UserInterface.ClosingListener listener)
      Adds a listener that is called on WINDOW_CLOSING events.
      BoxTransformer.BBox askForGirth​(BoxTransformer.BBox best, int layer, MapMetric metric)
      Displays a SetGirthDialog.
      boolean confirm​(java.lang.String strMessage, java.lang.String strTitle)
      Opens a confirm dialog.
      int getProgress()  
      java.lang.Object input​(java.lang.String strMessage, java.lang.String strTitle, java.lang.Object[] values, java.lang.Object initial)
      Opens an input dialog.
      void ready()
      Notifies the interface that the task is done.
      void setMaximum​(int maxProgress)
      Sets the maximum number of steps.
      void setProgress​(java.lang.String strMessage, int iProgress)
      Sets the progress of the action.
      void setTitle​(java.lang.String title)
      Sets the title of the progress dialog.
      void show()
      Shows the dialog.
      void showDialog​(java.lang.String title, java.lang.String message, int messageType, int options)
      Displays a dialog.
      void showException​(java.lang.String message, java.lang.String description, java.lang.Exception exception)
      Displays an error window
      void showMessageDialog​(java.lang.String message)
      Shows a message with an OK option
    • Method Detail

      • show

        void show()
        Shows the dialog. If the action is done in a different thread, this method should be called in the calling thread (usually the EventDispatchThread).
      • ready

        void ready()
        Notifies the interface that the task is done. Destroys progress dialog. If the action is done in a different thread, this method should be called in the working thread.
      • addClosingListener

        void addClosingListener​(UserInterface.ClosingListener listener)
        Adds a listener that is called on WINDOW_CLOSING events.
        Parameters:
        listener -
      • setProgress

        void setProgress​(java.lang.String strMessage,
                         int iProgress)
        Sets the progress of the action.
      • getProgress

        int getProgress()
        Returns:
        the current progress.
      • setMaximum

        void setMaximum​(int maxProgress)
        Sets the maximum number of steps. A value of 0 or less means, that the maximum is indeterminate.
      • setTitle

        void setTitle​(java.lang.String title)
        Sets the title of the progress dialog.
      • showException

        void showException​(java.lang.String message,
                           java.lang.String description,
                           java.lang.Exception exception)
        Displays an error window
        Parameters:
        message - A message for the user, may be null.
        description - An explanatory text, may be null
        exception -
      • confirm

        boolean confirm​(java.lang.String strMessage,
                        java.lang.String strTitle)
        Opens a confirm dialog.
      • input

        java.lang.Object input​(java.lang.String strMessage,
                               java.lang.String strTitle,
                               java.lang.Object[] values,
                               java.lang.Object initial)
        Opens an input dialog.
      • showMessageDialog

        void showMessageDialog​(java.lang.String message)
        Shows a message with an OK option
        Parameters:
        message -
      • showDialog

        void showDialog​(java.lang.String title,
                        java.lang.String message,
                        int messageType,
                        int options)
        Displays a dialog. See JOptionPane.
        Parameters:
        title - The title of a dialog
        message - The displayed object
        messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
        options - the options to display in the pane: DEFAULT_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION, OK_CANCEL_OPTION