|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.gui.transcriptionviewer.AbstractDisplayStrategy
net.sourceforge.nite.gui.transcriptionviewer.StringInsertDisplayStrategy
public class StringInsertDisplayStrategy
This DisplayStrategy implementation shows annotation elements in the transcription text by inserting text before the first and/or after the last NTextElement that is related to the annotation element.
The prefix and postfix strings can be customized. The actual strings for pre and postfix are
determined in the utility methods
formStartString(NOMElement element)
and formEndString(NOMElement element)
.
This makes it easy to extend this class with more specific visualization in a public subclass or an inner class.
The style of these strings can also be customized. The style may be dependent on the annotation element. This is
achieved by overriding the method
getStyle(NOMElement element)
.
See also DisplayStrategy
See also NTranscriptionView.setDisplayStrategy
EXAMPLES!!!
Field Summary | |
---|---|
static java.lang.String |
BRACKET_STYLE
Documentation !!! |
Constructor Summary | |
---|---|
StringInsertDisplayStrategy(NTranscriptionView ntv)
Default behaviour of this class: display annotation elements by placing relevant text between brackets (...), which are coloured red. |
|
StringInsertDisplayStrategy(NTranscriptionView ntv,
javax.swing.text.Style newStyle)
Default behaviour of this class: display annotation elements by placing relevant text between brackets (...), which get the given style. |
Method Summary | |
---|---|
boolean |
display(NOMElement element)
The display method of this class consists of tracking down the relevant NTextElements in the NTranscriptionView, placing the prefix just before the first displayed transcription element and placing the postfix just after the last displayed transcription element. |
void |
setEndString(java.lang.String newEndString)
Changes the value of the postfix string |
void |
setStartString(java.lang.String newStartString)
Changes the value of the prefix string |
void |
undisplay(NOMElement element)
This method is used to undisplay the annotation element. |
Methods inherited from class net.sourceforge.nite.gui.transcriptionviewer.AbstractDisplayStrategy |
---|
init, setTransToAnnoMap |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BRACKET_STYLE
Constructor Detail |
---|
public StringInsertDisplayStrategy(NTranscriptionView ntv)
public StringInsertDisplayStrategy(NTranscriptionView ntv, javax.swing.text.Style newStyle)
Method Detail |
---|
public void setStartString(java.lang.String newStartString)
public void setEndString(java.lang.String newEndString)
public boolean display(NOMElement element)
The newly inserted NTextElements will have the annotation element as dataElement.
public void undisplay(NOMElement element)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |