Package edu.cnu.mdi.splot.io
Class PlotFileFilter
java.lang.Object
javax.swing.filechooser.FileFilter
edu.cnu.mdi.splot.io.PlotFileFilter
File filter for persisted splot plot-spec JSON files.
Suggested extensions:
- .plot.json (preferred)
- .splot.json (accepted)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringTheedu.cnu.mdi.dialog.FileDialogsdirectory-history purpose shared by every plot open/save dialog (both a singlePlotViewand aMultiplotPanel'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 StringAlternate accepted extension (including leading dot).static final StringPreferred extension (including leading dot). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic FileIffalready has a supported extension, returns it unchanged; otherwise appendsEXT_PREFERRED.static booleanisPlotFile(File f) Returns true if the file name matches a supported plot extension.
-
Field Details
-
EXT_PREFERRED
Preferred extension (including leading dot).- See Also:
-
EXT_ALT
Alternate accepted extension (including leading dot).- See Also:
-
DIALOG_PURPOSE
Theedu.cnu.mdi.dialog.FileDialogsdirectory-history purpose shared by every plot open/save dialog (both a singlePlotViewand aMultiplotPanel'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
- Specified by:
acceptin classFileFilter
-
getDescription
- Specified by:
getDescriptionin classFileFilter
-
isPlotFile
Returns true if the file name matches a supported plot extension. -
ensurePlotExtension
Iffalready has a supported extension, returns it unchanged; otherwise appendsEXT_PREFERRED.
-