EASModuleRegistrar

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ocap.system
Class EASModuleRegistrar

    java.lang.Object
      org.ocap.system.EASModuleRegistrar

    public class EASModuleRegistrar

extends Object

An OCAP-J application can set and get a preferred attribute value of an EAS alert text. The capability method provides possible attribute values. And also, an OCAP-J application can set an EASHandler to be notified of a private descriptor indicating an alternative audio, if the alert_priority=15 but no audio specified by SCTE 18 is available. The OCAP implementation may throw an exception if a specified preference doesn't conform to FCC rules or the SCTE 18 specification. For example, some color combinations could make text unreadable. See http://www.fcc.gov/eb/eas/ for FCC rules.

See also Section 20 Baseline Functionality for detail on EAS functionality.

Since:
  1.0
Author:
  Shigeaki Watanabe (modify)

Field Summary
`static int` | `EAS_ATTRIBUTE_BACK_COLOR` Indicates a background color attribute of an EAS alert text.
`static int` | `EAS_ATTRIBUTE_BACK_OPACITY` Indicates a background opacity attribute of an EAS alert text.
`static int` | `EAS_ATTRIBUTE_FONT_COLOR` Indicates a font color attribute of an EAS alert text.
`static int` | `EAS_ATTRIBUTE_FONT_FACE` Indicates a font face attribute of an EAS alert text.
`static int` | `EAS_ATTRIBUTE_FONT_OPACITY` Indicates a font opacity attribute of an EAS alert text.
`static int` | `EAS_ATTRIBUTE_FONT_SIZE` Indicates a font size attribute of an EAS alert text.
`static int` | `EAS_ATTRIBUTE_FONT_STYLE` Indicates a font style attribute of an EAS alert text.

Method Summary
`Object` | `getEASAttribute(int attribute)` This method returns a current attribute values applied to an EAS alert text on a screen.
`Object[]` | `getEASCapability(int attribute)` This method returns a possible attribute values applied to an EAS alert text on a screen.
`static EASModuleRegistrar` | `getInstance()` This method returns a sole instance of the EASModuleRegistrar class.
`void` | `registerEASHandler(EASHandler handler)` This method registers an EASHandler instance.
`void` | `setEASAttribute(int[] attribute, Object[] value)` This method sets a preferred attribute values applied to an EAS alert text on a screen.
`void` | `unregisterEASHandler()` This method unregisters the current registered EASHandler instance.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### EAS_ATTRIBUTE_FONT_COLOR

    public static final int EAS_ATTRIBUTE_FONT_COLOR

  Indicates a font color attribute of an EAS alert text.

  See Also:
    Constant Field Values

### EAS_ATTRIBUTE_FONT_STYLE

    public static final int EAS_ATTRIBUTE_FONT_STYLE

  Indicates a font style attribute of an EAS alert text.

  See Also:
    Constant Field Values

### EAS_ATTRIBUTE_FONT_FACE

    public static final int EAS_ATTRIBUTE_FONT_FACE

  Indicates a font face attribute of an EAS alert text.

  See Also:
    Constant Field Values

### EAS_ATTRIBUTE_FONT_SIZE

    public static final int EAS_ATTRIBUTE_FONT_SIZE

  Indicates a font size attribute of an EAS alert text.

  See Also:
    Constant Field Values

### EAS_ATTRIBUTE_BACK_COLOR

    public static final int EAS_ATTRIBUTE_BACK_COLOR

  Indicates a background color attribute of an EAS alert text.

  See Also:
    Constant Field Values

### EAS_ATTRIBUTE_FONT_OPACITY

    public static final int EAS_ATTRIBUTE_FONT_OPACITY

  Indicates a font opacity attribute of an EAS alert text.

  See Also:
    Constant Field Values

### EAS_ATTRIBUTE_BACK_OPACITY

    public static final int EAS_ATTRIBUTE_BACK_OPACITY

  Indicates a background opacity attribute of an EAS alert text.

  See Also:
    Constant Field Values

Method Detail

### getInstance

    public static EASModuleRegistrar getInstance()

  This method returns a sole instance of the EASModuleRegistrar class. The EASModuleRegistrar instance is either a singleton for each OCAP application or a singleton for an entire OCAP implementation.

  Returns:
    a singleton EASModuleRegistrar instance.
  Throws:
    `SecurityException` - if the caller does not have MonitorAppPermission("handler.eas").

