Class SwingUserInteractor

  • All Implemented Interfaces:
    UserInteractor

    public class SwingUserInteractor
    extends java.lang.Object
    implements UserInteractor
    This class provides methods for user-interaction through swing-dialogs.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String askForString​(java.lang.String question)  
      java.lang.String askForString​(java.lang.String question, java.lang.String defaultInput)  
      java.lang.String askForString​(java.lang.String question, java.lang.String defaultInput, java.awt.Component parent)  
      boolean showPanelDialog​(PanelProvider panelProvider, java.awt.Component parent)
      opens a dialog with the panel of the given panelProvider
      boolean showPanelDialog​(javax.swing.JPanel panel, java.awt.Component parent)
      opens a dialog with the given panel
      • Methods inherited from class java.lang.Object

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

      • SwingUserInteractor

        public SwingUserInteractor()
    • Method Detail

      • askForString

        public java.lang.String askForString​(java.lang.String question,
                                             java.lang.String defaultInput)
        Specified by:
        askForString in interface UserInteractor
        Parameters:
        question - the the String, which describes to the user, what to enter.
        defaultInput - the string to display as default for the input
        Returns:
        the answer. Null, if aborted
      • askForString

        public java.lang.String askForString​(java.lang.String question,
                                             java.lang.String defaultInput,
                                             java.awt.Component parent)
      • askForString

        public java.lang.String askForString​(java.lang.String question)
        Specified by:
        askForString in interface UserInteractor
        Parameters:
        question - the the String, which describes to the user, what to enter.
        Returns:
        the answer. Null, if aborted
      • showPanelDialog

        public boolean showPanelDialog​(javax.swing.JPanel panel,
                                       java.awt.Component parent)
        Description copied from interface: UserInteractor
        opens a dialog with the given panel
        Specified by:
        showPanelDialog in interface UserInteractor
        Parameters:
        panel - the panel to show in the dialog
        parent - the parent of the dialog
        Returns:
        true, if the ok-button was pressed, false if not
      • showPanelDialog

        public boolean showPanelDialog​(PanelProvider panelProvider,
                                       java.awt.Component parent)
        Description copied from interface: UserInteractor
        opens a dialog with the panel of the given panelProvider
        Specified by:
        showPanelDialog in interface UserInteractor
        Parameters:
        panelProvider - the panelProvider which provides the panel to show
        parent - the parent of the dialog
        Returns:
        true, if the ok button was pressed, false otherwise