Package fim

Class PatternView

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

public class PatternView extends JFrame implements Runnable
Class for an item pattern viewer.
Since:
2013.11.28
See Also:
  • Field Details

    • VERSION

      public static final String VERSION
      the version string
      See Also:
    • PROGRAM

      public static final int PROGRAM
      mode flag: the viewer is a stand-alone program
      See Also:
    • LOAD_ITEMS

      public static final int LOAD_ITEMS
      mode flag: add menu items for loading trees
      See Also:
    • SAVE_ITEMS

      public static final int SAVE_ITEMS
      mode flag: add menu items for saving trees
      See Also:
    • FILE_ITEMS

      public static final int FILE_ITEMS
      mode flag: add menu items for loading and saving trees
      See Also:
    • ALL_ITEMS

      public static final int ALL_ITEMS
      mode flag: add all menu items
      See Also:
  • Constructor Details

    • PatternView

      public PatternView(int mode)
      Create an item pattern viewer.
      Parameters:
      mode - the mode flags
      Since:
      2013.11.28 (Christian Borgelt)
    • PatternView

      public PatternView(Component owner, int mode)
      Create an item pattern viewer.
      Parameters:
      owner - the component that is to own this viewer
      mode - the mode flags
      Since:
      2013.11.28 (Christian Borgelt)
  • Method Details

    • run

      public void run()
      Create the user interface.

      Following the recommendations in the Java tutorial, the user interface is created in the "run" method, which is invoked from the event queue, in order to avoid problems with threads.

      Specified by:
      run in interface Runnable
      Since:
      2013.11.28 (Christian Borgelt)
    • getFormatDlg

      public dialog.FormatDialog getFormatDlg()
      Get the data format dialog (create if necessary).
      Returns:
      the data format dialog
      Since:
      2013.11.28 (Christian Borgelt)
    • setMessage

      public void setMessage(String msg)
      Set the message to display in the status line.
      Parameters:
      msg - the message to display
      Since:
      2013.11.28 (Christian Borgelt)
    • setPatterns

      public void setPatterns(PatternSet pats)
      Set the item patterns to display.
      Parameters:
      pats - the item pattern set to display
      Since:
      2013.11.28 (Christian Borgelt)
    • getPatterns

      public PatternSet getPatterns()
      Get the currently displayed set of item patterns.
      Returns:
      the currently displayed set of item patterns
      Since:
      2013.11.28 (Christian Borgelt)
    • sortPatterns

      public void sortPatterns(int field)
      Sort the item patterns.
      Parameters:
      field - the identifier of the field to compare first
      Since:
      2014.10.05 (Christian Borgelt)
    • loadPatterns

      public boolean loadPatterns(File file)
      Load a set of patterns.
      Parameters:
      file - the file to load the patterns from
      Returns:
      whether the file was successfully loaded
      Since:
      2013.11.28 (Christian Borgelt)
    • savePatterns

      public boolean savePatterns(File file)
      Save the displayed set of patterns.
      Parameters:
      file - the file to save the patterns to
      Returns:
      whether the file was successfully saved
      Since:
      2013.11.28 (Christian Borgelt)
    • main

      public static void main(String[] args)
      Main function for command line invocation.
      Parameters:
      args - the command line arguments
      Since:
      2013.11.28 (Christian Borgelt)