|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graph.persistence.GraphPersistence
The GraphPersistence class provides all functionalities to
read and write graphs to file or stream. This includes adding all the graph entities
likes styles, geometries or printing setup. You also can write out (read in of
course, too) all embedded image files of a graph.
| Field Summary | |
static java.lang.String |
FRAMEWORK_VERSION_FILE_KEY
REVIEWGRAPHSERIALIZATION (mk) comment |
static java.lang.String |
GEOMETRIES
Identifier for the toplevel Geometry list attribute. |
static java.lang.String |
PAGEFORMAT
Identifier for the top-level PageFormat list attribute. |
static java.lang.String |
STYLES
Identifier for the toplevel Style list attribute. |
| Method Summary | |
static AttributeList |
getGeometries(AttributeList list,
boolean remove)
Returns the geometries attribute list from the attribute list loaded from a graph xml file. |
static AttributeList |
getImages(AttributeList list,
boolean remove)
Returns the images attribute list from the attribute list loaded from a graph xml file. |
static AttributeSet |
getLayoutConfiguration(AttributeList list,
boolean remove)
Returns the LayoutConfiguration AttributeSet of the given AttributeList. |
static AttributeList |
getPageFormat(AttributeList list,
boolean remove)
Returns the page format that is stored in the given attribute list or null if there is no page format. |
static AttributeList |
getRules(AttributeList list,
boolean remove)
Returns the rules attribute list from the attribute list loaded from a graph xml file. |
static AttributeList |
getStyles(AttributeList list,
boolean remove)
Returns the styles attribute list from the attribute list loaded from a graph xml file. |
static RuleRegistry |
readRules(AttributeList list)
Method readRules reads the rule elements and creates a new RuleRegistry. |
static VisualGraphView |
readVisualGraphView(AttributeList list,
ViewBuilderFilter listener)
Reads a VisualGraphView from the given InputStream and uses the ViewBuilderFilter. |
static VisualGraphView |
readVisualGraphView(java.io.File file)
Reads a VisualGraphView from the File given by
file and returns it. |
static VisualGraphView |
readVisualGraphView(java.io.File file,
ViewBuilderFilter listener)
Reads a VisualGraphView from the File given
by file and returns it. |
static VisualGraphView |
readVisualGraphView(java.io.InputStream in)
Reads a VisualGraphView from the InputStream
given by in and returns it. |
static VisualGraphView |
readVisualGraphView(java.io.InputStream in,
ViewBuilderFilter listener)
Reads a VisualGraphView from the given InputStream and uses the ViewBuilderFilter. |
static VisualGraphView |
readVisualGraphView(java.io.InputStream in,
ViewBuilderFilter listener,
Attribute outAttributeList)
Reads a VisualGraphView from the given InputStream and uses the ViewBuilderFilter. |
static void |
writeVisualGraphView(AttributeList list,
java.io.OutputStream outputstream)
Writes a VisualGraphView serialization in form of the
AttributeList given by list to the the
OutputStream given by os.
|
static void |
writeVisualGraphView(VisualGraphView visualgraphview,
java.io.File file)
Writes the VisualGraphView given by
VisualGraphView to the File given by
file. |
static void |
writeVisualGraphView(VisualGraphView visualgraphview,
java.io.File file,
ViewSerializerFilter serializefilter,
Attribute preview)
Writes a given VisualGraphView to the given file by using
the SerializeFilter. |
static void |
writeVisualGraphView(VisualGraphView visualgraphview,
java.io.File file,
ViewSerializerFilter serializefilter,
Attribute preview,
AttributeList imageList)
Writes a given VisualGraphView to the given file by using
the SerializeFilter. |
static void |
writeVisualGraphView(VisualGraphView visualgraphview,
java.io.File file,
ViewSerializerFilter serializefilter,
Attribute preview,
AttributeList imageList,
AttributeList pageFormat)
Writes the visualgraphview to the file.
|
static void |
writeVisualGraphView(VisualGraphView visualgraphview,
java.io.OutputStream out,
ViewSerializerFilter serializefilter)
Writes the VisualGraphView given by
VisualGraphView to the OutputStream given by
out. |
static void |
writeVisualGraphView(VisualGraphView visualgraphview,
java.io.OutputStream outputstream,
ViewSerializerFilter serializefilter,
Attribute preview,
AttributeList imageList,
AttributeList pageFormat)
Writes the visualgraphview to the outputstream.
|
static AttributeList |
writeVisualGraphView(VisualGraphView visualgraphview,
ViewSerializerFilter serializefilter,
Attribute preview,
AttributeList imageList,
AttributeList pageFormat)
Returns an AttributeList serialization of a given VisualGraphView
by using the SerializeFilter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String FRAMEWORK_VERSION_FILE_KEY
public static final java.lang.String GEOMETRIES
public static final java.lang.String STYLES
public static final java.lang.String PAGEFORMAT
| Method Detail |
public static final void writeVisualGraphView(VisualGraphView visualgraphview,
java.io.OutputStream out,
ViewSerializerFilter serializefilter)
throws SerializeException,
WriteException
VisualGraphView given by
VisualGraphView to the OutputStream given by
out.
visualgraphview - the VisualGraphView to saveout - the OutputStream to write toserializefilter - used while serializing the view.
SerializeException - thrown when the serialization of the View fails.
java.io.FileNotFoundException - thrown when the
XMLIOUtilities.writeXML(OutputStream, String, AttributeList)
fails.
java.io.IOException - thrown when the
XMLIOUtilities.writeXML(OutputStream, String, AttributeList)
fails.
WriteException
public static final VisualGraphView readVisualGraphView(java.io.InputStream in)
throws ReadException,
BuildException
VisualGraphView from the InputStream
given by in and returns it.
in - the InputStream to read the
VisualGraphView from
VisualGraphView.
ReadException - delegated from the
readVisualGraphView(InputStream, ViewBuilderFilter)
call.
BuildException - delegated from the
readVisualGraphView(InputStream, ViewBuilderFilter)
call.
public static final VisualGraphView readVisualGraphView(java.io.InputStream in,
ViewBuilderFilter listener)
throws ReadException,
BuildException
in - the InputStream to read the
VisualGraphView fromlistener - a ViewBuilderFilter to be used while building the View from
the read AttributeList.
VisualGraphView.
BuildException - thrown whenever the building of components fails.
ReadException - thrown when the XMLIOUtilities.readXML(InputStream)
fails.
public static final VisualGraphView readVisualGraphView(java.io.InputStream in,
ViewBuilderFilter listener,
Attribute outAttributeList)
throws ReadException,
BuildException
in - the InputStream to read the
VisualGraphView fromlistener - a ViewBuilderFilter to be used while building the View from
the read AttributeList.outAttributeList - Attribute to store the attributelist into
VisualGraphView.
BuildException - thrown whenever the building of components fails.
ReadException - thrown when the XMLIOUtilities.readXML(InputStream)
fails.
public static final VisualGraphView readVisualGraphView(AttributeList list,
ViewBuilderFilter listener)
throws BuildException
list - the AttributeList to read the VisualGraphView fromlistener - a ViewBuilderFilter to be used while building the View from
the read AttributeList.
VisualGraphView.
BuildException - thrown whenever the building of components fails.
public static final void writeVisualGraphView(VisualGraphView visualgraphview,
java.io.File file)
throws SerializeException,
WriteException
VisualGraphView given by
VisualGraphView to the File given by
file.
visualgraphview - the VisualGraphView to savefile - the File to write to
SerializeException - thrown whenever the serialization of the
given VisualGraphView fails.
WriteException - thrown when an error occurs while writing to the
given Output stream
public static final void writeVisualGraphView(VisualGraphView visualgraphview,
java.io.File file,
ViewSerializerFilter serializefilter,
Attribute preview)
throws SerializeException,
WriteException
VisualGraphView to the given file by using
the SerializeFilter. The preview parameter contains the
optional preview image as Attribute. the imageList contains
the list of images, previously collected from the
VisualGraphView.
visualgraphview - the target VisualGraphView to save.file - the destination file.serializefilter - the Filter used while serializing the view.preview - the preview Attribute.
SerializeException - thrown whenever the serialization of the
given VisualGraphView fails.
WriteException - thrown when an error occurs while writing to the
given Output stream
public static final void writeVisualGraphView(VisualGraphView visualgraphview,
java.io.File file,
ViewSerializerFilter serializefilter,
Attribute preview,
AttributeList imageList,
AttributeList pageFormat)
throws SerializeException,
WriteException
visualgraphview to the file.
While the serialization of the visualgraphview the
serializefilter is called at certain points.
preview parameter contains the optional preview
image in form of an Attribute.
imageList contains the list of images, previously
collected from the visualgraphview.
pageFormat parameter holds all the print page
setup relevant information.
visualgraphview - the target VisualGraphView to save.file - the destination file.serializefilter - the Filter used while serializing the view.preview - the preview Attribute.imageList - the list of images.pageFormat - the AttributeList defining this views print setup.
SerializeException - thrown whenever the serialization of the
given VisualGraphView fails.
WriteException - thrown when an error occurs while writing to the
given Output stream
public static final void writeVisualGraphView(VisualGraphView visualgraphview,
java.io.OutputStream outputstream,
ViewSerializerFilter serializefilter,
Attribute preview,
AttributeList imageList,
AttributeList pageFormat)
throws SerializeException,
WriteException,
java.io.IOException
visualgraphview to the outputstream.
While the serialization of the visualgraphview the
serializefilter is called at certain points.
preview parameter contains the optional preview
image in form of an Attribute.
imageList contains the list of images, previously
collected from the visualgraphview.
pageFormat parameter holds all the print page
setup relevant information.
OutputStream.flush() of the given outputstream is
called.
visualgraphview - the target VisualGraphView to save.outputstream - the destination stream.serializefilter - the Filter used while serializing the view.preview - the preview Attribute.imageList - the list of images.pageFormat - the AttributeList defining this views print setup.
SerializeException - thrown whenever the serialization of the
given VisualGraphView fails.
WriteException - thrown when an error occurs while writing to the
given Output stream
java.io.IOException - delegated from the call to
OutputStream.flush() call.
public static final void writeVisualGraphView(AttributeList list,
java.io.OutputStream outputstream)
throws WriteException,
java.io.IOException
VisualGraphView serialization in form of the
AttributeList given by list to the the
OutputStream given by os.
OutputStream.flush() of the given outputstream is
called.
list - The serialization of the graphoutputstream - the destination stream.
WriteException - thrown when an error occurs while writing to the
given Output stream
java.io.IOException - delegated from the call to
OutputStream.flush() call.
public static final AttributeList writeVisualGraphView(VisualGraphView visualgraphview,
ViewSerializerFilter serializefilter,
Attribute preview,
AttributeList imageList,
AttributeList pageFormat)
throws SerializeException
VisualGraphView
by using the SerializeFilter. The preview parameter contains the
optional preview image as Attribute.
The imageList contains
the list of images, previously collected from the
VisualGraphView.
The pageFormat parameter holds all the print page setup
relevant attributes.
visualgraphview - the target VisualGraphView to save.serializefilter - the Filter used while serializing the view.preview - the preview Attribute.imageList - the list of images.pageFormat - the AttributeList defining this views print setup.
SerializeException - thrown whenever the serialization of the View
or the Style and Geometries fails.
public static final void writeVisualGraphView(VisualGraphView visualgraphview,
java.io.File file,
ViewSerializerFilter serializefilter,
Attribute preview,
AttributeList imageList)
throws SerializeException,
WriteException
VisualGraphView to the given file by using
the SerializeFilter. The preview parameter contains the
optional preview image as Attribute. the imageList
contains the list of images, previously collected from the
VisualGraphView.
visualgraphview - the target VisualGraphView to save.file - the destination file.serializefilter - the Filter used while serializing the view.preview - the preview Attribute.imageList - the list of images.
SerializeException - thrown whenever the serialization of the given
VisualGraphView fails.
WriteException - thrown when an error occurs while writing to the
given Output stream
public static final VisualGraphView readVisualGraphView(java.io.File file)
throws ReadException,
BuildException
VisualGraphView from the File given by
file and returns it.
file - the File to read the
VisualGraphView from
VisualGraphView.
BuildException - delegated from the
readVisualGraphView(InputStream, ViewBuilderFilter) call.
ReadException - delegated from the
readVisualGraphView(InputStream, ViewBuilderFilter) call.
java.io.FileNotFoundException - delegated from the
readVisualGraphView(InputStream, ViewBuilderFilter) call.
XMLParseException - delegated from the
readVisualGraphView(InputStream, ViewBuilderFilter) call.
public static final VisualGraphView readVisualGraphView(java.io.File file,
ViewBuilderFilter listener)
throws ReadException,
BuildException
VisualGraphView from the File given
by file and returns it. The ViewBuilderFilter
will be used while building the VisualGraphView from the AttributeList.
file - the File to read the
VisualGraphView fromlistener - a ViewBuilderFilter.
VisualGraphView.
XMLParseException - delegated from the
readVisualGraphView(InputStream, ViewBuilderFilter) call.
BuildException - delegated from the
readVisualGraphView(InputStream, ViewBuilderFilter) call.
ReadException - delegated from the
readVisualGraphView(InputStream, ViewBuilderFilter) call.
java.io.FileNotFoundException - delegated from the
readVisualGraphView(InputStream, ViewBuilderFilter) call.
public static AttributeList getStyles(AttributeList list,
boolean remove)
throws BuildException
list - The complete attribute list loaded from a xml fileremove - true, to remove the attribute list after retrieval
AttributeList containing the styles
or null, if there is no styles definition
BuildException - forwarded from
BuilderUtilities.getAttributeValueMayBeNull(AttributeList, String, Class).
public static AttributeList getRules(AttributeList list,
boolean remove)
throws BuildException
list - The complete attribute list loaded from a xml fileremove - true, to remove the attribute list after retrieval
AttributeList containing the rules
or null, if there is no rules definition
BuildException - forwarded from
BuilderUtilities.getAttributeValueMayBeNull(AttributeList, String, Class).
public static AttributeList getGeometries(AttributeList list,
boolean remove)
throws BuildException
list - The complete attribute list loaded from a xml fileremove - true, to remove the attribute list after retrieval
AttributeList containing the geometries
or null, if there is no geometry definition
BuildException - forwarded from
BuilderUtilities.getAttributeValueMayBeNull(AttributeList, String, Class).
public static AttributeList getImages(AttributeList list,
boolean remove)
throws BuildException,
IllegalAttributeException,
ConstraintViolationException,
java.lang.CloneNotSupportedException
list - The complete attribute list loaded from a xml fileremove - true, to remove the attribute list after retrieval
AttributeList containing the images
BuildException - forwarded from
BuilderUtilities.getAttributeValueMayBeNull(AttributeList, String, Class).
java.lang.CloneNotSupportedException
ConstraintViolationException
IllegalAttributeException
public static final AttributeSet getLayoutConfiguration(AttributeList list,
boolean remove)
throws BuildException
list - the AttributeList obtain previously by the
readVisualGraphView(InputStream, ViewBuilderFilter, Attribute)
method.remove - true, to remove the attribute list after retrieval
null if no
such AttributeSet can be found.
BuildException - delegated by the
BuilderUtilities.getAttributeValueMayBeNull(AttributeList, String, Class)
call.
public static final AttributeList getPageFormat(AttributeList list,
boolean remove)
list - The list to retrieve the data fromremove - true, to remove the attribute list after retrieval
public static RuleRegistry readRules(AttributeList list)
throws BuildException
list -
BuildException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||