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.XMLType
xml_type
Fields 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.Icon
getObjectIcon()
Returns theIcon
associated with this object.java.lang.String
getTitle()
XMLObject.XMLType
getXMLType()
Gets the current XML type for this writer.void
setXMLType(XMLObject.XMLType type)
Sets the XML type for this writer.boolean
write(InterfaceIOOptions options, ProgressUpdater progress_bar)
Writes this object according to the givenoptions
.boolean
writeGraph(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, write
Methods 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:FileWriter
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.- Specified by:
write
in classFileWriter
- Returns:
-
getTitle
public java.lang.String getTitle()- Specified by:
getTitle
in interfaceInterfaceIO
- Overrides:
getTitle
in 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:IconObject
Returns theIcon
associated with this object.- Specified by:
getObjectIcon
in interfaceIconObject
- Overrides:
getObjectIcon
in classFileWriter
- Returns:
-