|
HATS 7.5.1 Web API ReferencePublicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.hats.transform.components.Component
public abstract class Component
The Component class is the superclass of all component classes. Components are responsible for recognizing specific host screen patterns and returning those as logical component element objects. A component class should only recognize one type of host screen pattern. For example, the FunctionKeyComponent class is responsible for recognizing function keys.
A HsrScreen object, which represents a host screen, must be passed to the constructor of each component instance. This host screen will be used by the component to recognize components in the specified region and with the specified settings.
The two recognize() methods are marked as abstract and must be overridden. These methods are responsible for recognizing components in the specified region and with the specified settings.
Note: The recognize() method which accepts a LinearScreenRegion object is currently not supported by default or custom rendering requests. You can implement this method if you plan on calling it from your own implementation.
| Field Summary | |
|---|---|
static String |
CLASS_NAME
|
protected ContextAttributes |
contextAttributes
|
protected boolean |
flag
|
protected HsrScreen |
hostScreen
|
| Fields inherited from interface com.ibm.hats.common.ICustomPropertySupplier |
|---|
CLASSNAME |
| Constructor Summary | |
|---|---|
Component(HsrScreen hostScreen)
Component object constructor method. |
|
| Method Summary | |
|---|---|
static int |
convertPosToCol(int pos,
int numColumns)
Convenience method to convert a linear host screen position (from 1 to (number of rows * number of columns)) to its column value. |
static int |
convertPosToRow(int pos,
int numColumns)
Convenience method to convert a linear host screen position (from 1 to (number of rows * number of columns)) to its row value. |
static int |
convertRowColToPos(int row,
int col,
int numColumns)
Convenience method to convert a row/column position into a linear (1-based) position on the host screen. |
static int[] |
findFirstDelimiterIndex(String str,
String[] delimiters,
int startPos)
Method to find the index in the string of the highest priority delimiter. |
static int[] |
findFirstIndexOf(char[] buffer,
String[] lookFor)
|
static int[] |
findFirstIndexOf(String str,
String[] lookFor)
|
static int[] |
findFirstIndexOf(String str,
String[] lookFor,
int startPos)
Method to find the first index in the specified string in the set of "lookfor" strings. |
static int |
findFirstNonWhitespaceIndex(char[] str,
int startIndex)
|
static int |
findFirstNonWhitespaceIndex(String str)
Convenience method which returns the index (0-based) of the first non-whitespace (space, character 0x20 in this implementation) character. |
static int |
findFirstNonWhitespaceIndex(String str,
int startIndex)
Convenience method which returns the index (0-based) of the first non-whitespace (space, character 0x20 in this implementation) character starting at the specified index. |
Object |
getContextAttribute(String name)
Returns the value of the specified context attribute. |
ContextAttributes |
getContextAttributes()
Returns the table of context attributes. |
Class |
getCustomComposite()
Returns a Class object (assignable from com.ibm.hats.studio.composites.BasePropertiesComposite) if a
custom composite is to be used to represent the customizable properties for this object or null if dynamic GUI is to be used. |
Vector |
getCustomProperties(int iPageNumber,
Properties properties,
ResourceBundle bundle)
Returns a list of this object's custom properties. |
Properties |
getDefaultValues(int iPageNumber)
Returns this object's default property values. |
HsrScreen |
getHostScreen()
Returns the host screen object used by this component. |
int |
getPropertyPageCount()
Returns the number of property pages associated with this object. |
static int |
getTrailingSpaceCount(String str)
Returns the number of trailing spaces in a String. |
static Component |
newInstance(String className,
ClassLoader classLoader,
HsrScreen hs)
Convenience method to create a new instance of the specified className component object. |
abstract ComponentElement[] |
recognize(BlockScreenRegion region,
Properties settings)
Method to recognize components in the specified BlockScreenRegion using the specified settings. |
abstract ComponentElement[] |
recognize(com.ibm.hats.transform.regions.LinearScreenRegion region,
Properties settings)
Currently not implemented. |
ComponentElement[] |
recognize(ScreenRegion region,
Properties settings)
Currently not implemented. |
void |
setContextAttribute(String name,
Object value)
Method to set the value of a context attribute. |
void |
setContextAttributes(ContextAttributes contextAttributes)
Sets the contextAttributes. |
void |
setHostScreen(HsrScreen hostScreen)
Method to set the HostScreen object used by this component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CLASS_NAME
protected HsrScreen hostScreen
protected ContextAttributes contextAttributes
protected boolean flag
| Constructor Detail |
|---|
public Component(HsrScreen hostScreen)
setHostScreen() method (which is called by default from this default constructor).
hostScreen - | Method Detail |
|---|
public abstract ComponentElement[] recognize(BlockScreenRegion region,
Properties settings)
BlockScreenRegion using the specified settings.This method must be implemented if the base class is subclassed.
region - BlockScreenRegion to search insettings - recognition settings
public abstract ComponentElement[] recognize(com.ibm.hats.transform.regions.LinearScreenRegion region,
Properties settings)
This method must be implemented if the base class is subclassed.
public ComponentElement[] recognize(ScreenRegion region,
Properties settings)
public void setContextAttribute(String name,
Object value)
name - value - ContextAttributespublic Object getContextAttribute(String name)
name - The name of the context attribute.
ContextAttributes
public static final int convertPosToRow(int pos,
int numColumns)
pos - linear (1-based) position on the host screennumColumns - number of columns on the host screen (required to calculate row value)
public static final int convertPosToCol(int pos,
int numColumns)
pos - linear position on the host screennumColumns - number of columns on the host screen (required to calculate)
public static final int convertRowColToPos(int row,
int col,
int numColumns)
row - row number (1-based) of the positioncol - column number (1-based) of the positionnumColumns - number of columns on the host screen (required to calculate)
public void setHostScreen(HsrScreen hostScreen)
HostScreen object used by this component. Initialization of private fields, dependent on the host screen object, should be performed in this method.
hostScreen - public HsrScreen getHostScreen()
public int getPropertyPageCount()
ICustomPropertySupplierNote: Currently only 0 or 1 pages are supported.
getPropertyPageCount in interface ICustomPropertySupplier
public Vector getCustomProperties(int iPageNumber,
Properties properties,
ResourceBundle bundle)
ICustomPropertySuppliercom.ibm.hats.common.HCustomProperty.
getCustomProperties in interface ICustomPropertySupplieriPageNumber - page number containing desired propertiesproperties - existing values for properties defined herebundle - ResourceBundle containing NLS descriptions for the properties
HCustomPropertypublic Class getCustomComposite()
ICustomPropertySupplierClass object (assignable from com.ibm.hats.studio.composites.BasePropertiesComposite) if a
custom composite is to be used to represent the customizable properties for this object or null if dynamic GUI is to be used.
Note: this function only applies to HATS Studio
getCustomComposite in interface ICustomPropertySupplierBasePropertiesComposite) or null if dynamic GUI should be usedBasePropertiesCompositepublic Properties getDefaultValues(int iPageNumber)
ICustomPropertySupplier
getDefaultValues in interface ICustomPropertySupplieriPageNumber - page for which to retrieve default properties
public static Component newInstance(String className,
ClassLoader classLoader,
HsrScreen hs)
className component object.
Example:
FunctionKeyComponent fkc = Component.newInstance("com.ibm.hats.transform.components.FunctionKeyComponent", classLoader, hostScreen);
className - Fully package-qualified name of the class name to use to create a new instance.classLoader - The classloader.hs - The HostScreen object to be used as the single constructor parameter of the new object.
public ContextAttributes getContextAttributes()
public void setContextAttributes(ContextAttributes contextAttributes)
contextAttributes - the contextAttributes to set
public static int[] findFirstIndexOf(String str,
String[] lookFor)
public static int[] findFirstIndexOf(String str,
String[] lookFor,
int startPos)
Returns an array:
index 0: index in the "str" of the first found item in "lookFor"
index 1: index in "lookFor" that was found first in the string.
str - The String to be searched.lookFor - The array of items to look for in the specified string.startPos - The linear (0-based) position in the string to start searching for "lookFor" strings.
public static int[] findFirstIndexOf(char[] buffer,
String[] lookFor)
public static int[] findFirstDelimiterIndex(String str,
String[] delimiters,
int startPos)
public static int findFirstNonWhitespaceIndex(String str)
str - String to search in
public static int findFirstNonWhitespaceIndex(String str,
int startIndex)
str - The String to be searched.startIndex - The index (0-based) of the specified string specifying where to commence the search.
public static int findFirstNonWhitespaceIndex(char[] str,
int startIndex)
public static int getTrailingSpaceCount(String str)
String.
str - String to count the number of trailing spaces in
|
HATS 7.5.1 (201005110649) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||