de.dante.extex.typesetter.impl
Class NullTypesetterImpl

java.lang.Object
  extended byde.dante.extex.typesetter.impl.NullTypesetterImpl
All Implemented Interfaces:
ListMaker, Typesetter

public class NullTypesetterImpl
extends java.lang.Object
implements Typesetter

The dummy typesetter which does nothing but provide the appropriate interface.

Version:
$Revision: 1.27 $
Author:
Gerd Neugebauer

Constructor Summary
NullTypesetterImpl()
          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 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.
 void clearShipoutMark()
          Clear the internal state about shipouts.
 NodeList complete(TypesetterOptions context)
          Close the node list.
 void configure(Configuration config)
           
 void cr(Context context, TypesettingContext tc, UnicodeChar uc)
          Process a carriage return.
 ListMaker ensureHorizontalMode(Locator locator)
          Switch to horizontal mode if necessary.
 void finish()
          Instructs the typesetter to perform any actions necessary for cleaning up everything at the end of processing.
 BackendDriver getBackendDriver()
          Getter for back-end.
 Node getLastNode()
          Access the last node on the list.
 ListMaker getListMaker()
          Getter for the current list maker.
 Locator getLocator()
          Getter for the locator.
 ListManager getManager()
          Getter for the manager of the list maker stack.
 Mode getMode()
          Getter for the current mode.
 NodeFactory getNodeFactory()
          Getter for the NodeFactory.
 FixedDimen getPrevDepth()
          Getter for the previous depth parameter.
 long getSpacefactor()
          Getter for the space factor.
 boolean isShipoutMark()
          Query the shipout mark.
 void leftBrace()
          Notification method to deal the case that a left brace hs 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 push(ListMaker listMaker)
          Open a new list maker and put it in the top of the stack as current box.
 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 setBackend(BackendDriver driver)
          Setter for the back-end driver.
 void setNodeFactory(NodeFactory nodeFactory)
          Setter for the node factory.
 void setOptions(TypesetterOptions options)
          Setter for the typesetter specific options.
 void setOutputRoutine(OutputRoutine output)
          Setter for the output routine.
 void setPageBuilder(PageBuilder pageBuilder)
          Setter for the page builder.
 void setParagraphBuilder(ParagraphBuilder paragraphBuilder)
          Setter for the paragraph builder.
 void setPrevDepth(FixedDimen pd)
          Setter for the previous depth parameter.
 void setSpacefactor(FixedCount f)
          Setter for the space factor.
 void shipout(NodeList nodes)
          Send a list of nodes to the document writer.
 void showlist(java.lang.StringBuffer sb, long l, long m)
          Print the status for \showlists.
 void showlists(java.lang.StringBuffer sb, long l, long m)
          This method produces a diagnostic representation of the current lists in a StringBuffer.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullTypesetterImpl

public NullTypesetterImpl()
Creates a new object.

Method Detail

add

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

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

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.

Specified by:
add in interface ListMaker
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.

Specified by:
addAndAdjust in interface ListMaker
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)

addSpace

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

Specified by:
addSpace in interface ListMaker
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:
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.

Specified by:
afterParagraph in interface ListMaker
Parameters:
observer - the observer to register
See Also:
ListMaker.afterParagraph(ParagraphObserver)

clearShipoutMark

public void clearShipoutMark()
Description copied from interface: Typesetter
Clear the internal state about shipouts. The shipout mark is reset to false.

Specified by:
clearShipoutMark in interface Typesetter
See Also:
Typesetter.clearShipoutMark()

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.

Specified by:
complete in interface ListMaker
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)

configure

public void configure(Configuration config)
See Also:
Configurable.configure( de.dante.util.framework.configuration.Configuration)

cr

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

Specified by:
cr in interface ListMaker
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)

ensureHorizontalMode

public ListMaker ensureHorizontalMode(Locator locator)
Description copied from interface: Typesetter
Switch to horizontal mode if necessary. If the current mode is a horizontal mode then nothing is done.

Specified by:
ensureHorizontalMode in interface Typesetter
Parameters:
locator - the locator
Returns:
the horizontal list maker
See Also:
Typesetter.ensureHorizontalMode( de.dante.util.Locator)

finish

public void finish()
            throws ConfigurationException
