org.pz.platypus.plugin.pdf.commands
Class PdfCodeOff

java.lang.Object
  extended by org.pz.platypus.plugin.pdf.commands.PdfCodeOff
All Implemented Interfaces:
IOutputCommand

public class PdfCodeOff
extends java.lang.Object
implements IOutputCommand

End of a code section or code listing

Author:
alb

Field Summary
private  java.lang.String root
           
 
Constructor Summary
PdfCodeOff()
           
 
Method Summary
 java.lang.String getRoot()
          get the root of the command.
(package private)  boolean justBeforeEndOfParagraph(TokenList tokens, int tokNum)
          A new paragraph adds the requisite number of lines presuming that it's adding them to the end of the previous paragraph, not at the start of the next line, as is the case here when [-code] is followed by a [cr].
(package private)  boolean nextTokenIsEol(TokenList tokens, int tokNum)
          Is the next command an end of line, that is, a [cr] command?
 int process(IOutputContext context, Token tok, int tokNum)
          method for processing this command in the output plugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

private java.lang.String root
Constructor Detail

PdfCodeOff

public PdfCodeOff()
Method Detail

process

public int process(IOutputContext context,
                   Token tok,
                   int tokNum)
Description copied from interface: IOutputCommand
method for processing this command in the output plugin.

Specified by:
process in interface IOutputCommand
Parameters:
context - the context/state of the output document
tok - the command token as found in the token stream
tokNum - the number of the token in the token list

nextTokenIsEol

boolean nextTokenIsEol(TokenList tokens,
                       int tokNum)
Is the next command an end of line, that is, a [cr] command?

Parameters:
tokens - list of input tokens
tokNum - number of the current token, that is, of [-code]
Returns:
true if next token is [cr], else false.

justBeforeEndOfParagraph

boolean justBeforeEndOfParagraph(TokenList tokens,
                                 int tokNum)
A new paragraph adds the requisite number of lines presuming that it's adding them to the end of the previous paragraph, not at the start of the next line, as is the case here when [-code] is followed by a [cr]. So in this case, don't emit the CR/LF so that the end of paragraph routine will work correctly.

Parameters:
tokens - list of input tokens
tokNum - number of the current token, that is, of [-code]
Returns:
true if next

getRoot

public java.lang.String getRoot()
Description copied from interface: IOutputCommand
get the root of the command. For example, fsize: in [fsize:12pt]

Specified by:
getRoot in interface IOutputCommand
Returns:
the root as a string


Copyright © 2008-10 Pacific Data Works LLC