Class PolylineShape

All Implemented Interfaces:
IFigure

public class PolylineShape extends AbstractPointListShape
Renders a PointList as a series of line segments. All points from the PointList are recognized as a relative points, so you can move/resize this figure normally by calling Figure.setBounds(Rectangle).
Since:
3.5
  • Constructor Details

    • PolylineShape

      public PolylineShape()
  • Method Details

    • shapeContainsPoint

      protected boolean shapeContainsPoint(int x, int y)
      Description copied from class: AbstractPointListShape
      Returns true if the point (x, y) is contained within this figure.
      Specified by:
      shapeContainsPoint in class AbstractPointListShape
      Parameters:
      x - The X coordinate
      y - The Y coordinate
      Returns:
      true if the distance between specified point and closest segment of this PolyLine is less then tolerance
    • fillShape

      protected void fillShape(Graphics graphics)
      Description copied from class: Shape
      Fills the interior of the shape with the background color.
      Specified by:
      fillShape in class Shape
      Parameters:
      graphics - the graphics object
    • outlineShape

      protected void outlineShape(Graphics graphics)
      Description copied from class: Shape
      Outlines this shape using the foreground color.
      Specified by:
      outlineShape in class Shape
      Parameters:
      graphics - the graphics object
    • setTolerance

      public void setTolerance(int tolerance)
      Setting tolerance parameter. This parameter will be used in shapeContainsPoint(int, int)