All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ocap.media.ClosedCaptioningAttribute.html Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version






ClosedCaptioningAttribute














org.ocap.media
Class ClosedCaptioningAttribute

java.lang.Object
  extended by org.ocap.media.ClosedCaptioningAttribute

public class ClosedCaptioningAttribute
extends java.lang.Object

This class represents a system wide preference of closed-captioning representation. The OCAP implementation shall display closed-captioning according to preference values that is specified by this class. Application developers should be aware that the FCC has defined strict rules regarding display of CC and EAS (see http://ftp.fcc.gov/cgb/dro/caption.html for FCC closed captioning rules).


Field Summary
static int CC_ATTRIBUTE_FONT_ITALICIZED
          Indicates a font face attribute of a closed-captioning text.
static int CC_ATTRIBUTE_FONT_STYLE
          Indicates a font style attribute of a closed-captioning text.
static int CC_ATTRIBUTE_FONT_UNDERLINE
          Indicates a font face attribute of a closed-captioning text.
static int CC_ATTRIBUTE_PEN_BG_COLOR
          Indicates a pen back ground color attribute to draw closed-captioning text.
static int CC_ATTRIBUTE_PEN_BG_OPACITY
          Indicates a pen back ground opacity attribute of a closed-captioning text.
static int CC_ATTRIBUTE_PEN_FG_COLOR
          Indicates a pen color attribute to draw closed-captioning text.
static int CC_ATTRIBUTE_PEN_FG_OPACITY
          Indicates a pen opacity attribute of a closed-captioning text.
static int CC_ATTRIBUTE_PEN_SIZE
          Indicates a font size attribute of a closed-captioning text.
static int CC_ATTRIBUTE_WINDOW_BORDER_COLOR
          Indicates a border color attribute of a closed-captioning window.
static int CC_ATTRIBUTE_WINDOW_BORDER_TYPE
          Indicates a border type attribute of a closed-captioning window.
static int CC_ATTRIBUTE_WINDOW_FILL_COLOR
          Indicates a window fill color attribute of a closed-captioning window.
static int CC_ATTRIBUTE_WINDOW_FILL_OPACITY
          Indicates a border type attribute of a closed-captioning window.
static int CC_BORDER_DEPRESSED
          Indicates a border type of DEPRESSED.
static int CC_BORDER_NONE
          Indicates a border type of NONE.
static int CC_BORDER_RAISED
          Indicates a border type of RAISED.
static int CC_BORDER_SHADOW_LEFT
          Indicates a border type of SHADOW_LEFT.
static int CC_BORDER_SHADOW_RIGHT
          Indicates a border type of SHADOW_RIGHT.
static int CC_BORDER_UNIFORM
          Indicates a border type of UNIFORM.
static int CC_OPACITY_FLASH
          Indicates a opacity value for a flash.
static int CC_OPACITY_SOLID
          Indicates a opacity value for a solid.
static int CC_OPACITY_TRANSLUCENT
          Indicates a opacity value for a translucent.
static int CC_OPACITY_TRANSPARENT
          Indicates a opacity value for a transparent.
static int CC_PEN_SIZE_LARGE
          Indicates a large pen size.
static int CC_PEN_SIZE_SMALL
          Indicates a small pen size.
static int CC_PEN_SIZE_STANDARD
          Indicates a standard pen size.
static int CC_TYPE_ANALOG
          Indicates an analog type closed-captioning.
static int CC_TYPE_DIGITAL
          Indicates an digital type closed-captioning.
 
Constructor Summary
protected ClosedCaptioningAttribute()
          A constructor of this class.
 
Method Summary
 java.lang.Object getCCAttribute(int attribute, int ccType)
           This method returns a current attribute values applied to a closed-captioning text on a screen.
 java.lang.Object[] getCCCapability(int attribute, int ccType)
           This method returns a possible attribute values applied to an closed-captioning text on a screen.
static ClosedCaptioningAttribute getInstance()
          This method returns an instance of this class.
 void setCCAttribute(int[] attribute, java.lang.Object[] value, int ccType)
           This method sets a preferred attribute values applied to a closed-captioning text on a screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CC_ATTRIBUTE_PEN_FG_COLOR

public static final int CC_ATTRIBUTE_PEN_FG_COLOR
Indicates a pen color attribute to draw closed-captioning text. Identical to the "fg color" parameter of SetPenColor command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_PEN_BG_COLOR

public static final int CC_ATTRIBUTE_PEN_BG_COLOR
Indicates a pen back ground color attribute to draw closed-captioning text. Identical to the "bg color" parameter of SetPenColor command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_PEN_FG_OPACITY

public static final int CC_ATTRIBUTE_PEN_FG_OPACITY
Indicates a pen opacity attribute of a closed-captioning text. Identical to the "fg opacity" parameter of SetPenColor command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_PEN_BG_OPACITY

public static final int CC_ATTRIBUTE_PEN_BG_OPACITY
Indicates a pen back ground opacity attribute of a closed-captioning text. Identical to the "bg opacity" parameter of SetPenColor command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_FONT_STYLE

public static final int CC_ATTRIBUTE_FONT_STYLE
Indicates a font style attribute of a closed-captioning text. Identical to the "font style" parameter of SetPenAttributes command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_PEN_SIZE

public static final int CC_ATTRIBUTE_PEN_SIZE
Indicates a font size attribute of a closed-captioning text. Identical to the "pen size" parameter of SetPenAttributes command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_FONT_ITALICIZED

public static final int CC_ATTRIBUTE_FONT_ITALICIZED
Indicates a font face attribute of a closed-captioning text. Identical to the "italics" parameter of SetPenAttributes command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_FONT_UNDERLINE

public static final int CC_ATTRIBUTE_FONT_UNDERLINE
Indicates a font face attribute of a closed-captioning text. Identical to the "underline" parameter of SetPenAttributes command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_WINDOW_FILL_COLOR

public static final int CC_ATTRIBUTE_WINDOW_FILL_COLOR
Indicates a window fill color attribute of a closed-captioning window. Identical to the "fill color" parameter of SetWindowAttributes command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_WINDOW_FILL_OPACITY

public static final int CC_ATTRIBUTE_WINDOW_FILL_OPACITY
Indicates a border type attribute of a closed-captioning window. Identical to the "fill opacity" parameter of SetWindowAttributes command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_WINDOW_BORDER_TYPE

public static final int CC_ATTRIBUTE_WINDOW_BORDER_TYPE
Indicates a border type attribute of a closed-captioning window. Identical to the "border color" parameter of SetWindowAttributes command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_ATTRIBUTE_WINDOW_BORDER_COLOR

public static final int CC_ATTRIBUTE_WINDOW_BORDER_COLOR
Indicates a border color attribute of a closed-captioning window. Identical to the "border color" parameter of SetWindowAttributes command of EIA-708-B. For an analog captioning, an equivalent attribute is assigned.

See Also:
Constant Field Values

CC_PEN_SIZE_SMALL

public static final int CC_PEN_SIZE_SMALL
Indicates a small pen size.

See Also:
Constant Field Values

CC_PEN_SIZE_STANDARD

public static final int CC_PEN_SIZE_STANDARD
Indicates a standard pen size.

See Also:
Constant Field Values

CC_PEN_SIZE_LARGE

public static final int CC_PEN_SIZE_LARGE
Indicates a large pen size.

See Also:
Constant Field Values

CC_OPACITY_SOLID

public static final int CC_OPACITY_SOLID
Indicates a opacity value for a solid.

See Also:
Constant Field Values

CC_OPACITY_FLASH

public static final int CC_OPACITY_FLASH
Indicates a opacity value for a flash.

See Also:
Constant Field Values

CC_OPACITY_TRANSLUCENT

public static final int CC_OPACITY_TRANSLUCENT
Indicates a opacity value for a translucent.

See Also:
Constant Field Values

CC_OPACITY_TRANSPARENT

public static final int CC_OPACITY_TRANSPARENT
Indicates a opacity value for a transparent.

See Also:
Constant Field Values

CC_BORDER_NONE

public static final int CC_BORDER_NONE
Indicates a border type of NONE.

See Also:
Constant Field Values

CC_BORDER_RAISED

public static final int CC_BORDER_RAISED
Indicates a border type of RAISED.

See Also:
Constant Field Values

CC_BORDER_DEPRESSED

public static final int CC_BORDER_DEPRESSED
Indicates a border type of DEPRESSED.

See Also:
Constant Field Values

CC_BORDER_UNIFORM

public static final int CC_BORDER_UNIFORM
Indicates a border type of UNIFORM.

See Also:
Constant Field Values

CC_BORDER_SHADOW_LEFT

public static final int CC_BORDER_SHADOW_LEFT
Indicates a border type of SHADOW_LEFT.

See Also:
Constant Field Values

CC_BORDER_SHADOW_RIGHT

public static final int CC_BORDER_SHADOW_RIGHT
Indicates a border type of SHADOW_RIGHT.

See Also:
Constant Field Values

CC_TYPE_ANALOG

public static final int CC_TYPE_ANALOG
Indicates an analog type closed-captioning.

See Also:
Constant Field Values

CC_TYPE_DIGITAL

public static final int CC_TYPE_DIGITAL
Indicates an digital type closed-captioning.

See Also:
Constant Field Values
Constructor Detail

ClosedCaptioningAttribute

protected ClosedCaptioningAttribute()
A constructor of this class. An application shall not call this constructor directly.

Method Detail

getInstance

public static ClosedCaptioningAttribute getInstance()
This method returns an instance of this class. It is not required to be a singleton manner.

Returns:
A ClosedCaptioningAttribute instance.
Throws:
java.lang.SecurityException - if the caller doesn't have MonitorAppPermission("handler.closedCaptioning").

getCCCapability

public java.lang.Object[] getCCCapability(int attribute,
                                          int ccType)

This method returns a possible attribute values applied to an closed-captioning text on a screen. Note that the possible font attribute may be different from the possible font for Java application since the closed-captioning module may be implemented by native language.

Parameters:
attribute - specify an attribute to get possible values. One of constants that has a CC_ATTRIBUTE_ prefix shall be specified.
ccType - either CC_ANALOG or CC_DIGITAL to specify a type of closed-captioning.
Returns:
an array of possible attribute values of an closed-captioning text corresponding to the specified attribute parameter.
  • If the attribute parameter is CC_ATTRIBUTE_PEN_FG_COLOR or CC_ATTRIBUTE_PEN_BG_COLOR, an array of java.awt.Color that represents possible font color returns. The Color.getString() shall return a text expression of its color to show a user.
  • If the attribute parameter is CC_ATTRIBUTE_PEN_FG_OPACITY or CC_ATTRIBUTE_PEN_BG_OPACITY, an array of constants that represents possible opacity returns. The opacity constants has a prefix of CC_OPACITY_.
  • If the attribute parameter is CC_ATTRIBUTE_FONT_STYLE, an array of String that represents possible font style returns. It is recommended that the String is one of font style defined in EIA-708-B but not restricted to it. The host device can provide a new style.
  • If the attribute parameter is CC_ATTRIBUTE_PEN_SIZE, an array of constants that represents possible pen size returns. The pen size constants has a prefix of CC_PEN_SIZE_.
  • If the attribute parameter is CC_ATTRIBUTE_FONT_ITALICIZED, an array of possible Integer value (YES=1, NO=0) returns. I.e., if the host can select a plane font or an italicized font, an array of [0, 1] (or [1, 0]) returns. If the host only supports a plane font, [0] returns.
  • If the attribute parameter is CC_ATTRIBUTE_FONT_UNDERLINE, an array of possible Integer value (YES=1, NO=0) returns. See also the CC_ATTRIBUTE_FONT_ITALICIZED description.
  • If the attribute parameter is CC_ATTRIBUTE_WINDOW_FILL_COLOR, an array of java.awt.Color that represents possible window fill color returns. The Color.getString() shall return a text expression of its color to show a user.
  • If the attribute parameter is CC_ATTRIBUTE_WINDOW_FILL_OPACITY an array of constants that represents possible opacity returns. The opacity constants has a prefix of CC_OPACITY_.
  • If the attribute parameter is CC_ATTRIBUTE_WINDOW_BORDER_TYPE an array of constants that represents possible border type returns. The border type constants has a prefix of CC_BORDER_.
  • If the attribute parameter is CC_ATTRIBUTE_WINDOW_BORDER_COLOR, an array of java.awt.Color that represents possible window border color returns. The Color.getString() shall return a text expression of its color to show a user.
Throws:
java.lang.IllegalArgumentException - if a specified attribute or ccType parameter is out of range.

setCCAttribute

public void setCCAttribute(int[] attribute,
                           java.lang.Object[] value,
                           int ccType)

This method sets a preferred attribute values applied to a closed-captioning text on a screen. Some attribute values can be specified by one call of this method. If one of the specified attribute value is invalid, i.e., the value is not included in the return value of the getCCCapability(int, int) method, this method changes none of current attribute values and throw an exception.

Parameters:
attribute - an array of attributes to be set a preferred value. One of constants that has a CC_ATTRIBUTE_ prefix shall be specified.
value - an array of preferred values to be used to draw a closed-captioning text. The value shall be one of the return value from the getCCCapability(int, int) method for the specified attribute, or null to set a host?s default value. The i-th item of the value array corresponds to the i-th item of the attribute array.
ccType - either CC_ANALOG or CC_DIGITAL to specify a type of closed-captioning.
Throws:
java.lang.IllegalArgumentException - if a specified attribute, value, or ccType parameter is out of range or not a capable value, or if a length of a specified attribute array doesn?t matches with a length of a specified value array.

getCCAttribute

public java.lang.Object getCCAttribute(int attribute,
                                       int ccType)

This method returns a current attribute values applied to a closed-captioning text on a screen.

Parameters:
attribute - specify an attribute to get a preferred values. One of constants that has a CC_ATTRIBUTE_ prefix shall be specified. See the getCCCapability(int, int) method also.
ccType - either CC_ANALOG or CC_DIGITAL to specify a type of closed-captioning.
Returns:
a current attribute value corresponding to the specified closed-captioning attribute parameter. See the getCCCapability(int, int) method for an applicable value.
Throws:
java.lang.IllegalArgumentException - if a specified attribute or ccType parameter is out of range.






© 2015 - 2024 Weber Informatics LLC | Privacy Policy