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

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

public class PdfColumnCount
extends java.lang.Object
implements IOutputCommand

Change the number of columns in a document

Author:
alb

Field Summary
private  java.lang.String root
           
 
Constructor Summary
PdfColumnCount()
           
 
Method Summary
(package private)  float computeVerticalSkip(float yPosition, PdfData pdd)
          Computes how much vertical distance there is between the current baseline and the top margin.
(package private)  void flushExistingText(PdfOutfile outfile)
          Before changing columns, we need to flush any existing text to the PDF file.
 java.lang.String getRoot()
          get the root of the command.
 int process(IOutputContext context, Token tok, int tokNum)
          method for processing this command in the output plugin.
(package private)  void setupNewColumns(int newColumnCount, PdfData pdd)
          Set up the new columns starting wherever we are on the page.
 
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

PdfColumnCount

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

setupNewColumns

void setupNewColumns(int newColumnCount,
                     PdfData pdd)
Set up the new columns starting wherever we are on the page. We first figure where we are vertically on the page, and then set up the columns to occupy the rest of the vertical space on the page

Parameters:
newColumnCount - new number of columns (guaranteed != to current number)
pdd - the PDF document data

computeVerticalSkip

float computeVerticalSkip(float yPosition,
                          PdfData pdd)
Computes how much vertical distance there is between the current baseline and the top margin. Recall that in PDFs, the Y values increase from the bottom upward. So, the top edge of the paper (the page height) is the highest possible value. From this we subtract the top margin and the current Y value from the baseline. This gives us how much distance exists between the top margin and the current baseline.

Parameters:
yPosition - Y position of the current writing point
pdd - PDF document data
Returns:
the actual vertical location in absolute points

flushExistingText

void flushExistingText(PdfOutfile outfile)
Before changing columns, we need to flush any existing text to the PDF file. That action is performed here.

Parameters:
outfile - the outfile that emits the PDF document

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