| 
 | 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 java.lang.String | convertColor(java.awt.Color col)Converts a java Color into standard string representation. | 
| static java.awt.Color | decodeColor(java.lang.String colorString)Decodes a color string produced by convertColor(Color). | 
| static EncoderFactory | getEncoderFactory()Getter for the ParserFactory (Singleton) | 
|  java.lang.String | getFileFormatString()Returns the GML file format string. | 
|  java.lang.String | getFileNameExtension()Returns the GML file name extension, i.e. | 
| static ParserFactory | getParserFactory()Getter for the ParserFactory (Singleton) | 
|  void | read(Graph2D graph,
     java.io.InputStream in)Adds the contents from the given stream to the given graph. | 
| protected  void | read(Graph2D graph,
     java.io.Reader reader)Fills the contents of the given graph from a reader. | 
|  void | read(Graph2D graph,
     java.lang.String name)Generates a FileReaderand passes control
 toread(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,
      java.io.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 java.lang.String getFileFormatString()
getFileFormatString in class IOHandlerpublic java.lang.String getFileNameExtension()
getFileNameExtension in class IOHandler
public void read(Graph2D graph,
                 java.io.InputStream in)
          throws java.io.IOException
read in class IOHandlerin - The input stream being read from
java.io.IOException
public void read(Graph2D graph,
                 java.lang.String name)
          throws java.io.IOException
FileReader and passes control
 to read(y.view.Graph2D, java.io.Reader)
read in class IOHandlergraph - the graphname - the filename
java.io.IOException - in the case of an I/O error
protected void read(Graph2D graph,
                    java.io.Reader reader)
             throws java.io.IOException
graph - the graph to be filledreader - The reader being read from
java.io.IOException - in case of an I/O Exceptionpublic 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,
                  java.io.OutputStream out)
           throws java.io.IOException
ObjectEncoder.encode(Object, y.io.gml.GMLEncoder) method
 with the graph as the first argument.
write in class IOHandlergraph - the graph to be writtenout - The OutputStream being written to.
java.io.IOException - in case of an I/O Exceptionpublic static java.lang.String convertColor(java.awt.Color col)
col - the color
public static java.awt.Color decodeColor(java.lang.String colorString)
convertColor(Color).
colorString - the color string
| 
 | © Copyright 2000-2025, yWorks GmbH. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||