de.dante.extex.backend.documentWriter.dvi
Class DviWriter

java.lang.Object
  extended byde.dante.extex.backend.documentWriter.dvi.DviWriter

public class DviWriter
extends java.lang.Object

This is a implementation of a dvi document writer.

Version:
$Revision: 1.3 $
Author:
Sebastian Waschik

Constructor Summary
DviWriter(java.io.OutputStream outputStream, DocumentWriterOptions options)
          Creates a new DviWriter instance.
 
Method Summary
 void beginDviFile()
          Before any output the method beginDviFile have to be called.
 void beginPage()
          beginPage starts a new page in the dvi file.
 void endDviFile()
          After the output the method endDviFile have to be called.
 void endPage()
          endPage terminates the current page.
 GeneralException getError()
          Get the last error.
 int getPages()
          Get the number of written pages until now.
 void restoreCurrentPositions()
          Restore all saved Positions.
 void saveCurrentPositions()
          Save all saved Positions.
 void selectFont(Font font)
          Select Font for the next CharNodes.
 void writeHorizontalSpace(FixedDimen space)
          Write horizontal space to dvi-file.
 void writeNode(CharNode node)
          Write a char node to the dvi file.
 void writeNode(RuleNode node)
          Write node to the dvi file.
 void writeNode(WhatsItNode node)
          Write node to the dvi-file.
 void writeSpace(FixedDimen space, Mode mode)
          Write space to the the dvi file.
 void writeVerticalSpace(FixedDimen space)
          Write vertical space to dvi-file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DviWriter

public DviWriter(java.io.OutputStream outputStream,
                 DocumentWriterOptions options)
Creates a new DviWriter instance.

Parameters:
outputStream - the dvi file is written to this stream
options - options for the dvi-file
Method Detail

getPages

public int getPages()
Get the number of written pages until now.

Returns:
the number of written pages

beginDviFile

public void beginDviFile()
                  throws GeneralException
Before any output the method beginDviFile have to be called.

Throws:
GeneralException - if an error occurs

endDviFile

public void endDviFile()
                throws GeneralException,
                       java.io.IOException
After the output the method endDviFile have to be called.

Throws:
GeneralException - if an error occurs
java.io.IOException - ...

beginPage

public void beginPage()
               throws GeneralException
beginPage starts a new page in the dvi file. to start a new page. Each page must be terminated with a call of endPage().

Throws:
GeneralException - if an error occurs

endPage

public void endPage()
             throws GeneralException
endPage terminates the current page. The page have to be started with beginPage().

Throws:
GeneralException - if an error occurs

selectFont

public void selectFont(Font font)
                throws GeneralException
Select Font for the next CharNodes.

Parameters:
font - the Font
Throws:
GeneralException - if an error occurs

writeNode

public void writeNode(CharNode node)
               throws GeneralException
Write a char node to the dvi file.

Parameters:
node - the CharNode
Throws:
GeneralException - if an error occurs

writeNode

public void writeNode(RuleNode node)
               throws GeneralException
Write node to the dvi file.

Parameters:
node - a RuleNode
Throws:
GeneralException - if an error occurs
See Also:
"TeX -- The Program [585]"

writeNode

public void writeNode(WhatsItNode node)
               throws GeneralException
Write node to the dvi-file.

Parameters:
node - a WhatsItNode
Throws:
GeneralException - if an error occurs

getError

public GeneralException getError()
Get the last error.

Returns:
null if there was no error, otherwise the occurred error

writeSpace

public void writeSpace(FixedDimen space,
                       Mode mode)
                throws GeneralException
Write space to the the dvi file.

Parameters:
space - the space
mode - current Mode
Throws:
GeneralException - if an error occurs

writeHorizontalSpace

public void writeHorizontalSpace(FixedDimen space)
                          throws GeneralException
Write horizontal space to dvi-file.

Parameters:
space - space size
Throws:
GeneralException - if an error occurs

writeVerticalSpace

public void writeVerticalSpace(FixedDimen space)
                        throws GeneralException
Write vertical space to dvi-file.

Parameters:
space - space size
Throws:
GeneralException - if an error occurs

saveCurrentPositions

public void saveCurrentPositions()
                          throws GeneralException
Save all saved Positions.

Throws:
GeneralException - if an error occurs
See Also:
restoreCurrentPositions()

restoreCurrentPositions

public void restoreCurrentPositions()
                             throws GeneralException
Restore all saved Positions.

Throws:
GeneralException - if an error occurs
See Also:
saveCurrentPositions()