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 Summary
Fields Modifier and Type Field Description protected java.io.FiledataFileprotected java.net.URLdataURLprotected java.lang.Stringfailure_messageprotected InterfaceIOOptionsoptionsprotected java.lang.Stringsuccess_message -
Constructor Summary
Constructors Constructor Description FileWriter() -
Method Summary
Modifier and Type Method Description InterfaceIOTypegetComplementIOType()Returns anInterfaceIOTypespecifying theInterfaceIOwhich performs the complementary operation to this one.java.lang.StringgetFailureMessage()java.io.FilegetFile()InterfaceIOTypegetIOType()Returns the registered IO type for this object, if one existsInterfaceIOTypegetLoaderComplement()Returns theInterfaceIOTypeof aFileLoaderwhich is the complement of this writer; i.e., reads what this writer writes with identical encoding.javax.swing.IcongetObjectIcon()Returns theIconassociated with this object.InterfaceIOOptionsgetOptions()Gets theInterfaceIOOptionsspecifying this I/O operation, if options have been set; otherwise returnsnull.java.lang.StringgetProgressMessage()java.lang.StringgetSuccessMessage()java.util.ArrayList<java.lang.Class<?>>getSupportedObjects()Returns a list of classes for objects which are supported by this I/O interfacejava.lang.StringgetTitle()java.net.URLgetURL()voidsetFile(java.io.File file)voidsetOptions(InterfaceIOOptions options)Sets theInterfaceIOOptionsspecifying this I/O operationvoidsetURL(java.net.URL url)java.lang.StringtoString()booleanwrite()Write the object to file subject to the given set of options.booleanwrite(ProgressUpdater progress_bar)abstract booleanwrite(InterfaceIOOptions options, ProgressUpdater progress_bar)Writes this object according to the givenoptions.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
dataFile
protected java.io.File dataFile -
dataURL
protected java.net.URL dataURL -
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:
setFilein interfaceInterfaceIO
-
setURL
public void setURL(java.net.URL url)- Specified by:
setURLin interfaceInterfaceIO
-
getFile
public java.io.File getFile() -
getURL
public java.net.URL getURL() -
setOptions
Description copied from interface:InterfaceIOSets theInterfaceIOOptionsspecifying this I/O operation- Specified by:
setOptionsin interfaceInterfaceIO
-
getOptions
Description copied from interface:InterfaceIOGets theInterfaceIOOptionsspecifying this I/O operation, if options have been set; otherwise returnsnull.- Specified by:
getOptionsin interfaceInterfaceIO
-
write
public boolean write()Write the object to file subject to the given set of options.- Returns:
-
write
-
getIOType
Description copied from interface:InterfaceIOReturns the registered IO type for this object, if one exists- Specified by:
getIOTypein interfaceInterfaceIO- Returns:
- the registered IO type, or
nullif none exists
-
write
Writes this object according to the givenoptions. If loaded object is of typePersistentObject, 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:
getProgressMessagein interfaceInterfaceIO
-
getSuccessMessage
public java.lang.String getSuccessMessage()- Specified by:
getSuccessMessagein interfaceInterfaceIO
-
getFailureMessage
public java.lang.String getFailureMessage() -
getTitle
public java.lang.String getTitle()- Specified by:
getTitlein interfaceInterfaceIO
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
getLoaderComplement
Returns theInterfaceIOTypeof aFileLoaderwhich 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
nullif no complement is defined.- Returns:
-
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from interface:IconObjectReturns theIconassociated with this object.- Specified by:
getObjectIconin interfaceIconObject- Returns:
-
getSupportedObjects
public java.util.ArrayList<java.lang.Class<?>> getSupportedObjects()Description copied from interface:InterfaceIOReturns a list of classes for objects which are supported by this I/O interface- Specified by:
getSupportedObjectsin interfaceInterfaceIO- Returns:
-
getComplementIOType
Description copied from interface:InterfaceIOReturns anInterfaceIOTypespecifying theInterfaceIOwhich performs the complementary operation to this one. I.e., loaders should specify their complementary writers.- Specified by:
getComplementIOTypein interfaceInterfaceIO- Returns:
- The complementary class, or
nullif none is defined
-