|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.io.IOHandler
y.io.GMLIOHandler
public class GMLIOHandler
Read and write 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 Color |
decodeColor(String colorString)
Decodes a color string produced by convertColor(Color). |
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 read(y.view.Graph2D, java.io.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 IOHandlerpublic String getFileNameExtension()
getFileNameExtension in class IOHandler
public void read(Graph2D graph,
InputStream in)
throws IOException
read in class IOHandlerIOExceptionin - The input stream being read from
public void read(Graph2D graph,
String name)
throws IOException
FileReader and passes control
to read(y.view.Graph2D, java.io.Reader)
read in class IOHandlerIOException - in the case of an I/O errorgraph - the graphname - the filename
protected 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()
DefaultParserFactorypublic static void setParserFactory(ParserFactory _parserFactory)
_parserFactory - the factory to be installedpublic static EncoderFactory getEncoderFactory()
HierarchicGraphEncoderFactorypublic static void setEncoderFactory(EncoderFactory _encoderFactory)
_encoderFactory - the factory to be installed
public void write(Graph2D graph,
OutputStream out)
throws IOException
ObjectEncoder.encode(Object, y.io.gml.GMLEncoder) method
with the graph as the first argument.
write in class IOHandlerIOException - 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
public static Color decodeColor(String colorString)
convertColor(Color).
colorString - the color string
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||