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

Class JComponentProxy

    • 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
      • getClippedScreenRectangle

        public java.awt.Rectangle getClippedScreenRectangle()
        Specified by:
        getClippedScreenRectangle in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        getClippedScreenRectangle in class JavaGuiProxy
      • getVisualClippedRectangle

        public java.awt.Rectangle getVisualClippedRectangle()
        Overrides:
        getVisualClippedRectangle in class com.rational.test.ft.domain.ProxyTestObject
      • 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()