Class InspectableAdapter — Adapter class for writing extensions.
public abstract class com.froglogic.squish.extension.InspectableAdapterimplements, com.froglogic.squish.extension.Inspectable {
// Public Constructorspublic InspectableAdapter();
// Public Methodspublic boolean findObjects(ObjectQuery query,
int n,
java.util.AbstractList list);public boolean findObjects(ObjectQuery query,
Object obj,
java.util.AbstractList list);public Object getChildAt(Point pos);public Object[] getChildren();public Rect getGlobalBounds();public String getName();public Object getPropertyValue(String prop);public boolean isObjectReady();public Point mapFromGlobal(Point pos);public Point mapToGlobal(Point pos);
// Protected Methodsprotected boolean findObjects(ObjectQuery query,
int n,
Object obj,
java.util.AbstractList list);
}
Adapter class for writing extensions. You can use this class when one or more of the default implementations presented here for the Inspectable methods make sense for your extension. You must to reimplement Inspectable.getObject()
public boolean findObjects(ObjectQuery query,
int n,
java.util.AbstractList list);Parameters
query
ObjectQuery object
n
no more then n objects need to be found
matches
list that matches the query in order of found
true if n objects are in the list
Find and add objects that matches query in a list. The search should end if list contains n objects. This function is used for finding the n-th reoccurrence of an object.
IMPORTANT: This function is subject to change at any time. Use the InspectableAdapter default implementation, unless there are good reasons not to.
protected boolean findObjects(ObjectQuery query,
int n,
Object obj,
java.util.AbstractList list);Depth first implementation for findObjects.
Squish calls the function when searching for an object, its container or window object. Therefore the properties 'container', 'window' and 'occurrence' should not be used when searching for objects. The 'type' property is for performance reasons taken out of the
ObjectQuery.match
function and should be checked in this function instead.
public boolean findObjects(ObjectQuery query,
Object obj,
java.util.AbstractList list);Parameters
query
ObjectQuery object
obj
stop searching up until obj is found
matches
objects that matches the query in order of found
true if obj is in the list
Find and add objects that matches query in a list. The search should end after obj is found. This function is used for finding the occurrence property of an object.
IMPORTANT: This function is subject to change at any time. Use the InspectableAdapter default implementation, unless there are good reasons not to.
public Object getChildAt(Point pos);Parameters
pos
the point to use for hit-testing
the object that is hit
Return the child hit at position pos. Containers should return the exact child that is hit if it supports recording at that level of detail (for instance canvasses). The hit child can also be an indirect child, for instance a child of a child of the container. The coordinates are relative to the wrapped object.
public Object[] getChildren();Parameters
array of all children
Return all children of the wrapped object.
public Rect getGlobalBounds();Parameters
the bounds as a Rect
Gets the bounds of this component in the form of a Rect object. The bounds specify this component's width, height, and location relative to its container, all in the container's coordinate system.
public String getName();Parameters
the name
Return the name of this object.
public Object getPropertyValue(String prop);Parameters
prop
property name
value of this property or null
Return the value of a string property. This function is used for creating an object name for the object map. In the descriptors xml file, any property name "abc" from getter functions "getAbc()" may be added if the object class is known to Squish. For object classes not known to Squish, or if there is not a getter function, this function should return the value instead. Properties marked in the descriptor xml as object, must have a matching Inspectable.
public boolean isObjectReady();Returns true when the wrapped object is ready to receive user input like text for a text field, or button clicks for a button, false otherwise.
public Point mapFromGlobal(Point pos);Parameters
pos
the global coordinate
the converted point
Converts the global/screen coordinates x,y into coordinates local to the wrapped object and returns the result as a Point.
public Point mapToGlobal(Point pos);Parameters
pos
the local coordinate
the converted point
Converts the local coordinates x,y into absolute screen coordinates and returns the result as a Point.