Interface ILcdAWTPath

All Known Implementing Classes:
TLcdAWTPath

public interface ILcdAWTPath
ILcdAWTPath is an interface defining a path in AWT coordinates. Such a path is generally used as support for caching and drawing polygons and polylines. A path contains 0 or more subpaths. A subpath contains 0 or more points. Each subpath is terminated by a line break, a polygon break, or a polygon closure.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends a line break to the path.
    void
    Appends a polygon break to the path.
    void
    Returns the world bounds of the path in the side effect parameter aBoundsSFCT.
    void
    Closes the current polygon.
    void
    drawPolygon(Graphics aGraphics)
    Draws the outlines of the path as a polygon.
    void
    Draws the outlines of the path as a polyline.
    void
    fillPolygon(Graphics aGraphics)
    Fills the path as a complex polygon that consists of one or more polygons.
    int
    getX(int aSubpathIndex, int aPointIndex)
    Returns the x coordinate of the subpath point at the given indices.
    default double
    getXAsDouble(int aSubpathIndex, int aPointIndex)
    Returns the x coordinate of the subpath point at the given indices.
    int
    getY(int aSubpathIndex, int aPointIndex)
    Returns the y coordinate of the subpath point at the given indices.
    default double
    getYAsDouble(int aSubpathIndex, int aPointIndex)
    Returns the y coordinate of the subpath point at the given indices.
    boolean
    isPolylineTouched(double aX, double aY, int aSensitivity)
    Checks whether the given point touches the path.
    void
    lineTo(double aX, double aY)
    Appends a line to the AWT point (aX, aY).
    void
    moveTo(double aX, double aY)
    Breaks the current line and moves to the AWT point (aX, aY).
    boolean
    polygonContains(double aX, double aY)
    Checks whether the given point is contained by the polygon represented by this ILcdAWTPath.
    void
    Resets the path.
    boolean
    subPathBreaksLine(int aSubpathIndex)
    Returns whether the subpath at the given index represents a broken line.
    boolean
    subPathBreaksPolygon(int aSubpathIndex)
    Returns whether the subpath at the given index represents a broken part of a polygon.
    boolean
    subPathClosesPolygon(int aSubpathIndex)
    Returns whether the subpath at the given index represents a closing part of a polygon.
    int
     
    int
    subPathLength(int aSubpathIndex)
    Returns the length of the subpath at the given index.
  • Method Details

    • moveTo

      void moveTo(double aX, double aY)
      Breaks the current line and moves to the AWT point (aX, aY).
      Parameters:
      aX - an x coordinate in AWT coordinates
      aY - an y coordinate in AWT coordinates
    • lineTo

      void lineTo(double aX, double aY)
      Appends a line to the AWT point (aX, aY).
      Parameters:
      aX - an x coordinate in AWT coordinates
      aY - an y coordinate in AWT coordinates
    • reset

      void reset()
      Resets the path. The path becomes empty, containing no subpaths and thus no points.
    • breakLine

      void breakLine()
      Appends a line break to the path. Subsequent points will define a new polyline. The points will continue to define the same current polygonal piece or hole, however.
    • breakPolygon

      void breakPolygon()
      Appends a polygon break to the path. Subsequent points will define a detached polygonal piece or a hole of the current polygon.
    • closePolygon

      void closePolygon()
      Closes the current polygon. Subsequent points will define a new polygon, possibly with its own set of detached polygonal pieces or holes.
    • subPathCount

      int subPathCount()
      Returns:
      the number of subpaths (separated by a line break).
    • subPathLength

      int subPathLength(int aSubpathIndex)
      Returns the length of the subpath at the given index.
      Parameters:
      aSubpathIndex - the given subpath index.
      Returns:
      the length of the subpath at the given index.
    • subPathBreaksLine

      boolean subPathBreaksLine(int aSubpathIndex)
      Returns whether the subpath at the given index represents a broken line.
      Parameters:
      aSubpathIndex - the given subpath index.
      Returns:
      whether the subpath at the given index represents a broken line.
    • subPathBreaksPolygon

      boolean subPathBreaksPolygon(int aSubpathIndex)
      Returns whether the subpath at the given index represents a broken part of a polygon.
      Parameters:
      aSubpathIndex - the given subpath index.
      Returns:
      whether the subpath at the given index represents a broken part of a polygon.
    • subPathClosesPolygon

      boolean subPathClosesPolygon(int aSubpathIndex)
      Returns whether the subpath at the given index represents a closing part of a polygon.
      Parameters:
      aSubpathIndex - the given subpath index.
      Returns:
      whether the subpath at the given index represents a closing part of a polygon.
    • getX

      int getX(int aSubpathIndex, int aPointIndex)
      Returns the x coordinate of the subpath point at the given indices.
      Parameters:
      aSubpathIndex - the given subpath index.
      aPointIndex - the given point index.
      Returns:
      the x coordinate of the subpath point at the given indices.
    • getY

      int getY(int aSubpathIndex, int aPointIndex)
      Returns the y coordinate of the subpath point at the given indices.
      Parameters:
      aSubpathIndex - the given subpath index.
      aPointIndex - the given point index.
      Returns:
      the y coordinate of the subpath point at the given indices.
    • getXAsDouble

      default double getXAsDouble(int aSubpathIndex, int aPointIndex)
      Returns the x coordinate of the subpath point at the given indices.
      Parameters:
      aSubpathIndex - the given subpath index.
      aPointIndex - the given point index.
      Returns:
      the x coordinate of the subpath point at the given indices.
      Since:
      2019.0
    • getYAsDouble

      default double getYAsDouble(int aSubpathIndex, int aPointIndex)
      Returns the y coordinate of the subpath point at the given indices.
      Parameters:
      aSubpathIndex - the given subpath index.
      aPointIndex - the given point index.
      Returns:
      the y coordinate of the subpath point at the given indices.
      Since:
      2019.0
    • drawPolyline

      void drawPolyline(Graphics aGraphics)
      Draws the outlines of the path as a polyline.
      Parameters:
      aGraphics - the graphics on which to draw the path as a polyline.
    • drawPolygon

      void drawPolygon(Graphics aGraphics)
      Draws the outlines of the path as a polygon.
      Parameters:
      aGraphics - the graphics on which to draw the path as a polygon.
    • fillPolygon

      void fillPolygon(Graphics aGraphics)
      Fills the path as a complex polygon that consists of one or more polygons.
      Parameters:
      aGraphics - the graphics on which to fill the path as a complex polygon.
    • isPolylineTouched

      boolean isPolylineTouched(double aX, double aY, int aSensitivity)
      Checks whether the given point touches the path.
      Parameters:
      aX - the x coordinate of the given point in AWT coordinates.
      aY - the y coordinate of the given point in AWT coordinates.
      aSensitivity - the sensitivity in pixels.
      Returns:
      whether the given point touches the path.
    • calculateAWTBoundsSFCT

      void calculateAWTBoundsSFCT(Rectangle aBoundsSFCT) throws TLcdNoBoundsException
      Returns the world bounds of the path in the side effect parameter aBoundsSFCT.
      Parameters:
      aBoundsSFCT - the Rectangle in which to store the bounds of the path.
      Throws:
      TLcdNoBoundsException - if no bounds are available
    • polygonContains

      boolean polygonContains(double aX, double aY)
      Checks whether the given point is contained by the polygon represented by this ILcdAWTPath.
      Parameters:
      aX - the x coordinate of the given point in AWT coordinates.
      aY - the y coordinate of the given point in AWT coordinates.
      Returns:
      whether the given point is contained by the polygon represented by this ILcdAWTPath.