org.safs.jvmagent.agents
Class ComponentAgent

java.lang.Object
  extended by org.safs.jvmagent.agents.ObjectAgent
      extended by org.safs.jvmagent.agents.ComponentAgent
All Implemented Interfaces:
AlternateAncestorUser, LocalAgent, LocalAgentFactoryUser, LocalSubItemsAgent
Direct Known Subclasses:
ComponentAgent, ContainerAgent

public class ComponentAgent
extends ObjectAgent


Field Summary
static java.lang.String objectType
          "Component" (Subclasses will override) The generic object type supported by this Agent helper class.
 
Fields inherited from class org.safs.jvmagent.agents.ObjectAgent
alternateAncestor, alternateAncestorClassname, factory
 
Constructor Summary
ComponentAgent()
          Constructor for ComponentAgent.
 
Method Summary
 java.awt.Point convertCoords(java.lang.String coords)
          Convert coordinates string of the formats: "x;y" "x,y" "Coords=x;y" "Coords=x,y" into a java.awt.Point object.
protected  java.lang.String validateActionCommand(TestRecordData testRecordData)
          Verify testRecordData.getCommand() is not null or 0-length.
protected  java.awt.Component validateComponent(java.lang.Object object)
          Verify the object is an instanceof java.awt.Component.
 
Methods inherited from class org.safs.jvmagent.agents.ObjectAgent
getAlternateAncestor, getAlternateAncestorClassname, getAncestorAgent, getCaption, getChildCount, getChildren, getClassName, getID, getLevel, getLocalAgentFactory, getMatchingPathObject, getName, getProperty, getPropertyNames, getStringData, getSubItemAtIndex, getSuperClassNames, getText, isMatchingPath, isShowing, isValid, process, processAncestor, setAlternateAncestor, setAlternateAncestorClassname, setLocalAgentFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectType

public static final java.lang.String objectType
"Component" (Subclasses will override) The generic object type supported by this Agent helper class. The generic object type is that returned by GuiClassData.getGenericObjectType. Example: Component Button Table etc..

See Also:
GuiClassData.getGenericObjectType(String), Constant Field Values
Constructor Detail

ComponentAgent

public ComponentAgent()
Constructor for ComponentAgent.

Method Detail

validateActionCommand

protected java.lang.String validateActionCommand(TestRecordData testRecordData)
Verify testRecordData.getCommand() is not null or 0-length.

Returns:
the retrieved action command.
Throws:
SAFSInvalidActionRuntimeException("Invalid - Action") if action is null or 0-length.

validateComponent

protected java.awt.Component validateComponent(java.lang.Object object)
Verify the object is an instanceof java.awt.Component.

Returns:
the cast Component on success.
Throws:
SAFSObjectNotFoundRuntimeException("Invalid - object") if component is null.
SAFSInvalidComponentRuntimeException(object.getClass().getName()) - if component is not a java.awt.Component.

convertCoords

public java.awt.Point convertCoords(java.lang.String coords)
Convert coordinates string of the formats: into a java.awt.Point object.

Subclasses may override to convert alternative values, such as Row and Col values as is done in org.safs.rational.CFTable

Parameters:
coords, - String x;y or x,y or Coords=x;y or Coords=x,y
Returns:
Point if successfull, null otherwise