Description copied from interface: Typesetter
Instructs the typesetter to perform any actions necessary for cleaning up everything at the end of processing. This should involve a shipout of any material still left unprocessed.

Specified by:
finish in interface Typesetter
Throws:
ConfigurationException - in case of an configuration problem
See Also:
Typesetter.finish()

getBackendDriver

public BackendDriver getBackendDriver()
Getter for back-end.

Specified by:
getBackendDriver in interface Typesetter
Returns:
the back-end
See Also:
Typesetter.getBackendDriver()

getLastNode

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

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

getListMaker

public ListMaker getListMaker()
Description copied from interface: Typesetter
Getter for the current list maker.

Specified by:
getListMaker in interface Typesetter
Returns:
the top list maker or null if the stack is empty
See Also:
Typesetter.getListMaker()

getLocator

public Locator getLocator()
Description copied from interface: ListMaker
Getter for the locator.

Specified by:
getLocator in interface ListMaker
Returns:
the locator
See Also:
ListMaker.getLocator()

getManager

public ListManager getManager()
Description copied from interface: Typesetter
Getter for the manager of the list maker stack.

Specified by:
getManager in interface Typesetter
Returns:
the manager
See Also:
Typesetter.getManager()

getMode

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

Specified by:
getMode in interface ListMaker
Returns:
the mode which is one of the values defined in Mode.
See Also:
ListMaker.getMode()

getNodeFactory

public NodeFactory getNodeFactory()
Description copied from interface: Typesetter
Getter for the NodeFactory.

Specified by:
getNodeFactory in interface Typesetter
Returns:
the node factory
See Also:
Typesetter.getNodeFactory()

getPrevDepth

public FixedDimen getPrevDepth()
                        throws TypesetterUnsupportedException
Description copied from interface: ListMaker
Getter for the previous depth parameter.

Specified by:
getPrevDepth in interface ListMaker
Returns:
the previous depth
Throws:
TypesetterUnsupportedException - in case of an error
See Also:
ListMaker.getPrevDepth()

getSpacefactor

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

Specified by:
getSpacefactor in interface ListMaker
Returns:
the space factor
Throws:
TypesetterUnsupportedException - in case of an error
See Also:
ListMaker.getSpacefactor()

isShipoutMark

public boolean isShipoutMark()
Description copied from interface: Typesetter
Query the shipout mark. The shipout mark is an internal state which records whether or not the shipout method has been called recently. This method can be used to get the current state. The method clearShipoutMark() can be used to reset the shipout mark to false. Initially the shipout mark is false.

Specified by:
isShipoutMark in interface Typesetter
Returns:
true iff there has been an invocation to the method shipout() since the last clearing
See Also:
Typesetter.isShipoutMark()

leftBrace

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

Specified by:
leftBrace in interface ListMaker
See Also:
ListMaker.leftBrace()

letter

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

Specified by:
letter in interface ListMaker
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
See Also:
de.dante.extex.typesetter.ListMaker#letter( de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.context.TypesettingContext, de.dante.util.UnicodeChar, de.dante.util.Locator)

mathShift

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

Specified by:
mathShift in interface ListMaker
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
See Also:
ListMaker.mathShift( de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.TokenSource, de.dante.extex.scanner.type.token.Token)

par

public void par()
         throws TypesetterException,
                ConfigurationException
Description copied from interface: ListMaker
Emit a new paragraph. This might be a noop under certain circumstances.

Specified by:
par in interface ListMaker
Throws:
TypesetterException - in case of an error
ConfigurationException - in case of a configuration error
See Also:
ListMaker.par()

push

public void push(ListMaker listMaker)
          throws TypesetterException
Description copied from interface: Typesetter
Open a new list maker and put it in the top of the stack as current box.

Specified by:
push in interface Typesetter
Parameters:
listMaker - the list maker
Throws:
TypesetterException - in case of an error
See Also:
Typesetter.push( de.dante.extex.typesetter.ListMaker)

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.

Specified by:
removeLastNode in interface ListMaker
See Also:
ListMaker.removeLastNode()

rightBrace

public void rightBrace()
                throws TypesetterException
Description copied from interface: ListMaker
Notification method to deal the case that a right brace has been encountered.

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

setBackend

public void setBackend(BackendDriver driver)
Description copied from interface: Typesetter
Setter for the back-end driver. The back-end driver is addressed whenever a complete page has to be shipped out.

