Class ImageImporter
java.lang.Object
org.openstreetmap.josm.gui.io.importexport.FileImporter
org.openstreetmap.josm.gui.io.importexport.ImageImporter
- All Implemented Interfaces:
Comparable<FileImporter>
File importer allowing to import geotagged images
- Since:
- 17548
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ExtensionFileFilterThe default file filterstatic final ExtensionFileFilterAn alternate file filter that also includes folders.private GpxLayerThe supported image file types on the current systemprivate static final PatternCheck if the filename starts with a borked path (File(java.net.URI)drops consecutive/characters).private static final PatternCheck for the beginning of a "good" urlFields inherited from class org.openstreetmap.josm.gui.io.importexport.FileImporter
filter, options -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newImageImporter.ImageImporter(boolean includeFolders) Constructs a newImageImporterwith folders selection, if wanted.ImageImporter(GpxLayer gpx) Constructs a newImageImporterfor the given GPX layer. -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptFile(File pathname) Determines if this file importer accepts the given file.(package private) static voidaddRecursiveFiles(List<File> files, Set<String> visitedDirs, List<File> sel, ProgressMonitor progressMonitor) (package private) static voidaddRecursiveFiles(Set<Options> options, List<File> files, Set<String> visitedDirs, List<File> sel, ProgressMonitor progressMonitor) private static ExtensionFileFiltergetFileFilters(boolean folder) doubleNeeds to be the last, to avoid problems.voidimportData(List<File> sel, ProgressMonitor progressMonitor) Needs to be implemented if isBatchImporter() returns true.booleanA 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 Details
-
URL_START_BAD
Check if the filename starts with a borked path (File(java.net.URI)drops consecutive/characters). -
URL_START_GOOD
Check for the beginning of a "good" url -
gpx
-
SUPPORTED_FILE_TYPES
The supported image file types on the current system -
FILE_FILTER
The default file filter -
FILE_FILTER_WITH_FOLDERS
An alternate file filter that also includes folders.
-
-
Constructor Details
-
ImageImporter
public ImageImporter()Constructs a newImageImporter. -
ImageImporter
Constructs a newImageImporterwith folders selection, if wanted.- Parameters:
includeFolders- If true, includes folders in the file filter
-
ImageImporter
Constructs a newImageImporterfor the given GPX layer. Folders selection is allowed.- Parameters:
gpx- The GPX layer
-
-
Method Details
-
getFileFilters
-
acceptFile
Description copied from class:FileImporterDetermines if this file importer accepts the given file.- Overrides:
acceptFilein classFileImporter- Parameters:
pathname- The file to test- Returns:
trueif this file importer accepts the given file,falseotherwise
-
importData
public void importData(List<File> sel, ProgressMonitor progressMonitor) throws IOException, IllegalDataException Description copied from class:FileImporterNeeds to be implemented if isBatchImporter() returns true.- Overrides:
importDatain 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
Description copied from class:FileImporterA batch importer is a file importer that prefers to read multiple files at the same time.- Overrides:
isBatchImporterin classFileImporter- Returns:
trueif this importer is a batch importer
-
getPriority
Needs to be the last, to avoid problems.- Overrides:
getPriorityin classFileImporter- Returns:
- priority
-