|
Platypus | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pz.platypus.commands.CodeWithOptions
org.pz.platypus.plugin.pdf.commands.PdfCodeWithOptions
public class PdfCodeWithOptions
Begin a code section or code listing, with options controlling the line count To be added: - the language for use in syntax highlighting - file location to extract from a source file Status of implementation: TO DO: Currently, line number is hard-coded to a max of three digits. Need error routines (and defaults) in case parameters are in error.
| Field Summary |
|---|
| Fields inherited from class org.pz.platypus.commands.CodeWithOptions |
|---|
params, root, tokenParam |
| Constructor Summary | |
|---|---|
PdfCodeWithOptions()
|
|
| Method Summary | |
|---|---|
private void |
emitCode(float fontSize,
PdfData pdd,
Token tok)
Emits code |
private void |
emitLineMarker(PdfOutfile outfile)
Emit the marker for a line with no number |
private void |
emitLineNumber(PdfData pdd)
Emit the line number for a listing line |
private void |
emitNewLine(PdfOutfile outfile)
Emits a CR or CR/LF to the PDF outfile. |
private boolean |
endOfCode(Token tok)
At the [-code] token? (So, at end of code?) |
private boolean |
isBlankLine(Token t)
Is the token a blank line (so, [CR]) ? |
private boolean |
isText(Token t)
Is the token text? |
int |
process(OutputContextable context,
Token tok,
int tokNum)
method for processing this command in the output plugin. |
protected void |
switchToCodeMode(PdfData pdd,
Token tok,
int tokNum)
Code mode means saving the current format and switching to a code font. |
| Methods inherited from class org.pz.platypus.commands.CodeWithOptions |
|---|
getRoot, parseSkipLineNumber, parseStartingLineNumber, preProcess |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.pz.platypus.interfaces.OutputCommandable |
|---|
getRoot |
| Constructor Detail |
|---|
public PdfCodeWithOptions()
| Method Detail |
|---|
public int process(OutputContextable context,
Token tok,
int tokNum)
OutputCommandable
process in interface OutputCommandablecontext - the context/state of the output documenttok - the command token as found in the token streamtokNum - the number of the token in the token list
private void emitCode(float fontSize,
PdfData pdd,
Token tok)
private void emitNewLine(PdfOutfile outfile)
outfile - to which newLine is writtenprivate boolean isText(Token t)
t - the token
private boolean isBlankLine(Token t)
t - Token
private void emitLineNumber(PdfData pdd)
pdd - PDF data blockprivate void emitLineMarker(PdfOutfile outfile)
outfile - the name of the PDF outfileprivate boolean endOfCode(Token tok)
tok - current token
protected void switchToCodeMode(PdfData pdd,
Token tok,
int tokNum)
pdd - PDF datatok - tokentokNum - token number of token in the token list.
|
Platypus | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||