edu.washington.NVisF.animator
Class AppearanceSerializer

java.lang.Object
  |
  +--edu.washington.NVisF.animator.AppearanceSerializer

public class AppearanceSerializer
extends java.lang.Object

This class provides static methods to write an Appearance object to file and to reconstruct the Appearance from a previously written file. Currently only the PointAttributes, LineAttributes, PolygonAttributes, ColoringAttributes, and RenderingAttributes are stored; the remainder can easily be added in a later version. If a filename is provided, the extension ".apr" is added if not already present.


Constructor Summary
AppearanceSerializer()
           
 
Method Summary
static Appearance readAppearance(java.io.ObjectInputStream input)
          Read an Appearance object from the given ObjectInputStream.
static Appearance readAppearance(java.lang.String fileName)
          Read an Appearance object from the file with the given name, with a ".apr" extension added if not already present.
static void writeAppearance(Appearance appearance, java.io.ObjectOutputStream output)
          Writes the provided Appearance object to the given ObjectOutputStream.
static void writeAppearance(Appearance appearance, java.lang.String fileName)
          Writes the provided Appearance object to a file with the given name, with a ".apr" extension added if not already present.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppearanceSerializer

public AppearanceSerializer()
Method Detail

writeAppearance

public static void writeAppearance(Appearance appearance,
                                   java.lang.String fileName)
                            throws java.io.IOException
Writes the provided Appearance object to a file with the given name, with a ".apr" extension added if not already present.
Parameters:
appearance - the Appearance object to write to file
fileName - the name of the file to write
Throws:
java.io.IOException - if something goes wrong while trying to write the file

readAppearance

public static Appearance readAppearance(java.lang.String fileName)
                                 throws java.io.IOException
Read an Appearance object from the file with the given name, with a ".apr" extension added if not already present.
Parameters:
fileName - the name of the file to read from
Throws:
java.io.IOException - if something goes wrong while trying to read the file

writeAppearance

public static void writeAppearance(Appearance appearance,
                                   java.io.ObjectOutputStream output)
                            throws java.io.IOException
Writes the provided Appearance object to the given ObjectOutputStream.
Parameters:
appearance - the Appearance object to write
Throws:
java.io.IOException - if something goes wrong while trying to write

readAppearance

public static Appearance readAppearance(java.io.ObjectInputStream input)
                                 throws java.io.IOException
Read an Appearance object from the given ObjectInputStream.
Throws:
java.io.IOException - if something goes wrong while trying to read