Class PlotFileFilter

java.lang.Object
javax.swing.filechooser.FileFilter
edu.cnu.mdi.splot.io.PlotFileFilter

public final class PlotFileFilter extends FileFilter
File filter for persisted splot plot-spec JSON files.

Suggested extensions:

  • .plot.json (preferred)
  • .splot.json (accepted)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The edu.cnu.mdi.dialog.FileDialogs directory-history purpose shared by every plot open/save dialog (both a single PlotView and a MultiplotPanel's "Save Active Plot As"), so opening and saving plot files -- from either view -- remember and reuse one directory rather than each tracking its own.
    static final String
    Alternate accepted extension (including leading dot).
    static final String
    Preferred extension (including leading dot).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    static File
    If f already has a supported extension, returns it unchanged; otherwise appends EXT_PREFERRED.
     
    static boolean
    Returns true if the file name matches a supported plot extension.

    Methods inherited from class java.lang.Object

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

    • EXT_PREFERRED

      public static final String EXT_PREFERRED
      Preferred extension (including leading dot).
      See Also:
    • EXT_ALT

      public static final String EXT_ALT
      Alternate accepted extension (including leading dot).
      See Also:
    • DIALOG_PURPOSE

      public static final String DIALOG_PURPOSE
      The edu.cnu.mdi.dialog.FileDialogs directory-history purpose shared by every plot open/save dialog (both a single PlotView and a MultiplotPanel's "Save Active Plot As"), so opening and saving plot files -- from either view -- remember and reuse one directory rather than each tracking its own.
      See Also:
  • Constructor Details

    • PlotFileFilter

      public PlotFileFilter()
  • Method Details

    • accept

      public boolean accept(File f)
      Specified by:
      accept in class FileFilter
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in class FileFilter
    • isPlotFile

      public static boolean isPlotFile(File f)
      Returns true if the file name matches a supported plot extension.
    • ensurePlotExtension

      public static File ensurePlotExtension(File f)
      If f already has a supported extension, returns it unchanged; otherwise appends EXT_PREFERRED.