ReportCat 1.1

li.netcat.print.util.text
Class LineBreakStrategy

java.lang.Object
  extended byli.netcat.print.util.text.LineBreakStrategy

public abstract class LineBreakStrategy
extends java.lang.Object

The LineBreakStrategy is used to calculate the automatic line brakes of a text. The default implementation breakes the lines at ' ' and '\n' and after a '-'. You may implement your own strategy (by extending this class) and define it as the default strategy.

Author:
Arthur Marxer

Constructor Summary
LineBreakStrategy()
           
 
Method Summary
abstract  LineBreaker createLineBreaker(java.awt.Font font, char[] text)
          Creates a new instance of a line breaker that is able to break the given text that gets painted with the given font.
static LineBreakStrategy getDefault()
          Returns the default line break strategy.
static void setDefault(LineBreakStrategy strategy)
          Sets a new line brake strategy as the default strategy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineBreakStrategy

public LineBreakStrategy()
Method Detail

getDefault

public static LineBreakStrategy getDefault()
Returns the default line break strategy. Use the setDefault method to set a new default line break strategy.

Returns:
The default line break strategy.

setDefault

public static void setDefault(LineBreakStrategy strategy)
Sets a new line brake strategy as the default strategy.

Parameters:
strategy - The new default strategy, not null.

createLineBreaker

public abstract LineBreaker createLineBreaker(java.awt.Font font,
                                              char[] text)
Creates a new instance of a line breaker that is able to break the given text that gets painted with the given font.

Parameters:
font - The font that is used to paint the text.
text - The text that should be broken in one or more lines. This parameter should not be modified.
Returns:
A line breaker object, that generates the text blocks.

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