IBM Rational Functional Tester
Version 8.1.1000
IBM Rational Functional Tester Proxy SDK Reference

Project Version 2.3

com.rational.test.ft.domain.java.jfc
Class JComponentProxy

java.lang.Object   extended by com.rational.test.ft.sys.RegisteredObject       extended by com.rational.test.ft.domain.ProxyTestObject
          extended by com.rational.test.ft.domain.java.JavaProxy
              extended by com.rational.test.ft.domain.java.JavaGuiProxy
                  extended by com.rational.test.ft.domain.java.awt.ComponentProxy
                      extended by com.rational.test.ft.domain.java.jfc.JComponentProxy
All Implemented Interfaces:
IChannelObject, IDataDriven, IProxyBase, IPropertyFilter, ISetParent, com.rational.test.ft.object.interfaces.IGraphical
Direct Known Subclasses:
AbstractButtonProxy, InternalFrameTitlePaneProxy, JDesktopIconProxy, JDesktopProxy, JfcGraphicalSubitemProxy, JInternalFrameProxy, JLabelProxy, JOptionPaneProxy, JPanelProxy, JProgressBarProxy, JSliderProxy, JToolTipProxy

public class JComponentProxy
extends ComponentProxy

The proxy for javax.swing.JComponent.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.rational.test.ft.domain.java.awt.ComponentProxy
ComponentProxy.ChildEnumerator, ComponentProxy.ImmediateChildEnumerator
 
Field Summary
static java.lang.String TAB_INDEX
           
static java.lang.String TAB_TEXT
           
 
Fields inherited from class com.rational.test.ft.domain.java.awt.ComponentProxy
childrenEnumerated, CLASSINDEX, CLASSINDEXWEIGHT, MAX_NAME, NAMEPROPERTY, NAMEPROPERTYWEIGHT, PRIORLABEL, PRIORLABELWEIGHT
 
Fields inherited from class com.rational.test.ft.domain.java.JavaGuiProxy
LEFT, preDownState, processMouseEventHandler, ROLEINDEX, ROLEINDEXWEIGHT, TESTDATA_SPECIALFRAMESTATE, TESTDATA_SPECIALFRAMESTATE_DESCRIPTION, topLevelWindow
 
Fields inherited from class com.rational.test.ft.domain.java.JavaProxy
debug, uniqueId
 
Fields inherited from class com.rational.test.ft.domain.ProxyTestObject
BROWSERTABTESTOBJECT_CLASSNAME, BROWSERTESTOBJECT_CLASSNAME, COLORDIALOGTESTOBJECT_CLASSNAME, CROSSDOMAINCONTAINER_CLASSNAME, DOCUMENTTESTOBJECT_CLASSNAME, DOMAINTESTOBJECT_CLASSNAME, ECLIPSETOPLEVELTESTOBJECT_CLASSNAME, EMBEDDEDBROWSERTESTOBJECT_CLASSNAME, FILEDIALOGTESTOBJECT_CLASSNAME, FRAMESUBITEMTESTOBJECT_CLASSNAME, FRAMETESTOBJECT_CLASSNAME, GEFEDITPARTTESTOBJECT_CLASSNAME, GUISUBITEMTESTOBJECT_CLASSNAME, GUITESTOBJECT_CLASSNAME, INTERNALFRAMETESTOBJECT_CLASSNAME, MESSAGEBOXTESTOBJECT_CLASSNAME, PALETTEGUISUBITEMTESTOBJECT_CLASSNAME, PROCESSTESTOBJECT_CLASSNAME, SCROLLSUBITEMTESTOBJECT_CLASSNAME, SCROLLTESTOBJECT_CLASSNAME, SELECTGUISUBITEMTESTOBJECT_CLASSNAME, SELECTSCROLLGUISUBITEMTESTOBJECT_CLASSNAME, SHELLTESTOBJECT_CLASSNAME, STATELESSGUISUBITEMTESTOBJECT_CLASSNAME, SUBITEMTESTOBJECT_CLASSNAME, TABITEMTESTOBJECT_CLASSNAME, TESTOBJECT_CLASSNAME, TEXTGUISUBITEMTESTOBJECT_CLASSNAME, TEXTGUITESTOBJECT_CLASSNAME, TEXTSCROLLTESTOBJECT_CLASSNAME, TEXTSELECTGUISUBITEMTESTOBJECT_CLASSNAME, TOGGLEGUITESTOBJECT_CLASSNAME, TOGGLETESTOBJECT_CLASSNAME, TOPLEVELSUBITEMTESTOBJECT_CLASSNAME, TOPLEVELTESTOBJECT_CLASSNAME, TRACKBARTESTOBJECT_CLASSNAME, vomClippedRectangle
 
Fields inherited from class com.rational.test.ft.sys.RegisteredObject
theTestObject
 
Fields inherited from interface com.rational.test.ft.domain.IDataDriven
INCLUDE_ALL, INCLUDE_JUSTOBJECT, INCLUDE_SIBLINGS
 