### registerEASHandler

    public void registerEASHandler(EASHandler handler)

  This method registers an EASHandler instance. At most only one EASHandler instance can be registered. Multiple calls of this method replace the previous instance by a new one. By default, no instance is registered. If null is specified, this method do nothing and raise an exception.

  Throws:
    `IllegalArgumentException` - if null is specified.

### unregisterEASHandler

    public void unregisterEASHandler()

  This method unregisters the current registered EASHandler instance. If no EASHandler instance has registered, do nothing.

### getEASCapability

    public Object[] getEASCapability(int attribute)

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

  Parameters:
    `attribute` - one of constants that has a prefix of EAS_ATTRIBUTE_ to specify an attribute to get possible values.
  Returns:
    an array of possible attribute values of an alert text corresponding to the specified attribute parameter.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_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 EAS_ATTRIBUTE_FONT_STYLE, an array of String that represents possible font style returns.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_FACE, an array of String that represents possible font face name returns.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_SIZE, an array of Integer of possible font size returns.
    - If the attribute parameter is EAS_ATTRIBUTE_BACK_COLOR, an array of java.awt.Color that represents possible background color returns. The Color.getString() shall return a text expression of its color to show a user.
  Throws:
    `IllegalArgumentException` - if the attribute is out of range.

### setEASAttribute

    public void setEASAttribute(int[] attribute,
                                Object[] value)

  This method sets a preferred attribute values applied to an EAS alert text on a screen. If the specified attribute value is invalid, i.e., the value is not included in the return value of the `getEASCapability(int)` method, this method doesn't change current attribute value and throw an exception. If the specified attribute is EAS_ATTRIBUTE_FONT_OPACITY or EAS_ATTRIBUTE_BACK_OPACITY, this method accepts any Float value and the OCAP implementation tries to apply it. The OCAP implementation may not able to apply the specified opacity exactly.

  Note that even if the application could set a preference successfully, the OCAP implementation may not apply it to an EAS message text on a screen if a conflict with FCC rule or SCTE 18 specification is found while displaying process.

  Parameters:
    `attribute` - an array of constants that has a prefix of EAS_ATTRIBUTE_ to specify an attribute.
    `value` - an array of preferred attribute values to be set to an alert text. The i-th item of the value array corresponds to the i-th item of the attribute array.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_COLOR, an instance of java.awt.Color that represents preferred font color.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_STYLE, an String that represents preferred font style.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_FACE, an String that represents preferred font face name.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_SIZE, an Integer of preferred font size.
    - If the attribute parameter is EAS_ATTRIBUTE_BACK_COLOR, an instance of java.awt.Color that represents preferred background color.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_OPACITY, an Float of preferred font opacity.
    - If the attribute parameter is EAS_ATTRIBUTE_BACK_OPACITY, an Float of preferred background opacity.
  Throws:
    `IllegalArgumentException` - if the attribute is out of range or the value is not a possible value or if the specified preference conflicts with FCC rules or SCTE 18. For example, an EAS message is invisible since same color is specified to a font and background. Criteria of visibility depends on a manufacturer or a display device etc.

### getEASAttribute

    public Object getEASAttribute(int attribute)

  This method returns a current attribute values applied to an EAS alert text on a screen.

  Parameters:
    `attribute` - one of constants that has a prefix of EAS_ATTRIBUTE_ to specify an attribute to get current values.
  Returns:
    a current attribute values of an alert text corresponding to the specified attribute parameter.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_COLOR, an instance of java.awt.Color that represents current font color returns.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_STYLE, an String that represents current font style returns.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_FACE, an String that represents current font face name returns.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_SIZE, an Integer of current font size returns.
    - If the attribute parameter is EAS_ATTRIBUTE_BACK_COLOR, an instance of java.awt.Color that represents current background color returns.
    - If the attribute parameter is EAS_ATTRIBUTE_FONT_OPACITY, an Float of current font opacity returns.
    - If the attribute parameter is EAS_ATTRIBUTE_BACK_OPACITY, an Float of current background opacity returns.
  Throws:
    `IllegalArgumentException` - if the attribute is out of range.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD