uk.ac.ic.doc.automed.p2p.gui.graph
Class TextBox.TextBlock

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.gui.graph.TextBox.TextBlock
Enclosing class:
TextBox

 class TextBox.TextBlock
extends java.lang.Object

Represents a wrapped text block

Author:
Duc Le

Field Summary
private  java.awt.Dimension bound
           
private  java.awt.Insets insets
           
private  java.util.Vector lines
           
private  double lineSpace
           
 
Constructor Summary
TextBox.TextBlock(java.awt.Insets insets, double lineSpace)
          Create a new wrapped text block
 
Method Summary
 void add(java.lang.String line)
          Add a new line to the text block
 void clear()
           
 void drawAt(java.awt.Point p, java.awt.Graphics g)
          Draw this text block at a point on the canvas
 java.awt.Dimension getBound(java.awt.Graphics g)
           
 java.util.Vector getText()
          Return all the lines of the text block
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lines

private java.util.Vector lines

lineSpace

private double lineSpace

insets

private java.awt.Insets insets

bound

private java.awt.Dimension bound
Constructor Detail

TextBox.TextBlock

public TextBox.TextBlock(java.awt.Insets insets,
                         double lineSpace)
Create a new wrapped text block

Parameters:
x - x-coord of the top-left corner
y - y-coord of the top-left corner
insets - insets.X is the gap between the first character of each line to the left border of the bounding box
insets.Y is the gap between the first (and last) line and the top (bottom) border of the bounding box
lineSpace - gap between lines
Method Detail

add

public void add(java.lang.String line)
Add a new line to the text block

Parameters:
line -

getText

public java.util.Vector getText()
Return all the lines of the text block

Returns:

getBound

public java.awt.Dimension getBound(java.awt.Graphics g)

drawAt

public void drawAt(java.awt.Point p,
                   java.awt.Graphics g)
Draw this text block at a point on the canvas

Parameters:
g -

clear

public void clear()