com.lyrisoft.awt
Class TextRun

java.lang.Object
  |
  +--com.lyrisoft.awt.TextRun
Direct Known Subclasses:
HyperlinkTextRun

public class TextRun
extends java.lang.Object

A TextRun represents some text with a specified TextStyle. TextRuns know how to word-wrap and how to render themselves onto Graphics objects.


Constructor Summary
TextRun(java.lang.String text, TextStyle style)
          Create a new text run with the given text and style.
 
Method Summary
 boolean contains(int x, int y, int yTranslation)
          Check if this TextRun contains the specified point.
 java.awt.Rectangle getBoundingRect()
          Return the smallest Rectangle that contains this whole TextRun.
 TextStyle getStyle()
           
 java.lang.String getText()
           
 void setFont(java.awt.Font f)
          Change our font.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextRun

public TextRun(java.lang.String text,
               TextStyle style)
Create a new text run with the given text and style.
Method Detail

getStyle

public TextStyle getStyle()

getText

public java.lang.String getText()

setFont

public void setFont(java.awt.Font f)
Change our font.

getBoundingRect

public java.awt.Rectangle getBoundingRect()
Return the smallest Rectangle that contains this whole TextRun. Prepare must be called before this will return anything accurate, because the width is needed.

contains

public boolean contains(int x,
                        int y,
                        int yTranslation)
Check if this TextRun contains the specified point. This class assumes that the y coordinate has already been translated

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2000-2002 Taso Lyristis