de.dante.extex.typesetter.listMaker
Class HorizontalListMaker

java.lang.Object
  extended byde.dante.extex.typesetter.listMaker.AbstractListMaker
      extended byde.dante.extex.typesetter.listMaker.HorizontalListMaker
All Implemented Interfaces:
ListMaker
Direct Known Subclasses:
MathListMaker, RestrictedHorizontalListMaker

public class HorizontalListMaker
extends AbstractListMaker

Maker for a horizontal list.

After par(), the line breaking and hyphenation are applied.

Version:
$Revision: 1.39 $
Author:
Gerd Neugebauer, Michael Niedermair

Constructor Summary
HorizontalListMaker(ListManager manager, Locator locator)
          Creates a new object.
 
Method Summary
 void add(FixedGlue g)
          Add a glue node to the list.
 void add(Node c)
          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 context, Count sfCount)
          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.
 Mode getMode()
          Getter for the current mode.
protected  HorizontalListNode getNodes()
          Getter for nodes.
 long getSpacefactor()
          Getter for the space factor.
 boolean letter(UnicodeChar symbol, TypesettingContext tc, Context context, TokenSource source, Locator locator)
          Add a character node to the list.
 void par()
          Emit a new paragraph.
 void removeLastNode()
          Removes the last node from the list.
protected  void setNodes(HorizontalListNode nodes)
          Setter for nodes.
 void setSpacefactor(FixedCount f)
          Setter for the space factor.
 void showlist(java.lang.StringBuffer sb, long l, long m)
          Print the status for \showlists.
 java.lang.String toString()
           
 
Methods inherited from class de.dante.extex.typesetter.listMaker.AbstractListMaker
getLocalizer, getLocator, getManager, getMyLocalizer, getPrevDepth, leftBrace, mathShift, rightBrace, setPrevDepth, subscriptMark, superscriptMark, tab
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HorizontalListMaker

public HorizontalListMaker(ListManager manager,
                           Locator locator)
Creates a new object.

Parameters:
manager - the manager to ask for global changes
locator - the locator
Method Detail

add

public void add(Node c)
         throws TypesetterException,
                ConfigurationException
Description copied from interface: ListMaker
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:
c - the node to add
Throws:
ConfigurationException - in case of a configuration error
TypesetterException - in case of an error
See Also:
ListMaker.add( de.dante.extex.typesetter.type.Node)

addAndAdjust

public void addAndAdjust(NodeList list,
                         TypesetterOptions options)
                  throws TypesetterException
Description copied from interface: ListMaker
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
See Also:
ListMaker.addAndAdjust( de.dante.extex.typesetter.type.NodeList, de.dante.extex.typesetter.TypesetterOptions)

add

public void add(FixedGlue g)
         throws TypesetterException
Description copied from interface: ListMaker
Add a glue node to the list.

Parameters:
g - the glue to add
Throws:
TypesetterException - in case of an error
See Also:
ListMaker.add( de.dante.extex.interpreter.type.glue.FixedGlue)

addSpace

public void addSpace(TypesettingContext context,
                     Count sfCount)
              throws TypesetterException,
                     ConfigurationException
Description copied from interface: ListMaker
Add a space node to the list.

Parameters:
context - the typesetting context for the space
sfCount - the space factor to use for this space or null to indicate that the default space factor should be used.
Throws:
ConfigurationException - in case of a configuration error
TypesetterException - in case of an error
See Also:
de.dante.extex.typesetter.ListMaker#addSpace( de.dante.extex.interpreter.context.TypesettingContext, de.dante.extex.interpreter.type.count.Count)

afterParagraph

public void afterParagraph(ParagraphObserver observer)
Description copied from interface: ListMaker
Register an observer to be invoked at the end of the paragraph.

Parameters:
observer - the observer to register
See Also:
ListMaker.afterParagraph( de.dante.extex.typesetter.ParagraphObserver)

complete

public NodeList complete(TypesetterOptions context)
                  throws TypesetterException,
                         ConfigurationException
Description copied from interface: ListMaker
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:
ConfigurationException - in case of a configuration error
TypesetterException - in case of an error
See Also:
ListMaker.complete(TypesetterOptions)

cr

public void cr(Context context,
               TypesettingContext tc,
               UnicodeChar uc)
        throws TypesetterException
Description copied from interface: ListMaker
Process a carriage return.

Parameters:
context - the interpreter context
tc - the typesetting context
uc - the character
Throws:
TypesetterException - in case of an error
See Also:
de.dante.extex.typesetter.ListMaker#cr( de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.context.TypesettingContext, de.dante.util.UnicodeChar)

getLastNode

public Node getLastNode()
Description copied from interface: ListMaker
Access the last node on the list.

Returns:
the last node in the current list or null if the list is empty
See Also:
ListMaker.getLastNode()

getMode

public Mode getMode()
Description copied from interface: ListMaker
Getter for the current mode.

Specified by:
getMode in interface ListMaker
Specified by:
getMode in class AbstractListMaker
See Also:
ListMaker.getMode()

getNodes

protected HorizontalListNode getNodes()
Getter for nodes.

Returns:
the nodes.

getSpacefactor

public long getSpacefactor()
Description copied from interface: ListMaker
Getter for the space factor.

Specified by:
getSpacefactor in interface ListMaker
Overrides:
getSpacefactor in class AbstractListMaker
See Also:
ListMaker.getSpacefactor()

letter

public boolean letter(UnicodeChar symbol,
                      TypesettingContext tc,
                      Context context,
                      TokenSource source,
                      Locator locator)
               throws TypesetterException
Add a character node to the list.

Parameters:
symbol - the symbol to add
tc - the typesetting context for the symbol
context - the interpreter context
source - the source of 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
See Also:
de.dante.extex.typesetter.ListMaker#letter( de.dante.util.UnicodeChar, de.dante.extex.interpreter.context.TypesettingContext, de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.TokenSource; de.dante.util.Locator), "The TeXbook [p.76]"

par

public void par()
         throws TypesetterException,
                ConfigurationException
Description copied from interface: ListMaker
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
See Also:
ListMaker.par()

removeLastNode

public void removeLastNode()
Description copied from interface: ListMaker
Removes the last node from the list. If the list is empty then nothing is done.

See Also:
ListMaker.removeLastNode()

setNodes

protected void setNodes(HorizontalListNode nodes)
Setter for nodes.

Parameters:
nodes - the nodes to set.

setSpacefactor

public void setSpacefactor(FixedCount f)
                    throws TypesetterUnsupportedException,
                           InvalidSpacefactorException
Description copied from interface: ListMaker
Setter for the space factor.

Specified by:
setSpacefactor in interface ListMaker
Overrides:
setSpacefactor in class AbstractListMaker
Throws:
TypesetterUnsupportedException
InvalidSpacefactorException
See Also:
ListMaker.setSpacefactor( de.dante.extex.interpreter.type.count.FixedCount)

showlist

public void showlist(java.lang.StringBuffer sb,
                     long l,
                     long m)
Description copied from interface: ListMaker
Print the status for \showlists.

Parameters:
sb - the target buffer
l - the depth of the list display
m - the breadth of the list display
See Also:
ListMaker.showlist( java.lang.StringBuffer, long, long)

toString

public java.lang.String toString()
Overrides:
toString in class AbstractListMaker
See Also:
Object.toString()