com.tensegrity.gui.graphdocument.persistence
Class GraphDocumentWriter

java.lang.Object
  extended bycom.tensegrity.gui.graphdocument.persistence.GraphDocumentWriter
All Implemented Interfaces:
DocumentWriter
Direct Known Subclasses:
SwingGraphDocumentWriter, SwtGraphDocumentWriter

public abstract class GraphDocumentWriter
extends java.lang.Object
implements DocumentWriter

Base implementation of the DocumentWriter interface for writing GraphDocuments.

Version:
$Id: GraphDocumentWriter.java,v 1.19 2006/03/02 11:40:57 BurkhardWick Exp $
Author:
BurkhardWick, MKegel

Field Summary
protected  ApplicationFrame applicationframe
          The application frame, stored from constructor for internal use
static java.lang.String DOCUMENTSETTINGS
          Identifier for the top-level DocumentSettings list attribute.
 
Constructor Summary
GraphDocumentWriter(ApplicationFrame applicationframe)
          Constructor
 
Method Summary
protected  void clearUsedItems()
           
protected  AttributeList getImageList(GraphDocument gd)
          Creates a list of images as AttributeList that can be serialized
protected  void prepareForWriting(Document doc)
          Makes preparations depending on the settings in the given document.
protected  void saveGeometries(AttributeList list, GraphDocument gDoc)
          Saves the geometries to the given AttributeList structure.
protected  void saveLayouts(AttributeList list, GraphDocument gDoc)
          Saves the layout configuration to the given AttributeList structure.
protected  void saveRules(AttributeList list, GraphDocument gDoc)
          Saves the rules to the given AttributeList structure.
protected  void saveStyles(AttributeList list, GraphDocument gDoc)
          Saves the styles to the given AttributeList structure.
protected  void writeDocumentToStream(Document doc, AttributeList list, java.io.OutputStream output)
          Writes the given AttributeList to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.tensegrity.gui.document.persistence.DocumentWriter
writeDocument
 

Field Detail

applicationframe

protected final ApplicationFrame applicationframe
The application frame, stored from constructor for internal use


DOCUMENTSETTINGS

public static final java.lang.String DOCUMENTSETTINGS
Identifier for the top-level DocumentSettings list attribute.

See Also:
Constant Field Values
Constructor Detail

GraphDocumentWriter

public GraphDocumentWriter(ApplicationFrame applicationframe)
Constructor

Parameters:
applicationframe - The application frame
Method Detail

writeDocumentToStream

protected void writeDocumentToStream(Document doc,
                                     AttributeList list,
                                     java.io.OutputStream output)
                              throws WriteException,
                                     java.io.IOException
Writes the given AttributeList to the output stream. The given document is only used to retrieve settings, the data is not modified by this method.

Parameters:
doc - The document that contains the data
list - The data that should be written to the stream
output - The output stream
Throws:
WriteException - If an error occured during writing
java.io.IOException - If an error occured during stream access

prepareForWriting

protected void prepareForWriting(Document doc)
Makes preparations depending on the settings in the given document.

Parameters:
doc - The document to get the settings from

saveStyles

protected final void saveStyles(AttributeList list,
                                GraphDocument gDoc)
                         throws IllegalAttributeException,
                                IllegalNameException,
                                IllegalValueException,
                                ConstraintViolationException,
                                SerializeException
Saves the styles to the given AttributeList structure. Whether data will be stored and the amount of data depends on the settings of the given graphdocument.

Parameters:
list - The list to store the data in
gDoc - The graphdocument to store
Throws:
IllegalAttributeException
IllegalNameException
IllegalValueException
ConstraintViolationException
SerializeException

saveGeometries

protected final void saveGeometries(AttributeList list,
                                    GraphDocument gDoc)
                             throws IllegalAttributeException,
                                    IllegalNameException,
                                    IllegalValueException,
                                    ConstraintViolationException,
                                    SerializeException
Saves the geometries to the given AttributeList structure. Whether data will be stored and the amount of data depends on the settings of the given graphdocument.

Parameters:
list - The list to store the data in
gDoc - The graphdocument to store
Throws:
IllegalAttributeException
IllegalNameException
IllegalValueException
ConstraintViolationException
SerializeException

saveRules

protected final void saveRules(AttributeList list,
                               GraphDocument gDoc)
                        throws IllegalAttributeException,
                               IllegalNameException,
                               IllegalValueException,
                               ConstraintViolationException,
                               SerializeException
Saves the rules to the given AttributeList structure. Whether data will be stored and the amount of data depends on the settings of the given graphdocument.

Parameters:
list - The list to store the data in
gDoc - The graphdocument to store
Throws:
IllegalAttributeException
IllegalNameException
IllegalValueException
ConstraintViolationException
SerializeException

saveLayouts

protected final void saveLayouts(AttributeList list,
                                 GraphDocument gDoc)
                          throws IllegalAttributeException,
                                 IllegalNameException,
                                 IllegalValueException,
                                 ConstraintViolationException
Saves the layout configuration to the given AttributeList structure. Whether data will be stored and the amount of data depends on the settings of the given graphdocument.

Parameters:
list - The list to store the data in
gDoc - The graphdocument to store
Throws:
IllegalAttributeException
IllegalNameException
IllegalValueException
ConstraintViolationException
SerializeException

clearUsedItems

protected final void clearUsedItems()

getImageList

protected final AttributeList getImageList(GraphDocument gd)
Creates a list of images as AttributeList that can be serialized

Parameters:
gd - The GraphDocument
Returns:
The list of found images


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.