|
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.VttDocument
public class VttDocument
This class is the VttDocument Java object. It includes three components:
History:
Field Summary | |
---|---|
static java.lang.String |
FILE_EXT
VTT file extension |
static java.lang.String |
MARKUP_FIELD_STR
markup field header string |
static java.lang.String |
MARKUP_STR
markup string in the header |
static java.lang.String |
META_DATA_STR
Meta data in the header |
static java.lang.String |
META_FILE_HISTORY_FIELD_STR
Meta data: save field header string |
static java.lang.String |
META_TAGS_FILE_FIELD_STR
Meta data: default tags file field header string |
static int |
MODE_MARKUP
read in mode of markup |
static int |
MODE_META
read in mode of text |
static int |
MODE_TAG
read in mode of tag |
static int |
MODE_TEXT
read in mode of text |
static int |
NOT_CHECK
not check value definition |
static int |
RESERVED_TAG_INDEX
reserved tag index, reserved 1st tag as text tag |
static java.lang.String |
RESERVED_TAG_STR
reserved tag string definition: the default text reserves 1st tag for clearing tag, and highlight colors |
static java.lang.String |
SEPARATOR_STR
separate string in the header |
static java.lang.String |
TAG_FIELD_STR
tag field header string |
static int |
TAG_START_INDEX
The start tag index, use the 2nd tag as start |
static java.lang.String |
TAG_STR
tag string in the header |
static java.lang.String |
TEXT_STR
text string in the header |
Constructor Summary | |
---|---|
VttDocument()
Create a Vtt document Java object with default values. |
|
VttDocument(java.io.File tagFile)
Create a Vtt document Java object by specifying a tag file. |
Method Summary | |
---|---|
static void |
CloseFile(javax.swing.text.DefaultStyledDocument doc,
VttDocument vttDocument,
VttObj vttObj)
Close the current opened vttDocument. |
Markups |
GetMarkups()
Get the markups list of Vtt documents. |
MetaData |
GetMetaData()
Get the Meta Data of Vtt documents. |
static int |
GetMode(java.lang.String line,
int curMode)
Return reading mode: text, tags, markups. |
Tag |
GetReservedTag()
Get the reserved tag. |
static Tag |
GetSelectTag(Tag markupTag,
ConfigObj configObj,
VttObj vttObj)
Get the select tag from vtt Document. |
Tags |
GetTags()
Get the tags list of Vtt documents. |
java.lang.String |
GetText()
Get the text of Vtt documents. |
Tag |
GetTextTag()
Get text tag. |
boolean |
HasChanged(java.io.File inFile,
VttObj vttObj)
Check if the vtt has been changed by comparing to the orignal inFile. |
static boolean |
IsHeader(java.lang.String str)
Check if the input string is a header line. |
static boolean |
IsLegalMarkupPos(int startPos,
int length,
int maxTextLength)
Check if a position of the specified start position and length is legal. |
static boolean |
IsLegalMarkupPos(Markup markup,
int maxTextLength)
Check if the position of the specified markup is legal. |
boolean |
ReadFromFile(java.io.File inFile)
Read text, tags, markups of Vtt Document from a file |
static void |
SaveFile(java.io.File docFile,
VttDocument vttDocument,
int vttFormat,
VttObj vttObj)
Save vttDocument to a file. |
void |
SetMarkups(Markups markups)
Set the markups list to Vtt document. |
void |
SetReservedTag(Tag tag)
set reserve tag to a specified tag |
static javax.swing.text.SimpleAttributeSet |
SetStyleConstants(Tag tag,
int fontSize)
Set style constants by specifying tag and font size. |
static javax.swing.text.SimpleAttributeSet |
SetStyleConstants(Tag tag,
int baseFontSize,
int zoomFactor)
Set style constant by specifying tag, base font size, and zoom factor. |
void |
SetTags(Tags tags)
Set the tags list to Vtt document. |
void |
SetText(java.lang.String text)
Set the text to Vtt document. |
static void |
SetTextStyleByMarkupTag(javax.swing.text.DefaultStyledDocument doc,
Markup markup,
Tag tag,
int baseFontSize,
int zoomFactor)
Set text style base on current markup-tag for the text in the markup range change. |
static java.lang.String |
ToString(VttDocument vttDocument,
int vttFormat,
VttObj vttObj)
Convert vttDocuemt to a string representation in the format of text|Tags|Markup. |
static java.io.File |
UpdateDocFileNameToVtt(java.io.File inFile)
Update Document file name to vtt extension. |
static boolean |
UpdateStyleForMarkups(javax.swing.text.DefaultStyledDocument doc,
VttDocument vttDocument,
ConfigObj configObj,
VttObj vttObj)
Update style for all markups by going through markups and change style on the text/doc. |
static boolean |
UpdateStyleForMarkups(javax.swing.text.DefaultStyledDocument doc,
VttDocument vttDocument,
ConfigObj configObj,
VttObj vttObj,
int zoomFactor)
Update style for all markups by going through markups and change style on the text/doc. |
static void |
UpdateStyleForText(javax.swing.text.DefaultStyledDocument doc,
VttDocument vttDocument,
ConfigObj configObj,
int zoomFactor)
Reload and update text style on Vtt document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SEPARATOR_STR
public static final java.lang.String META_DATA_STR
public static final java.lang.String TEXT_STR
public static final java.lang.String TAG_STR
public static final java.lang.String MARKUP_STR
public static final java.lang.String META_TAGS_FILE_FIELD_STR
public static final java.lang.String META_FILE_HISTORY_FIELD_STR
public static final java.lang.String TAG_FIELD_STR
public static final java.lang.String MARKUP_FIELD_STR
public static final java.lang.String FILE_EXT
public static final int MODE_META
public static final int MODE_TEXT
public static final int MODE_TAG
public static final int MODE_MARKUP
public static final int NOT_CHECK
public static final java.lang.String RESERVED_TAG_STR
public static final int RESERVED_TAG_INDEX
public static final int TAG_START_INDEX
Constructor Detail |
---|
public VttDocument()
public VttDocument(java.io.File tagFile)
Method Detail |
---|
public MetaData GetMetaData()
public java.lang.String GetText()
public Tags GetTags()
public Markups GetMarkups()
public void SetMarkups(Markups markups)
markups
- the markups list to be setpublic void SetText(java.lang.String text)
text
- the text to be setpublic void SetTags(Tags tags)
tags
- the tags list to be setpublic boolean ReadFromFile(java.io.File inFile)
inFile
- the input file
public boolean HasChanged(java.io.File inFile, VttObj vttObj)
inFile
- the input file to be comparedvttObj
- the Vtt object to be compared
public static boolean IsLegalMarkupPos(Markup markup, int maxTextLength)
markup
- the markup to be check on it's positionmaxTextLength
- max. text length
public static boolean IsLegalMarkupPos(int startPos, int length, int maxTextLength)
startPos
- the start positionlength
- the lengthmaxTextLength
- max. text length
public Tag GetReservedTag()
public void SetReservedTag(Tag tag)
tag
- the tag to be set as reserved tagpublic Tag GetTextTag()
public static java.lang.String ToString(VttDocument vttDocument, int vttFormat, VttObj vttObj)
vttDocument
- the vtt document to be converted to stringvttFormat
- the vtt format desired in the string representationvttObj
- the vtt object with configuration to be used
public static void SaveFile(java.io.File docFile, VttDocument vttDocument, int vttFormat, VttObj vttObj)
docFile
- the file the Vtt document to be saved tovttDocument
- the Vtt document to be savedvttFormat
- the Vtt format desiredvttObj
- the vtt object with configuration to be usedpublic static void CloseFile(javax.swing.text.DefaultStyledDocument doc, VttDocument vttDocument, VttObj vttObj)
doc
- the open styled document of Vtt documentvttDocument
- the Vtt document to be savedvttObj
- the vtt object with configuration to be usedpublic static void UpdateStyleForText(javax.swing.text.DefaultStyledDocument doc, VttDocument vttDocument, ConfigObj configObj, int zoomFactor)
doc
- the open styled document of Vtt documentvttDocument
- the Vtt document to be updatedconfigObj
- the Vtt configuration objectzoomFactor
- the zoom in/out factor of Vtt documentpublic static boolean UpdateStyleForMarkups(javax.swing.text.DefaultStyledDocument doc, VttDocument vttDocument, ConfigObj configObj, VttObj vttObj)
doc
- the open styled document of Vtt documentvttDocument
- the Vtt document to be updatedconfigObj
- the Vtt configuration objectvttObj
- the vtt object with configuration to be used
public static boolean UpdateStyleForMarkups(javax.swing.text.DefaultStyledDocument doc, VttDocument vttDocument, ConfigObj configObj, VttObj vttObj, int zoomFactor)
doc
- the open styled document of Vtt documentvttDocument
- the Vtt document to be updatedconfigObj
- the Vtt configuration objectvttObj
- the vtt object with configuration to be usedzoomFactor
- the zoom in/out factor of Vtt document
public static void SetTextStyleByMarkupTag(javax.swing.text.DefaultStyledDocument doc, Markup markup, Tag tag, int baseFontSize, int zoomFactor)
doc
- the open styled document of Vtt documentmarkup
- the markup (range) to apply text styletag
- the tag to apply text stylebaseFontSize
- the base font size of text stylezoomFactor
- the zoom in/out factor of Vtt documentpublic static javax.swing.text.SimpleAttributeSet SetStyleConstants(Tag tag, int baseFontSize, int zoomFactor)
tag
- the tag to apply text stylebaseFontSize
- the base font size of text stylezoomFactor
- the zoom in/out factor of Vtt document
public static javax.swing.text.SimpleAttributeSet SetStyleConstants(Tag tag, int fontSize)
tag
- the tag to apply text stylefontSize
- the font size of text style
public static java.io.File UpdateDocFileNameToVtt(java.io.File inFile)
inFile
- the input file
public static Tag GetSelectTag(Tag markupTag, ConfigObj configObj, VttObj vttObj)
markupTag
- the tag of selected markupconfigObj
- the Vtt configuration objectvttObj
- the vtt object with configuration to be used
public static int GetMode(java.lang.String line, int curMode)
line
- the lien to be read incurMode
- the current reading mode
public static boolean IsHeader(java.lang.String str)
str
- the input string
|
VTT Java 2010 Version |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |