public class TMFFStateParams
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
currLineNbr
currLineNbr is used internally and need not be set by programs calling
TMFF.
|
int |
leftmostColNbr |
int |
prevColNbr |
int |
rightmostColNbr |
java.lang.StringBuilder |
sb |
Constructor and Description |
---|
TMFFStateParams(java.lang.StringBuilder inSb,
int inPrevColNbr,
TMFFPreferences tmffPreferences)
Standard constructor for TMFFStateParams.
|
Modifier and Type | Method and Description |
---|---|
int |
appendTokenAtGivenPosition(java.lang.String token,
int pos)
Puts token to string buffer with at least one space following previous
output character.
|
int |
getAvailLengthOnCurrLine() |
void |
newlineSB() |
void |
padSB(char padChar,
int padLength) |
void |
padSBToGivenPosition(int pos)
Outputs spaces to prepare for output of a token at a given column.
|
void |
setLeftmostColNbr(int formulaLeftCol,
int useIndent,
int proofLevel)
Updates TMFFSP leftmost column number using the TMFFPrefences
formulaLeftCol and indent amount parameters plus the level number of the
formula within the proof.
|
void |
setPrevColNbr(int prevColNbr) |
void |
setSB(java.lang.StringBuilder sb) |
public int leftmostColNbr
public int rightmostColNbr
public java.lang.StringBuilder sb
public int prevColNbr
public int currLineNbr
public TMFFStateParams(java.lang.StringBuilder inSb, int inPrevColNbr, TMFFPreferences tmffPreferences)
You are responsible for setting reasonable values. No validation is performed. See previous constructor for additional information.
inSb
- is the input StringBuilder. All output is appended to this
StringBuilder. It must be pre-initialized.inPrevColNbr
- is the column number on the current print line of the
most recently output character. Set it to 0 if nothing has
been written to the current line, or to the previous
character's position (1, 2, etc.)tmffPreferences
- - current TMFFPreferences.public int appendTokenAtGivenPosition(java.lang.String token, int pos)
token
- the token to appendpos
- the screen column at which to draw the tokenpublic void padSBToGivenPosition(int pos)
Pads *thru* the given position! I.E. if you say pad to column 7, then column 7 ends up containing a space.
pos
- the screen column at which to draw the tokenpublic void setSB(java.lang.StringBuilder sb)
public void setPrevColNbr(int prevColNbr)
public void setLeftmostColNbr(int formulaLeftCol, int useIndent, int proofLevel)
If indentation is used, based on variances between different proof steps, then this routine needs to be invoked every time, just before calling tmffPreferences.renderFormula(). That is because the TMFFPreferences.formulaLeftCol is not updated and must be used to reset the value of TMFFSP.leftmostColNbr after each use.
setLeftmostColNbr(formulaLeftCol + (useIndent * proofLevel));NOTE: If the resulting leftmost column number is not less than the rightmost column number, the indentation is turned off:
setLeftmostColNbr(formulaLeftCol);
formulaLeftCol
- from TMFFPreferences or other.useIndent
- indent column amount per proof step levelproofLevel
- step formula level number within proofpublic void newlineSB()
public void padSB(char padChar, int padLength)
public int getAvailLengthOnCurrLine()