Unified Typesetting API M1-20040817

de.inghuimische.uta.linebreaking
Interface LinebreakAlgorithm

All Superinterfaces:
QManageable
All Known Implementing Classes:
AbstractLinebreakAlgorithm

public interface LinebreakAlgorithm
extends QManageable

A linebreak algorithm breaks one line of text into several ones with each of them having a given length. Such an algorithm can either work line based, finding the local optimum of a line width or paragraph based, searching for a global optimum of linebreaks.

A linebreak algorithm receives a sequence of socalled items, where each Item can contain anything (the linebreak algorithm is not interested in the content) and a linebreak is allowed behind every such item. Therefore an item will most commonly represent a word or a syllable. An item will in most cases also the sourrounding whitespace although this is not required. You can also put every whitespace in a item of its own.

The LineWidthModel provides the line width for every single line. The consider(Item) method called from outside informs the linebreaker of a new item. A call to getBreakpoints() finishes the linebreaking and returns the calculated breakpoints.

Have a look into Feature for features a linebreaker can support. Implementations have to provide a list of features.

Author:
Christian Ziesemer

Method Summary
 void consider(Item newItem)
          Tells the line breaker that he has to consider a newly generated item.
 List getBreakpoints()
          Returns the generated breakpoints.
 FeatureList getFeatures()
          Returns a list of supported features.
 LineWidthModel getLineWidthModel()
          Returns the line width model used.
 void setLineWidthModel(LineWidthModel aModel)
          Sets the line width model.
 

Method Detail

setLineWidthModel

public void setLineWidthModel(LineWidthModel aModel)
Sets the line width model. The model is used to allow varying line width.

Parameters:
aModel - The model to use.

getLineWidthModel

public LineWidthModel getLineWidthModel()
Returns the line width model used.

Returns:
The line width model used.

getFeatures

public FeatureList getFeatures()
Returns a list of supported features.

Specified by:
getFeatures in interface QManageable
Returns:
A list of supported features.

consider

public void consider(Item newItem)
Tells the line breaker that he has to consider a newly generated item. This allows implementations which do typesetting and linebreaking simultaneous.

Parameters:
newItem - The new Item to consider.

getBreakpoints

public List getBreakpoints()
Returns the generated breakpoints. Calling this method only makes sense if no further calls to consider(Item) are made.

Returns:
The generated breakpoints.

Unified Typesetting API M1-20040817


An inghuimische.de project.
Copyright (C) 2004 Christian Ziesemer; See the Mozilla Public License for more details.