com.rational.test.ft.domain.html

Class AreaProxy

  • All Implemented Interfaces:
    com.rational.test.ft.domain.IChannelObject, com.rational.test.ft.domain.IDataDriven, com.rational.test.ft.domain.IGetInterestingRecogProsForDynFind, com.rational.test.ft.domain.IHtmlCustomDomainEnablement, com.rational.test.ft.domain.IInternalObjectStatus, com.rational.test.ft.domain.IProxyBase, com.rational.test.ft.domain.IQuickFind, com.rational.test.ft.domain.IXPathFind, com.rational.test.ft.object.interfaces.IGraphical


    public class AreaProxy
    extends SubobjectProxy
    Implements the proxy for HTML Area elements. This object does not represent a full fledged object, but a sub-object of IMG Map elements.
    • TestObject Interface: SubitemTestObject

  • Supported Subitems:
    SubitemUsage
    TextText

  • Supported Canonical Properties:
    PropertyUsage
    .alt The value of the alt attribute an element.  This is the "alternate" text  for the element, frequently displayed by the browser when the mouse hovers over the element.
    .bounds A rectangle representing the bounding rectangle of the object in screen coordinates.
    .class This is the  test object class name, for example "HtmlTable" for a <Table> element.
    .coords The value of the coords attribute of an element.  This is  string containing the coordinates used to define the AREA of client side image map.  In the form x1, y1, x2,y2, etc.
    .href The value of the href attribute of an element.  This is a URL used by ANCHOR and AREA elements to indicate the result of clicking on the corresponding element.
    .id This is the value of the id attribute of an element.
    .noHref The value of the nohref attribute of an element.  When set on an AREA element indicates that the corresponding area has no associated action.
    .offsetHeight The height of the element.
    .offsetLeft The offset of the element from its offset parent in the DOM.
    .offsetTop The offset of the element from its offset parent in the DOM.
    .offsetWidth The width  of the element.
    .screenLeft Upper left corner of bounding rectangle in screen coordinates, x component.
    .screenTop Upper left corner of bounding rectangle in screen coordinates, y component.
    .shape The value of the shapeattribute of an element. Used for AREA elements in client side image maps.  Valid values are default, rect, circle, and poly
    .tag This is the Html tag for the element
    .text This is the text inside of the HTML tags for bounding the element.  For example, <A>This is an Anchor<IMG src=map.gif></a>   the text property will return "This is an Anchor.   All white space are combined and reduced to a single a blank character if consecutive white space characters are found.
    .title This is the value of the title attribute of an element.  This is frequently the text displayed when hovering over the element with the mouse.

Since:
RFT1.0
    • Method Detail

      • isPointInObject

        public boolean isPointInObject(java.awt.Point point)
        Specified by:
        isPointInObject in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        isPointInObject in class HtmlGuiProxy
      • getSubitem

        public com.rational.test.ft.script.Subitem getSubitem()
        Description copied from class: SubobjectProxy
        Return a subitem object that identifies the subobject
        Specified by:
        getSubitem in class SubobjectProxy
      • equals

        public boolean equals(java.lang.Object other)
        Compare the option element to the subitem, return true if it matches the value expressed by the subitem.
        Overrides:
        equals in class HtmlProxy
        Parameters:
        subitem - - subclass of subitem, currently supports Index, Text, and Value.
        Returns:
        true - matches subitem.
      • isSupported

        public static boolean isSupported(com.rational.test.ft.script.Subitem subitem)
      • setOffsetParent

        public void setOffsetParent(HtmlGuiProxy offsetParent)
        Called by the ImageProxy proxy which will act as the offset parent for this area. This is done because Image maps and areas don't "belong" to an image until they are rendered. An single image map object may in fact be used by mulitple images.
      • getScreenRectangle

        public java.awt.Rectangle getScreenRectangle()
        The screen rectangle for an area element is always relative to its assoicated image so the controlling ImageProxy must set the offsetParent because any geometry calls can be made.
        Specified by:
        getScreenRectangle in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        getScreenRectangle in class HtmlGuiProxy
      • getDefaultPointToClick

        protected java.awt.Point getDefaultPointToClick()
        Determine a default point to click for the area. If the area is a circle or a rectangle then the center point is returned. If the area is an arbitrary polygon then we walk various line segments through the bounding rectangle.
        Overrides:
        getDefaultPointToClick in class HtmlGuiProxy