ccvisu
Class WriterDataGraphicsDISP

java.lang.Object
  extended byccvisu.WriterData
      extended byccvisu.WriterDataGraphics
          extended byccvisu.WriterDataGraphicsDISP

public class WriterDataGraphicsDISP
extends WriterDataGraphics

Writer for displaying the layout on the screen device.

Version:
$Revision: 1.2 $; $Date: 2005/08/22 12:42:48 $
Author:
Dirk Beyer

Field Summary
private  java.awt.Graphics area
           
private  ScreenDisplay display
           
private  int insetleft
           
private  java.util.Set[] xMap
           
private  java.util.Set[] yMap
           
 
Fields inherited from class ccvisu.WriterDataGraphics
backColor, blackCircle, fontSize, hideSource, minVert
 
Fields inherited from class ccvisu.WriterData
endl, graph
 
Constructor Summary
WriterDataGraphicsDISP(GraphData graph, boolean hideSource, float minVert, int fontSize, java.awt.Color backColor, boolean blackCircle, boolean anim)
          Constructor.
 
Method Summary
 java.lang.String getVertexNames(int xPos, int yPos)
          Compute list of names of the vertices at the given position.
 void toggleVertexNames(int xPos, int yPos)
          Toggle the showName flag of the vertices at the given position.
 void write()
          Nothing to do here.
 void writeDISP(int size, java.awt.Graphics area, int xCanvasSize, int yCanvasSize, int insetleft)
          Writes the layout on the screen device (DISP output format).
 void writeLAY(java.lang.String fileName)
          Writes layout to file using class WriterDataLAY.
 void writeVertex(GraphVertex curVertex, int xPos, int yPos, int zPos, int dia)
          Writes a vertex on screen.
 
Methods inherited from class ccvisu.WriterDataGraphics
writeGraphicsLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

display

private ScreenDisplay display

xMap

private java.util.Set[] xMap

yMap

private java.util.Set[] yMap

area

private java.awt.Graphics area

insetleft

private int insetleft
Constructor Detail

WriterDataGraphicsDISP

public WriterDataGraphicsDISP(GraphData graph,
                              boolean hideSource,
                              float minVert,
                              int fontSize,
                              java.awt.Color backColor,
                              boolean blackCircle,
                              boolean anim)
Constructor.

Parameters:
graph - Graph representation, contains the positions of the vertices.
hideSource - If true, draw only vertices that are not source of an edge. In co-change graphs, all change-transaction vertices are source 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.
anim - If true, the layout is already displayed while the minimizer is still improving it, and a simple mouse click on the canvas updates the current layout on the screen. If false, the layout is displayed only after minimization is completed.
Method Detail

write

public void write()
Nothing to do here. The contructor initializes the ScreenDisplay (frame and canvas), and that calls back to the methods below (writeDISP, writeLAY, toggleVertexNames, getVertexNames).

Specified by:
write in class WriterDataGraphics

writeDISP

public void writeDISP(int size,
                      java.awt.Graphics area,
                      int xCanvasSize,
                      int yCanvasSize,
                      int insetleft)
Writes the layout on the screen device (DISP output format). Call-back method, invoked from ScreenDisplay.

Parameters:
size - Size of the output drawing quare.
area - The drawing area of the canvas.
xCanvasSize - Width of the canvas.
yCanvasSize - Height of the canvas.
insetleft - Left inset of the drawing frame.

writeVertex

public void writeVertex(GraphVertex curVertex,
                        int xPos,
                        int yPos,
                        int zPos,
                        int dia)
Writes a vertex on screen.

Specified by:
writeVertex in class WriterDataGraphics
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.
dia - Diameter of the vertex.

writeLAY

public void writeLAY(java.lang.String fileName)
Writes layout to file using class WriterDataLAY. Call-back method, invoked from within ScreenDisplay.

Parameters:
fileName - Name of the output file to write the layout to.

toggleVertexNames

public void toggleVertexNames(int xPos,
                              int yPos)
Toggle the showName flag of the vertices at the given position. Call-back method, invoked from within ScreenDisplay.

Parameters:
xPos - x coordinate of the vertex.
yPos - y coordinate of the vertex.

getVertexNames

public java.lang.String getVertexNames(int xPos,
                                       int yPos)
Compute list of names of the vertices at the given position. Call-back method, invoked from within ScreenDisplay.

Parameters:
xPos - x coordinate of the vertex.
yPos - y coordinate of the vertex.