weka.gui.treevisualizer
Class Edge

java.lang.Object
  extended byweka.gui.treevisualizer.Edge

public class Edge
extends java.lang.Object

This class is used in conjunction with the Node class to form a tree structure. This in particular contains information about an edges in the tree.

Version:
$Revision: 1.3 $
Author:
Malcolm Ware (mfw4@cs.waikato.ac.nz)

Field Summary
private  java.lang.String m_label
          The text caption for the edge.
private  java.util.Vector m_lines
          The label broken up into lines.
private  java.lang.String m_rsource
          The ID string of the parent Node of this edge (used for consrtuction purposes).
private  java.lang.String m_rtarget
          The ID string of the child Node of this edge (used for construction purposes).
private  Node m_source
          The parent Node of this edge.
private  Node m_target
          The child Node of this edge.
 
Constructor Summary
Edge(java.lang.String label, java.lang.String source, java.lang.String target)
          This constructs an Edge with the specified label and parent , child serial tags.
 
Method Summary
private  void breakupLabel()
          This function is called to break the label of the edge up in to seperate lines
 java.lang.String getLabel()
          Get the value of label.
 java.lang.String getLine(int n)
          Returns line number n
 java.lang.String getRsource()
          Get the value of rsource.
 java.lang.String getRtarget()
          Get the value of rtarget.
 Node getSource()
          Get the value of source.
 Node getTarget()
          Get the value of target.
 void setRsource(java.lang.String v)
          Set the value of rsource.
 void setRtarget(java.lang.String v)
          Set the value of rtarget.
 void setSource(Node v)
          Set the value of source.
 void setTarget(Node v)
          Set the value of target.
 java.awt.Dimension stringSize(java.awt.FontMetrics f)
          This will calculate how large a rectangle using the FontMetrics passed that the lines of the label will take up
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_label

private java.lang.String m_label
The text caption for the edge.


m_rsource

private java.lang.String m_rsource
The ID string of the parent Node of this edge (used for consrtuction purposes).


m_rtarget

private java.lang.String m_rtarget
The ID string of the child Node of this edge (used for construction purposes).


m_source

private Node m_source
The parent Node of this edge.


m_target

private Node m_target
The child Node of this edge.


m_lines

private java.util.Vector m_lines
The label broken up into lines.

Constructor Detail

Edge

public Edge(java.lang.String label,
            java.lang.String source,
            java.lang.String target)
This constructs an Edge with the specified label and parent , child serial tags.

Parameters:
label - The text caption for the edge.
source - The ID string for this edges parent.
target - The ID string for this edges child.
Method Detail

getLabel

public java.lang.String getLabel()
Get the value of label.

Returns:
Value of label.

breakupLabel

private void breakupLabel()
This function is called to break the label of the edge up in to seperate lines


stringSize

public java.awt.Dimension stringSize(java.awt.FontMetrics f)
This will calculate how large a rectangle using the FontMetrics passed that the lines of the label will take up

Parameters:
f - The size information for a particular Font
Returns:
A Dimension containing the size and width of the text

getLine

public java.lang.String getLine(int n)
Returns line number n

Parameters:
n - The number of the line requested
Returns:
The string for the line number or NULL if it didn't exist

getRsource

public java.lang.String getRsource()
Get the value of rsource.

Returns:
Value of rsource.

setRsource

public void setRsource(java.lang.String v)
Set the value of rsource.

Parameters:
v - Value to assign to rsource.

getRtarget

public java.lang.String getRtarget()
Get the value of rtarget.

Returns:
Value of rtarget.

setRtarget

public void setRtarget(java.lang.String v)
Set the value of rtarget.

Parameters:
v - Value to assign to rtarget.

getSource

public Node getSource()
Get the value of source.

Returns:
Value of source.

setSource

public void setSource(Node v)
Set the value of source. And then call v.addChild to add the edge to the Node.

Parameters:
v - Value to assign to source.

getTarget

public Node getTarget()
Get the value of target.

Returns:
Value of target.

setTarget

public void setTarget(Node v)
Set the value of target. And then call v.addParent to add the edge to the Node.

Parameters:
v - Value to assign to target.