public abstract class FileImporter extends Object implements Comparable<FileImporter>, MapView.LayerChangeListener
Modifier and Type | Field and Description |
---|---|
private boolean |
enabled |
ExtensionFileFilter |
filter |
Constructor and Description |
---|
FileImporter(ExtensionFileFilter filter) |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptFile(File pathname) |
void |
activeLayerChange(Layer oldLayer,
Layer newLayer)
Notifies this listener that the active layer has changed.
|
int |
compareTo(FileImporter other) |
static org.apache.tools.bzip2.CBZip2InputStream |
getBZip2InputStream(InputStream in) |
static GZIPInputStream |
getGZipInputStream(InputStream in) |
double |
getPriority()
If multiple files (with multiple file formats) are selected,
they are opened in the order of their priorities.
|
void |
importData(File file,
ProgressMonitor progressMonitor)
Needs to be implemented if isBatchImporter() returns false.
|
void |
importData(List<File> files,
ProgressMonitor progressMonitor)
Needs to be implemented if isBatchImporter() returns true.
|
boolean |
importDataHandleExceptions(File f,
ProgressMonitor progressMonitor)
Wrapper to give meaningful output if things go wrong.
|
boolean |
importDataHandleExceptions(List<File> files,
ProgressMonitor progressMonitor) |
boolean |
isBatchImporter()
A batch importer is a file importer that prefers to read multiple files at the same time.
|
boolean |
isEnabled()
Returns the enabled state of this
FileImporter . |
void |
layerAdded(Layer newLayer)
Notifies this listener that a layer has been added.
|
void |
layerRemoved(Layer oldLayer)
Notifies this listener that a layer has been removed.
|
void |
setEnabled(boolean enabled)
Sets the enabled state of the
FileImporter . |
public final ExtensionFileFilter filter
private boolean enabled
public FileImporter(ExtensionFileFilter filter)
public boolean acceptFile(File pathname)
public boolean isBatchImporter()
public void importData(File file, ProgressMonitor progressMonitor) throws IOException, IllegalDataException
IOException
IllegalDataException
public void importData(List<File> files, ProgressMonitor progressMonitor) throws IOException, IllegalDataException
IOException
IllegalDataException
public boolean importDataHandleExceptions(File f, ProgressMonitor progressMonitor)
public boolean importDataHandleExceptions(List<File> files, ProgressMonitor progressMonitor)
public double getPriority()
public int compareTo(FileImporter other)
compareTo
in interface Comparable<FileImporter>
public static org.apache.tools.bzip2.CBZip2InputStream getBZip2InputStream(InputStream in) throws IOException
IOException
public static GZIPInputStream getGZipInputStream(InputStream in) throws IOException
IOException
public final boolean isEnabled()
FileImporter
. When enabled, it is listed and usable in "File->Open" dialog.FileImporter
is enabledpublic final void setEnabled(boolean enabled)
FileImporter
. When enabled, it is listed and usable in "File->Open" dialog.enabled
- true to enable this FileImporter
, false to disable itpublic void activeLayerChange(Layer oldLayer, Layer newLayer)
MapView.LayerChangeListener
activeLayerChange
in interface MapView.LayerChangeListener
oldLayer
- The previous active layernewLayer
- The new activer layerpublic void layerAdded(Layer newLayer)
MapView.LayerChangeListener
layerAdded
in interface MapView.LayerChangeListener
newLayer
- The new added layerpublic void layerRemoved(Layer oldLayer)
MapView.LayerChangeListener
layerRemoved
in interface MapView.LayerChangeListener
oldLayer
- The old removed layer