ReportCat 1.1

li.netcat.print.util
Class TextPrint

java.lang.Object
  extended byli.netcat.print.util.TextPrint
All Implemented Interfaces:
Print

public class TextPrint
extends java.lang.Object
implements Print

The TextPrint is a simple implementation of a multiline text that supports pagebreak.

Author:
Arthur Marxer

Constructor Summary
TextPrint()
          Constructs a new TextPrint with no text.
TextPrint(java.lang.String text)
          Constructs a new TextPrint displaying the given text.
TextPrint(java.lang.String text, int alignment)
          Constructs a new TextPrint displaying the given text with the given horizontal alignment.
 
Method Summary
 java.awt.Color getColor()
          Returns the Color used to draw the whole text.
 boolean getFitWidth()
          Specifies whether this TextPrint will consume the whole width or not.
 java.awt.Font getFont()
          Returns the Font used to draw the whole text.
 int getHorizontalAlignment()
          Returns the horizontal alignment.
 java.awt.Dimension getPreferredSize(java.awt.Graphics g)
          Returns the preferred size of the Print.
 PrintIterator getPrintIterator()
          Factory method, that produces a PrintIerator.
 java.lang.String getText()
          Returns the text associated with that TextPrint.
 void setColor(java.awt.Color color)
          Sets the Color used to draw the whole text.
 void setFitWidth(boolean fitWidth)
          Specifies whether this TextPrint will consume the whole width or not.
 void setFont(java.awt.Font font)
          Sets the Font used to draw the whole text.
 void setHorizontalAlignment(int alignment)
          Sets the horizontal alignment.
 void setText(java.lang.String text)
          Sets the text associated with that TextPrint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextPrint

public TextPrint()
Constructs a new TextPrint with no text.


TextPrint

public TextPrint(java.lang.String text)
Constructs a new TextPrint displaying the given text.

Parameters:
text - The text, can be null.

TextPrint

public TextPrint(java.lang.String text,
                 int alignment)
Constructs a new TextPrint displaying the given text with the given horizontal alignment.

Parameters:
text - The text, can be null.
alignment - The horizontal alignment, one of LEFT, CENTER or RIGHT.
Method Detail

getText

public java.lang.String getText()
Returns the text associated with that TextPrint.

Returns:
The text associated with that TextPrint.

setText

public void setText(java.lang.String text)
Sets the text associated with that TextPrint.

Parameters:
text - The new text associated with that TextPrint, can be null.

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the horizontal alignment.

Returns:
The horizontal alignment, one of LEFT, CENTER or RIGHT.

setHorizontalAlignment

public void setHorizontalAlignment(int alignment)
Sets the horizontal alignment.

Parameters:
alignment - The horizontal alignment, it must be one of LEFT, CENTER or RIGHT.

getFont

public java.awt.Font getFont()
Returns the Font used to draw the whole text.

Returns:
The Font used to draw the whole text.

setFont

public void setFont(java.awt.Font font)
Sets the Font used to draw the whole text.

Parameters:
font - The Font used to draw the whole text, must not be null.

getColor

public java.awt.Color getColor()
Returns the Color used to draw the whole text.

Returns:
The Color used to draw the whole text.

setColor

public void setColor(java.awt.Color color)
Sets the Color used to draw the whole text.

Parameters:
color - The Color used to draw the whole text, must not be null.

getFitWidth

public boolean getFitWidth()
Specifies whether this TextPrint will consume the whole width or not. This property is only of interest in combination with a short text.


setFitWidth

public void setFitWidth(boolean fitWidth)
Specifies whether this TextPrint will consume the whole width or not. This property is only of interest in combination with a short text.

Parameters:
fitWidth - Specify false if the width of the Painter shoud only be as wide as the longest line. true is the default.

getPreferredSize

public java.awt.Dimension getPreferredSize(java.awt.Graphics g)
Description copied from interface: Print
Returns the preferred size of the Print.

Specified by:
getPreferredSize in interface Print
Parameters:
g - The relevant Graphics object. It can be used to calculate the widths of strings.
Returns:
The preferred size of the Print.

getPrintIterator

public PrintIterator getPrintIterator()
Description copied from interface: Print
Factory method, that produces a PrintIerator. The PrintIterator is used like an enumeration to generate all Prints.

Specified by:
getPrintIterator in interface Print
Returns:
An instance of a PrintIterator that is able to iterate over the Print.

ReportCat 1.1

Copyright © 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation, Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation, Print,Printing,Printer,Java,Java Print,SDK,Java Printing,Printing Java,Print Java,Library,Java Library,Print Library,Report,Reports,Java Report,Java Programming,Java Output,Layout,Page,API,Preview,Print Preview,Content,A4,Free,Output,Header,Footer,Download,Package,Jar,Evaluation