de.dante.extex.backend.documentWriter.postscript.util
Class PsBasicConverter

java.lang.Object
  extended byde.dante.extex.backend.documentWriter.postscript.util.PsBasicConverter
All Implemented Interfaces:
ColorAware, NodeVisitor, PsConverter, ResourceConsumer

public class PsBasicConverter
extends java.lang.Object
implements PsConverter, NodeVisitor, ResourceConsumer, ColorAware

This class provides a converter to PostScript code.

Version:
$Revision: 1.7 $
Author:
Gerd Neugebauer

Constructor Summary
PsBasicConverter()
          Creates a new object.
 
Method Summary
 void init(HeaderManager header)
          Perform some initializations for each document.
 void setColorConverter(ColorConverter converter)
          Setter for the color converter.
 void setResourceFinder(ResourceFinder resourceFinder)
          Setter for the resource finder.
 byte[] toPostScript(Page page, FontManager fontManager, HeaderManager headerManager)
          Translate nodes into PostScript code.
 java.lang.Object visitAdjust(AdjustNode node, java.lang.Object oOut)
          This method is called when an AdjustNode has been encountered.
 java.lang.Object visitAfterMath(AfterMathNode node, java.lang.Object oOut)
          This method is called when an AfterMathNode has been encountered.
 java.lang.Object visitAlignedLeaders(AlignedLeadersNode node, java.lang.Object oOut)
          This method is called when an AlignedLeadersNode has been encountered.
 java.lang.Object visitBeforeMath(BeforeMathNode node, java.lang.Object oOut)
          This method is called when a BeforeMathNode has been encountered.
 java.lang.Object visitCenteredLeaders(CenteredLeadersNode node, java.lang.Object oOut)
          This method is called when a CenteredLeadersNode has been encountered.
 java.lang.Object visitChar(CharNode node, java.lang.Object oOut)
          This method is called when a CharNode has been encountered.
 java.lang.Object visitDiscretionary(DiscretionaryNode node, java.lang.Object oOut)
          This method is called when a DiscretionaryNode has been encountered.
 java.lang.Object visitExpandedLeaders(ExpandedLeadersNode node, java.lang.Object oOut)
          This method is called when an ExpandedLeadersNode has been encountered.
 java.lang.Object visitGlue(GlueNode node, java.lang.Object oOut)
          This method is called when a GlueNode has been encountered.
 java.lang.Object visitHorizontalList(HorizontalListNode node, java.lang.Object oOut)
          This method is called when a HorizontalListNode has been encountered.
 java.lang.Object visitInsertion(InsertionNode node, java.lang.Object oOut)
          This method is called when an InsertionNode has been encountered.
 java.lang.Object visitKern(KernNode node, java.lang.Object oOut)
          This method is called when a KernNode has been encountered.
 java.lang.Object visitLigature(LigatureNode node, java.lang.Object oOut)
          This method is called when a LigatureNode has been encountered.
 java.lang.Object visitMark(MarkNode node, java.lang.Object oOut)
          This method is called when a MarkNode has been encountered.
 java.lang.Object visitPenalty(PenaltyNode node, java.lang.Object oOut)
          This method is called when a PenaltyNode has been encountered.
 java.lang.Object visitRule(RuleNode node, java.lang.Object oOut)
          This method is called when a RuleNode has been encountered.
 java.lang.Object visitSpace(SpaceNode node, java.lang.Object oOut)
          This method is called when a SpaceNode has been encountered.
 java.lang.Object visitVerticalList(VerticalListNode node, java.lang.Object oOut)
          This method is called when a VerticalListNode has been encountered.
 java.lang.Object visitVirtualChar(VirtualCharNode node, java.lang.Object oOut)
          This method is called when a VirtualCharNode has been encountered.
 java.lang.Object visitWhatsIt(WhatsItNode node, java.lang.Object oOut)
          This method is called when a WhatsItNode has been encountered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PsBasicConverter

public PsBasicConverter()
Creates a new object.

Method Detail

init

public void init(HeaderManager header)
          throws java.io.IOException
Perform some initializations for each document.

Specified by:
init in interface PsConverter
Parameters:
header - the header manager
Throws:
java.io.IOException - in case of an error while loading

