Class FileExporter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean acceptFile​(java.io.File pathname, Layer layer)
      Check if this exporter can export a certain layer to a certain file.
      void activeOrEditLayerChanged​(MainLayerManager.ActiveLayerChangeEvent e)
      Called whenever the active or edit layer changed.
      void exportData​(java.io.File file, Layer layer)
      Execute the data export.
      void exportDataQuiet​(java.io.File file, Layer layer)
      Execute the data export without prompting the user.
      boolean isCanceled()
      Determines if this exporter has been canceled during export.
      boolean isEnabled()
      Returns the enabled state of this FileExporter.
      void setCanceled​(boolean canceled)
      Marks this exporter as canceled.
      void setEnabled​(boolean enabled)
      Sets the enabled state of the FileExporter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • acceptFile

        public boolean acceptFile​(java.io.File pathname,
                                  Layer layer)
        Check if this exporter can export a certain layer to a certain file. Most exporters support just a single layer type.
        Parameters:
        pathname - the target file name (check file extension using the filter
        layer - the layer requested for export
        Returns:
        true, if the exporter can handle the layer and filename is okay
      • exportData

        public void exportData​(java.io.File file,
                               Layer layer)
                        throws java.io.IOException
        Execute the data export. (To be overridden by subclasses.)
        Parameters:
        file - target file
        layer - the layer to export
        Throws:
        java.io.IOException - in case of an IO error
      • exportDataQuiet

        public void exportDataQuiet​(java.io.File file,
                                    Layer layer)
                             throws java.io.IOException
        Execute the data export without prompting the user. (To be overridden by subclasses.)
        Parameters:
        file - target file
        layer - the layer to export
        Throws:
        java.io.IOException - in case of an IO error
        Since:
        15496
      • isEnabled

        public final boolean isEnabled()
        Returns the enabled state of this FileExporter. When enabled, it is listed and usable in "File → Save" dialogs.
        Returns:
        true if this FileExporter is enabled
        Since:
        5459
      • setEnabled

        public final void setEnabled​(boolean enabled)
        Sets the enabled state of the FileExporter. When enabled, it is listed and usable in "File → Save" dialogs.
        Parameters:
        enabled - true to enable this FileExporter, false to disable it
        Since:
        5459
      • isCanceled

        public final boolean isCanceled()
        Determines if this exporter has been canceled during export.
        Returns:
        true if this FileExporter has been canceled
        Since:
        6815
      • setCanceled

        public final void setCanceled​(boolean canceled)
        Marks this exporter as canceled.
        Parameters:
        canceled - true to mark this exporter as canceled, false otherwise
        Since:
        6815