|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dante.extex.typesetter.impl.TypesetterImpl
This is a reference implementation of the
Typesetter
interface.
Constructor Summary | |
TypesetterImpl()
Creates a new object and initializes it to receive material. |
Method Summary | |
void |
add(FixedGlue glue)
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 |
buildParagraph(HorizontalListNode nodes)
Invoke the paragraph builder on a list of nodes. |
void |
clearShipoutMark()
Clear the internal state about shipouts. |
NodeList |
complete(TypesetterOptions context)
Close the node list. |
void |
cr(Context context,
TypesettingContext tc,
UnicodeChar uc)
Process a carriage return. |
void |
enableLocalization(Localizer theLocalizer)
Setter for the localizer. |
void |
enableLogging(java.util.logging.Logger theLogger)
Setter for the logger. |
void |
endParagraph()
End the current paragraph. |
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. |
TypesetterOptions |
getOptions()
Getter for the options object. |
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 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. |
ListMaker |
pop()
Discard the top of the stack of list makers. |
void |
push(ListMaker list)
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 parBuilder)
Setter for paragraph builder. |
void |
setPrevDepth(FixedDimen pd)
Setter for the previous depth parameter. |
void |
setSpacefactor(FixedCount sf)
Setter for the space factor |
void |
shipout(NodeList nodes)
This is the entry point for the document writer. |
void |
showlist(java.lang.StringBuffer sb,
long depth,
long breadth)
Print the status for \showlists. |
void |
showlists(java.lang.StringBuffer sb,
long depth,
long breadth)
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. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TypesetterImpl()
Method Detail |
public void add(FixedGlue glue) throws TypesetterException
ListMaker
add
in interface ListMaker
glue
- the glue to add
TypesetterException
- in case of an errorListMaker.add(
de.dante.extex.interpreter.type.glue.FixedGlue)
public void add(Node node) throws TypesetterException, ConfigurationException
ListMaker
add
in interface ListMaker
node
- the node to add
ConfigurationException
- in case of a configuration error
TypesetterException
- in case of an errorListMaker.add(
de.dante.extex.typesetter.type.Node)
public void addAndAdjust(NodeList list, TypesetterOptions options) throws TypesetterException, ConfigurationException
ListMaker
addAndAdjust
in interface ListMaker
list
- the listoptions
- the options to use
TypesetterException
- in case of an error
ConfigurationException
- in case of a configuration errorListMaker.addAndAdjust(
de.dante.extex.typesetter.type.NodeList,
de.dante.extex.typesetter.TypesetterOptions)
public void addSpace(TypesettingContext typesettingContext, Count spacefactor) throws TypesetterException, ConfigurationException
ListMaker
addSpace
in interface ListMaker
typesettingContext
- the typesetting context for the spacespacefactor
- the space factor to use for this space or
null
to indicate that the default space factor should
be used.
ConfigurationException
- in case of a configuration error
TypesetterException
- in case of an errorde.dante.extex.typesetter.ListMaker#addSpace(
de.dante.extex.interpreter.context.TypesettingContext,
de.dante.extex.interpreter.type.count.Count)
public void afterParagraph(ParagraphObserver observer)
ListMaker
afterParagraph
in interface ListMaker
observer
- the observer to registerListMaker.afterParagraph(
ParagraphObserver)
public NodeList buildParagraph(HorizontalListNode nodes) throws TypesetterException
ListManager
buildParagraph
in interface ListManager
nodes
- the nodes to make a paragraph from
TypesetterException
- in case of an errorListManager.buildParagraph(
de.dante.extex.typesetter.type.node.HorizontalListNode)
public void clearShipoutMark()
Typesetter
false
.
clearShipoutMark
in interface Typesetter
Typesetter.clearShipoutMark()
public NodeList complete(TypesetterOptions context) throws TypesetterException, ConfigurationException
ListMaker
complete
in interface ListMaker
context
- the typesetter options mapping a fragment of the
interpreter context
ConfigurationException
- in case of a configuration error
TypesetterException
- in case of an errorListMaker.complete(TypesetterOptions)
public void cr(Context context, TypesettingContext tc, UnicodeChar uc) throws TypesetterException
ListMaker
cr
in interface ListMaker
context
- the interpreter contexttc
- the typesetting contextuc
- the character
TypesetterException
- in case of an errorde.dante.extex.typesetter.ListMaker#cr(
de.dante.extex.interpreter.context.Context,
de.dante.extex.interpreter.context.TypesettingContext,
de.dante.util.UnicodeChar)
public void enableLocalization(Localizer theLocalizer)
enableLocalization
in interface Localizable
theLocalizer
- the new localizerLocalizable.enableLocalization(
de.dante.util.framework.i18n.Localizer)
public void enableLogging(java.util.logging.Logger theLogger)
LogEnabled
enableLogging
in interface LogEnabled
theLogger
- the logger to useLogEnabled.enableLogging(
java.util.logging.Logger)
public void endParagraph() throws TypesetterException, ConfigurationException
ListManager
endParagraph
in interface ListManager
TypesetterException
- in case of an error
ConfigurationException
- in case of an configuration problemListManager.endParagraph()
public ListMaker ensureHorizontalMode(Locator locator) throws TypesetterException
Typesetter
ensureHorizontalMode
in interface Typesetter
locator
- the locator
TypesetterException
- in case of an errorListManager.ensureHorizontalMode(
de.dante.util.Locator)
public void finish() throws TypesetterException, ConfigurationException
Typesetter
finish
in interface Typesetter
ConfigurationException
- in case of an configuration problem
TypesetterException
- in case of an errorTypesetter.finish()
public BackendDriver getBackendDriver()
getBackendDriver
in interface Typesetter
Typesetter.getBackendDriver()
public Node getLastNode()
ListMaker
getLastNode
in interface ListMaker
null
if the
list is emptyListMaker.getLastNode()
public ListMaker getListMaker()
Typesetter
getListMaker
in interface Typesetter
null
if the stack is emptyTypesetter.getListMaker()
public Locator getLocator()
ListMaker
getLocator
in interface ListMaker
ListMaker.getLocator()
public ListManager getManager()
getManager
in interface Typesetter
Typesetter.getManager()
public Mode getMode()
ListMaker
getMode
in interface ListMaker
Mode
.ListMaker.getMode()
public NodeFactory getNodeFactory()
Typesetter
getNodeFactory
in interface Typesetter
Typesetter.getNodeFactory()
public TypesetterOptions getOptions()
ListManager
getOptions
in interface ListManager
ListManager.getOptions()
public FixedDimen getPrevDepth() throws TypesetterUnsupportedException
ListMaker
getPrevDepth
in interface ListMaker
TypesetterUnsupportedException
- in case of an errorListMaker.getPrevDepth()
public long getSpacefactor() throws TypesetterUnsupportedException
ListMaker
getSpacefactor
in interface ListMaker
TypesetterUnsupportedException
- in case of an errorListMaker.getSpacefactor()
public boolean isShipoutMark()
Typesetter
clearShipoutMark()
can be used to
reset the shipout mark to false
.
Initially the shipout mark is false
.
isShipoutMark
in interface Typesetter
true
iff there has been an invocation to the method
shipout()
since the last clearingTypesetter.isShipoutMark()
public void leftBrace()
leftBrace
in interface ListMaker
public boolean letter(UnicodeChar uc, TypesettingContext tc, Context context, TokenSource source, Locator locator) throws TypesetterException
ListMaker
letter
in interface ListMaker
tc
- the typesetting contextuc
- the charactercontext
- the interpreter contextsource
- the source for new tokenslocator
- the locator
true
iff the character has been discarded because
it is not defined in the current font.
TypesetterException
- in case of an errorde.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)
public void mathShift(Context context, TokenSource source, Token t) throws TypesetterException, ConfigurationException
ListMaker
mathShift
in interface ListMaker
context
- the interpreter contextsource
- the source for new tokenst
- the actual math shift character token
TypesetterException
- in case of an error
ConfigurationException
- in case of a configuration errorListMaker.mathShift(
de.dante.extex.interpreter.context.Context,
de.dante.extex.interpreter.TokenSource,
de.dante.extex.scanner.type.token.Token)
public void par() throws TypesetterException, ConfigurationException
ListMaker
par
in interface ListMaker
TypesetterException
- in case of an error
ConfigurationException
- in case of a configuration errorListMaker.par()
public ListMaker pop() throws TypesetterException
ListManager
pop
in interface ListManager
TypesetterException
- in case of an errorListManager.pop()
public void push(ListMaker list) throws TypesetterException
Typesetter
push
in interface Typesetter
list
- the list maker
TypesetterException
- in case of an errorListManager.push(
de.dante.extex.typesetter.ListMaker)
public void removeLastNode()
ListMaker
removeLastNode
in interface ListMaker
ListMaker.removeLastNode()
public void rightBrace() throws TypesetterException
ListMaker
rightBrace
in interface ListMaker
TypesetterException
- in case of an errorListMaker.rightBrace()
public void setBackend(BackendDriver driver)
Typesetter
setBackend
in interface Typesetter
driver
- the new back-end driverTypesetter.setBackend(
de.dante.extex.backend.BackendDriver)
public void setNodeFactory(NodeFactory nodeFactory)
Typesetter
setNodeFactory
in interface Typesetter
nodeFactory
- the node factoryTypesetter.setNodeFactory(
de.dante.extex.typesetter.type.node.factory.NodeFactory)
public void setOptions(TypesetterOptions options)
Typesetter
setOptions
in interface Typesetter
options
- the options to useTypesetter.setOptions(
de.dante.extex.typesetter.TypesetterOptions)
public void setOutputRoutine(OutputRoutine output)
Typesetter
setOutputRoutine
in interface Typesetter
output
- the output routinede.dante.extex.typesetter.Typesetter#setOutputRoutine(
de.dante.extex.typesetter.OutputRoutine)
public void setPageBuilder(PageBuilder pageBuilder)
setPageBuilder
in interface Typesetter
pageBuilder
- the new page builderTypesetter.setPageBuilder(
de.dante.extex.typesetter.pageBuilder.PageBuilder)
public void setParagraphBuilder(ParagraphBuilder parBuilder)
setParagraphBuilder
in interface Typesetter
parBuilder
- the paragraph builder to set.public void setPrevDepth(FixedDimen pd) throws TypesetterUnsupportedException
ListMaker
setPrevDepth
in interface ListMaker
pd
- the previous depth parameter
TypesetterUnsupportedException
- in case of an errorListMaker.setPrevDepth(
de.dante.extex.interpreter.type.dimen.FixedDimen)
public void setSpacefactor(FixedCount sf) throws TypesetterUnsupportedException, InvalidSpacefactorException
ListManager
setSpacefactor
in interface ListMaker
sf
- the space factor to set
TypesetterUnsupportedException
- in case of an error
InvalidSpacefactorException
- in case of an invalid space factorListMaker.setSpacefactor(
de.dante.extex.interpreter.type.count.FixedCount)
public void shipout(NodeList nodes) throws TypesetterException
shipout
in interface Typesetter
nodes
- the nodes to send
TypesetterException
- in case of an errorTypesetter.shipout(
de.dante.extex.typesetter.type.NodeList)
public void showlist(java.lang.StringBuffer sb, long depth, long breadth)
ListMaker
showlist
in interface ListMaker
sb
- the target bufferdepth
- the depth of the list displaybreadth
- the breadth of the list displayListMaker.showlist(java.lang.StringBuffer,
long, long)
public void showlists(java.lang.StringBuffer sb, long depth, long breadth)
Typesetter
showlists
in interface Typesetter
sb
- the target string bufferdepth
- the depth for the displaybreadth
- the breadth of the displayTypesetter.showlists(
java.lang.StringBuffer, long, long)
public void subscriptMark(Context context, TokenSource source, Typesetter typesetter, Token t) throws TypesetterException
ListMaker
subscriptMark
in interface ListMaker
context
- the interpreter contextsource
- the source for new tokenstypesetter
- the typesettert
- the actual sub mark token
TypesetterException
- in case of an errorListMaker.subscriptMark(
de.dante.extex.interpreter.context.Context,
de.dante.extex.interpreter.TokenSource,
de.dante.extex.typesetter.Typesetter,
de.dante.extex.scanner.type.token.Token)
public void superscriptMark(Context context, TokenSource source, Typesetter typesetter, Token t) throws TypesetterException
ListMaker
superscriptMark
in interface ListMaker
context
- the interpreter contextsource
- the source for new tokenstypesetter
- the typesettert
- the actual super mark token
TypesetterException
- in case of an errorListMaker.superscriptMark(
de.dante.extex.interpreter.context.Context,
de.dante.extex.interpreter.TokenSource,
Typesetter, de.dante.extex.scanner.type.token.Token)
public void tab(Context context, TokenSource source, Token t) throws TypesetterException, ConfigurationException
ListMaker
tab
in interface ListMaker
context
- the interpreter contextsource
- the source for new tokenst
- the actual tab token
TypesetterException
- in case of an error
ConfigurationException
- in case of a configuration errorListMaker.tab(
Context,
TokenSource, de.dante.extex.scanner.type.token.Token)
public java.lang.String toString()
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |