|
|||||||||
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.TextStyleDisplayStrategy
public class TextStyleDisplayStrategy
This DisplayStrategy implementation shows annotation elements in the transcription text by changing the style (font, color, etc) of the text. You can set this style by calling one of the many-parameter-constructors or by creating a template style that is to be used as example.
Uses NTranscriptionView.insertCopyOfStyle
and NTranscriptionView.removeStyleFromChain
for maintaining the styles.
See also @link net.sourceforge.nite.gui.transcriptionviewer.DisplayStrategy DisplayStrategy See also @link net.sourceforge.nite.gui.transcriptionviewer.NTranscriptionView#setDisplayStrategy NTranscriptionView.setDisplayStrategy
Constructor Summary | |
---|---|
TextStyleDisplayStrategy(NTranscriptionView ntv,
int fontSize,
java.lang.String fontStyle,
java.awt.Color c,
boolean isBackground)
Initialize a TextStyleDisplayStrategy, creating a template style with the given parameters. |
|
TextStyleDisplayStrategy(NTranscriptionView ntv,
javax.swing.text.Style style)
Initialize a TextStyleDisplayStrategy that uses the given template style for display. |
Method Summary | |
---|---|
boolean |
display(NOMElement element)
Display annotation element by changing the text style of all text for all relevant transcription elements. |
void |
undisplay(NOMElement element)
Undisplay annotation elements by removing the relevant styles from the style chain for the appropriate transcription elements. |
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 |
Constructor Detail |
---|
public TextStyleDisplayStrategy(NTranscriptionView ntv, javax.swing.text.Style style)
public TextStyleDisplayStrategy(NTranscriptionView ntv, int fontSize, java.lang.String fontStyle, java.awt.Color c, boolean isBackground)
fontSize
- (if fontSize==0 font size is unchanged )fontStyle
- "italic","bold","underline" (if fontStyle==null fontStyle is to be unchangedc
- (if Color==null -> unchanged)isBackground
- Determines if colour is foreground or background colour (if color==null, isBackround is set to false)Method Detail |
---|
public boolean display(NOMElement element)
public void undisplay(NOMElement element)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |