VTT Java
2010 Version

gov.nih.nlm.nls.vtt.Model
Class Tag

java.lang.Object
  extended by gov.nih.nlm.nls.vtt.Model.Tag

public class Tag
extends java.lang.Object

This is the Tag Java object class. A tag is used to markup a selected text. A tag includes color, font, size, style, and other properties.

History:

Version:
V-2010
Author:
NLM NLS Development Team, clu

Constructor Summary
Tag()
          Create a Tag Java object with default values.
Tag(java.lang.String name)
          Create a Tag Java object by specifying name.
Tag(java.lang.String name, java.lang.String category, boolean display, boolean bold, boolean italic, boolean underline, java.awt.Color foreground, java.awt.Color background, java.lang.String fontFamily, java.lang.String fontSize)
          Create a Tag Java object by specifying name, category, display, bold, italic, underline, foreground color, background color, font family name, and font size.
Tag(java.lang.String name, java.lang.String category, boolean bold, boolean italic, boolean underline, java.awt.Color foreground, java.awt.Color background)
          Create a Tag Java object by specifying name, category, bold, italic, underline, foreground color, and background color.
Tag(Tag tag)
          Create a Tag Java object by specifying a tag.
 
Method Summary
 java.awt.Color GetBackground()
          Get the background color of text
 java.lang.String GetCategory()
          Get the category
static java.lang.String GetCategory(java.lang.String nameCategory)
          Get the category by specifying nameCategory
 java.lang.String GetFontFamily()
          Get the name of font family
 java.lang.String GetFontSize()
          Get the size of font
 int GetFontSize(int baseFontSize)
          Get the absolute size of font by specifying the base size
 java.awt.Color GetForeground()
          Get the foreground color of text
 java.lang.String GetName()
          Get the name
static java.lang.String GetName(java.lang.String nameCategory)
          Get the name by specifying nameCategory
 java.lang.String GetNameCategory()
          Get the name category
static java.lang.String GetNameCategory(java.lang.String name, java.lang.String category)
          Convert the name and category to nameCategory string
 boolean IsBold()
          Get the boolean flag of bold
 boolean IsDisplay()
          Get the boolean flag of display
 boolean IsItalic()
          Get the boolean flag of italic
 boolean IsUnderline()
          Get the boolean flag of underline
 void SetBackground(java.awt.Color background)
          Set the background color in the font style
 void SetBold(boolean bold)
          Set the bold in the font style
 void SetCategory(java.lang.String category)
          Set the category
 void SetDisplay(boolean display)
          Set the display
 void SetFontFamily(java.lang.String fontFamily)
          Set the name of font family
 void SetFontSize(java.lang.String fontSize)
          Set the size of font
 void SetForeground(java.awt.Color foreground)
          Set the foreground color in font style
 void SetItalic(boolean italic)
          Set the italic in the font style
 void SetName(java.lang.String name)
          Set the name
 void SetTag(Tag tag)
          Set tag to a specified tag
 void SetToTextDefault()
          Set bold, italic, underline, display, font, size to default
 void SetUnderline(boolean underline)
          Set the underline in the font style
 java.lang.String ToString()
          Convert tag to a string representation: name|category|bold|italic|underline|display|fr|fg|fb|br|bg|bb|font|size
static java.lang.String ToString(Tag tag)
          Convert a specified tag to a string representation: name|category|bold|italic|underline|display|fr|fg|fb|br|bg|bb|font|size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tag

public Tag()
Create a Tag Java object with default values.


Tag

public Tag(Tag tag)
Create a Tag Java object by specifying a tag.

Parameters:
tag - a tag to be instantiated

Tag

public Tag(java.lang.String name)
Create a Tag Java object by specifying name.

Parameters:
name - the name of tag

Tag

public Tag(java.lang.String name,
           java.lang.String category,
           boolean bold,
           boolean italic,
           boolean underline,
           java.awt.Color foreground,
           java.awt.Color background)
Create a Tag Java object by specifying name, category, bold, italic, underline, foreground color, and background color.

Parameters:
name - the name of tag
category - the category of tag
bold - bold in font style
italic - italic in font style
underline - underline in font style
foreground - foreground color in font style
background - background color in font style

Tag

