Package mgui.io

Class FileWriter

java.lang.Object
mgui.io.FileWriter
All Implemented Interfaces:
InterfaceIO, IconObject
Direct Known Subclasses:
CaminoPipelineWriter, CaminoProjectWriter, CaretAreaColourWriter, ContinuousColourMapWriter, DataSourceDriverWriter, DataSourceWriter, DiscreteColourMapWriter, ExportDataTableWriter, Graph3DWriter, GraphFileWriter, InterfaceShapeWriter, JsonFileWriter, MatrixFileWriter, NameMapWriter, PipelineProcessLibraryWriter, PipelineWriter, SurfaceDataFileWriter, SurfaceFileWriter, VideoWriter, View3DWriter, VolumeFileWriter, XMLWriter

public abstract class FileWriter
extends java.lang.Object
implements InterfaceIO
Base class for all file writer classes.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Details

    • dataFile

      protected java.io.File dataFile
    • dataURL

      protected java.net.URL dataURL
    • options

      protected InterfaceIOOptions options
    • failure_message

      protected java.lang.String failure_message
    • success_message

      protected java.lang.String success_message
  • Constructor Details

    • FileWriter

      public FileWriter()
  • Method Details

    • setFile

      public void setFile​(java.io.File file)
      Specified by:
      setFile in interface InterfaceIO
    • setURL

      public void setURL​(java.net.URL url)
      Specified by:
      setURL in interface InterfaceIO
    • getFile

      public java.io.File getFile()
    • getURL

      public java.net.URL getURL()
    • setOptions

      public void setOptions​(InterfaceIOOptions options)
      Description copied from interface: InterfaceIO
      Sets the InterfaceIOOptions specifying this I/O operation
      Specified by:
      setOptions in interface InterfaceIO
    • getOptions

      public InterfaceIOOptions getOptions()
      Description copied from interface: InterfaceIO
      Gets the InterfaceIOOptions specifying this I/O operation, if options have been set; otherwise returns null.
      Specified by:
      getOptions in interface InterfaceIO
    • write

      public boolean write()
      Write the object to file subject to the given set of options.
      Returns:
    • write

      public boolean write​(ProgressUpdater progress_bar)
    • getIOType

      public InterfaceIOType getIOType()
      Description copied from interface: InterfaceIO
      Returns the registered IO type for this object, if one exists
      Specified by:
      getIOType in interface InterfaceIO
      Returns:
      the registered IO type, or null if none exists
    • write

      public abstract boolean write​(InterfaceIOOptions options, ProgressUpdater progress_bar)
      Writes this object according to the given options. If loaded object is of type PersistentObject, this method should also set the file writer and reference URL for the object.
      Parameters:
      options -
      progress_bar -
      Returns:
    • getProgressMessage

      public java.lang.String getProgressMessage()
      Specified by:
      getProgressMessage in interface InterfaceIO
    • getSuccessMessage

      public java.lang.String getSuccessMessage()
      Specified by:
      getSuccessMessage in interface InterfaceIO
    • getFailureMessage

      public java.lang.String getFailureMessage()
    • getTitle

      public java.lang.String getTitle()
      Specified by:
      getTitle in interface InterfaceIO
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • getLoaderComplement

      public InterfaceIOType getLoaderComplement()
      Returns the InterfaceIOType of a FileLoader which is the complement of this writer; i.e., reads what this writer writes with identical encoding. Transfer between loader and writer should be lossless.

      Returns null if no complement is defined.

      Returns:
    • getObjectIcon

      public javax.swing.Icon getObjectIcon()
      Description copied from interface: IconObject
      Returns the Icon associated with this object.
      Specified by:
      getObjectIcon in interface IconObject
      Returns:
    • getSupportedObjects

      public java.util.ArrayList<java.lang.Class<?>> getSupportedObjects()
      Description copied from interface: InterfaceIO
      Returns a list of classes for objects which are supported by this I/O interface
      Specified by:
      getSupportedObjects in interface InterfaceIO
      Returns:
    • getComplementIOType

      public InterfaceIOType getComplementIOType()
      Description copied from interface: InterfaceIO
      Returns an InterfaceIOType specifying the InterfaceIO which performs the complementary operation to this one. I.e., loaders should specify their complementary writers.
      Specified by:
      getComplementIOType in interface InterfaceIO
      Returns:
      The complementary class, or null if none is defined