Class ImageImporter
- java.lang.Object
-
- org.openstreetmap.josm.gui.io.importexport.FileImporter
-
- org.openstreetmap.josm.gui.io.importexport.ImageImporter
-
- All Implemented Interfaces:
Comparable<FileImporter>
public class ImageImporter extends FileImporter
File importer allowing to import geotagged images- Since:
- 17548
-
-
Field Summary
Fields Modifier and Type Field Description static ExtensionFileFilter
FILE_FILTER
The default file filterstatic ExtensionFileFilter
FILE_FILTER_WITH_FOLDERS
An alternate file filter that also includes folders.private GpxLayer
gpx
static List<String>
SUPPORTED_FILE_TYPES
The supported image file types on the current systemprivate static Pattern
URL_START_BAD
Check if the filename starts with a borked path (File(java.net.URI)
drops consecutive/
characters).private static Pattern
URL_START_GOOD
Check for the beginning of a "good" url-
Fields inherited from class org.openstreetmap.josm.gui.io.importexport.FileImporter
filter, options
-
-
Constructor Summary
Constructors Constructor Description ImageImporter()
Constructs a newImageImporter
.ImageImporter(boolean includeFolders)
Constructs a newImageImporter
with folders selection, if wanted.ImageImporter(GpxLayer gpx)
Constructs a newImageImporter
for the given GPX layer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptFile(File pathname)
Determines if this file importer accepts the given file.(package private) static void
addRecursiveFiles(List<File> files, Set<String> visitedDirs, List<File> sel, ProgressMonitor progressMonitor)
(package private) static void
addRecursiveFiles(Set<Options> options, List<File> files, Set<String> visitedDirs, List<File> sel, ProgressMonitor progressMonitor)
private static ExtensionFileFilter
getFileFilters(boolean folder)
double
getPriority()
Needs to be the last, to avoid problems.void
importData(List<File> sel, ProgressMonitor progressMonitor)
Needs to be implemented if isBatchImporter() returns true.boolean
isBatchImporter()
A batch importer is a file importer that prefers to read multiple files at the same time.-
Methods inherited from class org.openstreetmap.josm.gui.io.importexport.FileImporter
compareTo, importData, importDataHandleExceptions, importDataHandleExceptions, isEnabled, setEnabled, setOptions
-
-
-
-
Field Detail
-
URL_START_BAD
private static final Pattern URL_START_BAD
Check if the filename starts with a borked path (File(java.net.URI)
drops consecutive/
characters).
-
URL_START_GOOD
private static final Pattern URL_START_GOOD
Check for the beginning of a "good" url
-
SUPPORTED_FILE_TYPES
public static final List<String> SUPPORTED_FILE_TYPES
The supported image file types on the current system
-
FILE_FILTER
public static final ExtensionFileFilter FILE_FILTER
The default file filter
-
FILE_FILTER_WITH_FOLDERS
public static final ExtensionFileFilter FILE_FILTER_WITH_FOLDERS
An alternate file filter that also includes folders.
-
-
Constructor Detail
-
ImageImporter
public ImageImporter()
Constructs a newImageImporter
.
-
ImageImporter
public ImageImporter(boolean includeFolders)
Constructs a newImageImporter
with folders selection, if wanted.- Parameters:
includeFolders
- If true, includes folders in the file filter
-
ImageImporter
public ImageImporter(GpxLayer gpx)
Constructs a newImageImporter
for the given GPX layer. Folders selection is allowed.- Parameters:
gpx
- The GPX layer
-
-
Method Detail
-
getFileFilters
private static ExtensionFileFilter getFileFilters(boolean folder)
-
acceptFile
public boolean acceptFile(File pathname)
Description copied from class:FileImporter
Determines if this file importer accepts the given file.- Overrides:
acceptFile
in classFileImporter
- Parameters:
pathname
- The file to test- Returns:
true
if this file importer accepts the given file,false
otherwise
-
importData
public void importData(List<File> sel, ProgressMonitor progressMonitor) throws IOException, IllegalDataException
Description copied from class:FileImporter
Needs to be implemented if isBatchImporter() returns true.- Overrides:
importData
in classFileImporter
- Parameters:
sel
- files to importprogressMonitor
- progress monitor- Throws:
IOException
- if any I/O error occursIllegalDataException
- if invalid data is read
-
addRecursiveFiles
static void addRecursiveFiles(List<File> files, Set<String> visitedDirs, List<File> sel, ProgressMonitor progressMonitor) throws IOException
- Throws:
IOException
-
addRecursiveFiles
static void addRecursiveFiles(Set<Options> options, List<File> files, Set<String> visitedDirs, List<File> sel, ProgressMonitor progressMonitor) throws IOException
- Throws:
IOException
-
isBatchImporter
public boolean isBatchImporter()
Description copied from class:FileImporter
A batch importer is a file importer that prefers to read multiple files at the same time.- Overrides:
isBatchImporter
in classFileImporter
- Returns:
true
if this importer is a batch importer
-
getPriority
public double getPriority()
Needs to be the last, to avoid problems.- Overrides:
getPriority
in classFileImporter
- Returns:
- priority
-
-