Constructor Summary
JComponentProxy(java.lang.Object theObjectInTheSUT)
          This sole constructor for all proxy objects sets the SUT object as a member variable for the proxy.
 
Method Summary
 java.lang.String getBorderTitle()
           
 java.awt.Rectangle getClippedRect(java.awt.Rectangle childRect)
           
 java.awt.Rectangle getClippedScreenRectangle()
          Returns the clipped-screen rectangle for the associated TestObject
 java.lang.String getDescriptiveName()
          Returns a name that can be used to describe the associated UI object in a script.
 java.util.Hashtable getProperties()
          Returns a complete set of properties for the associated test object.
 java.lang.Object getProperty(java.lang.String propertyName)
          Get the value for a specific property.
 java.lang.String getRole()
          Returns TestObjectRole.ROLE_JFC.
 java.util.Hashtable getStandardProperties()
          For Java, the definition for standard properties is the same as getProperties().
 java.lang.String getText(java.lang.Object comp)
          Returns a String when there's text on the object.
protected  java.awt.Rectangle getVisibleRectangle()
           
 java.awt.Rectangle getVisualClippedRectangle()
          The optimized way to obtain the ClippedRectangle.
 boolean hasFocus()
          Return true if this component has input focus.
 boolean isOpaque()
          Check the component under evaluation to determine if it is opaque or transparent.
 boolean isPointInObject(java.awt.Point pt)
          Determines if the specified screen relative point is contained in the component under evaluation.
 boolean isType(java.lang.Object comp, java.lang.String strType)
           
 void scrollRectToVisible(java.awt.Rectangle rect)
          Scrolls the viewport(if there's any) so that Rectangle within the viewport becomes visible.
 
Methods inherited from class com.rational.test.ft.domain.java.awt.ComponentProxy
canBeScrolled, childConstructed, getChildAtPoint, getChildProxy, getChildrenEnumeration, getComponentChildren, getEmbeddedBrowsers, getImmediateChildren, getLabelText, getLeadingLabel, getLocationOnScreen, getMappableChildren, getMappableParent, getName, getOwnedObjects, getOwner, getParent, getParent2, getParentObject, getScreenRectangle, getTopParent, getWindow, isDopeyDynamicName, isEnabled, isHScroll, isLabelled, isRecognitionProperty, isShowing, isVScroll, setParent
 
Methods inherited from class com.rational.test.ft.domain.java.JavaGuiProxy
activateTopWindow, click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, drag, drag, drag, drag, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, dumpAction, ensureObjectIsVisible, getActionRect, getCachedRectX, getCachedRectY, getMethodSpecForPoint, getProcessMouseEventHandler, getRegisteredTopLevelWindow, getScreenPoint, getScreenPoint, getScriptCommandFlags, getTestObjectClassName, getTopMappableWindow, getTopWindow, hover, hover, hover, hover, isDrag, isPointInObject, modifiersChanged, mouseMove, mouseMove, nClick, nClickDrag, nClickDragToScreenPoint, processHoverMouseEvent, processMouseEvent, processSingleMouseEvent, setProcessMouseEventHandler, setTopLevelWindow, shouldBeMapped
 
Methods inherited from class com.rational.test.ft.domain.java.JavaProxy
addMappableChildrenToVector, addRecognitionProperty, allowProperty, getAddedRecognitionPropertyValue, getChildren, getIndexer, getIndexers, getMethods, getNonValueProperties, getRecognitionProperties, getRecognitionPropertyWeight, getTestDataTypes, getTestDomain, getTopMappableParent, getUniqueId, getVisualClippableParent, hasAddedRecognitionProperties, setIndexer, setProperty
 
Methods inherited from class com.rational.test.ft.domain.ProxyTestObject
addDataDrivableCommands, baseClassMatch, canTakeVP, equals, findChildrenWithProperties, findChildrenWithPropertiesAndInvoke, getChannel, getChildren, getDataDrivableCommand, getDataDrivableCommands, getField, getIgnorableProperties, getMappableChildren, getMappableParent, getObjectClassName, getObjectCustomClassName, getOwnedObjects, getParent, getProxy, getScriptCommandAnchor, getTestData, getVisualMappableChildren, getVisualTopParent, getVOMSpecificProperty, hasSpecialFrameState, isClassIndexConsidered, isSameObject, isValidObject, ping, suppressKeyAction, updateTestData
 
Methods inherited from class com.rational.test.ft.sys.RegisteredObject
addProxyReference, dereference, getObject, getRegisteredId, getTransactionId, isReferenced, isReleaseRequired, register, registerTransiently, release, toString, unregister
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAB_TEXT

public static final java.lang.String TAB_TEXT
See Also:
Constant Field Values

TAB_INDEX

public static final java.lang.String TAB_INDEX
See Also:
Constant Field Values
Constructor Detail

JComponentProxy

public JComponentProxy(java.lang.Object theObjectInTheSUT)
This sole constructor for all proxy objects sets the SUT object as a member variable for the proxy. All interactions with the supplied object are performed through this class.

Method Detail

hasFocus

public boolean hasFocus()
Return true if this component has input focus.

Specified by:
hasFocus in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
hasFocus in class ComponentProxy
Returns:
Return true if this component has input focus.

isOpaque

public boolean isOpaque()
Check the component under evaluation to determine if it is opaque or transparent.

Specified by:
isOpaque in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
isOpaque in class ComponentProxy
Returns:
true if component is opaque, else false.

getDescriptiveName

public java.lang.String getDescriptiveName()
Returns a name that can be used to describe the associated UI object in a script. This name may be further adjusted to be made unique to the script, but will act as the base for the name used in the script. Only characters used in Java identifiers should be returned (alphabetic, numeric or underscore characters). Non-identifier characters will cause script compilation failures. An example of what to return may be "OKButton" for a java.awt.Button with the text "OK" on it.

Overrides:
getDescriptiveName in class ComponentProxy
Returns:
A descriptive object name.

getRole

public java.lang.String getRole()
Returns TestObjectRole.ROLE_JFC.

Overrides:
getRole in class ComponentProxy
Returns:
A brief type name that describes the role this object plays in the UI.
Since:
RFT1.0

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Get the value for a specific property.

Overrides:
getProperty in class ComponentProxy
Parameters:
propertyName - The name of the property to fetch.
Returns:
The active value of the specified property for the associated test object.
See Also:
ProxyTestObject.getProperties(), ProxyTestObject.setProperty(String,Object), ProxyTestObject.getRecognitionProperties(), ProxyTestObject.addRecognitionProperty(String,Object,int)

getClippedScreenRectangle

public java.awt.Rectangle getClippedScreenRectangle()
Description copied from interface: com.rational.test.ft.object.interfaces.IGraphical
Returns the clipped-screen rectangle for the associated TestObject

Specified by:
getClippedScreenRectangle in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
getClippedScreenRectangle in class JavaGuiProxy
Returns:
java.awt.Rectangle - The clipped screen rectangle, or null if the object cannot be seen in any window on the screen.
See Also:
IGraphical.getScreenRectangle()

getVisualClippedRectangle

public java.awt.Rectangle getVisualClippedRectangle()
Description copied from class: ProxyTestObject
The optimized way to obtain the ClippedRectangle.

Overrides:
getVisualClippedRectangle in class ProxyTestObject
Returns:
The ClippedScreen Rectangle of the control

getClippedRect

public java.awt.Rectangle getClippedRect(java.awt.Rectangle childRect)
Overrides:
getClippedRect in class ComponentProxy

isPointInObject

public boolean isPointInObject(java.awt.Point pt)
Determines if the specified screen relative point is contained in the component under evaluation. Note that the point is relative to the top left corner of the screen, and not the component itself or its parent.

This functionality is performed by the proxy due to potentially unusual aspects associated with functionality. While typically the getScreenRectangle is used to resolve this query, there are situations for which this is not accurate. For instance if the clickable region on a button is not rectangular, just checking if the point is in the rectangle is not be valid.

Specified by:
isPointInObject in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
isPointInObject in class JavaGuiProxy
Parameters:
pt - Screen relative point to check.
Returns:
true if component contains thePoint, else false.
See Also:
ComponentProxy.getScreenRectangle()

isType

public boolean isType(java.lang.Object comp,                       java.lang.String strType)

getText

public java.lang.String getText(java.lang.Object comp)
Returns a String when there's text on the object.

Parameters:
comp - an Object
Returns:
a String when the Object is a String or there's text associate with the Object. null when there's no text.

scrollRectToVisible

public void scrollRectToVisible(java.awt.Rectangle rect)
Scrolls the viewport(if there's any) so that Rectangle within the viewport becomes visible.

Overrides:
scrollRectToVisible in class JavaGuiProxy

getVisibleRectangle

protected java.awt.Rectangle getVisibleRectangle()

getBorderTitle

public java.lang.String getBorderTitle()

getProperties

public java.util.Hashtable getProperties()
Description copied from class: ProxyTestObject
Returns a complete set of properties for the associated test object. The meaning of a property is specific to the test domain and the test object. Typically, this is a set of name/value pairs that describe the test object and its active state. Properties such as font, colors, and coordinate information are typically associated with a GUI test object. Associated data and state information can also be returned, depending on the test object.

This method does not return properties whose values are references to objects. The method ProxyTestObject.getNonValueProperties() returns information about such properties.

Overrides:
getProperties in class JavaProxy
Returns:
The set of known properties associated with a test object.
See Also:
ProxyTestObject.getProperty(String), ProxyTestObject.setProperty(String,Object), ProxyTestObject.getStandardProperties(), ProxyTestObject.getNonValueProperties()

getStandardProperties

public java.util.Hashtable getStandardProperties()
Description copied from class: JavaProxy
For Java, the definition for standard properties is the same as getProperties().

Overrides:
getStandardProperties in class JavaProxy
Returns:
The full set of Java properties.
See Also:
JavaProxy.getProperties()