Name

Class InspectableAdapter — Adapter class for writing extensions.

Synopsis

 public abstract class com.­froglogic.­squish.­extension.­InspectableAdapterimplements, com.­froglogic.­squish.­extension.­Inspectable {

// Public Constructors  public InspectableAdapter();

// Public Methods  public boolean findObjects(com.­froglogic.­squish.­extension.­ObjectQuery query,

                             int n,

                             java.­util.­AbstractList list);


  public boolean findObjects(com.­froglogic.­squish.­extension.­ObjectQuery query,

                             java.­lang.­Object obj,

                             java.­util.­AbstractList list);


  public java.​­lang.​­Object getChildAt(com.­froglogic.­squish.­extension.­Point pos);

  public java.​­lang.​­Object[] getChildren();

  public com.​­froglogic.​­squish.​­extension.​­Rect getGlobalBounds();

  public java.​­lang.​­String getName();

  public java.​­lang.​­Object getPropertyValue(java.­lang.­String prop);

  public boolean isObjectReady();

  public com.​­froglogic.​­squish.​­extension.​­Point mapFromGlobal(com.­froglogic.­squish.­extension.­Point pos);

  public com.​­froglogic.​­squish.​­extension.​­Point mapToGlobal(com.­froglogic.­squish.­extension.­Point pos);

// Protected Methods  protected boolean findObjects(com.­froglogic.­squish.­extension.­ObjectQuery query,

                                int n,

                                java.­lang.­Object obj,

                                java.­util.­AbstractList list);


  protected boolean typeMatch(com.­froglogic.­squish.­extension.­ObjectQuery query,

                              java.­lang.­Object obj);


}

Methods inherited from java.lang.Object: clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait

Description

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()

Methods

findObjects(ObjectQuery, int, AbstractList)

public boolean findObjects(com.­froglogic.­squish.­extension.­ObjectQuery query,

                           int n,

                           java.­util.­AbstractList list);

Specified by: Method findObjects in interface Inspectable

Parameters

query

ObjectQuery object

n

no more then n objects need to be found

matches

list that matches the query in order of found

return

true if n objects are in the list

Description copied from interface: findObjects

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.

findObjects(ObjectQuery, int, Object, AbstractList)

protected boolean findObjects(com.­froglogic.­squish.­extension.­ObjectQuery query,

                              int n,

                              java.­lang.­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.

findObjects(ObjectQuery, Object, AbstractList)

public boolean findObjects(com.­froglogic.­squish.­extension.­ObjectQuery query,

                           java.­lang.­Object obj,

                           java.­util.­AbstractList list);

Specified by: Method findObjects in interface Inspectable

Parameters

query

ObjectQuery object

obj

stop searching up until obj is found

matches

objects that matches the query in order of found

return

true if obj is in the list

Description copied from interface: findObjects

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.

getChildAt(Point)

public java.​­lang.​­Object getChildAt(com.­froglogic.­squish.­extension.­Point pos);

Specified by: Method getChildAt in interface Inspectable

Parameters

pos

the point to use for hit-testing

return

the object that is hit

Description copied from interface: getChildAt

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. In case no child is at pos, null should be returned.

getChildren()

public java.​­lang.​­Object[] getChildren();

Specified by: Method getChildren in interface Inspectable

Parameters

return

array of all children

Description copied from interface: getChildren

Return all children of the wrapped object. In case of zero children, an empty array should be returned (not 'null' but 'new Object[]{}')

getGlobalBounds()

public com.​­froglogic.​­squish.​­extension.​­Rect getGlobalBounds();

Specified by: Method getGlobalBounds in interface Inspectable

Parameters

return

the bounds as a Rect

Description copied from interface: getGlobalBounds

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.

getName()

public java.​­lang.​­String getName();

Specified by: Method getName in interface Inspectable

Parameters

return

the name

Description copied from interface: getName

Return the name of this object.

getPropertyValue(String)

public java.​­lang.​­Object getPropertyValue(java.­lang.­String prop);

Specified by: Method getPropertyValue in interface Inspectable

Parameters

prop

property name

return

value of this property or null

Description copied from interface: getPropertyValue

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.

isObjectReady()

public boolean isObjectReady();

Specified by: Method isObjectReady in interface Inspectable

Description copied from interface: 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.

mapFromGlobal(Point)

public com.​­froglogic.​­squish.​­extension.​­Point mapFromGlobal(com.­froglogic.­squish.­extension.­Point pos);

Specified by: Method mapFromGlobal in interface Inspectable

Parameters

pos

the global coordinate

return

the converted point

Description copied from interface: mapFromGlobal

Converts the global/screen coordinates x,y into coordinates local to the wrapped object and returns the result as a Point.

mapToGlobal(Point)

public com.​­froglogic.​­squish.​­extension.​­Point mapToGlobal(com.­froglogic.­squish.­extension.­Point pos);

Specified by: Method mapToGlobal in interface Inspectable

Parameters

pos

the local coordinate

return

the converted point

Description copied from interface: mapToGlobal

Converts the local coordinates x,y into absolute screen coordinates and returns the result as a Point.