public Tag(java.lang.String name,
           java.lang.String category,
           boolean display,
           boolean bold,
           boolean italic,
           boolean underline,
           java.awt.Color foreground,
           java.awt.Color background,
           java.lang.String fontFamily,
           java.lang.String fontSize)
Create a Tag Java object by specifying name, category, display, bold, italic, underline, foreground color, background color, font family name, and font size.

Parameters:
name - the name of tag
category - the category of tag
display - the boolean flag of display the tag
bold - bold in font style
italic - italic in font style
underline - underline in font style
foreground - foreground color in font style
background - background color in font style
fontFamily - name of font family
fontSize - size of font
Method Detail

SetName

public void SetName(java.lang.String name)
Set the name

Parameters:
name - of the tag

SetCategory

public void SetCategory(java.lang.String category)
Set the category

Parameters:
category - the category of tag

SetDisplay

public void SetDisplay(boolean display)
Set the display

Parameters:
display - the boolean flag of display the tag

SetBold

public void SetBold(boolean bold)
Set the bold in the font style

Parameters:
bold - bold in font style

SetItalic

public void SetItalic(boolean italic)
Set the italic in the font style

Parameters:
italic - italic in the font style

SetUnderline

public void SetUnderline(boolean underline)
Set the underline in the font style

Parameters:
underline - underline in the font style

SetForeground

public void SetForeground(java.awt.Color foreground)
Set the foreground color in font style

Parameters:
foreground - foreground color in font style

SetBackground

public void SetBackground(java.awt.Color background)
Set the background color in the font style

Parameters:
background - background color in the font style

SetFontFamily

public void SetFontFamily(java.lang.String fontFamily)
Set the name of font family

Parameters:
fontFamily - name of font family

SetFontSize

public void SetFontSize(java.lang.String fontSize)
Set the size of font

Parameters:
fontSize - size of font

GetName

public java.lang.String GetName()
Get the name

Returns:
name of the tag

GetCategory

public java.lang.String GetCategory()
Get the category

Returns:
category of the tag

GetNameCategory

public java.lang.String GetNameCategory()
Get the name category

Returns:
name and category of the tag

GetNameCategory

public static java.lang.String GetNameCategory(java.lang.String name,
                                               java.lang.String category)
Convert the name and category to nameCategory string

Returns:
name and category string of the tag

GetName

public static java.lang.String GetName(java.lang.String nameCategory)
Get the name by specifying nameCategory

Returns:
name of the nameCategory

GetCategory

public static java.lang.String GetCategory(java.lang.String nameCategory)
Get the category by specifying nameCategory

Returns:
category of the nameCategory

IsDisplay

public boolean IsDisplay()
Get the boolean flag of display

Returns:
the boolean flag of display

IsBold

public boolean IsBold()
Get the boolean flag of bold

Returns:
the boolean flag of bold

IsItalic

public boolean IsItalic()
Get the boolean flag of italic

Returns:
the boolean flag of italic

IsUnderline

public boolean IsUnderline()
Get the boolean flag of underline

Returns:
the boolean flag of underline

GetForeground

public java.awt.Color GetForeground()
Get the foreground color of text

Returns:
the foreground color of text

GetBackground

public java.awt.Color GetBackground()
Get the background color of text

Returns:
the background color of text

GetFontFamily

public java.lang.String GetFontFamily()
Get the name of font family

Returns:
the name of font family

GetFontSize

public java.lang.String GetFontSize()
Get the size of font

Returns:
the size of font

GetFontSize

public int GetFontSize(int baseFontSize)
Get the absolute size of font by specifying the base size

Returns:
the absolute size of font

SetTag

public void SetTag(Tag tag)
Set tag to a specified tag

Parameters:
tag - the specified tag

SetToTextDefault

public void SetToTextDefault()
Set bold, italic, underline, display, font, size to default


ToString

public java.lang.String ToString()
Convert tag to a string representation: name|category|bold|italic|underline|display|fr|fg|fb|br|bg|bb|font|size

Returns:
string representation of a tag

ToString

public static java.lang.String ToString(Tag tag)
Convert a specified tag to a string representation: name|category|bold|italic|underline|display|fr|fg|fb|br|bg|bb|font|size

Returns:
string representation of a specified tag

VTT Java
2010 Version

Submit a bug or feature

Copyright © 2010 National Library of Medicine