|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.io.IOHandler | +--y.io.GMLIOHandler
Read and writes a Graph2D in Graph Modeling Language (GML).
This is mainly achieved by delegating the actual work to instances,
that are created by EncoderFactory
and
ParserFactory
.
Constructor Summary | |
GMLIOHandler()
Instantiates a new GMLIOHandler. |
Method Summary | |
static String |
convertColor(Color col)
converts a java Color into standard string representation |
static EncoderFactory |
getEncoderFactory()
Getter for the ParserFactory (Singleton) |
String |
getFileFormatString()
Returns the GML file format string. |
String |
getFileNameExtension()
Returns the GML file name extension, i.e. |
static ParserFactory |
getParserFactory()
Getter for the ParserFactory (Singleton) |
void |
read(Graph2D graph,
InputStream in)
Adds the contents from the given stream to the given graph. |
protected void |
read(Graph2D graph,
Reader reader)
Fills the contents of the given graph from a reader. |
void |
read(Graph2D graph,
String name)
Generates a FileReader and passes control to GMLIOHandler.read(Graph2D, Reader) |
static void |
setEncoderFactory(EncoderFactory _encoderFactory)
Setter for the EncoderFactory (Singleton) |
static void |
setParserFactory(ParserFactory _parserFactory)
Setter for the ParserFactory (Singleton) |
void |
write(Graph2D graph,
OutputStream out)
Writes the contents of the given graph in GML format to a stream. |
Methods inherited from class y.io.IOHandler |
canRead, canWrite, canWriteSubset, createObjectInputStream, createObjectOutputStream, hide, read, shouldSerialize, shouldSerialize, write, writeSubset, writeSubset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GMLIOHandler()
Method Detail |
public String getFileFormatString()
getFileFormatString
in class IOHandler
public String getFileNameExtension()
getFileNameExtension
in class IOHandler
public void read(Graph2D graph, InputStream in) throws IOException
read
in class IOHandler
IOException
in
- The input stream being read frompublic void read(Graph2D graph, String name) throws IOException
GMLIOHandler.read(Graph2D, Reader)
read
in class IOHandler
IOException
- in the case of an I/O errorgraph
- the graphname
- the filenameprotected void read(Graph2D graph, Reader reader) throws IOException
IOException
- in case of an I/O Exceptiongraph
- the graph to be filledreader
- The reader being read frompublic static ParserFactory getParserFactory()
DefaultParserFactory
public static void setParserFactory(ParserFactory _parserFactory)
_parserFactory
- the factory to be installedpublic static EncoderFactory getEncoderFactory()
HierarchicGraphEncoderFactory
public static void setEncoderFactory(EncoderFactory _encoderFactory)
_encoderFactory
- the factory to be installedpublic void write(Graph2D graph, OutputStream out) throws IOException
ObjectEncoder.encode(java.lang.Object, y.io.gml.GMLEncoder)
method with the graph as
the first argument.
write
in class IOHandler
IOException
- in case of an I/O Exceptiongraph
- the graph to be writtenout
- The OutputStream being written to.public static String convertColor(Color col)
col
- the color
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |