Interface Shape

All Known Implementing Classes:
BaseShape, Circle, Ellipse, ImageLayoutInformation, Polygon, Rectangle

@API(type=EXTENDABLE, src=PRIVATE) public interface Shape
Common shape
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(int x, int y)
    Check if the specified coordinates are inside the shape.
    boolean
    contains(int x, int y, int w, int h)
    Check if the specified coordinates are inside the shape.
     
    translate(int tx, int ty)
    Translate the shape into another one.
  • Method Details

    • getBounds

      Rectangle getBounds()
      Returns:
      The bounds of this shape.
    • translate

      Shape translate(int tx, int ty)
      Translate the shape into another one.
      Parameters:
      tx - the distance by which coordinates are translated in the X axis direction
      ty - the distance by which coordinates are translated in the Y axis direction
      Returns:
      The newly translated shape
    • contains

      boolean contains(int x, int y)
      Check if the specified coordinates are inside the shape.
      Parameters:
      x - The horizontal coordinate.
      y - The vertical coordinate.
      Returns:
      true if the point is inside the shape. false otherwise.
    • contains

      boolean contains(int x, int y, int w, int h)
      Check if the specified coordinates are inside the shape.
      Parameters:
      x - The horizontal coordinate.
      y - The vertical coordinate.
      w - The width.
      h - The height.
      Returns:
      true if the point is inside the shape. false otherwise.