All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class att.grappa.Utilities

java.lang.Object
   |
   +----att.grappa.Utilities

public class Utilities
extends Object
This class provides general-purpose, non-essential methods.

Version:
1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
Author:
John Mocenigo, Research @ AT&T Labs

Constructor Index

 o Utilities()

Method Index

 o computeEdgePos(Node, Node, boolean)
Compute the line running between the supplied nodes as a string sutiable for use as an edge "pos" attribute.
 o filterGraph(Graph, Object)
Filter the supplied graph using the given connector.
 o filterGraph(Graph, Object, String)
Filter the supplied graph using the given connector.

Constructors

 o Utilities
 public Utilities()

Methods

 o filterGraph
 public static boolean filterGraph(Graph graph,
                                   Object connector)
Filter the supplied graph using the given connector. The connector is either a java.lang.Process or a java.net.URLConnection. As such, it provides an output stream to which the graph can be written and an input stream from which the processed graph can be read back in (to replace the original graph). Such filtering is useful for processing the graph through a layout engine such as the dot program.

Parameters:
graph - the graph to be processed
connector - a Process or URLConnector that provides an input and output stream
Returns:
true if the filtering completed successfully, false otherwise.
 o filterGraph
 public static boolean filterGraph(Graph graph,
                                   Object connector,
                                   String preamble)
Filter the supplied graph using the given connector. The connector is either a java.lang.Process or a java.net.URLConnection. As such, it provides an output stream to which the graph can be written and an input stream from which the processed graph can be read back in (to replace the original graph). Such filtering is useful for processing the graph through a layout engine such as the dot program.

Parameters:
graph - the graph to be processed
connector - a Process or URLConnector that provides an input and output stream
preamble - if not null, a string sent to filter prior to graph
Returns:
true if the filtering completed successfully, false otherwise.
 o computeEdgePos
 public static String computeEdgePos(Node head,
                                     Node tail,
                                     boolean directed)
Compute the line running between the supplied nodes as a string sutiable for use as an edge "pos" attribute. The line runs from the center point (as given by the "pos" attribute) of the supplied tail node to the center point of the supplied head node. The string format depends on whether the edge is a directed edge or not.

Parameters:
head - the ending node for the line
tail - the starting node for the line
directed - true if the output should be formatted for a directed edge; false otherwise.
Returns:
a string in edge "pos" attribute format or an empty string if there is any problems formatting the string.

All Packages  Class Hierarchy  This Package  Previous  Next  Index