scale.visual
Class Vcg

java.lang.Object
  extended by scale.common.DisplayGraph
      extended by scale.visual.Vcg

public class Vcg
extends DisplayGraph

This class implements methods to generate commands to display a graph using vcg.

$Id: Vcg.java,v 1.5 2007-10-04 19:58:41 burrill Exp $

Copyright 2008 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.


Field Summary
 
Fields inherited from class scale.common.DisplayGraph
DISPLAY_EDGE_LABELS, outputPath, SHOW_ANNO, SHOW_CDG, SHOW_CLEF, SHOW_DD, SHOW_DEFUSE, SHOW_DOM, SHOW_EXPR, SHOW_EXPR_MASK, SHOW_HIGH_EXPR, SHOW_LOW_EXPR, SHOW_MAYUSE, SHOW_PDOM, SHOW_TYPE
 
Constructor Summary
Vcg()
           
 
Method Summary
 void addEdge(DisplayNode n1, DisplayNode n2, DColor color, DEdge edgeAttributes, java.lang.Object edgeInfo)
          Add an edge to the graph from node n1 to node n2.
 void addNode(DisplayNode n)
          Add a node to the graph.
 void closeWindow(java.lang.String context)
          This closes an existing new visualization window.
 java.lang.String dashedEdgeAttr()
          Return attribute for dashed edges.
 java.lang.String dottedEdgeAttr()
          Retrn attribute for dotted edges.
 void interact()
          Respond to interative events with this display.
 void newGraph(java.lang.String context, boolean top)
          Initialize for a new graph.
 void openWindow(java.lang.String context, java.lang.String title, int graphAttributes)
          This opens a new visualization window.
 void terminate()
          Terminates the visualizer process.
 boolean visited(DisplayNode n)
          Return true if the node has been processed.
 boolean windowExists(java.lang.String context)
          Return true if the window for the given context still exists.
 
Methods inherited from class scale.common.DisplayGraph
addDisplayString, getVisualizer, initColors, setOutputPath, setVisualizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Vcg

public Vcg()
Method Detail

newGraph

public void newGraph(java.lang.String context,
                     boolean top)
Initialize for a new graph. Only one graph can be created at a time.

Specified by:
newGraph in class DisplayGraph
Parameters:
context - is the name associated with the graph
top - if true places the root node at the top of the display

dottedEdgeAttr

public java.lang.String dottedEdgeAttr()
Retrn attribute for dotted edges.


dashedEdgeAttr

public java.lang.String dashedEdgeAttr()
Return attribute for dashed edges.


visited

public boolean visited(DisplayNode n)
Return true if the node has been processed.

Specified by:
visited in class DisplayGraph
Parameters:
n - is the node to check

addNode

public void addNode(DisplayNode n)
Add a node to the graph. This method should be used only for nodes that are not connected with an edge.

Specified by:
addNode in class DisplayGraph
Parameters:
n - is the node

addEdge

public void addEdge(DisplayNode n1,
                    DisplayNode n2,
                    DColor color,
                    DEdge edgeAttributes,
                    java.lang.Object edgeInfo)
Add an edge to the graph from node n1 to node n2. Attributes of the edge are specified by an integer that contains three fields. pattern: solid, dashed, dotted
bitsuse
5-0color
6type: normal, backedge
8-7

Specified by:
addEdge in class DisplayGraph
Parameters:
n1 - is the first node
n2 - is the second node
color - specifies the edge color
edgeAttributes - specifies the type, and form of the edge
edgeInfo - is additional information about the edge

terminate

public void terminate()
Terminates the visualizer process.

Specified by:
terminate in class DisplayGraph

openWindow

public void openWindow(java.lang.String context,
                       java.lang.String title,
                       int graphAttributes)
This opens a new visualization window. The context string should be unique from that used for any other window.

Specified by:
openWindow in class DisplayGraph
Parameters:
context - is the user defined string to distinguish between different windows
title - is title for the window
graphAttributes - species attributes for the graph
See Also:
DisplayGraph.newGraph(java.lang.String, boolean)

closeWindow

public void closeWindow(java.lang.String context)
This closes an existing new visualization window. The context string should be unique from that used for any other window.

Specified by:
closeWindow in class DisplayGraph
Parameters:
context - is the user defined string to distinguish between different windows
See Also:
DisplayGraph.newGraph(java.lang.String, boolean)

windowExists

public boolean windowExists(java.lang.String context)
Return true if the window for the given context still exists.

Specified by:
windowExists in class DisplayGraph

interact

public void interact()
Respond to interative events with this display. The method terminates when the display is terminated.

Specified by:
interact in class DisplayGraph