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

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

public class PdfHardCR
extends java.lang.Object
implements IOutputCommand

Force a hard CR/LF (note: this command does *not* force an end of paragraph) Note that the main token processor in Pdf.Start() will check the token after []. If it's a [cr], that [cr] is ignored (so that the next line does not begin with a blank).

Author:
alb

Field Summary
private  java.lang.String root
           
 
Constructor Summary
PdfHardCR()
           
 
Method Summary
 java.lang.String getRoot()
          get the root of the command.
(package private)  boolean isAfterCodeListing(IOutputContext context, int tokNum)
          Were the previous two tokens [-code][cr]? If so, return true.
private  boolean isFirstTokenInLine(IOutputContext context, Token tok, int tokNum)
          Determines whether the current [] is the first token in the line (which means either the absolute first token, or the first token other than a 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

PdfHardCR

public PdfHardCR()
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

isAfterCodeListing

boolean isAfterCodeListing(IOutputContext context,
                           int tokNum)
Were the previous two tokens [-code][cr]? If so, return true.

Parameters:
context - context for this token (needed to get the TokenList )
tokNum -
Returns:

isFirstTokenInLine

private boolean isFirstTokenInLine(IOutputContext context,
                                   Token tok,
                                   int tokNum)
Determines whether the current [] is the first token in the line (which means either the absolute first token, or the first token other than a command).

Parameters:
context - PdfData containing the Source fields for this token
tok - present token
tokNum - present token number
Returns:
true if first token as specified above, or false if not.

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