|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.wordhoard.tools.Context
public class Context
Parsing context for building works.
All of the variables which can vary during the parsing of a work are gathered together into a parsing context, which is passed as a parameter to all of the parsing methods as we recursively descend the DOM tree for the work. Each parsing method clones the context to make any necessary context changes during the processing of its element in the DOM tree.
Constructor Summary | |
---|---|
Context()
|
Method Summary | |
---|---|
void |
addSpeech(Speech speech)
Adds a speech to the speech list. |
void |
addWord(Word word)
Adds a word to the word list. |
void |
appendBlankLine()
Appends a blank line. |
void |
appendText(java.lang.String str)
Appends untagged text to the current line. |
Word |
appendWord(java.lang.String str)
Appends a word. |
java.lang.Object |
clone()
Clones the context. |
void |
endLine()
Ends the current text line. |
TextWrapper |
finalizeText()
Finalizes the text. |
void |
flushRun()
Flushes a style run. |
boolean |
getFirstLineOfStanza()
Gets the first line of stanza attribute. |
boolean |
getInTaggedLine()
Gets the tagged line attribute. |
boolean |
getLemmaTagging()
Gets the lemma tagging attribute. |
Line |
getLine()
Gets the current line object. |
java.util.ArrayList |
getLineList()
Gets the line list. |
int |
getPartLevel()
Gets the work part level. |
Prosodic |
getProsodic()
Gets the prosodic attribute. |
Speech |
getSpeech()
Gets the current speech. |
java.util.ArrayList |
getSpeechList()
Gets the speech list. |
java.lang.String |
getStanzaNumber()
Gets the stanza number. |
boolean |
getStanzaNumbering()
Gets the stanza numbering attribute. |
int |
getStyle()
Gets the style. |
java.util.ArrayList |
getWordList()
Gets the word list. |
WorkPart |
getWorkPart()
Gets the work part. |
void |
indent(int indentation)
Indents or undents subsequent lines. |
void |
setBold(boolean bold)
Sets the bold style. |
void |
setCharset(byte charset)
Sets the character set. |
void |
setFirstLineOfStanza(boolean firstLineOfStanza)
Sets the first line of stanza attribute. |
void |
setInTaggedLine(boolean inTaggedLine)
Sets the tagged line attribute. |
void |
setItalic(boolean italic)
Sets the italic style. |
void |
setJustification(byte justification)
Sets the line justification. |
void |
setLemmaTagging(boolean lemmaTagging)
Sets the lemma tagging attribute. |
void |
setLine(Line line)
Sets the line object. |
void |
setLineLocation()
Sets the line location. |
void |
setNormal()
Sets the normal style. |
void |
setProsodic(org.w3c.dom.Element el)
Sets the prosodic attribute. |
void |
setProsodic(Prosodic prosodic)
Sets the prosodic attribute. |
void |
setSize(byte size)
Sets the font size. |
void |
setSpeech(Speech speech)
Sets the current speech. |
void |
setStanzaNumber(java.lang.String stanzaNumber)
Sets the stanza number. |
void |
setStanzaNumbering(boolean stanzaNumbering)
Sets the stanza numbering attribute. |
void |
setStyle(int style)
Sets the style. |
void |
setStyle(int mask,
boolean set)
Sets a style. |
void |
setWorkPart(WorkPart workPart)
Sets the work part. |
void |
startLine()
Starts a new text line. |
void |
startNewText(boolean lineNumbers)
Starts new text. |
void |
startWorkPart(WorkPart workPart,
org.w3c.dom.Element headerEl)
Starts a new work part. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Context()
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public void setCharset(byte charset)
charset
- Character set. public WorkPart getWorkPart()
public void setWorkPart(WorkPart workPart)
workPart
- The work part. public void startWorkPart(WorkPart workPart, org.w3c.dom.Element headerEl)
workPart
- The work part.headerEl
- Header element for part. public int getPartLevel()
public void startNewText(boolean lineNumbers)
lineNumbers
- True if the text has line numbers. public TextWrapper finalizeText()
public java.util.ArrayList getWordList()
public void addWord(Word word)
word
- Word. public java.util.ArrayList getLineList()
public java.util.ArrayList getSpeechList()
public void addSpeech(Speech speech)
speech
- Speech. public Speech getSpeech()
public void setSpeech(Speech speech)
speech
- Current speech, or null if none. public boolean getStanzaNumbering()
public void setStanzaNumbering(boolean stanzaNumbering)
stanzaNumbering
- True if the work part uses stanza
numbering. public boolean getLemmaTagging()
public void setLemmaTagging(boolean lemmaTagging)
lemmaTagging
- True if the work part uses lemma tagging. public java.lang.String getStanzaNumber()
public void setStanzaNumber(java.lang.String stanzaNumber)
stanzaNumber
- The stanza number as a string, or null
if none. public boolean getFirstLineOfStanza()
public void setFirstLineOfStanza(boolean firstLineOfStanza)
firstLineOfStanza
- True if first line of stanza. public boolean getInTaggedLine()
public void setInTaggedLine(boolean inTaggedLine)
inTaggedLine
- True if in tagged line. public void indent(int indentation)
indentation
- The additional indentation for subsequent
lines. A negative value undents. public Line getLine()
public void setJustification(byte justification)
justification
- Line justification (TextLine.LEFT, TextLine.CENTER,
or TextLine.RIGHT). public void setLine(Line line)
The line object is also added to the line list if it is not null.
line
- Line object, or null if none. public void startLine()
public void endLine()
public Word appendWord(java.lang.String str)
The returned word object has the spelling, work part, line, and location attributes set. This class also takes care of setting the puncBefore and puncAfter attributes. All other attributes must be set by the caller.
str
- The word.
public void appendText(java.lang.String str)
str
- String of untagged text. public void flushRun()
public void setSize(byte size)
size
- Font size. public int getStyle()
public void setStyle(int style)
style
- The style. public void setStyle(int mask, boolean set)
mask
- Style mask.set
- True to set the style, false to clear the style. public void setNormal()
public void setBold(boolean bold)
bold
- The bold style. public void setItalic(boolean italic)
italic
- The italic style. public void appendBlankLine()
public void setLineLocation()
public Prosodic getProsodic()
public void setProsodic(org.w3c.dom.Element el)
el
- Element with "prosodic" attribute. public void setProsodic(Prosodic prosodic)
prosodic
- Prosodic attribute.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |