public interface

ShapeQuerying

sofia.graphics.ShapeQuerying

Class Overview

Methods that query shapes based on position, intersection, or other properties.

Summary

Public Methods
abstract <MyShape extends Shape> MyShape getShapeAt(float x, float y, Class<MyShape> cls)
Get one shape of the specified type (if any) that overlaps the specified location.
abstract Shape getShapeAt(float x, float y)
Get one shape (if any) that overlaps the specified location.
abstract <MyShape extends Shape> MyShape getShapeAt(PointF point, Class<MyShape> cls)
Get one shape of a specified type (if any) that overlaps the specified location.
abstract Shape getShapeAt(PointF point)
Get one shape (if any) that overlaps the specified location.
abstract Set<Shape> getShapes()
Gets a set that represents all the shapes currently in this view.
abstract <MyShape extends Shape> Set<MyShape> getShapes(Class<MyShape> cls)
Get all the shapes of the specified type in this view.
abstract <MyShape extends Shape> Set<MyShape> getShapesAt(PointF point, Class<MyShape> cls)
Get all the shapes of the specified type overlapping the specified location.
abstract Set<Shape> getShapesAt(float x, float y)
Get all the shapes overlapping the specified location.
abstract <MyShape extends Shape> Set<MyShape> getShapesAt(float x, float y, Class<MyShape> cls)
Get all the shapes of the specified type overlapping the specified location.
abstract Set<Shape> getShapesAt(PointF point)
Get all the shapes overlapping the specified location.

Public Methods

public abstract MyShape getShapeAt (float x, float y, Class<MyShape> cls)

Get one shape of the specified type (if any) that overlaps the specified location. If multiple shapes overlap that location, the one "in front" (drawn latest) is returned.

Parameters
x The x-coordinate of the location to check.
y The y-coordinate of the location to check.
cls Class of shape to look for (passing 'null' will find any object).
Returns
  • The front-most shape at the specified location, or null if none.

public abstract Shape getShapeAt (float x, float y)

Get one shape (if any) that overlaps the specified location. If multiple shapes overlap that location, the one "in front" (drawn latest) is returned.

Parameters
x The x-coordinate of the location to check.
y The y-coordinate of the location to check.
Returns
  • The front-most shape at the specified location, or null if none.

public abstract MyShape getShapeAt (PointF point, Class<MyShape> cls)

Get one shape of a specified type (if any) that overlaps the specified location. If multiple shapes overlap that location, the one "in front" (drawn latest) is returned.

Parameters
point The location to check.
cls Class of shape to look for (passing 'null' will find any object).
Returns
  • The front-most shape at the specified location, or null if none.

public abstract Shape getShapeAt (PointF point)

Get one shape (if any) that overlaps the specified location. If multiple shapes overlap that location, the one "in front" (drawn latest) is returned.

Parameters
point The location to check.
Returns
  • The front-most shape at the specified location, or null if none.

public abstract Set<Shape> getShapes ()

Gets a set that represents all the shapes currently in this view. Note that this set is not a copy of the view's shape set; changes to this set will directly affect the view.

Returns
  • a set that represents all the shapes currently in this view

public abstract Set<MyShape> getShapes (Class<MyShape> cls)

Get all the shapes of the specified type in this view.

Parameters
cls Class of objects to look for (passing 'null' will find all objects).
Returns
  • List of all the shapes of the specified type (or any of its subtypes) in the view.

public abstract Set<MyShape> getShapesAt (PointF point, Class<MyShape> cls)

Get all the shapes of the specified type overlapping the specified location.

Parameters
point The location to check.
cls Class of shape to look for (passing 'null' will find any object).
Returns
  • A set of all shapes at the specified location.

public abstract Set<Shape> getShapesAt (float x, float y)

Get all the shapes overlapping the specified location.

Parameters
x The x-coordinate of the location to check.
y The y-coordinate of the location to check.
Returns
  • A set of all shapes at the specified location.

public abstract Set<MyShape> getShapesAt (float x, float y, Class<MyShape> cls)

Get all the shapes of the specified type overlapping the specified location.

Parameters
x The x-coordinate of the location to check.
y The y-coordinate of the location to check.
cls Class of shape to look for (passing 'null' will find any object).
Returns
  • A set of all shapes at the specified location.

public abstract Set<Shape> getShapesAt (PointF point)

Get all the shapes overlapping the specified location.

Parameters
point The location to check.
Returns
  • A set of all shapes at the specified location.