de.dante.extex.typesetter
Interface ListMaker

All Known Subinterfaces:
NoadConsumer, Typesetter
All Known Implementing Classes:
AbstractListMaker, MathListMaker, NullTypesetterImpl, TypesetterImpl

public interface ListMaker

This interface describes the capabilities of a list maker.

Version:
$Revision: 1.53 $
Author:
Gerd Neugebauer
See Also:
"TeX – The Program [211]"

Method Summary
 void add(FixedGlue g)
          Add a glue node to the list.
 void add(Node node)
          Add an arbitrary node to the internal list of nodes gathered so far.
 void addAndAdjust(NodeList list, TypesetterOptions options)
          Add a node list to the current list maker and adjust the spacing between the elements of the list.
 void addSpace(TypesettingContext typesettingContext, Count spacefactor)
          Add a space node to the list.
 void afterParagraph(ParagraphObserver observer)
          Register an observer to be invoked at the end of the paragraph.
 NodeList complete(TypesetterOptions context)
          Close the node list.
 void cr(Context context, TypesettingContext tc, UnicodeChar uc)
          Process a carriage return.
 Node getLastNode()
          Access the last node on the list.
 Locator getLocator()
          Getter for the locator.
 Mode getMode()
          Getter for the current mode.
 FixedDimen getPrevDepth()
          Getter for the previous depth parameter.
 long getSpacefactor()
          Getter for the space factor.
 void leftBrace()
          Notification method to deal the case that a left brace has been encountered.
 boolean letter(UnicodeChar uc, TypesettingContext tc, Context context, TokenSource source, Locator locator)
          Add a letter to the current list or treat it in some other appropriate way.
 void mathShift(Context context, TokenSource source, Token t)
          Treat a math shift character.
 void par()
          Emit a new paragraph.
 void removeLastNode()
          Removes the last node from the list.
 void rightBrace()
          Notification method to deal the case that a right brace has been encountered.
 void setPrevDepth(FixedDimen pd)
          Setter for the previous depth parameter.
 void setSpacefactor(FixedCount sf)
          Setter for the space factor.
 void showlist(java.lang.StringBuffer sb, long depth, long breadth)
          Print the status for \showlists.
 void subscriptMark(Context context, TokenSource source, Typesetter typesetter, Token t)
          Treat a subscript mark.
 void superscriptMark(Context context, TokenSource source, Typesetter typesetter, Token t)
          Treat a superscript mark.
 void tab(Context context, TokenSource source, Token t)
          Treat a alignment tab character.
 

Method Detail

add

public void add(Node node)
         throws TypesetterException,
                ConfigurationException
Add an arbitrary node to the internal list of nodes gathered so far. The node should not be one of the special nodes treated by methods of their own.

Parameters:
node - the node to add
Throws:
TypesetterException - in case of an error
ConfigurationException - in case of a configuration error

addAndAdjust

public void addAndAdjust(NodeList list,
                         TypesetterOptions options)
                  throws TypesetterException,
                         ConfigurationException
Add a node list to the current list maker and adjust the spacing between the elements of the list.

Parameters:
list - the list
options - the options to use
Throws:
TypesetterException - in case of an error
ConfigurationException - in case of a configuration error

add

public void add(FixedGlue g)
         throws TypesetterException
Add a glue node to the list.

Parameters:
g - the glue to add
Throws:
TypesetterException - in case of an error

addSpace

public void addSpace(TypesettingContext typesettingContext,
                     Count spacefactor)
              throws TypesetterException,
                     ConfigurationException
Add a space node to the list.

Parameters:
typesettingContext - the typesetting context for the space
spacefactor - the space factor to use for this space or null to indicate that the default space factor should be used.
Throws:
TypesetterException - in case of an error
ConfigurationException - in case of a configuration error

afterParagraph

public void afterParagraph(ParagraphObserver observer)
Register an observer to be invoked at the end of the paragraph.

Parameters:
observer - the observer to register

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.

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

cr

public void cr(Context context,
               TypesettingContext tc,
               UnicodeChar uc)
        throws TypesetterException