Specified by:
setBackend in interface Typesetter
Parameters:
driver - the new back-end driver
See Also:
Typesetter.setBackend( de.dante.extex.backend.BackendDriver)

setNodeFactory

public void setNodeFactory(NodeFactory nodeFactory)
Description copied from interface: Typesetter
Setter for the node factory.

Specified by:
setNodeFactory in interface Typesetter
Parameters:
nodeFactory - the node factory
See Also:
Typesetter.setNodeFactory( de.dante.extex.typesetter.type.node.factory.NodeFactory)

setOptions

public void setOptions(TypesetterOptions options)
Description copied from interface: Typesetter
Setter for the typesetter specific options.

Specified by:
setOptions in interface Typesetter
Parameters:
options - the options to use
See Also:
Typesetter.setOptions( de.dante.extex.typesetter.TypesetterOptions)

setOutputRoutine

public void setOutputRoutine(OutputRoutine output)
Description copied from interface: Typesetter
Setter for the output routine.

Specified by:
setOutputRoutine in interface Typesetter
Parameters:
output - the output routine
See Also:
de.dante.extex.typesetter.Typesetter#setOutputRoutine( de.dante.extex.typesetter.OutputRoutine)

setPageBuilder

public void setPageBuilder(PageBuilder pageBuilder)
Setter for the page builder. Since the page builder is not needed this is a noop.

Specified by:
setPageBuilder in interface Typesetter
Parameters:
pageBuilder - the new page builder
See Also:
Typesetter.setPageBuilder( de.dante.extex.typesetter.pageBuilder.PageBuilder)

setParagraphBuilder

public void setParagraphBuilder(ParagraphBuilder paragraphBuilder)
Setter for the paragraph builder. Since the paragraph builder is not needed this is a noop.

Specified by:
setParagraphBuilder in interface Typesetter
Parameters:
paragraphBuilder - the new paragraph builder
See Also:
Typesetter.setParagraphBuilder( de.dante.extex.typesetter.paragraphBuilder.ParagraphBuilder)

setPrevDepth

public void setPrevDepth(FixedDimen pd)
Description copied from interface: ListMaker
Setter for the previous depth parameter.

Specified by:
setPrevDepth in interface ListMaker
Parameters:
pd - the previous depth parameter
See Also:
ListMaker.setPrevDepth( de.dante.extex.interpreter.type.dimen.FixedDimen)

setSpacefactor

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

Specified by:
setSpacefactor in interface ListMaker
Parameters:
f - the space factor to set
Throws:
InvalidSpacefactorException - in case of an invalid space factor
See Also:
ListMaker.setSpacefactor( de.dante.extex.interpreter.type.count.FixedCount)

shipout

public void shipout(NodeList nodes)
Description copied from interface: Typesetter
Send a list of nodes to the document writer. As a side effect the shipout mark is set.

Specified by:
shipout in interface Typesetter
Parameters:
nodes - the nodes to send to the typesetter
See Also:
Typesetter.shipout( de.dante.extex.typesetter.type.NodeList)

showlist

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

Specified by:
showlist in interface ListMaker
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)

showlists

public void showlists(java.lang.StringBuffer sb,
                      long l,
                      long m)
Description copied from interface: Typesetter
This method produces a diagnostic representation of the current lists in a StringBuffer.

Specified by:
showlists in interface Typesetter
Parameters:
sb - the target string buffer
l - the depth for the display
m - the breadth of the display
See Also:
Typesetter.showlists( java.lang.StringBuffer, long, long)

subscriptMark

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

Specified by:
subscriptMark in interface ListMaker
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
See Also:
ListMaker.subscriptMark( de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.TokenSource, de.dante.extex.typesetter.Typesetter, de.dante.extex.scanner.type.token.Token)

superscriptMark

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

Specified by:
superscriptMark in interface ListMaker
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
See Also:
ListMaker.superscriptMark( de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.TokenSource, de.dante.extex.typesetter.Typesetter, de.dante.extex.scanner.type.token.Token)

tab

public void tab(Context context,
                TokenSource source,
                Token t)
         throws TypesetterException,
                ConfigurationException
Description copied from interface: ListMaker
Treat a alignment tab character.

Specified by:
tab in interface ListMaker
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
See Also:
ListMaker.tab( de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.TokenSource, de.dante.extex.scanner.type.token.Token)