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.8 $; $Date: 2006/11/25 10:41:08 $
Author:
Dirk Beyer

Field Summary
protected  java.awt.Color backColor
           
protected  boolean blackCircle
           
protected  int fontSize
           
protected  float minVert
           
protected  boolean openURL
           
protected  boolean showEdges
           
 
Fields inherited from class ccvisu.WriterData
endl, graph
 
Constructor Summary
WriterDataGraphics(GraphData graph, float minVert, int fontSize, java.awt.Color backColor, boolean blackCircle, boolean showEdges, boolean openURL)
          Constructor.
 
Method Summary
abstract  void write()
          Writes the layout data in a graphics format.
abstract  void writeEdge(int index, int xPos1, int yPos1, int zPos1, int xPos2, int yPos2, int zPos2)
          Writes an edge.
 void writeGraphicsLayout(int size)
          Write graphics layout.
abstract  void writeVertex(GraphVertex curVertex, int xPos, int yPos, int zPos, int radius)
          Writes a vertex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minVert

protected float minVert

fontSize

protected int fontSize

backColor

protected java.awt.Color backColor

blackCircle

protected boolean blackCircle

showEdges

protected boolean showEdges

openURL

protected boolean openURL
Constructor Detail

WriterDataGraphics

public WriterDataGraphics(GraphData graph,
                          float minVert,
                          int fontSize,
                          java.awt.Color backColor,
                          boolean blackCircle,
                          boolean showEdges,
                          boolean openURL)
Constructor.

Parameters:
graph - Graph representation, contains the positions of the vertices.
minVert - Diameter of the smallest vertex.
fontSize - Font size of vertex annotations.
backColor - Background color.
blackCircle - If true, draw black circle around each vertex.
showEdges - If true, draw the edges between the vertices (if possible).
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(int size)
Write graphics layout.

Parameters:
size - 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(int index,
                               int xPos1,
                               int yPos1,
                               int zPos1,
                               int xPos2,
                               int yPos2,
                               int zPos2)
Writes an edge.

Parameters:
index - index of the 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.