Class KeySearchingExample

All Implemented Interfaces:
KeyFilesSearchReceiver, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class KeySearchingExample extends JFrame implements KeyFilesSearchReceiver
This example illustrates the use of the key bundle file searcher. It uses a small GUI for the demonstration. The background of the GUI turns green when the searcher performs its search. The result is then output in the text window.
See Also:
  • Constructor Details

    • KeySearchingExample

      public KeySearchingExample()
  • Method Details

    • main

      public static void main(String[] args)
    • synchronizeKeyFilesList

      public void synchronizeKeyFilesList(KeyFiles hashMap)
      Method of the "KeyFilesSearchReceiver" interface outputs a list of all key bundles found during the last search, with which the application can synchronize its current list.
      Specified by:
      synchronizeKeyFilesList in interface KeyFilesSearchReceiver
      Parameters:
      hashMap - the list with all key bundle files found by the last search.
    • getKeyFiles

      public KeyFiles getKeyFiles()
      Method of the "KeyFilesSearchReceiver" interface through which the searcher can access the application's list.
      Specified by:
      getKeyFiles in interface KeyFilesSearchReceiver
      Returns:
      the list of key bundle files.
    • setKeyFileLocations

      public void setKeyFileLocations(ArrayList<KeyFileLocation> keyFileLocations)
      Method of the "KeyFilesSearchReceiver" interface through which the searcher can pass a list with information about all found key bundle files.
      Specified by:
      setKeyFileLocations in interface KeyFilesSearchReceiver
      Parameters:
      keyFileLocations -
    • setKeyFileSearching

      public void setKeyFileSearching(boolean b)
      Method of the "KeyFilesSearchReceiver" interface through which the searcher can tell the application that it is now performing a search.
      Specified by:
      setKeyFileSearching in interface KeyFilesSearchReceiver
      Parameters:
      b - true, if the searcher is performing a search.
    • setBundleFolders

      public void setBundleFolders(ArrayList<File> bundleFolders)
      Method of the interface "KeyFilesSearchReceiver" via which the searcher passes the list of all found "bundle" folders.
      Specified by:
      setBundleFolders in interface KeyFilesSearchReceiver
      Parameters:
      bundleFolders - a list with the found "bundle" folders.
    • isSearchingAllowed

      public boolean isSearchingAllowed()
      Method of the interface "KeyFilesSearchReceiver" via which the searcher can request whether it is now allowed to perform a search.
      Specified by:
      isSearchingAllowed in interface KeyFilesSearchReceiver
      Returns:
      true, if the searcher is allowed to search now.
    • processWindowEvent

      protected void processWindowEvent(WindowEvent e)
      Overwritten method to terminate the application if the window is closed.
      Overrides:
      processWindowEvent in class JFrame
      Parameters:
      e - a window event.