|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectplatypus.Command
public class Command
Converts command strings into actions. Mostly, it's a big switch statement, followed by many methods that perform the actions the commands prescribe.
| Field Summary | |
|---|---|
private GDD |
gdd
instance of the GDD singleton |
private GID |
gid
instance of the GID singleton |
private Literals |
lits
instance of the Literals singleton |
| Constructor Summary | |
|---|---|
Command()
get the instances of the singletons we use here. |
|
| Method Summary | |
|---|---|
private int |
dispatchCommand(int commandType,
java.lang.String tokStr)
Calls the routine that performs the command based on commandType |
private void |
doAlignment(java.lang.String alignment)
Processes the alignment command by setting gdd_alignment to the specified value. |
private void |
doColumns(java.lang.String columnCommand)
process the command to change the number of regular columns |
void |
doDefineMacro(java.lang.String tok)
Defines a string to place in the macro dictionary |
private void |
doDump(java.lang.String tok)
Dumps various groups of variables to console. |
void |
doDumpPage()
Dump the various elements of a page in Platypus to the console. |
private void |
doFontBold(boolean boldOnOff)
Turn the bold attribute of a font on or off. |
private int |
doFontFace(java.lang.String commandString)
Changes the current font to a new typeface. |
private void |
doFontItalic(boolean italicOnOff)
Turn the italic attribute of the current font on or off |
private int |
doFontSize(java.lang.String commandString)
Changes the current font to a different size |
void |
doLeading(java.lang.String leadingSpec)
set the leading based on a user-supplied value and type; e.g., 2li, 0.5in, etc. |
int |
doMargin(int whichMargin,
java.lang.String tok)
handles setting the page margins. |
private void |
doMarginMirror(boolean onOff)
Sets the margin-mirror flag. |
private int |
doNewPage()
Inserts a new page. |
private void |
doNewParagraph()
Insert a new paragraph. |
private void |
doPageHeight(java.lang.String pageHeightStr)
Page size is generally specified using a preset page size. |
private void |
doPageSize(java.lang.String pageSizeStr)
Change the size of the page. |
private void |
doPageWidth(java.lang.String pageWidthStr)
Page size is generally specified using a preset page size. |
private void |
doParagraphIndent(java.lang.String indentString)
Creates a new ParaIndent (paragraph indent) structure and assigns it to the one in GDD provide no error occurred. |
private void |
doParagraphSkipSize(java.lang.String skipSize)
Creates a new ParaSkip (paragraph line skip) structure, loads it with the values in the command and places it in GDD, provided no error occurred. |
void |
doPrintMacro(java.lang.String rawKey)
Look up the macro and in the table and output the substitute string into text |
private void |
doStrikethru(boolean onOff)
Turn strikethrough on or off. |
private void |
doUnderline(boolean onOff)
Turn underline on or off. |
void |
FTO_doStrikethru(boolean onOff)
FTO = for testing only. |
int |
process(char[] tok)
The main switch that identifies the commands and dispatches them to the correct routine |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final GDD gdd
private final GID gid
private final Literals lits
| Constructor Detail |
|---|
public Command()
| Method Detail |
|---|
public int process(char[] tok)
tok - the command string (with surrounding brackets)
private int dispatchCommand(int commandType,
java.lang.String tokStr)
commandType - identifies which command to dispatch/performtokStr - needed as a parameter to some commands
private void doAlignment(java.lang.String alignment)
alignment - string from the user containing the alignment command.private void doColumns(java.lang.String columnCommand)
columnCommand - string from the user containing the alignment commandpublic void doDefineMacro(java.lang.String tok)
tok - string containing the command with the macro name and the substitute textprivate void doDump(java.lang.String tok)
tok - the string containing the dump command and associated parameter.public void doDumpPage()
private void doFontBold(boolean boldOnOff)
boldOnOff - Whether it's on (true) or off (false)private int doFontFace(java.lang.String commandString)
commandString - the command string containing the name of the new typeface
private void doFontItalic(boolean italicOnOff)
italicOnOff - whether it's to be turned on (true) or off (false)private int doFontSize(java.lang.String commandString)
commandString - the command in which the new font size was specified [fsize:xxx]
public void doLeading(java.lang.String leadingSpec)
leadingSpec - the string as specified by the user
public int doMargin(int whichMargin,
java.lang.String tok)
whichMargin - specifies top, bottom, left, or right margintok - the actual command string from which we get the margin size
private void doMarginMirror(boolean onOff)
onOff - boolean indicating whether on or offprivate int doNewPage()
private void doNewParagraph()
private void doPageHeight(java.lang.String pageHeightStr)
pageHeightStr - the specified page widthprivate void doPageSize(java.lang.String pageSizeStr)
pageSizeStr - the command string containing the page sizeprivate void doPageWidth(java.lang.String pageWidthStr)
pageWidthStr - the specified page widthprivate void doParagraphIndent(java.lang.String indentString)
indentString - the string containing the command to set the paragraph indentprivate void doParagraphSkipSize(java.lang.String skipSize)
skipSize - command string as specified by the user.public void doPrintMacro(java.lang.String rawKey)
rawKey - macro in []'s whose text must be looked up and printedprivate void doStrikethru(boolean onOff)
onOff - value setprivate void doUnderline(boolean onOff)
onOff - value set to Status.Opublic void FTO_doStrikethru(boolean onOff)
onOff - see this.doStrikethru() for details.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||