PolyLine
Class PolyLineDrawing

java.lang.Object
  extended by PolyLine.PolyLineDrawing

public class PolyLineDrawing
extends java.lang.Object

An object which executes the polyline drawing.

This class takes weakstratification object which has all the nodes in
the realizer assigned layer. In this class, the execution of assigning abscissa
and edge addition is done. Then its given to the output as text file (.pic)
the format is :
row-1 ->
row-2 to row-(n+1) -> < node id>
row-(n+2) to row-(2n+1) -> << adjacency matrix>>
row-(2n+2) -> << list of node id which are dummy vertex>>

Copyright: Copyright (c) 2008

Company: Bangladesh University of engineering and technology


Field Summary
(package private)  int[][] graph
          Graph as a adjacency matrix .
(package private)  int[][] nodeList
          nodeList is a n by 3 array.
(package private)  java.io.File output
          File
(package private)  Realizer realizer
          Realizer Object.
(package private)  int totalNodes
          Contains total nodes in the graph including the dummy vertices.
 
Constructor Summary
PolyLineDrawing(WeakStratification wk, java.io.File output)
           Constructor for the class PolyLine Drawing
 
Method Summary
private  void addEdge()
          Adds edges towards parent of tree_1 , tree_2 and child of tree_0
Also creates bends in the graph array.
private  void assignX()
          Assigns the abscissa ( x co ordinate) of each node
private  void assignXL_XR()
          Assigns all nodes xL ( left most leaf of the node in subtree of tree_0)
and xR ( right most leaf of the node in subtree of tree_0)
 java.lang.String toString()
          Generates string value of this object
private  void writeToFile()
          Writes to output file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

realizer

Realizer realizer
Realizer Object. Its set from weakstratification object's realizer object


graph

int[][] graph
Graph as a adjacency matrix . 2D array of integers.


nodeList

int[][] nodeList
nodeList is a n by 3 array. For i'th index
nodeList[i][0] -> abscissa of node of id "i" .
nodeList[i][1] -> ordinate of node of id "i" .
nodeList[i][2] -> whether dummy or not is node of id "i". If 1 then dummy vertex.


totalNodes

int totalNodes
Contains total nodes in the graph including the dummy vertices.


output

java.io.File output
File

Constructor Detail

PolyLineDrawing

public PolyLineDrawing(WeakStratification wk,
                       java.io.File output)

Constructor for the class PolyLine Drawing

Parameters:
wk - an WeakStratification object where layer value is already computed.
output - Output File where the text file output to be given.
Method Detail

writeToFile

private void writeToFile()
Writes to output file. Using java.io.File , java.io.FileWriter,


addEdge

private void addEdge()
Adds edges towards parent of tree_1 , tree_2 and child of tree_0
Also creates bends in the graph array.


assignXL_XR

private void assignXL_XR()
Assigns all nodes xL ( left most leaf of the node in subtree of tree_0)
and xR ( right most leaf of the node in subtree of tree_0)


assignX

private void assignX()
Assigns the abscissa ( x co ordinate) of each node


toString

public java.lang.String toString()
Generates string value of this object

Overrides:
toString in class java.lang.Object
Returns:
string as following format :
total nodes
(node id) (node x) (node y) (dummy or not)
(adjacency matrix or graph array)