toPostScript

public byte[] toPostScript(Page page,
                           FontManager fontManager,
                           HeaderManager headerManager)
                    throws DocumentWriterException
Translate nodes into PostScript code. This method traverses the nodes tree recursively and produces the corresponding PostScript code for each node visited.

Specified by:
toPostScript in interface PsConverter
Parameters:
page - the nodes to translate into PostScript code
fontManager - the font manager to inform about characters
headerManager - the header manager
Returns:
the bytes representing the current page
Throws:
DocumentWriterException - in case of an error
See Also:
PsConverter.toPostScript( de.dante.extex.typesetter.type.page.Page, de.dante.extex.backend.documentWriter.postscript.util.FontManager, de.dante.extex.backend.documentWriter.postscript.util.HeaderManager)

setColorConverter

public void setColorConverter(ColorConverter converter)
Description copied from interface: ColorAware
Setter for the color converter.

Specified by:
setColorConverter in interface ColorAware
Parameters:
converter - the color converter
See Also:
ColorAware.setColorConverter( de.dante.extex.color.ColorConverter)

setResourceFinder

public void setResourceFinder(ResourceFinder resourceFinder)
Description copied from interface: ResourceConsumer
Setter for the resource finder.

Specified by:
setResourceFinder in interface ResourceConsumer
Parameters:
resourceFinder - the resource finder
See Also:
ResourceConsumer.setResourceFinder( de.dante.util.resource.ResourceFinder)

visitAdjust

public java.lang.Object visitAdjust(AdjustNode node,
                                    java.lang.Object oOut)
                             throws GeneralException
Description copied from interface: NodeVisitor
This method is called when an AdjustNode has been encountered.

Specified by:
visitAdjust in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitAdjust( de.dante.extex.typesetter.type.node.AdjustNode, java.lang.Object)

visitAfterMath

public java.lang.Object visitAfterMath(AfterMathNode node,
                                       java.lang.Object oOut)
                                throws GeneralException
Description copied from interface: NodeVisitor
This method is called when an AfterMathNode has been encountered.

Specified by:
visitAfterMath in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitAfterMath( de.dante.extex.typesetter.type.node.AfterMathNode, java.lang.Object)

visitAlignedLeaders

public java.lang.Object visitAlignedLeaders(AlignedLeadersNode node,
                                            java.lang.Object oOut)
                                     throws GeneralException
Description copied from interface: NodeVisitor
This method is called when an AlignedLeadersNode has been encountered.

Specified by:
visitAlignedLeaders in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitAlignedLeaders( de.dante.extex.typesetter.type.node.AlignedLeadersNode, java.lang.Object)

visitBeforeMath

public java.lang.Object visitBeforeMath(BeforeMathNode node,
                                        java.lang.Object oOut)
                                 throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a BeforeMathNode has been encountered.

Specified by:
visitBeforeMath in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitBeforeMath( de.dante.extex.typesetter.type.node.BeforeMathNode, java.lang.Object)

visitCenteredLeaders

public java.lang.Object visitCenteredLeaders(CenteredLeadersNode node,
                                             java.lang.Object oOut)
                                      throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a CenteredLeadersNode has been encountered.

Specified by:
visitCenteredLeaders in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitCenteredLeaders( de.dante.extex.typesetter.type.node.CenteredLeadersNode, java.lang.Object)

visitChar

public java.lang.Object visitChar(CharNode node,
                                  java.lang.Object oOut)
                           throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a CharNode has been encountered.

Specified by:
visitChar in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitChar( de.dante.extex.typesetter.type.node.CharNode, java.lang.Object)

visitDiscretionary

public java.lang.Object visitDiscretionary(DiscretionaryNode node,
                                           java.lang.Object oOut)
                                    throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a DiscretionaryNode has been encountered.

Specified by:
visitDiscretionary in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitDiscretionary( de.dante.extex.typesetter.type.node.DiscretionaryNode, java.lang.Object)

visitExpandedLeaders

public java.lang.Object visitExpandedLeaders(ExpandedLeadersNode node,
                                             java.lang.Object oOut)
                                      throws GeneralException
