Package mgui.io.domestic.graphs
Class GraphFileWriter
java.lang.Object
mgui.io.FileWriter
mgui.io.domestic.graphs.GraphFileWriter
- All Implemented Interfaces:
InterfaceIO,IconObject
public class GraphFileWriter extends FileWriter
Abstract class for all graph writers.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description protected XMLObject.XMLTypexml_typeFields inherited from class mgui.io.FileWriter
dataFile, dataURL, failure_message, options, success_message -
Constructor Summary
Constructors Constructor Description GraphFileWriter(java.io.File file)Constructor setting the output file. -
Method Summary
Modifier and Type Method Description javax.swing.IcongetObjectIcon()Returns theIconassociated with this object.java.lang.StringgetTitle()XMLObject.XMLTypegetXMLType()Gets the current XML type for this writer.voidsetXMLType(XMLObject.XMLType type)Sets the XML type for this writer.booleanwrite(InterfaceIOOptions options, ProgressUpdater progress_bar)Writes this object according to the givenoptions.booleanwriteGraph(InterfaceAbstractGraph graph, ProgressUpdater progress_bar)Writes this graph to file using its domestic XML representation.Methods inherited from class mgui.io.FileWriter
getComplementIOType, getFailureMessage, getFile, getIOType, getLoaderComplement, getOptions, getProgressMessage, getSuccessMessage, getSupportedObjects, getURL, setFile, setOptions, setURL, toString, write, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
xml_type
-
-
Constructor Details
-
GraphFileWriter
public GraphFileWriter(java.io.File file)Constructor setting the output file.- Parameters:
file-
-
-
Method Details
-
setXMLType
Sets the XML type for this writer.- Parameters:
type-
-
getXMLType
Gets the current XML type for this writer.- Parameters:
type-
-
write
Description copied from class:FileWriterWrites 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.- Specified by:
writein classFileWriter- Returns:
-
getTitle
public java.lang.String getTitle()- Specified by:
getTitlein interfaceInterfaceIO- Overrides:
getTitlein classFileWriter
-
writeGraph
public boolean writeGraph(InterfaceAbstractGraph graph, ProgressUpdater progress_bar) throws java.io.IOExceptionWrites this graph to file using its domestic XML representation.- Parameters:
graph-- Returns:
- Throws:
java.io.IOException
-
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from interface:IconObjectReturns theIconassociated with this object.- Specified by:
getObjectIconin interfaceIconObject- Overrides:
getObjectIconin classFileWriter- Returns:
-