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(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 Methods  protected boolean findObjects(ObjectQuery query,

                                int n,

                                Object obj,

                                java.util.AbstractList list);


}

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

return

true if n objects are in the list

Description copied from interface: <link linkend="method-com.froglogic.squish.extension.inspectable.findobjects-com.froglogic.squish.extension.objectquery-int-java.util.abstractlist">findObjects</link>

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

findObjects(ObjectQuery, Object, AbstractList)

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

return

true if obj is in the list

Description copied from interface: <link linkend="method-com.froglogic.squish.extension.inspectable.findobjects-com.froglogic.squish.extension.objectquery-java.lang.object-java.util.abstractlist">findObjects</link>

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 Object getChildAt(Point pos);

Parameters

pos

the point to use for hit-testing

return

the object that is hit

Description copied from interface: <link linkend="method-com.froglogic.squish.extension.inspectable.getchildat-com.froglogic.squish.extension.point">getChildAt</link>

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.

getChildren()

public Object[] getChildren();

Parameters

return

array of all children

Description copied from interface: <link linkend="method-com.froglogic.squish.extension.inspectable.getchildren">getChildren</link>

Return all children of the wrapped object.

getGlobalBounds()

public Rect getGlobalBounds();

Parameters

return

the bounds as a Rect

Description copied from interface: <link linkend="method-com.froglogic.squish.extension.inspectable.getglobalbounds">getGlobalBounds</link>

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 String getName();

Parameters

return

the name

Description copied from interface: <link linkend="method-com.froglogic.squish.extension.inspectable.getname">getName</link>

Return the name of this object.

getPropertyValue(String)

public Object getPropertyValue(String prop);

Parameters

prop

property name

return

value of this property or null

Description copied from interface: <link linkend="method-com.froglogic.squish.extension.inspectable.getpropertyvalue-java.lang.string">getPropertyValue</link>

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();
Description copied from interface: <link linkend="method-com.froglogic.squish.extension.inspectable.isobjectready">isObjectReady</link>

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 Point mapFromGlobal(Point pos);

Parameters

pos

the global coordinate

return

the converted point

Description copied from interface: <link linkend="method-com.froglogic.squish.extension.inspectable.mapfromglobal-com.froglogic.squish.extension.point">mapFromGlobal</link>

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

mapToGlobal(Point)

public Point mapToGlobal(Point pos);

Parameters

pos

the local coordinate

return

the converted point

Description copied from interface: <link linkend="method-com.froglogic.squish.extension.inspectable.maptoglobal-com.froglogic.squish.extension.point">mapToGlobal</link>

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