org.extex.unit.tex.table.util
Class HAlignListMaker

java.lang.Object
  extended by org.extex.typesetter.listMaker.AbstractListMaker
      extended by org.extex.typesetter.listMaker.HorizontalListMaker
          extended by org.extex.typesetter.listMaker.RestrictedHorizontalListMaker
              extended by org.extex.unit.tex.table.util.HAlignListMaker
All Implemented Interfaces:
ListMaker, AlignmentList, TokenDelegateListMaker

public class HAlignListMaker
extends RestrictedHorizontalListMaker
implements AlignmentList

This class provides a list maker for horizontal alignments.

Version:
$Revision: 4770 $
Author:
Gerd Neugebauer
See Also:
"TTP [770]"

Nested Class Summary
protected static class HAlignListMaker.Cell
          This inner class is a container for the cell information in an alignment.
 
Constructor Summary
HAlignListMaker(ListManager manager, Context context, TokenSource source, java.util.List<PreambleItem> thePreamble, FixedDimen theWidth, boolean theSpread)
          Creates a new object.
 
Method Summary
 NodeList complete(TypesetterOptions context)
          Close the node list.
 void cr(Context context, TokenSource source, NodeList noalign)
          This method is invoked when a row in the alignment is complete and the cells can be integrated.
 void crcr(Context context, TokenSource source, Typesetter typesetter)
          This method is invoked when a row in the alignment is complete and the cells can be integrated.
 void omit()
          The invocation of this method indicates that the pattern for the current cell should not be taken from the preamble but the default should be used instead.
 void span(Context context, TokenSource source)
          This method is invoked when a cell is complete which should be continued in the next cell.
static Dimen sum(Dimen[] d)
          Compute the sum of an array of dimens.
 void tab(Context context, TokenSource source, Token token)
          Treat a alignment tab character.
 
Methods inherited from class org.extex.typesetter.listMaker.RestrictedHorizontalListMaker
getMode
 
Methods inherited from class org.extex.typesetter.listMaker.HorizontalListMaker
add, add, addAndAdjust, addSpace, afterParagraph, cr, getLastNode, getNodes, getSpacefactor, letter, par, removeLastNode, setNodes, setSpacefactor, showlist, toString
 
Methods inherited from class org.extex.typesetter.listMaker.AbstractListMaker
getLocalizer, getLocator, getManager, getMyLocalizer, getPrevDepth, leftBrace, mathShift, rightBrace, setPrevDepth, subscriptMark, superscriptMark
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HAlignListMaker

public HAlignListMaker(ListManager manager,
                       Context context,
                       TokenSource source,
                       java.util.List<PreambleItem> thePreamble,
                       FixedDimen theWidth,
                       boolean theSpread)
                throws HelpingException,
                       TypesetterException
Creates a new object.

Parameters:
manager - the manager
context - the interpreter context
source - the token source
thePreamble - the list of preamble items
theWidth - the target width or null if the natural width should be used
theSpread - indicator that the width should be interpreted relative
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter
Method Detail

complete

public NodeList complete(TypesetterOptions context)
                  throws TypesetterException,
                         ConfigurationException
Close the node list. This means that everything is done to ship the closed node list to the document writer. Nevertheless the invoking application might decide not to modify the node list and continue processing. In the other case some nodes might be taken from the node list returned by this method. Then the processing has to continue with the reduced node list.

Specified by:
complete in interface ListMaker
Overrides:
complete in class RestrictedHorizontalListMaker
Parameters:
context - the typesetter options mapping a fragment of the interpreter context
Returns:
the node list enclosed in this instance
Throws:
TypesetterException - in case of an error
ConfigurationException - in case of a configuration error
See Also:
RestrictedHorizontalListMaker.complete( org.extex.typesetter.TypesetterOptions)

cr

public void cr(Context context,
               TokenSource source,
               NodeList noalign)
        throws TypesetterException
This method is invoked when a row in the alignment is complete and the cells can be integrated. If some cells are not filled jet then they are treated as empty.

Specified by:
cr in interface AlignmentList
Parameters:
context - the interpreter context
source - the token source
noalign - the tokens to be inserted or null
Throws:
TypesetterException - in case of an error
See Also:
AlignmentList.cr( org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource, org.extex.typesetter.type.NodeList)

crcr

public void crcr(Context context,
                 TokenSource source,
                 Typesetter typesetter)
          throws TypesetterException
This method is invoked when a row in the alignment is complete and the cells can be integrated. If some cells are not filled jet then they are treated as empty. In contrast to the method cr() this method is a noop when the alignment is at the beginning of a row.

Specified by:
crcr in interface AlignmentList
Parameters:
context - the interpreter context
source - the token source
typesetter - the typesetter
Throws:
TypesetterException - in case of an error
See Also:
AlignmentList.crcr( org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)

omit

public void omit()
          throws TypesetterException
The invocation of this method indicates that the pattern for the current cell should not be taken from the preamble but the default should be used instead.

Specified by:
omit in interface AlignmentList
Throws:
TypesetterException - in case of an error
See Also:
AlignmentList.omit()

span

public void span(Context context,
                 TokenSource source)
          throws TypesetterException
This method is invoked when a cell is complete which should be continued in the next cell.

Specified by:
span in interface AlignmentList
Parameters:
context - the interpreter context
source - the token source
Throws:
TypesetterException - in case of an error
See Also:
AlignmentList.span( org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource)

sum

public static Dimen sum(Dimen[] d)
Compute the sum of an array of dimens.

Parameters:
d - the dimen array
Returns:
the sum in a new Dimen

tab

public void tab(Context context,
                TokenSource source,
                Token token)
         throws TypesetterException,
                ConfigurationException
Treat a alignment tab character.

Specified by:
tab in interface TokenDelegateListMaker
Overrides:
tab in class AbstractListMaker
Parameters:
context - the interpreter context
source - the source for new tokens
token - the actual tab token
Throws:
TypesetterException - in case of an error
ConfigurationException - in case of a configuration error
See Also:
AbstractListMaker.tab( org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource, org.extex.scanner.type.token.Token)