|
VTT Java 2010 Version |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nih.nlm.nls.vtt.Model.Markup
public class Markup
This class is the Markup Java object. Markup is used to label a selected text by different tags with different colors, fonts, sizes, styles, etc.
History:
Constructor Summary | |
---|---|
Markup()
Create a Markup Java object with default values. |
|
Markup(int offset,
int length,
java.lang.String tagName,
java.lang.String tagCategory,
java.lang.String annotation)
Create a Markup Java object by specifying offset, length, tag name, tag category, and annotation. |
|
Markup(Markup markup)
Create a Markup Java object by the specified markup. |
Method Summary | |
---|---|
static void |
DoMarkUp(Tag tag,
javax.swing.text.DefaultStyledDocument doc,
int offset,
int length,
int baseFontSize,
javax.swing.text.SimpleAttributeSet sas,
boolean replace)
Apply tag, offset, length of markup to text. |
boolean |
Equals(Markup markup)
Check if this markup equals to the specified markup. |
java.lang.String |
GetAnnotation()
Get the annotation of applied tag. |
int |
GetLength()
Get the length. |
java.lang.String |
GetMarkupName()
Get markup name. |
int |
GetOffset()
Get the offset. |
java.lang.String |
GetTagCategory()
Get the category of applied tag. |
java.lang.String |
GetTaggedText(java.lang.String text)
Get the markup text of this markup, start at offset, end at offset + length. |
java.lang.String |
GetTagName()
Get the name of applied tag. |
java.lang.String |
GetTagNameCategory()
Get the name and category string of applied tag. |
boolean |
IsOverlap(int start,
int end)
Check is a smear (by specifying the start and end position) overlap this markup. |
static Markup |
Join(Markup markup1,
Markup markup2)
Join two markups together. |
void |
SetAnnotation(java.lang.String annotation)
Set the annotation. |
void |
SetLength(int length)
Set the length. |
void |
SetOffset(int offset)
Set the offset. |
void |
SetTagCategory(java.lang.String tagCategory)
Set the category of applied tag. |
void |
SetTagName(java.lang.String tagName)
Set the name of applied tag. |
java.lang.String |
ToString()
Convert markup data to string in the format of: offset|length|tagName|tagCategory|Annotation |
java.lang.String |
ToString(boolean showAnnotation)
Convert markup data to string with option of showing annotation in the format of: offset|length|tagName|tagCategory|Annotation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Markup()
public Markup(Markup markup)
markup
- the specified markuppublic Markup(int offset, int length, java.lang.String tagName, java.lang.String tagCategory, java.lang.String annotation)
offset
- the offset positionlength
- the lengthtagName
- the name of tagtagCategory
- the category of tagannotation
- the annotationMethod Detail |
---|
public void SetOffset(int offset)
offset
- the beginning positionpublic void SetLength(int length)
length
- the lengthpublic void SetTagName(java.lang.String tagName)
tagName
- the name of applied tagpublic void SetTagCategory(java.lang.String tagCategory)
tagCategory
- the category of applied tagpublic void SetAnnotation(java.lang.String annotation)
annotation
- the annotationpublic int GetOffset()
public int GetLength()
public java.lang.String GetTagName()
public java.lang.String GetTagCategory()
public java.lang.String GetTagNameCategory()
public java.lang.String GetAnnotation()
public static void DoMarkUp(Tag tag, javax.swing.text.DefaultStyledDocument doc, int offset, int length, int baseFontSize, javax.swing.text.SimpleAttributeSet sas, boolean replace)
tag
- the tag of the applied markupdoc
- the styled document that markup is applied tooffset
- the offset of the applied markuplength
- the length of the applied markupbaseFontSize
- the base font size of the documentsas
- the simple attribute set of the applied markupreplace
- a boolean flag of replacing the previous attributepublic static Markup Join(Markup markup1, Markup markup2)
markup1
- the first markup to joinmarkup2
- the second markup to join
public java.lang.String GetTaggedText(java.lang.String text)
text
- the untagged text
public java.lang.String GetMarkupName()
public java.lang.String ToString()
public java.lang.String ToString(boolean showAnnotation)
public boolean Equals(Markup markup)
public boolean IsOverlap(int start, int end)
start
- the start position of the smearend
- the end position of the smear
|
VTT Java 2010 Version |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |