ccvisu
Class WriterDataGraphics

java.lang.Object
  extended by ccvisu.WriterData
      extended by ccvisu.WriterDataGraphics
Direct Known Subclasses:
WriterDataGraphicsDISP, WriterDataGraphicsSVG, WriterDataGraphicsVRML

public abstract class WriterDataGraphics
extends WriterData

Writer for graphical output of layout data.

Version:
$Revision: 1.26 $; $Date: 2007/12/15 01:20:50 $
Author:
Dirk Beyer

Field Summary
protected  Options options
           
 
Fields inherited from class ccvisu.WriterData
endl, graph, out
 
Constructor Summary
WriterDataGraphics(java.io.PrintWriter out, GraphData graph, Options options)
          Constructor.
 
Method Summary
protected  int[] paintArrow(int x0, int y0, int x1, int y1)
          Calculates the two angled lines that form the arrow head.
abstract  void write()
          Writes the layout data in a graphics format.
abstract  void writeEdge(GraphEdge edge, int xPos1, int yPos1, int zPos1, int xPos2, int yPos2, int zPos2)
          Writes an edge.
 void writeGraphicsLayout(java.util.List<GraphVertex> pVertices, java.util.List<GraphEdge> pEdges, int pSize)
          Write graphics layout.
abstract  void writeVertex(GraphVertex curVertex, int xPos, int yPos, int zPos, int radius)
          Writes a vertex.
 
Methods inherited from class ccvisu.WriterData
mkQuoted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

options

protected Options options
Constructor Detail

WriterDataGraphics

public WriterDataGraphics(java.io.PrintWriter out,
                          GraphData graph,
                          Options options)
Constructor.

Parameters:
graph - Graph representation, contains the positions of the vertices.
Method Detail

write

public abstract void write()
Writes the layout data in a graphics format.

Specified by:
write in class WriterData

writeGraphicsLayout

public void writeGraphicsLayout(java.util.List<GraphVertex> pVertices,
                                java.util.List<GraphEdge> pEdges,
                                int pSize)
Write graphics layout.

Parameters:
pSize - Size of output area (e.g., number of pixel).

writeVertex

public abstract void writeVertex(GraphVertex curVertex,
                                 int xPos,
                                 int yPos,
                                 int zPos,
                                 int radius)
Writes a vertex.

Parameters:
curVertex - The vertex object, to access vertex attributes.
xPos - x coordinate of the vertex.
yPos - y coordinate of the vertex.
zPos - z coordinate of the vertex.
radius - Radius of the vertex.

writeEdge

public abstract void writeEdge(GraphEdge edge,
                               int xPos1,
                               int yPos1,
                               int zPos1,
                               int xPos2,
                               int yPos2,
                               int zPos2)
Writes an edge.

Parameters:
edge - an edge in graph.edges
xPos1 - x coordinate of the first point.
yPos1 - y coordinate of the first point.
zPos1 - z coordinate of the first point.
xPos2 - x coordinate of the second point.
yPos2 - y coordinate of the second point.
zPos2 - z coordinate of the second point.

paintArrow

protected int[] paintArrow(int x0,
                           int y0,
                           int x1,
                           int y1)
Calculates the two angled lines that form the arrow head.