Description copied from interface: NodeVisitor
This method is called when an ExpandedLeadersNode has been encountered.

Specified by:
visitExpandedLeaders in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitExpandedLeaders( de.dante.extex.typesetter.type.node.ExpandedLeadersNode, java.lang.Object)

visitGlue

public java.lang.Object visitGlue(GlueNode node,
                                  java.lang.Object oOut)
                           throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a GlueNode has been encountered.

Specified by:
visitGlue in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitGlue( de.dante.extex.typesetter.type.node.GlueNode, java.lang.Object)

visitHorizontalList

public java.lang.Object visitHorizontalList(HorizontalListNode node,
                                            java.lang.Object oOut)
                                     throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a HorizontalListNode has been encountered.

Specified by:
visitHorizontalList in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitHorizontalList( de.dante.extex.typesetter.type.node.HorizontalListNode, java.lang.Object)

visitInsertion

public java.lang.Object visitInsertion(InsertionNode node,
                                       java.lang.Object oOut)
                                throws GeneralException
Description copied from interface: NodeVisitor
This method is called when an InsertionNode has been encountered.

Specified by:
visitInsertion in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitInsertion( de.dante.extex.typesetter.type.node.InsertionNode, java.lang.Object)

visitKern

public java.lang.Object visitKern(KernNode node,
                                  java.lang.Object oOut)
                           throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a KernNode has been encountered.

Specified by:
visitKern in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitKern( de.dante.extex.typesetter.type.node.KernNode, java.lang.Object)

visitLigature

public java.lang.Object visitLigature(LigatureNode node,
                                      java.lang.Object oOut)
                               throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a LigatureNode has been encountered.

Specified by:
visitLigature in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitLigature( de.dante.extex.typesetter.type.node.LigatureNode, java.lang.Object)

visitMark

public java.lang.Object visitMark(MarkNode node,
                                  java.lang.Object oOut)
                           throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a MarkNode has been encountered.

Specified by:
visitMark in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitMark( de.dante.extex.typesetter.type.node.MarkNode, java.lang.Object)

visitPenalty

public java.lang.Object visitPenalty(PenaltyNode node,
                                     java.lang.Object oOut)
                              throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a PenaltyNode has been encountered.

Specified by:
visitPenalty in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitPenalty( de.dante.extex.typesetter.type.node.PenaltyNode, java.lang.Object)

visitRule

public java.lang.Object visitRule(RuleNode node,
                                  java.lang.Object oOut)
                           throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a RuleNode has been encountered.

Specified by:
visitRule in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitRule( de.dante.extex.typesetter.type.node.RuleNode, java.lang.Object)

visitSpace

public java.lang.Object visitSpace(SpaceNode node,
                                   java.lang.Object oOut)
                            throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a SpaceNode has been encountered.

Specified by:
visitSpace in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitSpace( de.dante.extex.typesetter.type.node.SpaceNode, java.lang.Object)

visitVerticalList

public java.lang.Object visitVerticalList(VerticalListNode node,
                                          java.lang.Object oOut)
                                   throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a VerticalListNode has been encountered.

Specified by:
visitVerticalList in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitVerticalList( de.dante.extex.typesetter.type.node.VerticalListNode, java.lang.Object)

visitVirtualChar

public java.lang.Object visitVirtualChar(VirtualCharNode node,
                                         java.lang.Object oOut)
                                  throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a VirtualCharNode has been encountered.

Specified by:
visitVirtualChar in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitVirtualChar( de.dante.extex.typesetter.type.node.VirtualCharNode, java.lang.Object)

visitWhatsIt

public java.lang.Object visitWhatsIt(WhatsItNode node,
                                     java.lang.Object oOut)
                              throws GeneralException
Description copied from interface: NodeVisitor
This method is called when a WhatsItNode has been encountered.

Specified by:
visitWhatsIt in interface NodeVisitor
Parameters:
node - the first parameter for the visitor is the node visited
oOut - the second parameter for the visitor
Returns:
the visitor specific value
Throws:
GeneralException - in case of an error
See Also:
NodeVisitor.visitWhatsIt( de.dante.extex.typesetter.type.node.WhatsItNode, java.lang.Object)