Process a carriage return.

Parameters:
context - the interpreter context
tc - the typesetting context
uc - the character
Throws:
TypesetterException - in case of an error

getLastNode

public Node getLastNode()
Access the last node on the list.

Returns:
the last node in the current list or null if the list is empty

getLocator

public Locator getLocator()
Getter for the locator.

Returns:
the locator

getMode

public Mode getMode()
Getter for the current mode.

Returns:
the mode which is one of the values defined in Mode.

getPrevDepth

public FixedDimen getPrevDepth()
                        throws TypesetterUnsupportedException
Getter for the previous depth parameter.

Returns:
the previous depth
Throws:
TypesetterUnsupportedException - in case of an error

getSpacefactor

public long getSpacefactor()
                    throws TypesetterUnsupportedException
Getter for the space factor.

Returns:
the space factor
Throws:
TypesetterUnsupportedException - in case of an error

leftBrace

public void leftBrace()
Notification method to deal the case that a left brace has been encountered.


letter

public boolean letter(UnicodeChar uc,
                      TypesettingContext tc,
                      Context context,
                      TokenSource source,
                      Locator locator)
               throws TypesetterException
Add a letter to the current list or treat it in some other appropriate way.

Parameters:
tc - the typesetting context
uc - the character
context - the interpreter context
source - the source for new tokens
locator - the locator
Returns:
true iff the character has been discarded because it is not defined in the current font.
Throws:
TypesetterException - in case of an error

mathShift

public void mathShift(Context context,
                      TokenSource source,
                      Token t)
               throws TypesetterException,
                      ConfigurationException
Treat a math shift character. Usually this leads to entering or leaving math mode – maybe after inspection of a following token.

Parameters:
context - the interpreter context
source - the source for new tokens
t - the actual math shift character token
Throws:
TypesetterException - in case of an error
ConfigurationException - in case of a configuration error

par

public void par()
         throws TypesetterException,
                ConfigurationException
Emit a new paragraph. This might be a noop under certain circumstances.

Throws:
TypesetterException - in case of an error
ConfigurationException - in case of a configuration error

removeLastNode

public void removeLastNode()
Removes the last node from the list. If the list is empty then nothing is done.


rightBrace

public void rightBrace()
                throws TypesetterException
Notification method to deal the case that a right brace has been encountered.

Throws:
TypesetterException - in case of an error

setPrevDepth

public void setPrevDepth(FixedDimen pd)
                  throws TypesetterUnsupportedException
Setter for the previous depth parameter.

Parameters:
pd - the previous depth parameter
Throws:
TypesetterUnsupportedException - in case of an error

setSpacefactor

public void setSpacefactor(FixedCount sf)
                    throws TypesetterUnsupportedException,
                           InvalidSpacefactorException
Setter for the space factor.

Parameters:
sf - the space factor to set
Throws:
TypesetterUnsupportedException - in case of an error
InvalidSpacefactorException - in case of an invalid space factor

showlist

public void showlist(java.lang.StringBuffer sb,
                     long depth,
                     long breadth)
Print the status for \showlists.

Parameters:
sb - the target buffer
depth - the depth of the list display
breadth - the breadth of the list display

subscriptMark

public void subscriptMark(Context context,
                          TokenSource source,
                          Typesetter typesetter,
                          Token t)
                   throws TypesetterException
Treat a subscript mark. This might be meaningful in math mode only.

Parameters:
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter
t - the actual sub mark token
Throws:
TypesetterException - in case of an error

superscriptMark

public void superscriptMark(Context context,
                            TokenSource source,
                            Typesetter typesetter,
                            Token t)
                     throws TypesetterException
Treat a superscript mark. This might be meaningful in math mode only.

Parameters:
context - the interpreter context
source - the source for new tokens
typesetter - the typesetter
t - the actual super mark token
Throws:
TypesetterException - in case of an error

tab

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

Parameters:
context - the interpreter context
source - the source for new tokens
t - the actual tab token
Throws:
TypesetterException - in case of an error
ConfigurationException - in case of a configuration error